Category : wsgi

I’m trying to build a production environment using Django. python・・・ver3.9.5 apache・・・ver2.4 windows server .venv is not used. The following sites are the main references. https://tamapoco.com/archives/7727 I have confirmed the startup confirmation (It works) of apache. The project created in Django has been confirmed to work in a virtual environment. I want to run a project ..

Read more

I have created a flask app.I want to run this both development and production server. This is my app.py file: app = Flask(__name__) db = SQLAlchemy(app) app.config.from_object(Config) db.init_app(app) if __name__ == "__main__": app.run() this is my wsgi.py file: from app import app as application app = application if __name__ == ‘__main__’: app.run(debug=True, host=’0.0.0.0′, port=5000) I ..

Read more

I am hosting a python/flask application on a linux server from Namecheap with cpanel. I am using postman to send requests, but all requests are received as get-requests. This is the function I am calling: @app.route(‘/’, methods=[‘POST’, ‘GET’]) def index(): if request.method == ‘GET’: return ‘this was a get request’ if request.method == ‘POST’: return ..

Read more

I have a flask app deployed using gunicorn. It is behind a proxy(apigee) which add a Authorization header before redirecting to my application. However that header isn’t coming in my flask app Access logs shows that the header was passed by the proxy 100.125.20.1 – – [12/Jan/2022:22:10:14 +0000] "GET / HTTP/1.1" 200 29 "-" "kube-probe/1.11+" ..

Read more

I want to deploy my django project but uwsgi gives me an error: File "/root/eva/lawyer/lawyer/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/root/eva/venv/lib/python3.8/site-packages/django/core/wsgi.py", line 1> django.setup(set_prefix=False) File "/root/eva/venv/lib/python3.8/site-packages/django/__init__.py", line 19> configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/root/eva/venv/lib/python3.8/site-packages/django/conf/__init__.py", li> self._setup(name) File "/root/eva/venv/lib/python3.8/site-packages/django/conf/__init__.py", li> self._wrapped = Settings(settings_module) File "/root/eva/venv/lib/python3.8/site-packages/django/conf/__init__.py", li> mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module ..

Read more

/var/log/uwsgi/myapp.log: Tue Jan 11 15:27:45 2022 – *** Starting uWSGI 2.0.18-debian (64bit) on [Tue Jan 11 15:27:45 2022] *** Tue Jan 11 15:27:45 2022 – compiled with version: 10.0.1 20200405 (experimental) [master revision 0be9efad938:fcb98e4978a:705510a708d3642c9c962beb663c476167e4e8a4] on 11 April 2020 11:15:55 Tue Jan 11 15:27:45 2022 – os: Linux-5.4.0-92-generic #103-Ubuntu SMP Fri Nov 26 16:13:00 UTC 2021 ..

Read more

I’m trying to pip install some dependencies into my virtual environment for a flask wsgi server with pipenv and I am met with his error: Actual console error image (code-S7821ldY) [email protected]:/var/www/code$ sudo pipenv install Pipfile.lock not found, creating… Locking [dev-packages] dependencies… X11 connection rejected because of wrong authentication. X11 connection rejected because of wrong authentication. ..

Read more

I’m trying to deploy my Django app to ElasticBeanstalk. I deployed my app without errors but when I access the root page it show 502 error and the log shows ModuleNotFoundError: No module named ‘my_app_name’ How can I solve this? Logs Dec 16 01:16:26 ip-172-31-43-109 web: File "/var/app/venv/staging-LQM1lest/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp Dec 16 01:16:26 ..

Read more