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
745 views

How to get GDAL to work with Google GCLOUD

I am getting the below error trying to deploy my app to gcloud app engine. The whole problem is from trying to add the GDAL library to my app. File "/opt/python3.7/lib/python3.7/ctypes/init.py&...
75 votes
9 answers
294k views

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

systemctl start nginx doesn't do anything

if I do systemctl start nginx, it just goes to the next empty line, without letting server to work, like so: [[/home/sc/pro]]# systemctl start nginx [[/home/sc/pro]]# if I do nginx -t: nginx: the ...
0 votes
0 answers
1k views

How to redirect a client after sending 401 Unauthorized?

I've found out that due to the way HTTP Basic Authentication works I need to unauthorize a client in order for the browser to forget the session id. I found a way to do that but I still need to send ...
0 votes
1 answer
975 views

Conda, Django, Gunicorn and Supervisor bad interpreter: No such file or directory

I'm following this tutorial to deploy my Django app, but modified my executable /var/www/my_django_project/bin/gunicorn_start to use my conda env instead of virtualenv. CONDA_SRC=/home/justin/...
5 votes
1 answer
3k views

Analyze uwsgi strace log to find out why it takes high CPU usage

I'm running a django site with nginx through uwsgi. The problem is uwsgi process take a lot of CPU time when traffic become heavy. The same configuration works fine on test server and siege/ab ...
0 votes
2 answers
1k views

Django and Flask on same nginx server with gunicorn

I currently have a Djago app running on my main site when I visit mysite.com. However, I'd like mysite.com/flaskapp to run a separate Flask application. I'm able to set up two nginx site-enabled ...
1 vote
0 answers
1k views

Apache Server Error: ImportError: No module named site

I am trying to serve my django project over Apache using mod_wsgi. Apache will start but my project in inaccessible. When Apache launches I see ImportError: No module named site in the log. There is ...
0 votes
0 answers
1k views

POSTGRESQL and Django app: could not receive data from client: Connection reset by peer

I am running a django app with postgresql, nginx and gunicorn. I have a script where data is pulled from one table in the DB, modified and then needs to replace the existing data in that one table. In ...
6 votes
1 answer
11k views

Django with Apache and mod_wsgi: no system log unless setting Debug = True

I'm using apache web server and mod_wsgi to transfer request to django. $ apache2ctl -v Server version: Apache/2.4.10 (Raspbian) Server built: Sep 17 2016 16:40:43 I'm using this apache site to ...
0 votes
0 answers
326 views

How to correctly tune Apache and mod_wsgi

I'm using Django with mod_wsgi and need to tune the httpd.conf to handle 500 requests per second at peak. Right now I have the following configuration: StartServers 3 ServerLimit 15 MinSpareThreads ...
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. ...
0 votes
0 answers
15 views

what am I doing wrong in nginx / docker to get connect() failed (111: Connection refused) while connecting to upstream ? (SSL) [duplicate]

I am trying to solve why I am getting on docker / nginx container error 502 with connect() failed (111: Connection refused) when I setup properly the ssl , but I got this issue . I dont see clerly ...
-2 votes
1 answer
983 views

AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64 [closed]

when I deploy my project on google cloud I get the error File "/opt/python3.7/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__ func = self.__getitem__(name) File "/opt/...
1 vote
0 answers
3k views

Why is gunicorn not creating a .sock or .pid file?

First things first, I would like to clarify that I am completely knew to debugging servers and deploying in general. I'm a student developer for my university and so far all of my work has been ...
2 votes
1 answer
5k views

ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error! Code: APP_CONTAINER_CRASHED /bin/sh: 1: exec: gunicorn: not found

I am deploying my Django project on google cloud app engine with my virtual environment I get the error ERROR: (gcloud.app.deploy) Error Response: [9] Application startup error! Code: ...
1 vote
1 answer
43 views

Serving subsection of urls on different network card

I have a Django 2.2 web application running on Apache 2.4 Ubuntu 18.04 web server, which has two network interfaces. One network interface is for internet access(eth0) and other one is for local ...
0 votes
2 answers
2k views

Unable to connect to port 8000 on Azure

Description I am using a virtual machine with the Ubuntu image. I tried to run my server on Django with this command python manage.py runserver 0.0.0.0:8000. When I search <public ip>:8000 it ...
1 vote
1 answer
2k views

How to disable basic authentication when using kerberos on nginx?

My task is to configure Kerberos authentication on nginx. The backend is django. The idea is that when a request is made to api, nginx should perform kerberos authentication. But in case the user is ...
0 votes
1 answer
389 views

High CPU load on EC2 with Nginx/Celery/Django causes server to fail

I am running a Django web app on an EC2 server using Nginx, and uWSGI. I also have Celery running some background tasks (no CRON jobs, just on occasional user actions). The app is in early closed Beta ...
0 votes
1 answer
4k views

Are mod_wsgi, python3-mod_wsgi and libapache2-mod-wsgi-py3 the same thing? Do i need just one for Django on RHEL 7.6?

I see a couple of tutorials mentioning the Gate Interface specific to python3.6 for Ubuntu -- libapache2-mod-wsgi-py3 as opposed to just mod_wsgi in RHEL's case. Should i be worrying about looking for ...
0 votes
1 answer
265 views

How can I use the django shell while the server is running?

I have a django server deployed on digitalocean with gunicorn and nginx. I followed a tutorial, I think it was this one. Because of the tutorial I have django only installed in a virtualenv. When I ...
0 votes
1 answer
1k views

nginx, handle 404s in another location with proxy_pass location

I have a basic django application setup under nginx. So far everything runs fine. What I need is a setup so I can handle 404s under /media/ with my proxy_pass application. Currently, it shows a bare ...
4 votes
2 answers
3k views

How do I execute manage.py in Google App Engine?

I followed this tutorial: https://codeburst.io/beginners-guide-to-deploying-a-django-postgresql-project-on-google-cloud-s-flexible-app-engine-e3357b601b91 to get a Django app deployed to Google App ...
2 votes
2 answers
4k views

nginx django suburl doesn't work

I'm trying to setup django under some suburl, lets say /myproject, with nginx and uwsgi. However, I can't get it working. Whatever I try, seems that uwsgi_modifier1 30; option doesn't work. I always ...
3 votes
1 answer
5k views

Do I have to restart my server after changing settings.py?

I have a django app hosted on digitalocean with gunicorn and nginx. I have just changed something in settings.py. I have taken my SECRET_KEY and now I stored it in etc/secret_key.txt settings.py with ...
0 votes
1 answer
67 views

How do I set enviromental varialbes for my ubuntu server?

I have a ubuntu server deployed at digitalocean with gunicorn and nginx to host my django project. Now I want to save my secret key in an env. var. . I searched in the internet and I found that I have ...
1 vote
1 answer
15k views

Internal Server Error when running Gunicorn as a service

I'm trying to deploy my Django app for the first time on a Digital Ocean VPS. I've used their Django droplet which setup things like this except I'm not using a virtual environment. After adding my ...
4 votes
3 answers
8k views

configure nginx for serving django development static files

I am using Nginx to serve static files on django development server. However I can't make it work. The server runs fine but nginx is not able to find static files. This is my settings in nginx.conf: ...
1 vote
1 answer
1k views

How to serve user uploaded files in Django / nginx in Kubernetes on GCP (Google Cloud Platform)

I'm trying to convert a django(with gnunicorn)/nginx/postgres docker-compose environment (using docker-compose) to kubernetes on GCP. I've got everything running smoothly except for serving MEDIA ...
0 votes
1 answer
2k views

NGINX/Gunicorn/Django not serving custom error pages

I am attempting to serve custom error pages in my Django application running under NGINX. I have URLs defined for four pages, and navigating to them is successful; it shows the appropriate page with ...
0 votes
1 answer
3k views

502 Bad Gateway nginx/1.14.0 (Ubuntu)

Im trying to deploy django app using nginx & gunicorn but its showing error sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/...
1 vote
0 answers
372 views

nginx + uWsgi is not using it's maximum capability. 90% workers remain idle all the time

I have deployed my Django application using nginx + uwsgi. I have also implemented micro caching and made other changes by following this article (Nginx 10k concurrent connections). Now I am using ...
0 votes
0 answers
2k views

Configuring Apache for django project

im currently trying to deploy my django project to a web server hosted by a RHEL-8 VM. Im trying to set up the VM to utilize HTTPD (apache). However, i can't seem to get the Virtual Host configuration ...
0 votes
0 answers
3k views

Django Gunicorn-Nginx 504 gateway timeout

I have read a lot of articles about gunicorn & nginx timeout configs . I have some requests on my website which take longer than 30 seconds . I changed all gunicorn timeouts to 3 seconds but ...
1 vote
1 answer
750 views

AWS S3 Bucket Django 3.0 User Profile Image Upload Access ERROR

INTRO I am following this guide as recommended, here is the guide's GitHub repo. I have created an AmazonS3FullAccess to it as well I am using the guide's 3rd example "Mixing public assets and ...
0 votes
1 answer
127 views

unable to access executable in PATH from remote server

I have an web application hosted with Django-gUnicorn-Nginx. The web app is working mostly fine and is accessible except for one functionality. Recently, I added pybedtools, a python wrapper package ...
2 votes
1 answer
389 views

SQLite works, but PostgreSQL migrated database causes ERROR - Django 3.0

Situation I have built Django 3.0 project with a couple of applications. I have created the accounts app based on following course and it's github Than I have created an application fro ...
0 votes
0 answers
152 views

Django DateFilter - input_format change

I need to change input format just for one field. I need to accept 31/03/2020 instead of 3/31/2020. If I enter 3/31/2020 then it's works, but when try 31/03/2020 then appears Enter a valid date. This ...
0 votes
2 answers
633 views

Google App Engine and SAML (Okta)

We're trying to setup a web app (django) in Google App Engine connected via SAML to our idP, Okta. It has to be done as a Custom Flexible App because of a binary requirement, making it basically a ...
0 votes
1 answer
1k views

Django returns 502 error when user apps are added

I've configured a Debian 6 server with nginx, Passenger, and MySQL to run Django, and was running through the Django tutorial with everything going swimmingly until I tried to turn on the admin ...
1 vote
0 answers
256 views

Forbidden(403) permission access error on Apache2.4 on windows machine

I am running my Django app on Apache2.4.38. I have given all the necessary parameters and access to the Apache server. Still, I am receiving a 403 error when I try to access the Application URL. ...
0 votes
1 answer
1k views

nginx fails while the website somehow still works

Description I have built my Django3, gunicorn, nginx, Ubuntu 18.04, Digital Ocean project based on this guide. I only had 1 problem that it does not shows the CSS and all other static files like ...
1 vote
1 answer
5k views

Failed to start gunicorn.service: Unit gunicorn.service not found. Ubunto 18.04

I am following this How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 18.04 guide. I have created the following file .socket sudo nano /etc/systemd/system/gunicorn.socket [Unit] ...
7 votes
4 answers
35k views

ubuntu + nginx + uwsgi + django No Python application found

I am trying to setup my server with a nginx to uwsgi to django stack, but I am having problems with the uwsgi part. When I run uwsgi and pass in all the parameters on the command line, it works ...
15 votes
2 answers
5k views

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': { ...
1 vote
1 answer
2k views

Running two Django project in the same server , or use a new one?

I already have created one Django project in an Apache server using CentOS 7 , python3... Now I have to create another django project and I wonder if I should add this project in the same server or in ...
3 votes
3 answers
5k views

Installing Shapely on Alpine docker

I am trying to move my project to docker and I've been using the alpine variant. This is a django project with postgres database Here is how i install the dependencies: ... ADD ./requirements.txt /...
0 votes
0 answers
842 views

Gubicorn/Nginx does not download files completely: [CRITICAL] WORKER TIMEOUT (pid:18)

I am running a django app with nginx in docker. I can download files via an API using the library requests. When I want to download a file with 55 MB somehow the connection breaks down and the ...
0 votes
0 answers
65 views

Apache: Access control

As a newbie, I find the Apache documentation a bit confusing, too much specification and too little recipes / practical examples to achieve a certain goal. Forum posts are usually referring to older ...

1
3 4
5
6 7
21