Re: Error in manage.py when I do python manage.py runserver

2020-07-22 Thread Jagtar Singh Lakhyan
Use python3 & install if Not installed then run python3 manage.py runserver


On Wed, Jul 22, 2020 at 8:08 PM Kovy Jacob  wrote:

> It gives me a syntax error
>
> Jacob-Mac-mini:TachlisGeredt kovyjacob$ python manage.py runserver
> 0.0.0.0:8000
> File "manage.py", line 16
> ) from exc:
> ^
> SyntaxError: invalid syntax
>
> I didn’t edit manage.py yet, I literally just started the project. I was
> thinking maybe its a) a version error, or b) I know that I get syntax
> errors on code that was written in sublime text or a different IDE when I
> run it on IDLE, so maybe its that.
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/A7892FFC-BEE5-4DE3-99C1-6C4E8CD98C68%40gmail.com
> .
>


-- 

*jagtar singh*founder & CEO
LinkedIn  
Twitter 

web 1: Network 
web 2: WMS 
web 3: Conference 

Android App 1: Network

Android App 2: WMS

Android App 3: Conference


Instagram 
LinkedIn

LinkedIn2 
Twitter 
*IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD.
*



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD1gXQE_YQ17qBC5sk709M4en0yKftkfLvrT3XCMgD35-UDyXg%40mail.gmail.com.


Re: manage.py is giving me an error

2020-07-21 Thread Jagtar Singh Lakhyan
Use python3 & install if Not installed

On Tue, Jul 21, 2020 at 11:19 PM Kovy Jacob  wrote:

> Jacob-Mac-mini:TachlisGeredt kovyjacob$ python manage.py runserver
> 0.0.0.0:8000
>
>   File "manage.py", line 16
>
> ) from exc
>
>  ^
>
> SyntaxError: invalid syntax
>
>
> why am I getting an error, I never edited manage.py
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5cb39a87-ebcf-4c2d-8dce-d39274eba858o%40googlegroups.com
> 
> .
>


-- 

*jagtar singh*founder & CEO
LinkedIn  
Twitter 

web 1: Network 
web 2: WMS 
web 3: Conference 

Android App 1: Network

Android App 2: WMS

Android App 3: Conference


Instagram 
LinkedIn

LinkedIn2 
Twitter 
*IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD.
*



-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD1gXQGAKf6yHApzB--mPizZi9gGour1qtaXwF%2BqZbeDUq5qgg%40mail.gmail.com.


Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-13 Thread Jagtar Singh Lakhyan
@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

On Mon, Apr 13, 2020 at 10:30 PM Jagtar Singh Lakhyan <
jagtar.lakhe...@gmail.com> wrote:

> 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 " importlib._bootstrap>", line 994, in _gcd_import
>
> Apr 13 19:49:36 wms gunicorn[2515]:   File " importlib._bootstrap>", line 971, in _find_and_load
>
> Apr 13 19:49:36 wms gunicorn[2515]:   File " 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-packag

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-13 Thread Jagtar Singh Lakhyan
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 "",
line 994, in _gcd_import

Apr 13 19:49:36 wms gunicorn[2515]:   File "",
line 971, in _find_and_load

Apr 13 19:49:36 wms gunicorn[2515]:   File "",
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*

On Mon, Apr 13, 2020 at 10:21 PM Jagtar Singh Lakhyan <
jagtar.lakhe...@gmail.com> wrote:

> 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 " 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.ser

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-13 Thread Jagtar Singh Lakhyan
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 "",
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.*

On Mon, Apr 13, 2020 at 7:19 PM Aldian Fazrihady  wrote:

> 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` ?
>
> On Sat, Apr 11, 2020 at 11:53 PM Jagtar Singh Lakhyan <
> jagtar.lakhe...@gmail.com> wrote:
>
>> 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)
>>
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/b1031a40-e33c-4bca-8764-13849c75968e%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b1031a40-e33c-4bca-8764-13849c75968e%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> Regards,
>
> Aldian Fazrihady
> http://aldianfazrihady.com
>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7EoAaeBOPBq0NbvJYYV1n%3D7ZZkKLjcvYvVE1Aiw9ero8wS%2BA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAN7EoAaeBOPBq0NbvJYYV1n%3D7ZZkKLjcvYvVE1Aiw9ero8wS%2BA%40mail.gmail.com?utm_medium=email_source=footer>
> .
>


-- 

*jagtar singh*founder & CEO
LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/>
Twitter <https://twitter.com/jagtarslakhyan>

web 1: Network <https://iitians.xyz/>
web 2: WMS <https://iitiansasc.com/moodle/>
web 3: Conference <https://conference.iitians.xyz/>

Android App 1: Network
<https://play.google.com/store/apps/details?id=xyz.iitians>
Android App 2: WMS
<https://play.google.com/store/apps/details?id=xyz.iitians.wms>
Android App 3: Conference
<https://play.google.com/store/apps/details?id=com.iitiansasc.onlineclass>

LinkedIn
<https://www.linkedin.com/school/iitian's-advanced-school-of-competition-pvt-ltd-/>
LinkedIn2 <https://www.linkedin.com/company/iitians-group/>
Twitter <https://twitter.com/IITIANSGROUP>
*IITIAN'S ADVANCED SCHOOL OF

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-13 Thread Jagtar Singh Lakhyan
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

On Mon, Apr 13, 2020 at 6:24 PM Rok Klancar  wrote:

> 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.lakhe...@gmail.com> napisala:
>
>> You mean to say
>>
>>
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
>>
>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
>>
>> I followed these around 15 days back and i was able to run app at http://
>> server_domain_or_IP:8000 but Not on http://server_domain_or_IP
>>
>> On Mon, Apr 13, 2020 at 4:35 PM Sunday Iyanu Ajayi 
>> wrote:
>>
>>> My bad.
>>> I meant sudo systemctl daemon-reload
>>> Use this as a  guide:
>>> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunnexaj...@gmail.com *
>>>
>>>
>>>
>>> On Sun, Apr 12, 2020 at 2:57 PM Jagtar Singh Lakhyan <
>>> jagtar.lakhe...@gmail.com> wrote:
>>>
>>>> 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
>>>>
>>>> On Sun, Apr 12, 2020 at 5:14 PM Sunday Iyanu 

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-13 Thread Jagtar Singh Lakhyan
You mean to say

https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04

I followed these around 15 days back and i was able to run app at http://
server_domain_or_IP:8000 but Not on http://server_domain_or_IP

On Mon, Apr 13, 2020 at 4:35 PM Sunday Iyanu Ajayi 
wrote:

> My bad.
> I meant sudo systemctl daemon-reload
> Use this as a  guide:
> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-
>
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
>
>
> On Sun, Apr 12, 2020 at 2:57 PM Jagtar Singh Lakhyan <
> jagtar.lakhe...@gmail.com> wrote:
>
>> 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
>>
>> On Sun, Apr 12, 2020 at 5:14 PM Sunday Iyanu Ajayi 
>> wrote:
>>
>>> 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
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunnexaj...@gmail.com *
>>>
>>>
>>>
>>> On Sun, Apr 12, 2020 at 5:54 AM Jagtar Singh Lakhyan <
>>> jagtar.lakhe...@gmail.com> wrote:
>>>
>>>> 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 <http://iitian.xyz>'*, *'192.95.37.123'*]
>>>>
>>>> On Sun, Apr 12, 2020 

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-12 Thread Jagtar Singh Lakhyan
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.

On Sun, Apr 12, 2020 at 9:25 PM Rok Klancar  wrote:

> 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.lakhe...@gmail.com> napisala:
>
>> 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.
>>
>> On Sun, Apr 12, 2020 at 9:13 PM Rok Klancar  wrote:
>>
>>> And did you set up any funky settings in settings.py, like for example
>>> some of these:
>>> [image: 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 <
>>> rklan...@gmail.com> napisala:
>>>
>>>> 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.lakhe...@gmail.com> napisala:
>>>>
>>>>> /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
>>>>>
>>>>>
>>>>> On Sun, Apr 12, 2020 at 7:33 PM Rok Klancar 
>>>>> wrote:
>>>>>
>>>>>> 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.lakhe...@gmail.com> napisala:
>>>>>>
>>>>>>> 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
>>>>>>>
>>>>>>&

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-12 Thread Jagtar Singh Lakhyan
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.

On Sun, Apr 12, 2020 at 9:13 PM Rok Klancar  wrote:

> And did you set up any funky settings in settings.py, like for example
> some of these:
> [image: 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 
> napisala:
>
>> 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.lakhe...@gmail.com> napisala:
>>
>>> /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
>>>
>>>
>>> On Sun, Apr 12, 2020 at 7:33 PM Rok Klancar  wrote:
>>>
>>>> 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.lakhe...@gmail.com> napisala:
>>>>
>>>>> 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]
>>>>> 

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-12 Thread Jagtar Singh Lakhyan
/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


On Sun, Apr 12, 2020 at 7:33 PM Rok Klancar  wrote:

> 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.lakhe...@gmail.com> napisala:
>
>> 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
>>
>> On Sun, Apr 12, 2020 at 5:14 PM Sunday Iyanu Ajayi 
>> wrote:
>>
>>> 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
>>>
>>> *AJAYI Sunday *
>>> (+234) 806 771 5394
>>> *sunnexaj...@gmail.com *
>>>
>>>
>>>
>>> On Sun, Apr 12, 2020 at 5:54 AM Jagtar Singh Lakhyan <
>>> jagtar.lakhe...@gmail.com> wrote:
>>>
>>>> No luck, same 502 error.
>>>>
>>>> These r settings.py
>>>>
>>>> *# SECURITY WARNING: don't run with debug turned on in production!*
>>>>
>&

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-12 Thread Jagtar Singh Lakhyan
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

On Sun, Apr 12, 2020 at 5:14 PM Sunday Iyanu Ajayi 
wrote:

> 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
>
> *AJAYI Sunday *
> (+234) 806 771 5394
> *sunnexaj...@gmail.com *
>
>
>
> On Sun, Apr 12, 2020 at 5:54 AM Jagtar Singh Lakhyan <
> jagtar.lakhe...@gmail.com> wrote:
>
>> 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 <http://iitian.xyz>'*, *'192.95.37.123'*]
>>
>> On Sun, Apr 12, 2020 at 6:19 AM Andrew C.  wrote:
>>
>>> 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.
>>>
>>> On Sat, Apr 11, 2020 at 1:39 PM Jagtar Singh Lakhyan <
>>> jagtar.lakhe...@gmail.com> wrote:
>>>
>>>> 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: mas

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-11 Thread Jagtar Singh Lakhyan
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 <http://iitian.xyz>'*, *'192.95.37.123'*]

On Sun, Apr 12, 2020 at 6:19 AM Andrew C.  wrote:

> 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.
>
> On Sat, Apr 11, 2020 at 1:39 PM Jagtar Singh Lakhyan <
> jagtar.lakhe...@gmail.com> wrote:
>
>> 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
>>
>> On Sat, Apr 11, 2020 at 11:07 PM Rok Klancar  wrote:
>>
>>> Dude, try "sudo systemctl status nginx"
>>>
>>> Dne sobota, 11. april 2020 18.53.50 UTC+2 je oseba Jagtar Singh Lakhyan
>>> napisala:
>>>>
>>>> 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)
>>>>
>>>>
>>>> --
>>> 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+unsubscr...@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
>>> <https://groups.google.com/d/msgid/django-users/a3223d66-8adb-4dcd-8a48-d43d8a426ddc%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>
>>
>> --
>>
>> *jagtar singh*founder & CEO
>> LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/>
>> Twitter <https://twitter.com/jagtarslakhyan>
>>
>> web 1: Network <https://iitians.xyz/>
>> web 2: WMS <https://iitiansasc.com/moodle/>
>> web 3: Conference <https://conference.iitians.xyz/>
>>
>> Android App 1: Network
>> <https://play.google.com/store/apps/details?id=xyz.iitians>
>> Android App 2: WMS
>> &

Re: 502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-11 Thread Jagtar Singh Lakhyan
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

On Sat, Apr 11, 2020 at 11:07 PM Rok Klancar  wrote:

> Dude, try "sudo systemctl status nginx"
>
> Dne sobota, 11. april 2020 18.53.50 UTC+2 je oseba Jagtar Singh Lakhyan
> napisala:
>>
>> 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)
>>
>>
>> --
> 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+unsubscr...@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
> <https://groups.google.com/d/msgid/django-users/a3223d66-8adb-4dcd-8a48-d43d8a426ddc%40googlegroups.com?utm_medium=email_source=footer>
> .
>


-- 

*jagtar singh*founder & CEO
LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/>
Twitter <https://twitter.com/jagtarslakhyan>

web 1: Network <https://iitians.xyz/>
web 2: WMS <https://iitiansasc.com/moodle/>
web 3: Conference <https://conference.iitians.xyz/>

Android App 1: Network
<https://play.google.com/store/apps/details?id=xyz.iitians>
Android App 2: WMS
<https://play.google.com/store/apps/details?id=xyz.iitians.wms>
Android App 3: Conference
<https://play.google.com/store/apps/details?id=com.iitiansasc.onlineclass>

LinkedIn
<https://www.linkedin.com/school/iitian's-advanced-school-of-competition-pvt-ltd-/>
LinkedIn2 <https://www.linkedin.com/company/iitians-group/>
Twitter <https://twitter.com/IITIANSGROUP>
*IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD.
<https://www.facebook.com/IITiansASC/>*

<https://iitians.xyz/>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAD1gXQEbzWSWvSrQOCb-nBDcHzYb6ZE_qx4Hg6pJ_XJN3HN13Q%40mail.gmail.com.


502 Bad Gateway nginx/1.14.0 (Ubuntu)

2020-04-11 Thread Jagtar Singh Lakhyan
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)


-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b1031a40-e33c-4bca-8764-13849c75968e%40googlegroups.com.