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.
1,036
questions
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 ...
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 ...
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, ...
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 ...
-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 ...
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
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
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 ...
0
votes
1
answer
427
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 ...
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
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:
...
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: {}
...
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
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
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
880
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
vote
1
answer
447
views
Having difficulty connecting to PostgreSQL with Django hosted on IIS
Trying to host Django 4 app with PostgreSQL database on Windows Server 2016 with IIS manager 10 and httpPlatformHandler 1.2.
The app and database work without issues when running on a VM server with ...
0
votes
1
answer
193
views
Error 404 Message | Django | PyCharm
Right, is there any particular valid reason as to why - despite me doing everything correctly - do I get the error 404 message when I deploy my development server (on port 8000) from PyCharm?
This is ...
0
votes
0
answers
35
views
ValidationError on formset after user stopped POST request with browser goback
I have a django admin form containing a multiple files field and some inlines formsets after.
When user's connexion is slow, it happens they close the page or go back to the previous page (no patience ...
0
votes
1
answer
210
views
Running php and django on two subdomains
My friends and I have made a project which is made out of two parts. One is made in Django and other one is made in php language. We have just one server so we want to use 2 subdomains. My question is ...
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
0
answers
146
views
How can I enable mod_wsgi in Apache2.4.57.0 on Windows?
Apache/2.4.57 (Win64)
Django 2.4.2
I am new to Django and I tried to connect it with Apache through mod_wsgi but it seems new versions of Apache does not support such kind of module. I installed ...
0
votes
2
answers
105
views
Apache virtualhosts conf let wrong servername requests going through proxy
I have moved a server configuration to a new server and at the same time configured it with apache mod_proxy to access a gunicorn/django webserver (inside a docker container on port 8000). Previous ...
0
votes
1
answer
429
views
Access errors passing traffic from nginx to daphne server
I've got a GKE private k8s cluster with nginx and a django application running with wsgi and asgi. Logs from nginx show that websocket requests get a 403, and the logs on the daphne pod are showing &...
0
votes
1
answer
130
views
mailman3 - css files of hyperkitty placed in wrong directory
I have installed mailman3 and followed this instruction: https://lab.uberspace.de/guide_mailman-3/
My problem is, that css files for HyperKitty (and the login screen) are not available. If I'm on ...
0
votes
1
answer
393
views
Nginx doesn't see or use subdomain config
Problem: nginx doesn't apply configuration for subdomain if there are domain and subdomain config at the same time.
Disclaimer: I'm new to nginx and server deployment.
Question:
What I do wrong with ...
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. ...
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 ...
0
votes
0
answers
343
views
unable to find django error when running django app through apache2
I am trying to get a django app running on a apache2 server both on a raspberry pi for a project of mine. The appache server is running but I can't pull up the web page as I just get an "Internal ...
0
votes
1
answer
220
views
Connect Redis Unix Domain Socket to Django
I have a Django website running via nginx under user www-data and gunicorn under user myuser bound at /run/gunicorn.sock.
nginx works just fine; it acts as a proxy to the gunicorn Unix domain socket. ...
0
votes
1
answer
2k
views
Gunicorn quits without notice
I'm deploying a django/nginx/gunicorn site and am following this guide while doing so. Following the subheading "Final Steps for Production Deployments", I've created a production gunicorn ...
3
votes
1
answer
147
views
get request problems while running nginx + gunicorn + django-plotly-dash
The web site is running, Gigicorn has multipule workers.
For some reason the url_calling : http://web?id=value
the id=value do not propagate coherently, (sometimes it works, but most of the time it ...
1
vote
1
answer
2k
views
Connecting to hosts postgresql from django app running in a docker container
I am trying to connect to my hosts postgresql server (version 14) from my django app running in a docker container.
here are my settings
docker-compose.yml:
version: '3'
services:
web:
build: ...
0
votes
1
answer
1k
views
Best way to config gunicorn and nginx with django?
I am trying to deploy django with gunicorn and nginx on heroku, and i'm kinda confused with the way to config gunicorn and nginx, when i searched through internet, they usually create gunicorn.socket
[...
0
votes
0
answers
61
views
How to generate embedded element for other site to consume?
If I put a link on a comment on Twitter, facebook and other place the website analyse the link and show a small preview of the link if possible. It could be a small player for a video or an image with ...
4
votes
2
answers
5k
views
Redis cannot bind a specific ip address?
I'm new to redis, but I want to set one up on my Raspberry Pi 4 (RP) for using it in a Django application (with celery).
On my RP I have installed a firewall, ufw, and allowed incomming traffic from ...
0
votes
1
answer
2k
views
connection refused django gunicorn nginx
I am getting following error when running search feature on my site (search feature makes api request to my api server):
2022/08/31 21:01:56 [error] 726#726: *23 connect() failed (111: Connection ...