502 Bad Gateway nginx/1.14.0 (Ubuntu)

282 views
Skip to first unread message

Jagtar Singh Lakhyan

unread,
Apr 11, 2020, 12:53:50 PM4/11/20
to Django users
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/nginx.conf test is successful


sudo systemctl status gunicorn.service

gunicorn.service - gunicorn service

   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset:

   Active: active (running) since Sat 2020-04-11 21:19:19 IST; 11s ago

 Main PID: 16326 (gunicorn)

    Tasks: 4 (limit: 1689)


Rok Klancar

unread,
Apr 11, 2020, 1:36:00 PM4/11/20
to Django users
Dude, try "sudo systemctl status nginx"

Dne sobota, 11. april 2020 18.53.50 UTC+2 je oseba Jagtar Singh Lakhyan napisala:

Jagtar Singh Lakhyan

unread,
Apr 11, 2020, 1:40:51 PM4/11/20
to django...@googlegroups.com

sudo systemctl status nginx

nginx.service - A high performance web server and a reverse proxy server

   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)

   Active: active (running) since Sat 2020-04-11 04:54:18 IST; 18h ago

     Docs: man:nginx(8)

  Process: 1650 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfi

  Process: 1652 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exite

  Process: 1651 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (c

 Main PID: 1653 (nginx)

    Tasks: 9 (limit: 1689)

   CGroup: /system.slice/nginx.service

           ├─1653 nginx: master process /usr/sbin/nginx -g daemon on; master_process o

           ├─1654 nginx: worker process

           ├─1655 nginx: worker process

           ├─1656 nginx: worker process

           ├─1657 nginx: worker process

           ├─1658 nginx: worker process

           ├─1659 nginx: worker process

           ├─1660 nginx: worker process

           └─1661 nginx: worker process


Apr 11 04:54:18 wms systemd[1]: Starting A high performance web server and a reverse p

Apr 11 04:54:18 wms systemd[1]: Started A high performance web server and a reverse pr


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a3223d66-8adb-4dcd-8a48-d43d8a426ddc%40googlegroups.com.


--
jagtar singh
founder & CEO
web 1: Network
web 2: WMS
web 3: Conference  

Android App 1: Network
Android App 2: WMS
Android App 3: Conference

IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD.


Andrew C.

unread,
Apr 11, 2020, 8:49:34 PM4/11/20
to django...@googlegroups.com
What’s the HTTP status code? Does the nginx page even show anything? Try:

sudo systemctl stop nginx && sudo systemctl disable nginx && sudo systemctl enable nginx && sudo systemctl start nginx

This command could also be in the wrong order... it’s been awhile.

It could be a symbolic link error. I don’t know. If you see some web page with an error message like Internal Error 500 or the default nginx page, let us know.

Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 12:54:59 AM4/12/20
to django...@googlegroups.com
No luck, same 502 error.

These r settings.py

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = False


ALLOWED_HOSTS = ['iitian.xyz', '192.95.37.123']


Sunday Iyanu Ajayi

unread,
Apr 12, 2020, 7:44:48 AM4/12/20
to django...@googlegroups.com
HI Jagtar,

Sometimes when you get 502 nginx server error , it can be due to the fact that your django code has some error. If there is an error in your code, nginx will no serve. 

Try to run 
sudo systemctl reload daemon-reload
sudo systemctl enable gunicorn
sudo systemctl restart gunicorn
sudo systemctl restart nginx

wait for about 2-5minutes then run  
sudo systemctl status gunicorn  

IT shoud display error in your code



Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 9:57:41 AM4/12/20
to django...@googlegroups.com
Hi Ajayi,

sudo systemctl reload daemon-reload

Failed to reload daemon-reload.service: Unit daemon-reload.service not found.


perhaps u mean to say: sudo systemctl daemon-reload


Ran these 
sudo systemctl daemon-reload
sudo systemctl enable gunicorn
sudo systemctl restart gunicorn
sudo systemctl restart nginx

wait for about 2-5minutes then run  
sudo systemctl status gunicorn


Result:


sudo systemctl status gunicorn

[sudo] password for wms: 

gunicorn.service - gunicorn service

   Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset

   Active: active (running) since Sun 2020-04-12 19:17:35 IST; 6min ago

 Main PID: 8587 (gunicorn)

    Tasks: 4 (limit: 1689)

   CGroup: /system.slice/gunicorn.service

           ├─8587 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun

           ├─8590 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun

           ├─8592 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun

           └─8594 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun


Apr 12 19:17:35 wms systemd[1]: Started gunicorn service.

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] S

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] L

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] U

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8590] [INFO] B

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8592] [INFO] B

Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8594] [INFO] B


The app is well tested on my local, even i tried 15 days back the same app to run on nginx, gunicorn and it ran on ip/domain:8000 but Not it didnt run on ip/domain.


Also, i am checking for the app again if it has some issues. 


I am following this guide: https://medium.com/@_christopher/deploying-my-django-app-to-a-real-server-part-i-de78962e95ac


Rok Klancar

unread,
Apr 12, 2020, 10:04:02 AM4/12/20
to django...@googlegroups.com
Provide the contents of your file in nginx/sites-available and your gunicorn.service file

V V ned., 12. apr. 2020 ob 15:57 je oseba Jagtar Singh Lakhyan <jagtar....@gmail.com> napisala:


--

Rok Klancar
Fullstack developer
Amsterdam
Netherlands, EU
e-mail : rkla...@gmail.com
website: rok-klancar.com
mobile : +386 30 629880

Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 10:09:55 AM4/12/20
to django...@googlegroups.com
/etc/nginx/sites-available/iitians

server {
       listen 80;
       server_name 192.95.37.123;
       location = /images/favicon.ico {access_log off;log_not_found off;}

       location /static/ {
         root /home/wms/iitians;
       }
       location /media/ {
         root /home/wms/iitians;
       }

       location / {
         include proxy_params;
         proxy_pass http://unix:/home/wms/iitians/iitians.sock;
       }
     }
/etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn service
After=network.target

[Service]
User=wms
Group=www-data
WorkingDirectory=/home/wms/iitians/
ExecStart=/home/wms/iitiansenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/home/wms/iitians/iitans.sock iitians.wsgi:application

[Install]
WantedBy=multi-user.target

Rok Klancar

unread,
Apr 12, 2020, 11:41:11 AM4/12/20
to django...@googlegroups.com
Everything seems to be in order....

Maybe it's the firewall's fault.
What do you get when you type
'sudo ufw status' ?

V V ned., 12. apr. 2020 ob 16:09 je oseba Jagtar Singh Lakhyan <jagtar....@gmail.com> napisala:

Rok Klancar

unread,
Apr 12, 2020, 11:43:46 AM4/12/20
to django...@googlegroups.com
And did you set up any funky settings in settings.py, like for example some of these:
image.png
Cuz I once tried to make a "very secure" application, and I set all of those settings,
but when I moved them into production, none of them worked, because I didn't really
understand them.

V V ned., 12. apr. 2020 ob 17:40 je oseba Rok Klancar <rkla...@gmail.com> napisala:

Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 11:48:00 AM4/12/20
to django...@googlegroups.com

sudo ufw status

[sudo] password for wms: 

Status: inactive


No funky settings as currently i want only to run the app on web, Not even installed ssl.


Rok Klancar

unread,
Apr 12, 2020, 11:56:11 AM4/12/20
to django...@googlegroups.com
Allright, It seems that the problem lies in the firewall (ufw stands for Uncomplicated FireWall)

Try this:
sudo ufw allow 'Nginx Full'
and don't forget to do this after:
sudo ufw enable

Tell me how that worked out

V V ned., 12. apr. 2020 ob 17:47 je oseba Jagtar Singh Lakhyan <jagtar....@gmail.com> napisala:

Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 12:05:09 PM4/12/20
to django...@googlegroups.com
Nope

sudo ufw allow 'Nginx Full'

[sudo] password for wms: 

Skipping adding existing rule

Skipping adding existing rule (v6)

sudo ufw enable

Command may disrupt existing ssh connections. Proceed with operation (y|n)? y

Firewall is active and enabled on system startup


Do i need to sudo reboot also.


Rok Klancar

unread,
Apr 12, 2020, 12:07:49 PM4/12/20
to django...@googlegroups.com
Do it;
It can't hurt

V V ned., 12. apr. 2020 ob 18:04 je oseba Jagtar Singh Lakhyan <jagtar....@gmail.com> napisala:

Rok Klancar

unread,
Apr 12, 2020, 12:10:26 PM4/12/20
to django...@googlegroups.com
And If this doesn't work, I think it is the best course of action to go to settings.py,
and set the DEBUG=True.
Then the 502 error may disappear and you'll see the Django error log

V V ned., 12. apr. 2020 ob 18:06 je oseba Rok Klancar <rkla...@gmail.com> napisala:

Jagtar Singh Lakhyan

unread,
Apr 12, 2020, 12:16:56 PM4/12/20
to django...@googlegroups.com
Done but no luck

Also, its Not logging in through ssh

Sunday Iyanu Ajayi

unread,
Apr 13, 2020, 7:06:10 AM4/13/20
to django...@googlegroups.com

Jagtar Singh Lakhyan

unread,
Apr 13, 2020, 7:37:51 AM4/13/20
to django...@googlegroups.com

Rok Klancar

unread,
Apr 13, 2020, 8:54:31 AM4/13/20
to django...@googlegroups.com
Jagtar, did you wanted to say before that enabling ufw disabled you to access your server via ssh?


V V pon., 13. apr. 2020 ob 13:37 je oseba Jagtar Singh Lakhyan <jagtar....@gmail.com> napisala:

Jagtar Singh Lakhyan

unread,
Apr 13, 2020, 9:10:04 AM4/13/20
to django...@googlegroups.com
Im working from terminal but on enabling ufw, server wasn't logging in from terminal and i had to go to server console to disable ufw to access again from terminal 

Soham Navadiya

unread,
Apr 13, 2020, 9:28:50 AM4/13/20
to django...@googlegroups.com
You forgot one step after enabling ufw. 

You have to execute sudo ufw allow ssh.

Currently you can't login via ssh bcoz ufw not allowing you. 

Aldian Fazrihady

unread,
Apr 13, 2020, 9:50:12 AM4/13/20
to django...@googlegroups.com
If you turned off gunicorn, will you still get the 502 error? If yes, the orginal error it means your nginx cannot connect to your gunicorn.

Have you tested your app on dev server, i.e: `python manage.py runserver` ?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.


--
Regards,

Jagtar Singh Lakhyan

unread,
Apr 13, 2020, 12:53:11 PM4/13/20
to django...@googlegroups.com
Now im following this guide https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04

its working till domain/ip:8000 as i already said but 

curl --unix-socket /run/gunicorn.sock localhost

curl: (7) Couldn't connect to server


and


sudo systemctl status gunicorn

[sudo] password for wms: 

gunicorn.service - gunicorn daemon

   Loaded: loaded (/etc/systemd/system/gunicorn.service; disabled; vendor preset: enabled)

   Active: failed (Result: exit-code) since Mon 2020-04-13 20:52:38 IST; 1h 28min ago

  Process: 4643 ExecStart=/home/wms/iitians/iitiansenv/bin/gunicorn --access-logfile - --workers 3 --bind unix:/run/gunicorn.

 Main PID: 4643 (code=exited, status=3)


Apr 13 20:52:38 wms gunicorn[4643]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked

Apr 13 20:52:38 wms gunicorn[4643]: ModuleNotFoundError: No module named 'iitians.wsgi'

Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4646] [INFO] Worker exiting (pid: 4646)

Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4643] [INFO] Shutting down: Master

Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4643] [INFO] Reason: Worker failed to boot.

Apr 13 20:52:38 wms systemd[1]: gunicorn.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED

Apr 13 20:52:38 wms systemd[1]: gunicorn.service: Failed with result 'exit-code'.

Apr 13 20:52:38 wms systemd[1]: gunicorn.service: Start request repeated too quickly.

Apr 13 20:52:38 wms systemd[1]: gunicorn.service: Failed with result 'exit-code'.

Apr 13 20:52:38 wms systemd[1]: Failed to start gunicorn daemon.


Jagtar Singh Lakhyan

unread,
Apr 13, 2020, 1:01:56 PM4/13/20
to django...@googlegroups.com

sudo journalctl -u gunicorn

-- Logs begin at Fri 2020-04-10 23:00:11 IST, end at Mon 2020-04-13 21:54:16 IST. --

Apr 13 19:49:35 wms systemd[1]: Started gunicorn daemon.

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Starting gunicorn 20.0.4

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Listening at: unix:/run/gunicorn.sock (2515)

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Using worker: sync

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] [INFO] Booting worker with pid: 2520

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2521] [INFO] Booting worker with pid: 2521

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] [INFO] Booting worker with pid: 2522

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] [ERROR] Exception in worker process

Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last):

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker

Apr 13 19:49:36 wms gunicorn[2515]:     worker.init_process()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process

Apr 13 19:49:36 wms gunicorn[2515]:     self.load_wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi

Apr 13 19:49:36 wms gunicorn[2515]:     self.wsgi = self.app.wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi

Apr 13 19:49:36 wms gunicorn[2515]:     self.callable = self.load()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load

Apr 13 19:49:36 wms gunicorn[2515]:     return self.load_wsgiapp()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp

Apr 13 19:49:36 wms gunicorn[2515]:     return util.import_app(self.app_uri)

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app

Apr 13 19:49:36 wms gunicorn[2515]:     mod = importlib.import_module(module)

Apr 13 19:49:36 wms gunicorn[2515]:   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module

Apr 13 19:49:36 wms gunicorn[2515]:     return _bootstrap._gcd_import(name[level:], package, level)

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked

Apr 13 19:49:36 wms gunicorn[2515]: ModuleNotFoundError: No module named 'iitians.wsgi'

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] [ERROR] Exception in worker process

Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last):

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker

Apr 13 19:49:36 wms gunicorn[2515]:     worker.init_process()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process

Apr 13 19:49:36 wms gunicorn[2515]:     self.load_wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi

Apr 13 19:49:36 wms gunicorn[2515]:     self.wsgi = self.app.wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi


$ sudo nano /etc/systemd/system/gunicorn.service


-- Logs begin at Fri 2020-04-10 23:00:11 IST, end at Mon 2020-04-13 22:26:42 IST. --

Apr 13 19:49:35 wms systemd[1]: Started gunicorn daemon.

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Starting gunicorn 20.0.4

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Listening at: unix:/run/gunicorn.sock (2515)

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] [INFO] Using worker: sync

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] [INFO] Booting worker with pid: 2520

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2521] [INFO] Booting worker with pid: 2521

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] [INFO] Booting worker with pid: 2522

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] [ERROR] Exception in worker process

Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last):

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", li

Apr 13 19:49:36 wms gunicorn[2515]:     worker.init_process()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py

Apr 13 19:49:36 wms gunicorn[2515]:     self.load_wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py

Apr 13 19:49:36 wms gunicorn[2515]:     self.wsgi = self.app.wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", l

Apr 13 19:49:36 wms gunicorn[2515]:     self.callable = self.load()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py"

Apr 13 19:49:36 wms gunicorn[2515]:     return self.load_wsgiapp()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py"

Apr 13 19:49:36 wms gunicorn[2515]:     return util.import_app(self.app_uri)

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/util.py", line 

Apr 13 19:49:36 wms gunicorn[2515]:     mod = importlib.import_module(module)

Apr 13 19:49:36 wms gunicorn[2515]:   File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module

Apr 13 19:49:36 wms gunicorn[2515]:     return _bootstrap._gcd_import(name[level:], package, level)

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 994, in _gcd_import

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 971, in _find_and_load

Apr 13 19:49:36 wms gunicorn[2515]:   File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked

Apr 13 19:49:36 wms gunicorn[2515]: ModuleNotFoundError: No module named 'iitians.wsgi'

Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] [ERROR] Exception in worker process

Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last):

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", li

Apr 13 19:49:36 wms gunicorn[2515]:     worker.init_process()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py

Apr 13 19:49:36 wms gunicorn[2515]:     self.load_wsgi()

Apr 13 19:49:36 wms gunicorn[2515]:   File "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py


project/project/ ls

asgi.py  __init__.py  __pycache__  settings.py  urls.py  views.py  wsgi.py

Jagtar Singh Lakhyan

unread,
Apr 13, 2020, 1:04:14 PM4/13/20
to django...@googlegroups.com
@soham will keep in mind next time

You forgot one step after enabling ufw. 

You have to execute sudo ufw allow ssh.

@Aldian will try n update the same
Reply all
Reply to author
Forward
0 new messages