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
0answers
21 views

Django-import-export-celery Import error [Errno 13] Permission denied

I have a minor issue where I always see an error 13: Import error [Errno 13] Permission denied: '/_/_/_/media/django-import-export-celery-import-change-summaries' I can still import but I cannot see ...
1
vote
1answer
637 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: ...
0
votes
0answers
52 views

Environment Variables not visible in DJango

As you can see in the above image, that my environment variables are set and when I try to access them using the os module of python it works. But the moment I run my DJango application (which runs on ...
0
votes
0answers
22 views

Django: How to detect if project is running with a DEBUG= True or False

I have the Amazon S3 service configured and working well. I created a FOLDER structure for all the files that my website will load to S3. What I need to do is: if I am working on develop mode (DEBUG =...
0
votes
0answers
64 views

DJango access media files from different disk

I have a DJango web application running on a NGINX server. My storage space is almost full and now I want to add a new disk to my project. Is there any scope for DJango to access media files from both ...
1
vote
1answer
36 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 * * * /...
0
votes
0answers
474 views

Apache/2.4.46 (Ubuntu) Server at Port 80 Error

I have uploaded 2 django projects before and worked perfectly fine to the server, but now for some reason I am receiving this error. I have revisited a tutorial word by word and revised it several ...
0
votes
1answer
32 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/...
0
votes
1answer
65 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 ...
0
votes
0answers
214 views

How to setup multiple django sites using NGINX and gunicorn

I have a virtual server already running a DJango site of mine. Now I want to add on another site to the same server but am unable to do so. Yes I correctly configured the NGINX part which redirects ...
0
votes
0answers
683 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
0answers
53 views

Vagrant server not running in host machine

I was trying to create a server for running Django app. I installed a virtual box and initialize the vagrant in my application. Vagrant file: # -*- mode: ruby -*- # vi: set ft=ruby : # All ...
0
votes
0answers
21 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 ...
0
votes
2answers
74 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 ...
0
votes
0answers
220 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 ...
0
votes
1answer
154 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
1answer
6k 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
vote
1answer
1k 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]:...
4
votes
1answer
2k 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
0answers
262 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 ...
0
votes
0answers
197 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
0answers
763 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 ...
5
votes
2answers
3k 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", "...
0
votes
0answers
684 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/...
1
vote
1answer
839 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
2answers
1k 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
1answer
239 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
0answers
37 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 ...
0
votes
1answer
618 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/...
0
votes
1answer
570 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
1answer
867 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
2answers
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 ...
2
votes
0answers
790 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
1answer
4k 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
1answer
162 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
1answer
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
1answer
5k 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
2answers
12k 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
1answer
3k 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 ...
-1
votes
2answers
283 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
0
votes
2answers
1k views

PyCharm Pro ImportError and Broken Virtualenv

Issue: The solution was to uninstall the virtualenv. While I was trying to set-up a Django Project. On the manage.py: ImportError("Couldn't import Django. Are you sure it's installed and " "...
0
votes
1answer
219 views

write a complex text into file(include double quotation and single quotation)

I want write a complex string into a file in python but the problem is my text itself have a command and double quotation and single quotation too so python can't write it and assume its a command too....
2
votes
1answer
4k views

systemctl .service can't read the environment variable

I'm using django and now trying to configure server with nginx and uwsi. now i'm running nginx+socket+uwsgi_emperor well . for running uwsgi i use below command in terminal: /usr/local/bin/uwsgi --...
0
votes
1answer
2k views

Access python os.environ var in virtualenv with sudo?

I am working on a django project where I have to keep secrete information to python's os.environ. by following below link http://barkas.com/2016/set-environment-variables-activating-virtualenv/ code ...
0
votes
2answers
5k views

Mkvirtualenv: command not found 19.04

Trying to install Django Framework. This when I am trying to activate an virtual environment for the very first time: mkvirtualenv test mkvirtualenv: command not found Location of the ...
1
vote
0answers
103 views

Not being able to install the latest version of Django

I tried installing the latest version of django using the following command:sudo apt-get install Django==2.0.5 But this is giving an error saying that the system requirements allow me to install only ...
3
votes
1answer
6k views

How to run Django cron in crontab?

I have a Django application which uses django-cron (https://django-cron.readthedocs.io/en/latest/installation.html), and I need to execute python manage.py runcrons every 5 mins in AWS EC2 running on ...
1
vote
0answers
766 views

facing issue Couldn't import Django. Are you sure it's installed and after installing docker

I continuously get this message: Couldn't import Django. Are you sure it's installed on running this command: python manage.py runserver after installing docker in my ubuntu 16.04. Done with Below ...
0
votes
1answer
266 views

django app deployment without subdomain

I have deployed a django app to the server i have. Let say its ip is 192.168.1.1. So i was able to access the any site there with 192.168.1.1/my_site. I have now deployed the Django App which is a ...
1
vote
1answer
2k views

Unmet dependencies while trying to install python3-pip in Ubuntu 18.04 [duplicate]

lokesh@lokesh-pc:~$ python3 --version Python 3.6.5 lokesh@lokesh-pc:~$ pip3 --version bash: pip3: command not found lokesh@lokesh-pc:~$ sudo apt-get install python3-pip [sudo] password for lokesh: ...