2,491 questions
0
votes
0
answers
9
views
Flask + Waitress - Is my API limited to the number of workers when I spawn new threads inside endpoints?
By default the application served with waitress uses 4 threads. The statemnt below is from waitress documentation:
threads:
The number of threads used to process application logic (integer).
Default: ...
0
votes
0
answers
35
views
POST URLs throwing 404s in Flask
First, I'm a sysadmin, not a developer, but I am assisting a developer with setting up a Flask app.
The app works in that it serves content and looks great. However, any time we need to take an action ...
0
votes
0
answers
29
views
Starting a Django Web App as a Service using nginx and uWSGI fails
I have a simple web app that I am trying to run under Ubuntu 22.04 using Django, NGINX, and uWSGI. There is a service for my application which essentially starts uWSGI. If I start the service, uWSGI ...
0
votes
1
answer
68
views
Can't create two sessions- one fails one works
I have a post request in Django views from which I am calling a Selenium WebDriver. I am running it on Linux.
I have set the DISPLAY in the OS environment.
Now when I call the request it does open the ...
0
votes
1
answer
74
views
uwsgi module not found after Python upgrade
I have a Flask/UWSGI application running on my home server. A recent Ubuntu upgrade deleted Python 3.10 and installed Python 3.12 instead. I've made a new venv and installed the application, but it no ...
0
votes
0
answers
12
views
WSGI Application error when attempting to register
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column user.is_active does not exist LINE 1: ... user_password, "user".is_admin AS user_is_admin, "user".is_... ^ ...
0
votes
0
answers
43
views
Running application via Gunicorn gives key error
I am facing a wierd error while running the application via gunicorn.
On the client code I have a key REQUEST_KEY in the header.
One the server code i am trying to read the value by using
req_key = ...
2
votes
2
answers
58
views
Unrecognized Imports in old Flask Project
I was working on setting up a flask web app today, and was referencing a previous ~2yr old project to refresh myself on some of the syntax and such. However, as I was looking through my (private) ...
0
votes
1
answer
109
views
whitenoise module not found in production
Error:
I ran into this error when trying to deploy my Django app using GAE using these instructions GAE for Django: ModuleNotFoundError: No module named 'whitenoise'.
The error occurs when starting ...
0
votes
1
answer
125
views
How to launch a flask application with a domain name on a computer? [closed]
I have this simple flask application that I want to deploy. I want to use my own computer as the application's server and I want to give it a domain name. Please give me step by step instructions on ...
0
votes
0
answers
55
views
Waitress as a production WSGI server
What are the benefits of using Waitress as a WSGI server instead of running Flask directly? For instance, can it spawn multiple processes to leverage multiple CPU cores for handling incoming requests?
0
votes
1
answer
55
views
WSGI Application - To Accept JSON Payload from and process and send email
I am trying to setup a App in python and wsgi to get some payload from cloud to on-prem and send email eventually.
My Setup includes WSGI & NGINX but for testing purpose I am forming a payload ...
0
votes
1
answer
117
views
gunicorn issues with ModuleNotFoundError when deploying DRF project to Render due to
DRF project is running in development environment, expects to deploy to Render through yaml. The error message is as follows:
==> Running 'gunicorn core.wsgi:application'
Traceback (most recent ...
0
votes
1
answer
22
views
init_fs_encoding during deploying django app to apache
i'm trying for hours to deploy a django app on an apache2 and still get following error:
PYTHONHOME = '/home/rickmanns/bar/bar/djenv'
PYTHONPATH = (not set)
program name = 'python3'
isolated = ...
0
votes
2
answers
54
views
How can solve Target SWGI script '/aa/bb/wsgi.py' does not contain WSGI application 'application'?
When I change sqlite3 to postgresql, I receave error,
this error I have only then I run apache2,
if I start "manage.py runserver 0.0.0.0:8000" its work fine.
I tried so many things, but I ...
0
votes
1
answer
52
views
problem with apache server displaying index.html instead of flask endpoint
I have the following config files:
/etc/apache2/sites-available/propman.domain.com.conf:
WSGIApplicationGroup %{GLOBAL}
WSGIDaemonProcess propman_proc python-home=/var/www/propman/.venv processes=1 ...
0
votes
0
answers
49
views
hello world flask app on apache in a subdomain - getting python import errors on page access
I have a domain and subdomain registered and when accessing them, they go to the correct IP address and host. The main domain is working fine, but its a static group of pages (pretty hard to mess ...
1
vote
0
answers
83
views
can I run my python script using gunicorn and wsgi
I have a Python script which I want to run using Gunicorn. I have created a wsgi file as I am not using any framework. So I have 3 files in my folder: my Python script (app.py), Wsgi file (wsgi.py), ...
0
votes
0
answers
54
views
How to implement reload-on-rss on mod_wsgi in Django?
In uwsgi, reload-on-rss helps to prevent the Django server from running into OOM. How do you implement reload-on-rss on mod_wsgi in Django? I want the Django server to reload after the server hits a ...
0
votes
0
answers
47
views
How do I deploy Wagtail CMS to Ionos Standard Web Hosting
I have tried to deploy Wagtail CMS to Ionos Standard hosting using the instructions at How can I deploy Django App to 1and1 (ionos) but I am just getting an internal server error.
Any ideas how I can ...
0
votes
0
answers
18
views
Apache configuration to host both PHP and Python backend together not working for special Alias requirement
I am working on a web application in Ubuntu.
I have a PHP backend that I want to host in "http://localhost/myapp/".
All the application files are in the "/var/www/html/myapp/website/...
0
votes
0
answers
75
views
Flask server goes to sleep or shutdown after one day of inactivity
I have a flask server and it is deployed on digital ocean droplet with production WSGI server and it is working fine there.
But the issue is that after one day flask server goes to sleep and it gives ...
0
votes
1
answer
67
views
CSRF verification failed. Request aborted. Origin checking failed
Here is my setup:
localhost (Windows 11)
- Nginx
listening on port 80 and 443, 80 is NOT automatically redirected to 443
each proxy_passed to http://wsgi-server where wsgi-server=127.0.0....
1
vote
1
answer
633
views
Do I need "if __name__ == '__main__': app.run()" in my Flask app on WSGI server?
I'm deploying a Flask application to an WSGI server. In my development code, I have the typical if __name__ == '__main__': app.run() block to run the app locally. I'm unsure if this code snippet is ...
0
votes
0
answers
52
views
pywsgi.WSGIServer SSL Certificate eroor with Flask
I generated a ssl certificate with openssl and wanted to add it to flask.
if __name__ == '__main__':
http_server = pywsgi.WSGIServer(('0.0.0.0', 5000), app, keyfile='server.key', certfile='server....
0
votes
0
answers
65
views
Django retrieves old content from the database
I've developed an app using Django 5, tested it on my server and my local, and made it in production on my server. The problem is that when a certain action is taken to write or update a record in the ...
0
votes
0
answers
49
views
Python WSGI/websocket server in Apache: ModuleNotFoundError: No module named 'cv2'
On an Ubuntu 22.04 environment, I'm trying to access to my webcam on a web page using Python using Opencv library (called cv2).
The code works well when I execute it on my local interpreter. But when ...
0
votes
1
answer
566
views
Python opentelemetry wsgi usage with gunicorn / Application Insights
I have the below setup working perfectly in development mode in my django application, so when I run python manage.py runsslserver the application reports perfectly to Application Insights.
from azure....
0
votes
1
answer
84
views
What are the differences between a Web Server and a Web Server Gateway Interface (WSGI)?
I get confused between WSGI and a web server. I'd like an explanation of the differences between them, or if they are the same thing. And thank you in advance.
0
votes
0
answers
15
views
Issues while deploying flask app using apache2
I need to deploy a flask app using apache2 and wsgi but I can't figure out how to do it. I have seen many tutorials and blogs on how to do it but they all use a demo flask app and I have built my app ...
2
votes
4
answers
722
views
How to suppress "Invalid HTTP method" error message on gevent flask/wsgi server running HTTP when it gets an HTTPS request
If a confused user of my application accidentally makes an HTTPS call against my "plain" flask server (expecting an HTTP request) running gevent, I get a log message that I dont know how to ...
0
votes
0
answers
23
views
My Add to cart button not calling out product id
In my product details page, I have an "Add to cart" button that is expected to bring out the product through the id on the next page.
This is my view function according to tutorial:
...
1
vote
1
answer
166
views
Apache hosted Python Flask web app running in Rocky Linux 9 not able execute shutdown command
I'm new to Python Flask application web hosting, in the web app I'm trying to set functionality to shutdown server once every work is complete. I have built the application in Flask Jinja Python ...
0
votes
0
answers
15
views
Is it fine to omit "application server"(e.g. Gunicorn) part when deploying a Python Backend(e.g. Flask) application on a webserver?
I have a Flask application running on port 5001 on my remote Ubuntu 20.04 computer. I need to make sure that it can be accessed on the internet. My organization bought the domain name myapp.edu.
For ...
0
votes
0
answers
101
views
code 400, message Bad request version in Python socketio server
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client.
when i use the http it works fine client is able to connect to ...
0
votes
0
answers
56
views
How to host via Apache, an API in Flask, and a website in React?
I've made several attempts to configure Apache to be able to use Flask + React. My request is as follows: when accessing the server, all routes that are not '/api/', should be directed to React. As ...
1
vote
0
answers
128
views
Django WSGI and ASGI via Passenger confusion
Hi all I have a dedicated plesk server on the internet running debian 12. I've started experimenting with Django and deploying django apps via apache and Nginx. I have successfully managed to get a ...
1
vote
2
answers
188
views
Trouble sending data from Socket.IO server to client in Python
I'm currently working on a Socket.IO implementation using Python with socketio and eventlet for my server and socketio for my client. Despite successful connections between the client and server, I'm ...
0
votes
2
answers
87
views
Add Flask-WSGI routes to DDEV-Drupal project
I have a ddev-Drupal project and want to add web-routing for my python-flask project. Ideally something like this: https://github.com/docker/awesome-compose/tree/master/flask-redis - or maybe with ...
0
votes
0
answers
60
views
DDEV add a flask-wsgi 5000 route to existing drupal web build
I have a running drupal-9 ddev site. My goal is to add support to run a Python-Flask app at ./bot/app.py which runs at localhost:800X.
Changes so far - this part works.
.ddev/config.yaml
added ...
6
votes
0
answers
128
views
How to use a production WSGI server for Firebase Cloud Functions in Python
I implemented production ready functions in python that I want to deploy on Cloud Functions. When I do so using the following command :
firebase deploy --only functions
I get the following Warning ...
0
votes
1
answer
65
views
Flask won´t run my code and is stuck on index page
I am just finishing this project and i´ve got everything done but eventhough everything seems alright flask server won´t let me through selection on index page :( any ideas? i need this in couple ...
0
votes
0
answers
77
views
Django gunicorn setup - DJANGO_WSGI_MODULE - ModuleNotFoundError: No module named 'config'
I'm trying setup the gunicorn but I am facing an error for DJANGO_WSGI_MODULE.
DJANGO_WSGI_MODULE=config.wsgi
`ModuleNotFoundError: No module named 'config'
File "/webapps/myapp/myapp_venv/lib/...
0
votes
0
answers
28
views
When deploying on pythonanywhere i followed all stepts but still get the default pythonanywhere page
I did all the stepts from the documentation but still get the pythonanywhere default page, and I do not even know from where is coming since is not in my wsgi. Below is my wsgi, anyone has any clue? ...
0
votes
1
answer
104
views
Turn old Python web app into WSGI-ready and Apache
I have an ancient web application written in Python. It's basically a bunch of .py files. For instance:
display.py:
import cgi
import re
import string
import operator
from urllib.parse import urlparse
...
1
vote
0
answers
356
views
AWS Lambda & AWSGI
I have an AWS Lambda function which uses 'import awsgi'. I have uploaded the aws-wsgi & awsgi python dependencies, with other dependencies, to an S3 bucket. Then, uploaded all the dependencies to ...
0
votes
0
answers
98
views
uvicorn WSGIMiddleware ignoring max_requests?
I'm using gunicorn with uvicorn.workers.UvicornWorker and have set max_requests to recycle worker processes and avoid memory leaks.
My Application is FastAPI, but also mounts a legacy Django ...
0
votes
1
answer
53
views
can't host my flask web app using pythonanywhere
2024-01-11 09:47:43,839: Error running WSGI application
2024-01-11 09:47:43,841: ModuleNotFoundError: No module named 'numpy'
2024-01-11 09:47:43,841: File "/var/www/...
0
votes
1
answer
114
views
How to push a flask request context when dispatching a different WSGI application
I am following https://flask.palletsprojects.com/en/3.0.x/patterns/appdispatch/ to dispatch an arbitrary WSGI application alongside a Flask application
import werkzeug.middleware.dispatcher
import ...
0
votes
1
answer
288
views
Apache2 not working with mod_wsgi: "ModuleNotFoundError: No module named 'encodings'"
I run Apache2 in a Docker container and want to host my Django site using mod_wsgi. Anyway WSGI process fails to start and I get the error below. I tried using Python paths of the container and of a ...