dockerizing django,nginx,gunicorn return exited code 3 - django

Im new to learn this django in docker.
Im following this guide: https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
In my lab ubuntu server 22.04, all working well until nginx part, i up and build the docker-compose.prod.yml and result the "web" services is exited by code 3.
And when i browse http://localhost:1337, it show me 502 Bad Gateway.
What is this issue? I cant found any relate error about this.
Tried to google but no luck.

Related

problem with the nginx config for a next js app on ec2

im trying to run a next js app on aws ec2 but when i visit the url of the server i get a 403 error, https://i.stack.imgur.com/jFF9Q.png the code for the app is in /var/www/kosher/ and im using pm2 to run the server, here is a screenshot of pm2 running, https://i.stack.imgur.com/V35Lf.jpg
and here are the nginx config files
https://i.stack.imgur.com/Svmct.jpg
https://i.stack.imgur.com/4qb2A.jpg
for reference im following this tutorial https://medium.com/today-i-solved/how-to-deploy-next-js-on-aws-ec2-with-ssl-https-7980ec6fe8d3
i tested the app locally and it runs prefectly so i think the problem is with the nginx config, can someone help me
never mind i fixed it by adding proxy pass and then localhost

404 not found after installed cyberpanal

I try to install cyberpanal in digitalocean droplet, but it does not install successfully.
After that when i visited my website a '404 not found' default page from LiteSpeed is shown. Also the Apache is not running
Sample Image
If you have an issue with installing the CyberPanel, please consider launching a CyberPanel from the marketplace directly. It should be much easier for you to setup a server.
CyberPanel uses OpenLiteSpeed as a default web server, so you should not expect an Apache run by default.
Before visiting the page, did you create a website on the control panel yet? If not, then a returned 404 status code is expected.
More, https://cyberpanel.net/docs/2-creating-website/
If you have more question for CyberPanel, I'd recommend you ask in their forum https://community.cyberpanel.net/

Django app on Windows Server 2012 - HTTP Error 500.0 - The FastCGI process exited unexpectedly

I setup a django "hello world" app IIS (Windows Server 2012). The application is run successfully using the Django web server. However, when I tried to install in on IIS (following the instructions provided here) I get an HTTP 500 error with the message "python.exe - The FastCGI process exited unexpectedly".
I have seen numerous related posts on stackoverflow, but nothing seems to work for me. Based on the guidance
I have checked file permissions on both the app and virtual environment folder but they in my opinion this should not be the issue as the users IUSR and IIS_IUSRS can Read & execute, Read and List folder contents.
I have tried also to run wfastcgi-enable based on the instructions provided by this post but I get the error "ensure your user has sufficient privileges and try again". Please note that I tried running it both from an "elevated" command line and also power shell with no results.
I have reinstalled python to make sure it is installed for "all users" (as suggested by this post) but I get an error "0x80070659 - This installation is forbidden by system policy".
I looked in the Event viewer but I could not find something useful.
My questions:
Is there a specific log that I should check? How could I find it?
My django app does not have a web.config file. Should I create one?
My setup: Windows Server 2012 R2, IIS 8.5, Python 3.9.1

How to set virtualenv to stay active on a host server

I created a website that uses vuejs as the frontend and django as the backend with another service running behind everything that im making api calls to.
So django is setup in a way to look at the dist folder of Vuejs and serve it if you run manage.py runserver. but the problem is that my service that I created is
is also in python and it needs to run in a virtualenv in order to work (It uses tensorflow 1.15.2 and this can only run in a contained environment)
I'm sitting here and wondering how I can deploy the django application and keep the virtualenv active and Im coming up with nothing, I've tried doing some research on this but everything I found was not relevant to my problem. I've deployed it and when I close the ssh connection the virtualenv stops.
If there is anyone that can enlighten my ways I would appreciate it.
i think you need to nginx: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
if you are search for keep states just in terminal i suggest tmux https://github.com/tmux/tmux/wiki
You can use uWSGI and nginx to deploy Django apps on server. Here's helpful articles:
https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-centos-7
https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-centos-7
Django official docs also has a page about it: https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/uwsgi/
There are articles from developers so you can refer them in case you get stuck anywhere:
https://www.freecodecamp.org/news/django-uwsgi-nginx-postgresql-setup-on-aws-ec2-ubuntu16-04-with-python-3-6-6c58698ae9d3/
https://medium.com/#biswashirok/deploying-django-python-3-6-to-digital-ocean-with-uwsgi-nginx-ubuntu-18-04-3f8c2731ade1

Django CMS Deployment issues using Apphooks with Postgresql

I am trying to run a Django CMS project that i created recently. The project uses PostgreSQL for its database, and works great with the runserver command.
But i started having intermittent Bad Gateway(Nginx) issues when i deployed the project using NGINX and WSGI. This error was sometimes happening on the whole site or sometimes in the sidebar where the pages, administration, etc would show up or sometimes in the page or advanced page settings.
The error i was getting was as follows:
django.db.utils.OperationalError: SSL error: decryption failed or bad record mac
So i decided to get into the details of the error and found out that this error occurs only when i am using AppHooks in the project and that too only with PostgreSql. The project worked well when i deployed it using Sqlite database.
I further tried to resolve the issue by setting ssl = false in the config. file of PostgreSql to see if that would change anything. It changed the error i was getting earlier as follows:
django.db.utils.InterfaceError: connection already closed
So i was wondering the reason behind this issue? Let me remind you that this error is happening only when the project is deployed and not when runserver is being used.
UPDATE:
I tried using the Django-debug-toolbar to check what sql queries are being executed during these errors and it turns out the app is working fine. Somehow the debug toolbar is slowing down the applications which is not breaking the app any more. What might be the reason for the app to not work? How can i get around this issue