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.
41
questions
49
votes
3
answers
22k
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?
6
votes
2
answers
17k
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 ...
5
votes
4
answers
13k
views
Make mod_wsgi use python2.7.2 instead of python2.6?
i am running Ubuntu 10.04.1 LTS and it came pre-packed with python2.6 but i need to replace it with python2.7.2.
(The reason is simple, 2.7 has a lot of features backported from 3 )
i had ...
19
votes
6
answers
29k
views
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 ...
7
votes
3
answers
27k
views
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 ...
6
votes
3
answers
8k
views
Using Nginx to Block Connections that aren't addressed to my domain
I am running a django app on AWS elastic beanstalk and I'm getting spammed by bots trying to scan for vulnerabilities. It results in a flood of errors such as:
(Where xx.xxx.xx.xx is my ec2 instance's ...
1
vote
1
answer
1k
views
How to integrate PHP forum system with new Django website
I'm just about to launch a new Django website (RedHat EL4, Apache 2.0.52, Django 1.1, mod_wsgi), transitioning from a basic static-html and php site. As it's currently configured, Django handles ...
27
votes
2
answers
22k
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 ...
21
votes
6
answers
54k
views
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 ...
18
votes
4
answers
21k
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 ...
14
votes
4
answers
3k
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 ...
8
votes
5
answers
17k
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 ...
7
votes
1
answer
42k
views
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, ...
7
votes
2
answers
12k
views
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 ...
4
votes
2
answers
3k
views
Apache mpm worker + wsgi Python/Django workers stuck
Our Apache+Django server has the problem that workers get stuck. It's an mpm worker model, and after some time, each process that serves some dozen worker threads has all its workers frozen:
# ...
4
votes
1
answer
636
views
HAProxy URL Introspection
I have an application where the URL of a request determines which server to forward the request to based on a memcache or database lookup. Currently, it is just round robin, but the state is only ...
3
votes
2
answers
12k
views
Python: ImportError: No module named os [closed]
error_log
...
[Fri Sep 07 16:30:14 2012] [error] import os
[Fri Sep 07 16:30:14 2012] [error] ImportError: No module named os
-shell-
[root@lts5srv1 home]# ldd /root/epd-5.1.0/bin/python
...
3
votes
2
answers
3k
views
Apache : Map one virtualhost to a subdirectory of another virtualhost
I'm trying to map one virtual host to a subdirectory of another virtual host, something like this http://host2.com -> http://host1.com/host2. At this moment, whenever I go to http://host2.com it ...
2
votes
2
answers
6k
views
Django, nginx, FastCGI - running via unix sockets, permission problems
I've configured nginx to run django site via socket:
fastcgi_pass unix:/tmp/django.socket;
now I'm (manually) running
./manage.py runfcgi socket=/tmp/django.socket
http request results in 502 bad ...
2
votes
2
answers
2k
views
How do I get Apache to run Python 2.7 rather than 2.5?
How do I get Apache to run 2.7 rather than 2.5?
I'm configuring Apache to use mod_wsgi with Django and Python 2.7, but error logs show Apache is using Python 2.5.2 and can't find django.core.handlers....
2
votes
1
answer
4k
views
Fine tuning Django Apache mod_wsgi
First off I am looking for some help setting up my Django and Apache settings to fine tune it for my site for the best performance cost effectiveness.
Server info:
Django 1.3 Webfacion server, 80mb ...
2
votes
2
answers
13k
views
Nginx - when tunnel the url redirects without port number
My problem is very similar to this: nginx proxy pass redirects ignore port
I am using nginx 1.0.14.
I want to be able to ssh-tunnel into my Django website, so I can work remotely. I've tested a ...
2
votes
1
answer
114
views
Apache2 server using a lot of CPU
The output of top
Tasks: 68 total, 1 running, 67 sleeping, 0 stopped, 0 zombie
Cpu(s): 96.0%us, 3.7%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st
Mem: 3840492k total, 1175776k ...
2
votes
1
answer
4k
views
How can Django/WSGI and PHP share / on Apache?
I have a server running an established PHP site, as well as some Django apps.
Currently, a VirtualHost set up for PHP listens on port 80, and requests to certain directories are proxied to a ...
2
votes
2
answers
721
views
my first "production" debian server configuration
I have been using Debian for a year, mostly as the distro for my internal company server. Now I am making a public e-commerce website and I am planning to use a dedicated Debian server at a datacenter ...
2
votes
1
answer
3k
views
Redirecting from www to no www in nginx reverse proxy
I'm developing a Django app with nginx reverse proxy and gunicorn application server. Being a newbie web developer, I need help with redirecting www traffic to no www at the webserver level. I'm ...
2
votes
1
answer
3k
views
Running multiple Django projects within Apache, sys.path being over written
I have been trying to research how to do a multiple Python / Django deployment using Apache VirtualHosts.
The issue I am encountering seems straight forward,
ImportError: Could not import settings '...
1
vote
1
answer
9k
views
Django 2.1 deployment on centos 7 with apache, mod_wsgi, python3 venv
I've stumbled with this seemingly most relevant deployment option because guides seem to either reference mod_wsgi with python2, or deployment on deb based systems where expected paths are different.
...
1
vote
1
answer
3k
views
How can I track down a memory leak with wsgi, django, php and apache2?
I'm running 3 separate virtualhosts for my website (Django w/ wsgi for the main site, another Django w/ wsgi for the mobile version of the site, and a 3rd for Wordpress serving as the site's blog). ...
1
vote
1
answer
563
views
Lighttpd redirect from www.domain.com to domain.com
I need to permanently redirect all www.domain.com to domain.com in Lighttpd.
Here's relevant part of my lighttpd.conf:
$HTTP["host"] =~ "^www\.domain\.com$" {
url.redirect = (
"^/(.*)" =&...
1
vote
0
answers
1k
views
Production server much slower then local test server when sending large request
I am running a django app and I am trying to send an API POST-request which is pretty big to my production server.
Now the problem is that what takes 4 seconds locally takes 1 minute in production. ...
1
vote
3
answers
66k
views
Nginx cache is not cleared when using cloudflare [closed]
My nginx config here:
http://p.ngx.cc/0c
This link http://aa-tour.ru/static/system/css/style.css show me old cached version of file, how to remove it and clear cache?
This is correct (new) version of ...
1
vote
1
answer
525
views
Re: How can Django/WSGI and PHP share / on Apache?
in response to: How can Django/WSGI and PHP share / on Apache?
Hello,
could you please post the complete config file from /sites-available
I am having a problem seems like rewrite engine redirects ...
1
vote
1
answer
13k
views
Removing port from nginx redirect
I have a domain so www.mysite.com running app Django. In this server I created a Blog with WordPress. www.mysite.com/blog
Nginx Django app:
upstream django {
server 127.0.0.1:8001;
}
server {
...
1
vote
0
answers
717
views
docker-compose, nginx, gunicorn and SSL
I'm trying to set up a django project using SSL. I got it working without SSL but I'm clearly doing something wrong since https:// doesn't work and http:// just redirects to the main nginx site.
Here'...
0
votes
1
answer
914
views
Django site running in Apache 2.4.6 on Centos giving 503 server error
Please assist. I have a Django site that i'm trying to configure to run in apache using mod_wsgi. I have setup my virtualhost as follows:
<virtualhost *:80>
ServerName mysite.com
...
0
votes
1
answer
881
views
How to point static folder in Nginx for a Django application
I have deployed a simple Django application in the AWS server and created a config file in the Nginx as follows. But its static files are not detecting.
Location of my static folder location: /path/...
0
votes
0
answers
2k
views
Kerberos Double Hop Delegation from IIS to SQL server (using django)
I need to pass the credentials (Integrated Windows Authentication) from a django website on IIS onto a backend SQL server so that it runs under the proper user context.
This is how my setup looks so ...
0
votes
1
answer
440
views
Django caused Unable to connect with Docker
I found a Django project and failed to get it running in Docker container in the following way:
git clone https://github.com/hotdogee/django-blast.git
$ cat requirements.txt
#psycopg2==2.6.0 # if ...
0
votes
1
answer
733
views
Redirect with lighttpd and fastcgi on Django App
I have setup my lighttpd in a fashion which redirects all subdomains to my primary domain in following fashion * .domain.com -> domain.com. Unfortunately when i type in a subdomain such as www.domain....
0
votes
1
answer
307
views
Why does my migrated apache2-fastcgi-django solution give me 'AH01630: client denied by server configuration'?
I have a solution to run a Django (1.3.1 on Python 2.7) site which is working on an old server. I'm trying to migrate this to a new server but I'm encountering the following error when I try to access ...