Skip to main content

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.

324 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
9 votes
1 answer
9k 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** ...
Chase Seibert's user avatar
7 votes
1 answer
5k views

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 ...
jmetz's user avatar
  • 181
6 votes
0 answers
20k views

What is the nginx Variable for a custom Header?

A client is sending a custom HTTP Header X-ABC-LOGIN-NAME to my Nginx reverse proxy. To be sure that it is actually arriving, a PHP server (fastcgi) was installed and this header is really showing up (...
TMOTTM's user avatar
  • 161
4 votes
1 answer
11k views

Supervisor doesn't start: couldn't chdir to ... EACCES

I'm setting up an ec2 server to run a django project with ngnix & gunicorn. The server is running Amazon Linux. When I run the start gunicorn command from the command line, it starts up the ...
hgolov's user avatar
  • 141
4 votes
0 answers
929 views

Prevent Gunicorn from loading slowly after an inactive period?

My Django project is running on gunicorn. Sometimes loading a page (and oracle procedures calls related) takes a lot of time. This occurs 90/100 when the server remains inactive for some minutes. How ...
Sam's user avatar
  • 151
4 votes
1 answer
2k views

Trying to run gunicorn from supervisor gives error - error: class uri 'simple' invalid or not found

I am already running successfully 2 django projects (in same virtualenv with python 2.7) with Django + gunicorn + virtualenv + Supervisord environment. But now i am trying to run another project in ...
Muhammad Tahir's user avatar
4 votes
0 answers
2k views

Ubuntu Locales Incorrect for Python Application

I have a NGINX -> UWSGI -> Django(python) stack installed on an Ubuntu AMI on Amazon EC2. I've run into a problem when accessing a file with unicode characters in the name. The exact output from the ...
OpIvy's user avatar
  • 113
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 ...
Matt Williamson's user avatar
3 votes
0 answers
4k views

Load testing throws Server 502 error: Bad Gateway after 700 users. Gunicorn, Gevent, Nginx, Django

I'm trying to reach 2000 concurrent users with my benchmarking tool. I'm using locust to simulate them. My server has 24vCPUs, 128GB RAM, 25SSD. I want to be able to serve 2000 concurrent users ...
Tony Kyriakidis's user avatar
3 votes
1 answer
3k views

Nginx redirecting every url to localhost

I have a Django website running with Nginx and Gunicorn. Everytime I call a url on the server, example website/url, it redirects to localhost/url. I have given the nginx settings in both nginx.conf ...
Shounak's user avatar
  • 31
3 votes
0 answers
870 views

NGINX Websocket initial communication delay

I've created a Django server that is making use of django-channels for websocket communication. When I run the server with NGINX there is an initial delay in websocket communication between the server ...
MCBama's user avatar
  • 131
3 votes
0 answers
5k views

uwsgi and "No module named django.core.wsgi"

On a fairly vanilla FreeBSD system without virtualenv, I'm having trouble getting uwsgi to work with Django. Attempting to run generates this error: Traceback (most recent call last): File "./...
user avatar
3 votes
0 answers
7k views

Configure Nginx to only allow specified hosts

I am running a Django Project on DigitalOcean (using Nginx, Gunicorn and Postgres), and I have specified the "allowed hosts" in the settings.py like this: ALLOWED_HOSTS = ['sub.domain.tld'] Based on ...
Tobi's user avatar
  • 139
3 votes
2 answers
5k views

Debugging Gunicorn + Nginx + Django

I'm trying to deploy a readthedocs instance on my own server. The recommended way to deploy is using Gunicorn + nginx with postgres. Because there's basically no documentation on how to do this (...
bertzzie's user avatar
  • 131
3 votes
1 answer
2k views

Graphite not running

I'm currently trying to install graphite 0.9.9 on a gentoo box using these instructions from the graphite wiki. Essentially, it fronts graphite using apache and mod_wsgi. Everything seems to have ...
River's user avatar
  • 143
2 votes
0 answers
757 views

CORS is not working NGINX + DJANGO + REACT application

Existing nginx configuration given bellow. I tried in multiple way but nothing is working. server { server_name backend.xxxxxx.com www.backend.xxxxxx.com; client_max_body_size 100M; #...
Ariful Islam's user avatar
2 votes
1 answer
2k views

How to pass multiple commands with Ansible docker_container

We have a Django container in which, at start, we need to run two different commands: python manage.py collectstatic --noinput and gunicorn myproj.wsgi We've tried all sorts of methods, but the result ...
RicHincapie's user avatar
2 votes
1 answer
9k views

ERR_CONNECTION_REFUSED I can not connect my Ubuntu Server

I have Ubuntu server that I am serving Django project. But I can not browse anything. I get ERR_CONNECTION_REFUSED error on all browsers. Server host, OS, and applications: Digital Ocean Ubuntu 18.04 ...
Captain Django's user avatar
2 votes
0 answers
2k views

Nginx - UWSGI 504 gateway timeout

I saw lots of topics of nginx 504 error , but non if them solved this. Im using nginx , uwsgi on 1 machine to run Django application . i tried to add these config line at the end of /etc/nginx/...
Mehdi bahmanpour's user avatar
2 votes
0 answers
7k views

AssertionError: The `request` argument must be an instance of `django.http.HttpRequest`, not `rest_framework.request.Request`

Traceback (most recent call last): File "/home/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner response = get_response(request) File "/home/lib/python3.6/site-...
naveen chary's user avatar
2 votes
1 answer
5k views

nginx, gunicorn, Django 499 error 60s

I get a 499 error after 60s whatever the config I try. I use Docker on a 8 core/32GB server and there is another nginx/lets-encrypt reverse proxy in front for the others containers. I am more on the ...
Patrick Aymar's user avatar
2 votes
1 answer
5k views

Serve Django Media Files via Nginx (Django/React/Nginx/Docker-Compose)

Context I have a single page web app using the following stack: React for the frontend Django for the backend Nginx for the webserver The web application is dockerized using docker-compose. My ...
Teddy's user avatar
  • 121
2 votes
0 answers
694 views

Django (uwsgi) + nginx hangs on curl requests

I am trying to debug a problem where a request done with curl hangs. The website renders fine if I open it through any web browser. I can't find anything suspicious into the log files as well. I've ...
Dimitar Petrov's user avatar
2 votes
1 answer
2k views

HTTP 503 errors with Apache and mod_wsgi

I have written a webapp in Django that I host under Apache 2.4 using mod_wsgi. At first glance, it works fine. However, when the Apache process has been running for a while, the webapp starts ...
Compizfox's user avatar
  • 404
2 votes
1 answer
310 views

Troubleshooting nginx caching for static assets

I have a Django website where users post images for the whole community to see (kind of like 9gag). I use Azure storage to save and serve the images. The webserver is an nginx reverse proxy + ...
Hassan Baig's user avatar
  • 2,615
2 votes
0 answers
494 views

How can I configure a Django website to work with Apache 2.4 VirtualHosts?

I recently started developing Django websites and I want to deploy them on a CentOS VPS with mod_wsgi and Apache. I followed this guide and it works perfectly, but I would like to have more than one ...
user256472's user avatar
2 votes
0 answers
1k views

Django Invalid HTTP_HOST header: '\x80\xc7\xda\x9e'

I am getting errors from Django 1.7 application hosted in Digital ocean. Invalid HTTP_HOST header: '\x80\xc7\xda\x9e'. The domain name provided is not valid according to RFC 1034/1035. Request repr()...
Navajyoth M S's user avatar
2 votes
1 answer
3k views

Setup ssl on nginx for a django project

I want to setup ssl for Nginx, my project is a Django and I also use gunicorn as wsgi Http server. I add following lines in my settings.py code : CSRF_COOKIE_SECURE = True SESSION_COOKIE_SECURE = ...
Mairon's user avatar
  • 159
2 votes
0 answers
2k views

Didn't receive any response from local server in the machine

So I've server linux using NGIX with docker and many Applications django with UWSGI. So I need to create a job to execute inside a container of docker. This jobs will do a request to a some url of ...
Guilherme Soares's user avatar
2 votes
0 answers
2k views

recv not ready (11: Resource temporarily unavailable)) (nginx/1.1.19, supervisorctl, gunicorn )

I have site on Ubuntu 12.04.5 LTS, django (supervisorctl, gunicorn). It work 1 year without problems, but today my zabbix server sending me messages about alerts (every 3-7 minutes) about timeout (for ...
Patjomkin's user avatar
2 votes
1 answer
207 views

How can I install libmemcached on Openshift with sasl support?

I need libmemcached with sasl support to use Memcached Cloud cartridge on Openshift Online. I doing next: 1) Install sasl. curl -LO ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-2.1.26.tar.gz tar --...
BottieYOYO's user avatar
2 votes
0 answers
1k views

How to deploy django with uWsgi and nginx on CentOS

My version of Django is 1.6.3 I downloaded uwsgi-2.0.4. Someone says installing uwsgi with command make while someone use python setup.py build. What exactly is the difference? I saw a tutorial that ...
Crayon's user avatar
  • 21
2 votes
0 answers
4k views

upstream timed out (110: Connection timed out) while reading response header from upstream

For some reason, I am getting this error whenever I am running a query on my server. On my local setup, this query takes around 7-8 seconds to return, but it keeps timing out on my actual server. ...
abisson's user avatar
  • 121
2 votes
0 answers
357 views

How to tell apache to look for last modified date before serving an old modified HTML file?

On certain requests my Django application updates static HTML files. However apache is serving them old copy from its cache... How can I configure Apache to make sure serve latest file changes.. ...
shahjapan's user avatar
  • 141
2 votes
0 answers
11k views

Nginx/uWSGI - upstream prematurely closed connection while reading response header from upstream

I've got an Ubuntu server configured with Nginx and uWSGI to serve Django which was setup and working with the default start page yesterday. All I have done since is install MySQL and later ...
markwalker_'s user avatar
2 votes
1 answer
154 views

Supervisord unable to shutdown fcgi processes

I've managed to set up supervisord with fastcgi on a django project of mine, the problem is that when I make mi program stop, the server keeps running somehow, and my page keeps online. Here is my ...
danielrvt's user avatar
  • 239
2 votes
0 answers
711 views

Nginx > Varnish > Gunicorn Error Too many Redirections

I have the following config: Nginx > Varnish > Gunicorn > Django I want to cache 2 versions of same site (mobile & web) with Varnish. Gunicorn : WEB: gunicorn_django --bind 127.0.0.1:8181 ...
kollo's user avatar
  • 21
2 votes
0 answers
1k views

Stress testing Django app - how to improve throughput?

I'm having my first attempt at stress testing a simple django web app running from gunicorn and nginx which I’ve put on a small 256MB Rackspace Cloud server. Using httperf, I increase the number of ...
Pete W's user avatar
  • 143
2 votes
1 answer
849 views

Application reports timeouts. However nginx has no record or log

We are serving Django via nginx/uwsgi. We use AWS ELB behind a VPC. This is a webservice to Mobile clients. We had reports of timeouts during development so we have added a concept of a request_id ...
semarjt's user avatar
  • 21
2 votes
2 answers
300 views

Re-uploading file with unicode filename creates identical duplicate

I'm running a Django site on a Debian 6 system, with a gunicorn server and nginx 0.7.67 handling static files. The filesystem locale is set to sv_SE.UTF-8. I got a problem where another user uploaded ...
Samuel Linde's user avatar
2 votes
1 answer
2k views

gunicorn serving django app produces no log on exceptions

I am trying to serve a Django app using gunicorn. In my current setup running on Debian 6 (production) and Ubuntu 11.04 (development), gunicorn (v0.12) is behind nginx and managed by supervisor. The ...
shanyu's user avatar
  • 121
2 votes
1 answer
321 views

speeding up django server

My setup is django 1.3 and the default mod_wsgi and apache packages for ubuntu 10.04. I tested one view of my app on my development VM (DEBUG and debugging toolbar off): ab -n 200 -c 5 http://127.0.0....
asciitaxi's user avatar
  • 143
2 votes
1 answer
108 views

Apache could not be stablely support more than 200 visitors at the same time. How to set mpm module?

The server seems not be able to support almost two or three hundred people visiting at the same time. We upload some new codes in Nov. 29the and people saw 404 Not Found frequently ever since that ...
user avatar
2 votes
1 answer
513 views

django subdomains apache config

Trying to setup django to take subdomains and use different settings file based on subdomain dns is setup as wildcards apache mod_vhost_alias sounded like good option, it did not work SetEnv ...
user avatar
2 votes
1 answer
3k views

Apache not serving my python app

So here's my apache config: LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so <VirtualHost *:80> ServerAdmin [email protected] ServerName 31.220.49.197 ...
Marijus's user avatar
  • 121
1 vote
0 answers
606 views

STATIC files not found when running Django app in development

I'm currently training in the Django framework and am attaching a CSS document to an HTML document. All pretty straight forward staff. Except it apparently isn't. Hardly surprising really. Can anyone ...
Hunktydunkaty's user avatar
1 vote
1 answer
269 views

Django: Configuration for serving static files on IIS server

I have a django application deployed on an AWS IIS server. Static fils are served just fine via 'runserver', but not via the IIS server. I have done everything right but it doesn't work. i even tried ...
Henry's user avatar
  • 11
1 vote
1 answer
650 views

Django CSRF verification failed after setting SSL with Certbot

I'm currently working on a Django project that utilizes Docker, and I recently set up an SSL certificate using a containerized version of Certbot in order to secure my Django app through HTTPS. ...
Nikko's user avatar
  • 111
1 vote
0 answers
579 views

100 concurrent requests to a Django-App with Gunicorn lead to "54: Connection reset by peer" and 502's

I'm hosting a Django-App which serves as an API-Endpoint. Unfortunately the App which uses the API does a lot of concurrent requests on page-load (in the realm of 80-90 requests). Nginx is running as ...
Subito's user avatar
  • 398
1 vote
0 answers
480 views

Page not found (404) error. "The current path, dashboard/auth/login/, didn’t match any of these."

I'm attempting to get Devstack and Horizon working on Ubuntu 20.04. Devstack seems to install OK. I'm following the steps: All-In-One Single Machine, DevStack Networking, (Horizon) Quickstart, and ...
BurningKrome's user avatar

1
2 3 4 5
7