Questions tagged [wsgi]

Web Server Gateway Interface (WSGI) is a standard for web applications written in Python.

The Web Server Gateway Interface (WSGI) is a simple calling convention for web servers to forward requests to web applications or frameworks written in the programming language. Applications, gateways and servers should use it to ensure interoperability.

WSGI is supported by many web frameworks, including , and .

2494 questions
12
votes
1 answer

How do I configure my uWsgi server to protect against the Unreadable Post Error?

This is the problem: File "/app/.heroku/python/lib/python2.7/site-packages/django/utils/six.py", line 535, in next return type(self).__next__(self) File "/app/.heroku/python/lib/python2.7/site-packages/django/http/multipartparser.py", line…
Sai Krishna
  • 7,647
  • 6
  • 29
  • 40
12
votes
4 answers

Python + WSGI - Can't import my own modules from a directory?

I'm new to Python and i have looked around on how to import my custom modules from a directory/ sub directories. Such as this and this. This is my structure, index.py __init__.py modules/ hello.py HelloWorld.py moduletest.py index.py, #…
Run
  • 54,938
  • 169
  • 450
  • 748
12
votes
4 answers

How to check if mod_wsgi is installed on a shared Apache server?

I am looking into deploying a Django project on a shared server running Apache. This is my first time doing this. I have a shared folder on the server for my work and I have been added to the sudo group so I can install new software. How do I check…
Deepend
  • 4,057
  • 17
  • 60
  • 101
12
votes
2 answers

Python: uWSGI configuration for NGINX+FLASK

I successfully managed to install: NGINX + uWSGI + Flask on a CentOS 6.x server but I still have some doubts in terms of configuration: 1) I am running NGINX as a service: service nginx start/stop/restart if I type "ps aux | grep nginx", I can see 2…
Daniele B
  • 19,801
  • 29
  • 115
  • 173
12
votes
2 answers

Retrying failed jobs in RQ

We are using RQ with our WSGI application. What we do is have several different processes in different back-end servers that run the tasks, connecting to (possibly) several different task servers. To better configure this setup, we are using a…
Juan Carlos Coto
  • 11,900
  • 22
  • 62
  • 102
12
votes
1 answer

webapp2 redirect explained

I'm sometimes unsure how to use webapp2.redirect. Is there ever a time when I should use self.redirect("/blah") instead of return self.redirect("/blah") Here is my understanding/guess of the time-line: (sometimes i'm confused about if the response…
Rusty Rob
  • 16,489
  • 8
  • 100
  • 116
12
votes
2 answers

Handling HTTP chunked encoding with django

I have a problem handeling http chunked transfer encoding. I'm using: apache. mod_wsgi plugin. django. django, is only capable of handling reqular http request with content-length header field, but when it comes to handling TE…
securecurve
  • 5,589
  • 5
  • 45
  • 80
12
votes
1 answer

flask: wsgi-middleware vs before_ and after_request()

I find it quite confusing what exactly are the differences in using Flask's before_request() and/or after_request() versus using a WSGI middleware. Say I want to do something very silly like this: Every request-body should be scanned for the word…
bmaeser
  • 982
  • 7
  • 13
12
votes
2 answers

What are the connection limits for Google Cloud SQL from App Engine, and how to best reuse DB connections?

I have a Google App Engine app that uses a Google Cloud SQL instance for storing data. I need my instance to be able to serve hundreds of clients at a time, via restful calls, which each result in one or a handful of DB queries. I've wrapped the…
JJC
  • 9,547
  • 8
  • 48
  • 53
11
votes
3 answers

How does cgi.FieldStorage store files?

So I've been playing around with raw WSGI, cgi.FieldStorage and file uploads. And I just can't understand how it deals with file uploads. At first it seemed that it just stores the whole file in memory. And I thought hm, that should be easy to test…
Justinas
  • 347
  • 2
  • 4
  • 10
11
votes
3 answers

gunicorn via mod_proxy is redirecting outside of the project's scope, despite ProxyPassReverse

I have a WSGI-app (a Django project) running under gunicorn on 127.0.0.1:18731 and I use Apache with mod_proxy to redirect requests from http://example.com/my-project/* to http://127.0.0.1:18731/*. Static files are stored outside of /my-project/. If…
ashastral
  • 2,818
  • 1
  • 21
  • 32
11
votes
3 answers

Manually stop processes launched by mod_wsgi, and monitor how many processes are running

I know it's not recommended to run a Bottle or Flask app on production with python myapp.py --port=80 because it's a development server only. I think it's not recommended as well to run it with python myapp.py --port=5000 and link it to Apache with:…
Basj
  • 41,386
  • 99
  • 383
  • 673
11
votes
2 answers

GAE don't see gunicorn, but it is already installed

I am trying to deploy Django app with Google App Engine. My app.yaml file: # [START runtime] runtime: python api_version: 1 threadsafe: true env: flex entrypoint: gunicorn -b :$PORT wsgi runtime_config: python_version: 3.4 env_variables: …
11
votes
2 answers

uWSGI fails to install on Windows

I'm trying to install uWSGI on Windows using pip install uwsgi and it keeps failing with the bellow error: Command "python setup.py egg_info" failed with error code 1 in c:\users\fathima\appdata\local\temp\pip-build-igkqn2\uwsgi\
Fahtima
  • 401
  • 1
  • 3
  • 9
11
votes
1 answer

How to add http headers in WSGI middleware?

How can http headers be added within a WSGI middleware?
deamon
  • 89,107
  • 111
  • 320
  • 448