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.

Filter by
Sorted by
Tagged with
1 vote
1 answer
5k views

Apache as a reverse proxy not working for gunicorn

My Goal is to let client connect through https connection but apache serve it to my application which is running on same server over http. Here is my minimalistic apache configuration file (for ...
1 vote
2 answers
6k views

upstream sent more data than specified in "Content-Length" header while reading upstream

I have django app (based on Mezzanine). My nginx conf looks like: upstream myhost { server 127.0.0.1:8000; } server { listen 80; server_name www.myhost.ru myhost.ru; ...
0 votes
1 answer
5k views

nginx, gunicorn and django weird 504 gateway timeout

I have an nginx / gunicorn / django setup as follows: Nginx server { listen 80; server_name myserver.com; root /www/python/apps/pyapp/; access_log /var/log/nginx/myserver.com....
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 ...
0 votes
0 answers
11 views

Django Application hosting on different servers but uses the same database

I have a django project called django_project and a domain website.com , I want to host the subdomains of this on different server. So , django project Server A website.com django project Server b ...
0 votes
0 answers
26 views

I cannot send mail using python on a VPS

I have a running website on a VPS but I am unable to send mail. If I look in the supervisor logs I see the following error: Traceback (most recent call last): File "/home/founders/founders/lib/...
-1 votes
0 answers
74 views

change selinux policy to allow gunicorn to start for a django managed web site

How do I create a selinux policy to allow gunicorn to operate with nginx for a django managed web site? I know there's a way to do it, but don't understand selinux' arcane policy definitions --YES, I ...
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 (...
0 votes
0 answers
24 views

Why is nginx not serving my static site

I have two applications. One is a Django app and the files for this is located at /home/founders/founders/back The site is running and you can see it on founderslooking.com I have another Vue site ...
0 votes
0 answers
45 views

Invalid HTTP_HOST even after setting nginx default_server block

I have a Django server that has entries like ALLOWED_HOSTS = ['example.domain.com']. In my nginx config, under sites-available, I have a bunch of sites listed, all listening on different servers like ...
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** ...
0 votes
0 answers
55 views

NGINX + Django + UBUNTU + GUNICORN + AWS + ROUTE53 = Default NGINX Page and not my Website

Right, I have a Django powered website which I am now ready to deploy into production. Except it keeps coming back with the default NGINX page - which I knew about already. The tutorial is as follows, ...
0 votes
0 answers
77 views

Error 500 with "Invalid block tag" issue

So I get the Internal Server Error message come up on my browser when I set DEBUG = False after I correctly have set up gunicorn and nginx and I'm currently in production mode. In Debug, all is fine, ...
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 ...
0 votes
1 answer
8k views

Apache is not serving static files from correct directory

I am actually not sure if the title of the topic is actually the source of my issue but there are serious indications for this. I am not an expert in application servers such as apache so any help is ...
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 ...
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 ...
0 votes
1 answer
265 views

Proxy error: /var/run/rpc/xmlrpc.sock (localhost) failed

I'm inheriting this old Django project hosted on an EC2 instance. It used to run on Heroku and used a Proximo proxy in front of gunicorn. Now it just runs a systemd script with the following: ...
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 ...
0 votes
1 answer
88 views

Exposing two applications on different external ports using nginx - nginx: [emerg] bind() to 0.0.0.0:8000 failed (98: Address already in use) [closed]

I am trying to make two apps be accessible on my LAN server (raspberry pi). lab_app: this one is a very simple app, made with flask from a third party, using a sqlite3 database, which results to be a ...
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 ...
-1 votes
1 answer
2k views

Error: ip address not working After the giving to nginx

I am deploying the django app to digitalocean my ip address is not working after the sudo vim /etc/nginx/sites-available/lok in nginx .I added to the my nginx is as follows upstream app_server { ...
1 vote
1 answer
4k views

Django uwsgi deploy. Unable to find 'application'

Has a problem when starting uwsgi: unable to find "application" callable in file dashboard/wsgi.py unable to load app 0 (mountpoint='') (callable not found or import error) uwsgi.ini: [uwsgi] ...
1 vote
1 answer
8k views

Got django.db.utils.OperationalError: could not connect to server: Connection refused

I found a Django project and failed to get it running in Docker container in the following way: git clone git clone https://github.com/NAL-i5K/django-blast.git $ cat requirements.txt in this files ...
0 votes
2 answers
5k views

caching system between nginx and gunicorn for django

I have a django project that I'd like to setup caching for. I want my caching system to cache everything after nginx. I found varnish but it has a problem - I use unix socket for communications ...
-1 votes
1 answer
154 views

Mysql Error 1045 Access Denied: Using Password: FALSE

I'm using MySQL v8.0.35 with django and python. A website is used to access the database with both the website and database hosted on AWS. When the website tries to access the database in any way, it ...
0 votes
0 answers
90 views

Django site is not opening up on Digital Ocean Ubuntu droplet

We have been using this server for an year already as our Django application development server but it stopped launching the site on whatever port we start the application. Digital Ocean hosting ...
1 vote
1 answer
297 views

Django + Nginx + Gunicorn - Static files not found

I'm using Django+Gunicorn+Nginx for my web application in a Ubuntu 22.04.4 server. I followed this guide until the end and my web is running in production. However, static files are not working (css, ...
0 votes
1 answer
1k views

Linux / Django / Site not reachable

Something wrong. 2 months ago I was able to access my django server to this url/port http://212.47.245.79:8000/ Yesterday I went back to this machine, as connection was down. I have restarted django, ...
-1 votes
1 answer
141 views

System slow to respond to request. What to do?

I have an application container behind an Nginx reverse proxy. When I access the application via https, the POST request returns 302 and then the GET returns 200. See monitoring via browser: Request ...
0 votes
0 answers
97 views

Putting a Django application into production on Ubuntu server with Apache2 and Cloudflare

I have this Django application which works very well, but I do not understand at all, how to put it in production on a Ubuntu 22.04 LTS server using apache2 and to link it in HTTPS, on a domain such ...
0 votes
0 answers
154 views

Django: CONN_MAX_AGE persists connections, with gthread worker class of gunicorn

I am using Django, without MAX_CONN_AGE setting (default = 0), this leads to creation of connection in each request, and connection is not reused in django ORM. This is causing multiple postgres ...
25 votes
2 answers
15k views

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 ...
0 votes
1 answer
428 views

Django uwsgi behind haproxy: http or http-socket?

I've a Django app inside a docket that uses uwsgi. Since we have several Dockers running on different machines we have haproxy as load balancer. My question is: should I use uwsgi with http or http-...
0 votes
0 answers
62 views

uWSGI with nginx bad gateway error

So I'm trying to host my django app with nginx and uwsgi but i keep running into a 502 bad gateway error. I have the following nginx config. upstream django { server unix:///home/david/...
0 votes
1 answer
345 views

www-data nginx permission django no read access

I followed this guide to setup my Django application to work with my nginx webserver. However upon testing I discovered that www data group did not have access to my applications static files and ...
1 vote
1 answer
558 views

Why is Gunicorn necessary to make Django work with nginx?

Why does Django need a server like Gunicorn to work with NGINx? Why is nginx not enough?
0 votes
1 answer
92 views

Apache Bad Request (400) and time shift in logfile

My web server utilizes Apache and Django for its web service. Occasionally, the web service produces a "Bad Request (400)" error. After reviewing the error log, I noticed that there is a 6-...
0 votes
2 answers
212 views

Getting Reverse Proxy to work

I have a Django web app sharing external ports 80 and 443 with another server. localhost works fine without the reverse proxy, but when it is enabled, I run into all kinds of errors. How to make ...
1 vote
2 answers
187 views

Django app hosted in Apache running on Windows - service won't start

I've found many similar articles with similar issues, and a couple of them concluded the Apache service just cannot be run at all for my situation. However I did get the service to run -- only it ...
0 votes
1 answer
115 views

Vue + Django REST + traefik = page not found

I am modifying djangocookiecutter to meet my requirements. I have Vue + Django REST production.yml version: '3' volumes: production_postgres_data: {} production_postgres_data_backups: {} ...
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 ...
3 votes
2 answers
10k views

Nginx + Gunicorn + Django - nginx not allowing static files

Updated Code - this is still not working though. Settings.py STATIC_ROOT = '/home/ubuntu/virtualenv/mysite/homelaunch/static/' STATIC_URL = '/static/' nginx conf :: /etc/nginx/sites-enabled/mysite ...
0 votes
0 answers
175 views

Django on EC2 can't connect to RDS (Same VPC, same subnets)

i set up this environment on AWS: VPC: 1 Public subnet Route table with Internet Gateway 2 Private subnets Route table with NAT I created a subnetgroup with the private subnets and attached it to ...
0 votes
0 answers
38 views

How to configure Apahce with websocket through python daphne DJango on EC2 server

Below is my virtual host for running python <VirtualHost *:8000> DocumentRoot /var/www/VITSBACKEND ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log ...
0 votes
1 answer
172 views

Postfix rejecting my email from a "Contact Us" form, with "SMTPRecipientsRefused"

I made a "Contact Us" form in Django, and the Django part of it seems to be working. But sending of the email it generates fails with SMTPRecipientsRefused at /contact/ {'[email protected]'...
1 vote
1 answer
149 views

nginx Expires header based on mime type for proxied content?

My setup uses a map to define different Expires headers for various static files (based on their mime type). For proxied content (uwsgi_pass), I use a static Expires header: map $...
1 vote
1 answer
881 views

Why is docker compose failing with " ERROR [internal] load metadata for docker.io/library/python:3.11.6-alpine3.18 "?

I'm new to docker, trying to build a website by following a online course but i was struck with this error in the beginning itself FROM python:3.9-alpine3.13 LABEL maintainer="rohitgajula" ...
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 ...
0 votes
0 answers
174 views

Development Server Failing to see CSS Files | Django

Right, being a Python & Django student using VSC so therefore, in the interest of not having a nervous breakdown here, how on earth do other VSC users import CSS files into their HTML/PHP ...

1
2 3 4 5
21