Questions tagged [django]

Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

domain "refused to connect" running django app on digitalocean droplet

I want to deploy a site on a digitalocean droplet. So far, it works as expected when I hit the IP address 123.45.678.910, but when I go to my domain name, I see "This site can't be reached, my-...
  • 277
-2 votes
0 answers
13 views

Ubuntu Server - Django dosent work on public IP

I have an server with Django, Nginx and uWSGI. Everything works fine on local IP, but when i type public IP theres only Nginx site, without Django. On log from uWSGI i have only that: On uWSGI logs i ...
0 votes
1 answer
29 views

Allow only certain files in Apache

The application I built with the django runs on the linux server. As a result of one process I have done in this app, the file.txt is created in this directory: /home/user/app/media/file.txt My goal ...
0 votes
0 answers
19 views

gunicorn.service: Failed with result 'exit-code'

I want to use a digitalocean droplet to host a django site. I'm trying to get the app running on the server with gunicorn and nginx, I'm getting a 502 error when I try to hit the server from my ...
  • 277
0 votes
0 answers
82 views

Permission denied (publickey,password) Apache in Ubuntu 20.04LTS

I obtain the above mentioned error "Permission denied (publickey,password)" when trying to connect with ssh using my apache server. The framework I have used is Django and when deploying it ...
0 votes
0 answers
39 views

I have problem when saving codes in VSCode

I just migrated to Ubuntu. I have a problem when saving codes in VSCode. It keeps asking me to enter the password. It seems that this problem occurs when working with Docker.
  • 1
0 votes
0 answers
530 views

Permission denied inside a container

I am trying to build Django app container with the following dockerfile and docker compose, but I have permission denied. Since a week I am looking how to solve this error. Dockerfile-prod FROM python:...
0 votes
0 answers
175 views

DisallowedHost at / Invalid HTTP_HOST header: '192.168.0.245:8000'. You may need to add '192.168.0.245' to ALLOWED_HOSTS

Run GeoNode Project This command will run both GeoNode and GeoServer locally after having prepared the Spatialite database. The server will start in DEBUG (or DEVELOPMENT) mode, and it will start the ...
0 votes
0 answers
507 views

Failed to load resource: the server responded with a status of 500 (Internal Server Error) server cannot be a server error When I run it in visual

When I run it in visual, it works, but when I deploy it to the server, the part with the url is https://domain/finance/ $.ajax({ url: 'https://example.ca/finance/', beforeSend : function(...
  • 1
1 vote
0 answers
219 views

How do I run daphne (or any python application) from a no-login user?

Bottom Line Up Front For security, I want a "your only purpose in life is to serve butter" user with only enough privileges to execute Daphne and my Django app as a systemd service. How do I ...
  • 151
0 votes
0 answers
27 views

How to recover deleted files in ubantu which is deleted by -delete comand? [duplicate]

While trying to reset my python Django project migrations due to 1st command my whole is deleted. How can I recover? find . - path "*/migrations/*.py" -not -name " __init.py__ " -...
  • 101
0 votes
0 answers
1k views

Django mod_wsgi Apache error 403 Forbidden on Ubuntu 22.04

Django mod_wsgi on Apache application works fine in Ubuntu 20.04 and previous versions with the configuration mentioned below, but when I do the same configuration in Ubuntu 22.04 it gets 403 ...
0 votes
0 answers
43 views

don't show Select Options in form django

I do not want to display the number of products that is zero in the list model class Khoroj(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE, null=True, ...
0 votes
1 answer
92 views

How to open a terminal inside a sub-directory from django

I am learning django. I am stuck with this problem. I want to open a new terminal and execute a command in it. Here is the code that I used to do it. run(["gnome-terminal", "--", &...
0 votes
0 answers
684 views

How to create systemd for django python under ubuntu?

I created /etc/systemd/system/django.service [Unit] Description=Unit crm3 After=network.target [Service] Restart=on-failure WorkingDirectory=/var/www/repocrm3/RepositoryCRM3/ ExecStart=/var/www/...
  • 101
1 vote
1 answer
28k views

CERTIFICATE_VERIFY_FAILED error

Python Django error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1131)> Exception Location: /usr/lib/python3.8/...
0 votes
0 answers
840 views

gunicorn active: failed, why don`t active gunicorn?

i hav ubuntu server 20.04 and a django project i set /etc/systemd/system/gunicorn.socket Description=gunicorn socket [Socket] ListenStream=/run/gunicorn.sock [Install] WantedBy=sockets.target and /...
  • 9
2 votes
1 answer
3k views

Django + Nginx, and Gunicorn: doesn't create gunicorn.sock

I have error when i do systemctl start gunicorn.socket systemctl status gunicorn.socket ● gunicorn.socket - gunicorn socket Loaded: error (Reason: Unit gunicorn.socket failed to load properly: ...
1 vote
1 answer
221 views

CronJob Not running

I have prepared a py Script to update my Django database once a day. Trying to use Crontab along with python to run the py script. 0 1 * * 4 /usr/bin/python3 /home/user/folder1/script1.py 0 2 * * * /...
1 vote
1 answer
1k views

crontab fails to write logs

I'm using crontab to run a python script every minute. This is my how my crontab file looks like: */1 * * * * source /root/.bashrc && source /home/env/bin/activate && python /home/...
  • 267
0 votes
1 answer
255 views

Python3 cannot be downloaded result, after $sudo apt --reinstall install python3 command.ubuntu 18.04

Whenever I try to update or upgrade anything,broken file /usr/lib/python3/dist-packages/django/contrib/admin/widgets.py is generating SyntaxError:Generator expression must be parenthesized How to ...
  • 21
0 votes
1 answer
3k views

gunicorn.service failed with result 'exit-code'

i am trying to deploy my django project on digital ocean, and this error stoping me from doing that MY gunicorn.socket file [Unit] Description=gunicorn socket [Socket] ListenStream=/run/gunicorn.sock ...
0 votes
0 answers
27 views

Can't push Django project to Heroku

I ran into a issue with Django pushing to heroku because of Python version, when I change in my terminal with sudo ln -sf /usr/bin/python3.6 /usr/bin/python changing the 3.6 to other versions ...
  • 1
0 votes
2 answers
231 views

Python3.5 claiming pip installations in virtualenv and its uninstallation causing errors

nmj@pc-nm:~$ sudo apt remove python3.5 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you ...
  • 296
0 votes
0 answers
643 views

Django Gunicorn got error Request Line is too large

I'm just a new to it. I've been trying to deploy a Django Project on Digitalocean, It worked fine except there was one url that thrown an error: Request Line is too large (4583 > 4094) As I know ...
1 vote
1 answer
979 views

Linux Environment Variables in sudo

I have an AWS ec2 instance running and have hosted a DJango based web app on it. But the problem is I cannot access the environment variables in sudo mode. So while my DJango app's settings file tries ...
0 votes
1 answer
8k views

ModuleNotFoundError: No module named 'django_filters'

When I try to collect all of my static files in my project in one location with python manage.py collectstatic, I get the error ModuleNotFoundError: No module named 'django_filters django_filters is ...
  • 1
1 vote
1 answer
2k views

How to fix gunicorn.service: Failed to load environment files: Is a directory

When i run sudo journalctl -u gunicorn I get: Oct 14 12:49:22 my-server-thing systemd[1]: gunicorn.service: Failed to load environment files: Is a directory Oct 14 12:49:22 my-server-thing systemd[1]:...
5 votes
1 answer
5k views

Django crontab is not running, even i setup everything

I am using crontab in django and my OS is ubuntu def my_scheduled_job(): print("1") This is code in settings.py CRONJOBS = [ ('*/1 * * * *', 'stocks.cron.my_scheduled_job') ] If I ...
1 vote
0 answers
310 views

ascii error code in django apache2 mysql

I deployed my Django project that uses Apache and MySQL. all apps features work fine, but in an application's views.py, when I try to access it, it raises this error. UnicodeDecodeError: 'ascii' codec ...
  • 113
0 votes
0 answers
328 views

Ubuntu server with apache2 shows index of/

I am fairly new to the world of Ubuntu and apache2. And I've become a little confused of the directories and some other stuff. I have read that the default web directory is /var/www/. I have my ...
1 vote
1 answer
2k views

Deploying a django application and Im having issues with the gunicorn service failing with result "service-start-limit-hit"

I'm deploying on digital-ocean, on Ubuntu 18.04.3. This is my first time deploying a Django application so I have lots of exposure to this new deployment stuff but next to no ability. When I start and ...
6 votes
2 answers
5k views

Permission denied to a 777 file

I have a Django app which is configured to write db queries into a /tmp/db.log file. "debug_console_to_file": { "level": "DEBUG", "...
  • 2,318
0 votes
0 answers
1k views

apache2 Ubuntu django : can't upload my django app

I tried to upload my Django 2.2 project, but I get this error in Ubuntu 18.04 when I type cat /var/log/apache2/error.log : (13)Permission denied: mod_wsgi (pid=7692): Unable to stat Python home /root/...
  • 113
1 vote
1 answer
1k views

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

I am getting the error AttributeError: /usr/lib/libgdal.so.1: undefined symbol: OGR_F_GetFieldAsInteger64 when I try to deploy Django project on google cloud can anyone please give the GDAL dockerfile ...
0 votes
2 answers
3k views

Error: You don't have permission to access that port

I have django application running on ubuntu 18.04 LTS. All of a sudden I started getting below error while running server. $ python manage.py runserver localhost:9000 Performing system checks... ...
0 votes
1 answer
386 views

Django Nginx Gunicorn is not taking the changse for new urls

I recently deployed my first project on digital Digital ocean. I got it working and the site is live, but later when I updated some files I got stuck because the new urls I created are not being ...
1 vote
0 answers
56 views

Upgrade from 19.10 to 20.04 broke all my venvs. How do I fix them?

I just upgraded my cloud server to 20.04. Unfortunately all of my python django driven websites stopped working because all of my venvs do not work. I can actually activate a venv, but then if I try ...
  • 115
0 votes
1 answer
746 views

Upgrade to Ubuntu 20 breaking mysqlclient pip package

Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "/home/tom/cs344/group8-rw334-project-2/venv/lib/python3.7/site-packages/...
  • 1
0 votes
1 answer
704 views

updated from ubuntu 18.04 to 20.04 and now my django project is not working

when I activate my virtual environment and enter python manage.py runserver it gives me following error: (myenv) nouman@nouman-G3:~/Documents/test/myshop$ python manage.py runserver Traceback (most ...
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 ...
  • 155
1 vote
2 answers
1k views

Django Project Runs With runserver, But Not With Gunicorn and nginx

I have a django project installed on a Digital Ocean droplet with ubuntu 18.04.3(LTS). I've installed python 3 and Django 3. In my virtual environment, the command python --version returns 3.6.9 The ...
  • 133
2 votes
0 answers
1k views

Renewing certificate on server with Let's Encrypt when first issued with docker

I am running a dockerized django on an EC2 instance. I configured nginx in a docker container and got a certificate also in a docker container. (I followed this guide: https://www.humankode.com/ssl/...
2 votes
1 answer
5k views

Installing mysqlclient using pip problem

I am deploying Django on DigitalOcean using MySQL and Apache. I am following a step-by-step tutorial on Youtube and everything is fine until when I start installing the python package mysql-client. ...
3 votes
1 answer
171 views

For every Framework new Python Env?

I'm very new to Linux so it could be that I think more in a Windows way. I want to develop something in Python, especially Django and Discord Bot. I have a folder PythonEnvironment where I set up a ...
0 votes
1 answer
1k views

django-admin --version can not find installed version

I have installed latest django(2.2) using pip3 command. Although it is successfully installed I getting below error for the command- django-admin --version Error: Cannot find installed version of ...
1 vote
1 answer
7k views

Django + Guncorn + nginx: 111: Connection refused; bad gateway 502

For some reason, it does not work. Do you see any issues in this code? Thank you for your review in advance! Error.log: 2019/11/10 18:02:02 [error] 8761#8761: *1 connect() to unix:/run/gunicorn....
4 votes
2 answers
13k views

"pip install requirements.txt" command returns many errors, including 404 not found

(myenv1) root@p-VirtualBox:~/online-exam/onlineexam# pip install requirements.txt Collecting requirements.txt Exception: Traceback (most recent call last): File "/root/online-exam/myenv1/lib/...
0 votes
1 answer
4k views

pam_unix(sudo:auth): authentication failure - Restarting apache2

I am deploying my website on a Linux Virtual Machine (Ubuntu 19) on Linode. My deployment worked when allowed: xx.xx.xx.xx:8000 To allow HTTP/TCP traffic I did: sudo delete allow 8000 sudo allow ...
  • 121
0 votes
2 answers
328 views

Visual studio code extensions

Now, i'm trying to install some extensions from vscode, but i have this problem : Failed to install 'batisteo.vscode-django'. Download Manually