Django, "the web framework for perfectionists with deadlines", is a Python-based framework for creating web applications. With a powerful object-based database mapper, a clean syntax for mapping URLs to views, a simple template language and a convenient automatically generated administration interface, Django is the most popular of the Python web frameworks.
Questions tagged [django]
1012 questions
8
votes
5 answers
Why do I get error, Invalid command 'PythonHandler'?
I'm trying to deploy a Django application, but I've hit a brick wall. On Debian (latest), I've run these commands so far:
apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert libapache2-mod-python…

Nick Bolton
- 5,126
- 12
- 54
- 62
8
votes
4 answers
gunicorn + django + nginx unix://socket failed (11: Resource temporarily unavailable)
Running very high volume traffic on these servers configured with django, gunicorn, supervisor and nginx. But a lot of times I tend to see 502 errors. So I checked the nginx logs to see what error and this is what is recorded:
[error] 2388#0:…

user1068118
- 81
- 1
- 4
8
votes
2 answers
Long running requests with gunicorn + nginx
I've put together an integration server for our Django-powered application. A few of the features are still experimental, and result in overly long requests.
I'm okay with the poor performance, for now, but I need to be able to integrate. Whenever…

Matt Luongo
- 201
- 1
- 2
- 8
8
votes
1 answer
Python/Django/WSGI/Apache - "ImportError: No module named site"
I am trying to use a django application on my local ubuntu machine. However the site doesn't work and my /var/log/apache2/errors.log is filled with messages like this:
ImportError: No module named site
My /var/log/apache2/error.log (for today)…

Amandasaurus
- 31,471
- 65
- 192
- 253
8
votes
3 answers
Which Apache package is best for mod_wsgi Django application?
In Ubuntu (and Debian, and other distro) there is a few Apache packages (mpm-event, mpm-prefork, mpm-worker). Which is the most suitable for hosting Django mod_wsgi application on single CPU server? Which package is best choice for OpenVZ container?

miHost
- 183
- 2
- 6
7
votes
1 answer
Cron job running a Django Python command through a virtual environment not working
I have a crontab file supposedly executing a Django command after loading the project virtual environment:
*/1 * * * * source /home/virtualenvs/mydjangoproject-venv/bin/activate && python /home/www/production/mydjangoproject/manage.py…

bolino
- 273
- 3
- 15
7
votes
1 answer
What user should run the gunicorn process?
When running a Django application on a Debian server, should you create some sort of application user (e.g. "myappuser") and run the gunicorn process as that user or can/should gunicorn be run as root? Would running it as root create a security…

Jim
- 330
- 7
- 16
7
votes
1 answer
gunicorn not fully reloading after an HUP signal
I'm trying to get a working supervisor/gunicorn/django setup on vagrant. I am using python-watchdog to try and restart gunicorn when code changes happen.
I am using the following supervisor configuration for…

synic
- 793
- 1
- 8
- 13
7
votes
3 answers
Supervisor process exits with 'exit status 1; not expected'
I'm trying to run a gunicorn_django process in supervisor but it always exits immediately, giving this error:
INFO exited: my_app (exit status 1; not expected)
INFO received SIGCLD indicating a child quit
INFO gave up: my_app entered FATAL state,…

Sævar
- 201
- 1
- 2
- 4
7
votes
1 answer
Python Threads and uWSGI Harakiri
I have a webapp that is using an API built on nginx, uWSGI, and Django. Recently I have been seeing a lot of harakiris on a particular API call which does some quick processing and then spawns a few threads to handle some long-running functions. The…

jmetz
- 181
- 1
- 4
7
votes
4 answers
ubuntu + nginx + uwsgi + django No Python application found
I am trying to setup my server with a nginx to uwsgi to django stack, but I am having problems with the uwsgi part.
When I run uwsgi and pass in all the parameters on the command line, it works properly. My uwsgi call looks like this:
uwsgi…

OpIvy
- 113
- 1
- 1
- 5
7
votes
1 answer
Running django custom management commands with supervisord
I'd like to use supervisord to run some commands for my Django project but I keep getting the following error:
supervisor.log:
2012-05-18 17:52:15,784 INFO spawnerr: can't find command 'source'
If I remove the "source" command, the log shows the…

mfsaint
- 201
- 2
- 2
7
votes
2 answers
Setup CNAME for subdomain issue
I would setup for this:
user go to test.example_site1.org
test.example_org1.org it's a CNAME of test.example_org2.org
user will see the page of test.example_org2.org
On the example_org2.org server I use nginx and I have 3 django…

Fred Collins
- 251
- 1
- 4
- 10
7
votes
1 answer
How to get nginx to pass HTTP_AUTHORIZATION header to Apache
Am using Nginx as a reverse proxy to an Apache server that uses HTTP Auth. For some reason, I can't get the HTTP_AUTHORIZATION header through to Apache, it seems to get filtered out by Nginx. Hence, no requests can authenticate.
Note that the…

codeinthehole
- 313
- 2
- 6
- 10
7
votes
1 answer
Django + gunicorn + virtualenv + Supervisord issue
I have a strange issue with my virtualenv + gunicorn setup, only when gunicorn is launched via supervisord. I do realize that it may very well be an issue with my supervisord and I would appreciate any feedback on a better place to ask for…

Florian Le Goff
- 121
- 1
- 5