mod-wsgi

Installing mod_wsgi for Python3 on Ubuntu

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 07:40:54
Could anyone give me a clear set of instructions for installing mod_wsgi on Ubuntu for Python 3? I did get Flask & mod_wsgi successfully using Python3, and for a brief moment felt happy. ...until I looked at Apache's log and realised that I've run into this problem: https://askubuntu.com/questions/569550/assertionerror-using-apache2-and-libapache2-mod-wsgi-py3-on-ubuntu-14-04-python apt-get is installing an out of date version of libapache2-mod-wsgi-py3 and this is causing errors in Apache's log. (Should I report this and if so where?) In the link, the engineer is using pip to install a more

Activating the Flask debugger when running under mod_wsgi

三世轮回 提交于 2019-11-28 07:30:45
问题 How can I activate the Flask debugger when running under mod_wsgi? I have DEBUG , PROPAGATE_EXCEPTION and PRESERVE_CONTEXT_ON_EXCEPTION set to True , but still the debugger doesn't appear on exceptions. 回答1: As described in the Flask documentation at: http://flask.pocoo.org/docs/quickstart/#debug-mode use: app.debug = True Under mod_wsgi you aren't doing the app.run() though. Ensure you are setting 'app.debug' at global scope and not in a conditional section where checking whether __name__ is

Django + mod_wsgi. Set OS environment variable from Apache's SetEnv

守給你的承諾、 提交于 2019-11-28 07:17:16
问题 I need to split Django's development and production settings. I decided that if USKOVTASK_PROD variable is set, then app should use production settings. I read this article and tried to do it. My snippets: /etc/apache2/sites-enabled/uskovtask.conf: <VirtualHost *:80> ServerName uskovtask.*.com ServerAlias uskovtask.*.com DocumentRoot /mnt/ebs/uskovtask Alias /static /mnt/ebs/uskovtask/static/ <Directory /mnt/ebs/uskovtask/static> Require all granted </Directory> #WSGIPythonPath /mnt/ebs

How do I redirect domain.com to WWW.domain.com under Django?

南楼画角 提交于 2019-11-28 06:37:14
How do I go about redirecting all requests for domain.com/... to www .domain.com/... with a 301 in a django site? Obviously this can't be done in urls.py because you only get the path part of the URL in there. I can't use mod rewrite in .htaccess, because .htaccess files do nothing under Django (I think). I'm guessing something in middleware or apache conf? I'm running Django on a Linux server with Plesk, using mod WSGI The WebFaction discussion someone pointed out is correct as far as the configuration, you just have to apply it yourself rather than through a control panel. RewriteEngine On

How to install & configure mod_wsgi for py3

耗尽温柔 提交于 2019-11-28 06:23:33
I installed & configured mod_wsgi for python2.7 but now I would also like to have mod_wsgi for py3 I'm in ubuntu 12.04 My apache conf file looks like this for py2.7 : <Directory /var/www/vhosts/my_web> WSGIProcessGroup my_web WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> Now I would like to install mod_wsgi for python3. I think I have to do apt-get install libapache2-mod-wsgi-py3 But I can't find any instruction on how to configure mod_wsgi for py3. a) Can I keep mod_wsgi for py2.7 or do I need to remove it for apache to work with mod_wsgi_py3? b) What do I need

How to install python developer package?

别等时光非礼了梦想. 提交于 2019-11-28 04:30:56
I am trying to get mod_wsgi 3.3 to work. When I run make it is telling me that I am missing the Python developer package. How do I get and install the Python developer package? The error I get is as follows: mod_wsgi.c:135:20: error: Python.h: No such file or directory mod_wsgi.c:138:2: error: #error Sorry, Python developer package does not appear to be installed. mod_wsgi.c:142:2: error: #error Sorry, mod_wsgi requires at least Python 2.3.0 for Python 2.X. mod_wsgi.c:150:2: error: #error Sorry, mod_wsgi requires that Python supporting thread. mod_wsgi.c:153:21: error: compile.h: No such file

switch python version on uwsgi

浪子不回头ぞ 提交于 2019-11-28 04:30:08
问题 I am running a django app with nginx and uwsgi. It was was working ok but suddenly I do not know what I changed that the app stop working. The problem resides in that python version from uWsgi is 2.4.3 which is the default version in Linux CentOs and I have installed django, webpy and other python distributions in version 2.7.3 (will upgrade sooner) I also tried creating a symbolic link from python 2.7 path to just "python" in usr/bin and did not work. How can I make uWsgi use python2.7.3(

Debugging Apache/Django/WSGI Bad Request (400) Error

£可爱£侵袭症+ 提交于 2019-11-28 04:16:55
My simple Django app worked fine in debug mode ( manage.py runserver ), and works under WSGI+Apache on my dev box, but when I pushed to EC2 I began receiving intermittent (10-80% of the time) errors of Bad Request (400) for any URLs I try to view (whether in my app or in the Django admin. Where can I find debug information about this? Nothing appears in /var/log/apache2/error.log , even with LogLevel=info . I have checked versions, logged the Request environment (cf. ModWSGI Debugging Tips ) and see no major differences. The one remaining thought I had is, I'm using the mod_wsgi from Ubuntu 12

Multiple mod_wsgi apps on one virtual host directing to wrong app

社会主义新天地 提交于 2019-11-28 03:48:37
I'm trying to get two (or more) Django applications set up at subdirectories under the same domain, e.g.: http://example.com/site1/ http://example.com/site2/ I know that normally this works fine by setting up an apache virtualhost like this: <VirtualHost *:80> ... WSGIScriptAlias /site1 /path/to/site1.wsgi WSGIScriptAlias /site2 /path/to/site2.wsgi </VirtualHost> Now, I've verified that each site works individually. But when I try to run both side-by-side, apache sends me to whichever site the worker process loaded first. Example: Restart apache configured to serve 6 threads Load example.com

Multiple django sites on Apache / Windows / mod_wsgi - problem with win32

核能气质少年 提交于 2019-11-28 03:43:40
问题 I have two django sites that use the same database and share some of the code. The main parent site is an extranet for staff and contractors, while the second site exposes some of the data to a few of our partners. I have managed to set up sites to work but found that if I launched Apache and went into the main site, then the partner site wouldn't work, returning an "Internal Server Error". If I restarted and went into the partner site, then the main site wouldn't work. So I guess they are