Just a scrap of websites and links I followed or stumbled to make a python webhook system of unofficed for chartink, tradingview. (Receptor). For my own future use and anyone who is suffering my fate in the universe.
Installed Django using this method -
How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04 | DigitalOcean
The gunicorn shit will work only if you do on virtualenv and only if you do with user. (I did with root and direct.)
https://www.digitalocean.com/community/questions/gunicorn-service-no-such-file-or-directory
See the first comment which gunicorn’s response can not be read if you are a user.
https://blog.bearer.sh/consume-webhooks-with-python/
https://reqbin.com/
If you request from reqbin, digitalocean will throw errors. So I tried to fix some error that never actually happened.
The solution of python - Django: Create webhook receiver - Stack Overflow was working fine.
shell - Django runserver permanent - Stack Overflow Maybe in the future?
Instead of reqbin, test using normal python directly. Here goes sample code -
python - How to receive json data using HTTP POST request in Django 1.6? - Stack Overflow
Stumbled on this good info while I was troubleshooting fictional problem python - Where's my JSON data in my incoming Django request? - Stack Overflow
Slack Bot Tag Mechanism - How do you tag people with a slack bot? - Stack Overflow
Sites I was visiting to make the port 80
python - Django project on 80 port? - Stack Overflow
Good read on gunicorn
django - Why do I need Nginx and something like Gunicorn? - Server Fault
gunicorn, nginx, and using port 80 for running a django web application - Stack Overflow
Did not liked this tutorial as I am not fan of sock file nginx - Getting rid of port in URL for django installation in production - Stack Overflow
As It was not gunicorn I tried into deep and found an amazing tutorial https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html#configure-nginx-for-your-site
It uses uWSGI
Again it landed in ownership problems and I did not want to make mess with that part as I have interconnected apps django - uwsgi socket file not created - Stack Overflow
This I used finally digitalocean.com/community/questions/how-to-forward-traffic-from-another-port-to-port-80
Some shit was running in port 80 unix - How to kill a process running on particular port in Linux? - Stack Overflow
Firewall was not active. https://www.digitalocean.com/community/questions/sudo-ufw-status-return-inactive
Activating Firewall firewalled my SSH and SFTP digitalocean.com/community/questions/i-am-not-able-to-connect-my-droplet-ip-using-sftp
Adding HTTPS
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
https://www.digitalocean.com/community/questions/how-to-secure-nginx-with-let-s-encrypt-on-for-a-subdomain
Finally screened shell - Django runserver permanent - Stack Overflow