Questions tagged [django]

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.

1015 questions
281
votes
4 answers

Why do I need Nginx and something like Gunicorn?

I'm looking for an overly simplified answer to the following question. I'm trying to build a foundational understanding of how Nginx works alongside something like Gunicorn. Do I need both Nginx and something like Gunicorn to deploy Django apps on…
a.m.
  • 2,915
  • 3
  • 13
  • 6
86
votes
2 answers

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 applications, it can serve static files, it can also do…
user983447
  • 1,107
  • 1
  • 10
  • 10
73
votes
9 answers

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 Which made sense. So I edited the permissions on the…
Nick Bolton
  • 5,016
  • 12
  • 51
  • 62
47
votes
3 answers

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?
TheOne
  • 595
  • 1
  • 5
  • 6
45
votes
5 answers

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 use Ubuntu 12.04 on my working machines and Debian…
culebrón
  • 565
  • 1
  • 4
  • 7
26
votes
2 answers

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 configuration file for one of the site will look like…
Thierry Lam
  • 6,041
  • 9
  • 26
  • 24
24
votes
1 answer

Django: CONN_MAX_AGE persists connections, but doesn't reuse them with PostgreSQL

I've got a django setup are using Django 1.6.7 and Postgres 9.3 on Ubuntu 14.04 LTS. At any given time, the site gets about ~250 simultaneous connections to the PostgreSQL database, which is a Quad Core Xeon E5-2670 at 2.5GHz, and has 16GB of ram. …
synic
  • 783
  • 1
  • 8
  • 13
21
votes
6 answers

Why is Nginx more popular than lighttpd?

I'd like to use Lighttpd in production for serving Django apps but i see that these days Nginx is more and more popular. Why is that? I'm aware that in the past Lighttpd had memory leaks but isn't this fixed now? They do have active developers that…
daniels
  • 1,195
  • 5
  • 15
  • 26
18
votes
4 answers

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

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 of them acts much better than the other? When…
Ryszard Szopa
  • 101
  • 1
  • 1
  • 5
16
votes
5 answers

WSGI : Truncated or oversized response headers received from daemon process

System Configuration : Apache2, Django 1.10, Python 3, Ubuntu 16.04 LTS Django debug=True. /var/log/apache2/error.log [52:53.057967] [wsgi:error] [pid 4303] [client 1.1.1.22:24409] Timeout when reading response headers from daemon process…
Suraj
  • 419
  • 1
  • 3
  • 12
16
votes
2 answers

Wiring uWSGI to work with Django and nginx on Ubuntu 16.04

I am trying to follow this tutorial to setup uWSGI with Django and nginx on Ubuntu16.04. It all works fine up until the very last step (oh the irony...) where I try to execute this command: sudo service uwsgi start If fails with the following…
Vlad Schnakovszki
  • 563
  • 1
  • 4
  • 12
15
votes
2 answers

Not seeing Django logs on Heroku

I'm not seeing log entries (at a level of INFO) made by Django in my Heroku logs. This is my configuration: LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'filters': { 'require_debug_false': { '()':…
Ram Rachum
  • 5,011
  • 6
  • 33
  • 44
14
votes
4 answers

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 mod_wsgi, and using nginx for loading static files. I am…
JCWong
  • 241
  • 2
  • 3
13
votes
4 answers

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 Varnish on the caching server? If so, should I use…
Enrico
  • 491
  • 1
  • 6
  • 15
13
votes
3 answers

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 many others, I have the issue of having an…
Bartek
1
2 3
67 68