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 ...

learn more… | top users | synonyms

43
votes
1answer
9k views

Why do I need Nginx and something like Gunicorn?

Im looking for a overly simplified answer for the following question. Im trying to build a foundational understanding of how Nginx works along side something like GUnicorn. Do I need both Nginx and ...
29
votes
7answers
69k views

Why do I get sqlite error, “unable to open database file”?

Using my Django app, I'm able to read from the database just fine. When the application didn't have permission to access the file, it gave me this error: attempt to write a readonly database ...
18
votes
3answers
5k views

How do I make uWSGI restart when a Python script is modified?

Can't remember where, but I read uWSGI can reload itself like Django development server when a project script is modified. I can't find that in the docs, nor in the internets. How can I do this? I ...
18
votes
4answers
17k views

Which is best for Django? Lighttpd or Nginx? Or maybe something else? [closed]

Which of Lighttpd and Nginx is, basing on your experience, better suited for Django? I've used both and can hardly notice any difference at all, they just work fine... Are there any use cases when one ...
15
votes
1answer
3k views

Why is setting Nginx as a reverse proxy a good idea?

I have a Django site running on Gunicorn with a reverse proxy through Nginx. Isn't Nginx just an extra unnecessary overhead? How does adding that on top of Gunicorn help?
12
votes
4answers
7k views

Nginx Varnish Nginx Django?

I have a django app and I want to to setup Varnish on a server in front of it. In another serverfault thread somebody suggested putting Nginx in front of Varnish. Should I put Nginx in front of ...
12
votes
2answers
4k views

How many processes should I specify in a WSGIDaemonProcess while running Django through mod_wsgi?

Let's say I have 2 sites(Superuser and Serverfault) running from their own Apache virtual host on one box. The 2 sites are powered by Django and are running on Apache with mod-wsgi. A typical ...
11
votes
6answers
3k views

Is there a Heroku for Django?

I've been looking into Heroku as a hosting provider. I'm specifically interested in its ease of deployment and ability to scale up and scale down resources as needed. Is there a hosting solution ...
10
votes
5answers
6k views

Amazon EC2 Ami recommendations for free tier?

Amazon web services recently introduced a free tier, where you basically get free stuff to try out AWS and run tiny sites and projects. Basically it's free as long as you remain below a certain limit ...
9
votes
2answers
2k views

How to set up Django with IIS 8?

I have tried in the past to get Django running under IIS 8 in Windows 8 Developer Preview. Now that the Consumer Preview of Windows 8 is out, I was wondering if I could get some detailed instructions ...
9
votes
1answer
510 views

Why do I need nginx when I have uWSGI

There are many tutorials on how to configure nginx to cooperate with uWGSI when I want to deploy Django application. But why do I need nginx in this kit? uWSGI itself can serve WSGI Python ...
9
votes
3answers
2k views

How to explain Django/Python installation to Python-newbie running a shared IIS server [closed]

For reasons beyond my control, our website is hosted with a hosting provider that uses IIS for their servers. They currently offer PHP and ASP, and also Python and Perl through cgi-scripts. I want to ...
9
votes
3answers
985 views

nginx + fastCGI + Django - getting data corruption in the responses sent to the client

I am running Django behind nginx using FastCGI. I have discovered that in some of the responses sent to the client, random data corruption is occurring in the middle of the responses (might be a ...
8
votes
1answer
2k views

High CPU load on Django/Apache/mod_wsgi site

Load testing a django 1.21/Apache/mod_wsgi configuration on an AWS small instance (Ubuntu 10.04) with Apache bench is showing extremely high CPU load (using uptime and vmstat) at low concurrent ...
6
votes
2answers
5k views

nginx+django serving static files

I have followed instruction for setting up django with nginx from the django wiki (https://code.djangoproject.com/wiki/DjangoAndNginx) and have nginx setup as follows (a few name changes to fit my ...
6
votes
3answers
2k views

Is it possible to run automatically celery at startup?

I have python server based on django and celery. Each time computer restarts, apache2 starts so my server is working, BUT I have to restart celery manually (going to my project directory and executing ...
6
votes
1answer
4k views

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 ...
6
votes
3answers
788 views

Development, Testing, Staging and Production model

I'm developing a run of the mill django powered website with a Postgres database. I develop locally and have 3 VPS servers for Testing, Staging and Production. Each VPS runs their own Linux / Apache ...
6
votes
1answer
985 views

Install problems with XSendFile on Ubuntu

I installed the apache dev headers: sudo apt-get install apache2-prefork-dev Downloaded and compiled the module as outlined here: http://tn123.ath.cx/mod_xsendfile/ Added the following line to ...
5
votes
5answers
14k views

Help me understand how to use ProxyPass

UPDATE: I added a revised question after playing around with it two answers below. Hi there, If you're reading this you're probably familiar with Apache's mod_proxy and its ProxyPass function. Like ...
5
votes
2answers
264 views

Safely install MDM Certificate in MDM Server

I am new to server technology.I know how to obtain an Apple iOS MDM Certificate and to use Apple iOS MDM features, we must: 1. Join Apple’s iOS Developer Enterprise Program. 2. Enroll 3. Register ...
5
votes
3answers
421 views

Measuring and visualing web application performance using apache logs?

I have a Django web application served up by mod_wsgi and Apache. I have apache logs of the web application in a production system, the logs include the time taken to serve the request in ...
5
votes
1answer
2k views

nginx+ uwsgi gives 502 Bad Gateway

I used this guide to set it up and it was working to server my django app for a while, but after adding a new django module, without touching any of the nginx or uwsgi configs, now the server leads to ...
5
votes
2answers
4k views

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 ...
5
votes
1answer
90 views

Storing secure keys on Ubuntu web server

I'm running Ubuntu 12.04 Precise with a DUNG (Django, Unix, Nginx & Gunicorn) environment and my app (as well as various config files) is stored in a python virtual environment inside /srv, which ...
5
votes
1answer
502 views

MySQL transaction issue with Django and Amazon RDS

I'm having a problem with a MySQL 5.5 database instance running on Amazon RDS. Periodically (once every couple of days) a transaction will fail to complete and appears to leave the tables locked. ...
5
votes
2answers
1k views

Has anyone used uwsgi nginx and django for a high-load environment?

I was wondering if anyone has used uwsgi with nginx to serve a high-load django site before. If so, did they have any problems?
5
votes
1answer
908 views

Celery Daemon receives unregistered tasks

I installed Celery for my Django project following what the official tutorial / doc says. And it's working fine when I launch celery at the command line, I can see it receiving the tasks and execute ...
5
votes
1answer
3k views

Apache/wsgi “Script timed out before returning headers”

I have a custom Django app that's becoming unresponsive roughly every 5,000 requests. In the apache logs, I see see the following: Apr 13 11:45:07 www3 apache2[27590]: **successful view render here** ...
5
votes
2answers
1k views

Django rewrites URL as IP address in browser - why?

I am using django, nginx and apache. When I access my site with a URL (e.g., http://www.foo.com/) what appears in my browser address is the IP address with admin appended (e.g., ...
4
votes
3answers
3k views

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? ...
4
votes
2answers
1k views

Which Linux distro should I use for Apache, mod_wsgi, Python, Django, PostgreSQL deployment?

Currently we are running CentOS for our production servers. Wer're deploying Django projects with Apache 2.2, mod_wsgi and PostgreSQL. We are in the process of making Python 2.5 the default version. ...
4
votes
5answers
10k views

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 ...
4
votes
3answers
4k views

Nginx fastcgi problems with django (double slashes in url?)

I'm deploying my first django app. I'm familiar with nginx and fastcgi from deploying php-fpm. I can't get python to recognize the urls. I'm also at a loss on how to debug this further. I'd welcome ...
4
votes
3answers
2k views

Way to configure apache for ~125 django sites to optimize memory usage (mod_python v mod_wsgi; worker vs prefork; static files)

I'm currently running 125 Django sites on a single dedicated box at GoDaddy. The sites are relativelly low traffic and I'm wondering what i can do to optimize the memory usage in my apache config. ...
4
votes
3answers
535 views

What port should I use for my reverse proxy to Apache 2 from nginx?

I have nginx setup as the defacto port 80. I want to setup django+mod_wsgi on Apache2. I'm worried if I leave Apache2 as 80 it will cause a conflict. Is it better to avoid the headache and change ...
4
votes
1answer
77 views

Storing username in nginx logs

Is there a way in which user-name or user-id can be stored in nginx logs. I tried inserting $remote_user in the log_format directive but it doesn't seem to work.
4
votes
1answer
516 views

Django VPS Configuration

I'm looking to run some Django sites on my VPS, with nginx acting as a front-end for it. I've been having some issues with mod_python and Apache, the site just starts erroring out whenever the traffic ...
4
votes
3answers
2k views

Scheduling tasks with Django

I have a Django website, and I want to have a certain piece of Python code run at regular intervals. What would be a good way to do that? I know I can cron, but I would prefer the solution to be ...
4
votes
2answers
2k views

Better webserver performance for Python Django: Apache mod_wsgi or Lighttpd fastcgi

I am currently running a high-traffic python/django website using Apache and mod_wsgi. I'm hoping that there's a faster webserver configuration out there, and I've heard a fair number of ...
4
votes
1answer
1k views

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' ...
4
votes
2answers
699 views

Deploying Django App with Nginx, Apache, mod_wsgi

I have a django app which can run locally using the standard development environment. I want to now move this to EC2 for production. The django documentation suggests running with apache and ...
4
votes
1answer
777 views

Gracefully Restarting Django Celery Instances

I'm wondering what the best way to restart Celery is without losing any tasks during the restart. I'm currently running it as a daemon using the init.d/ script provided with celery - everything is ...
3
votes
1answer
338 views

What is wrong with this attempt to serve up static content? Does a Proxy/ReverseProxy trump Alias, or can I ask for Alias to trump proxy?

I'm working on getting Apache to serve up static files for a Django project. My VirtualHost has: Alias /static/ /home/jonathan/pragmatometer/static/ ProxyPass / http://localhost:8000/ ...
3
votes
2answers
610 views

How can I run two Django versions in the same server?

i've got two web apps. One was developed using Django 1.0 and the other using Django 1.4. How can I run both apps in the same apache2 server using two versions of django? Somebody told me something ...
3
votes
3answers
479 views

Getting more database performance - postgresql

There is a django "web application" (from hell) we are hosting on a dedicated server. After some benchmarking I found that the "Application" is amazingly bad at database operations (refactoring is not ...
3
votes
1answer
2k views

Nginx + Django + FastCGI WSGI error? (Non fatal)

Hi everyone I am running django on top of nginx with fastcgi. When i do runfcgi, I am seeing these errors: python manage.py runfcgi daemonize=false host=127.0.0.1 port=8000 WSGIServer: missing ...
3
votes
1answer
200 views

Split the same virtualhost configuration across multiple files

I have multiple django applications on my server that run each within their own virtualhosts, bound to different ports. (I do this so as to isolate each WSGIProcessGroup). Now I would like to proxy ...
3
votes
3answers
426 views

Django: Nginx with WSGI or Apache with WSGI

Are there any studies comparing the performance (RPS, CPU, Memory usage etc) of delivering python web apps (Django in my case) between nginx and Apache? Can someone help me with facts? Which ...
3
votes
3answers
125 views

We are moving to two servers from one server due to performance issues. How do we monitor the value of this change?

We are moving to two servers from one server due to performance issues. We are moving our MySQL DB to its own dedicated server and will keep the original machine as the front end machine running ...