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
224
votes
5 answers

What are Flask Blueprints, exactly?

I have read the official Flask documentation on Blueprints and even one or two blog posts on using them. I've even used them in my web app, but I don't completely understand what they are or how they fit into my app as a whole. How is it similar to…
JoshieSimmons
  • 2,721
  • 2
  • 14
  • 23
207
votes
4 answers

How many concurrent requests does a single Flask process receive?

I'm building an app with Flask, but I don't know much about WSGI and it's HTTP base, Werkzeug. When I start serving a Flask application with gunicorn and 4 worker processes, does this mean that I can handle 4 concurrent requests? I do mean…
Carson
  • 17,073
  • 19
  • 66
  • 87
155
votes
5 answers

How Python web frameworks, WSGI and CGI fit together

I have a Bluehost account where I can run Python scripts as CGI. I guess it's the simplest CGI, because to run I have to define the following in .htaccess: Options +ExecCGI AddType text/html py AddHandler cgi-script .py Now, whenever I look up web…
Eli Bendersky
  • 263,248
  • 89
  • 350
  • 412
146
votes
4 answers

What are WSGI and CGI in plain English?

Every time I read either WSGI or CGI I cringe. I've tried reading on it before but nothing really has stuck. What is it really in plain English? Does it just pipe requests to a terminal and redirect the output?
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
134
votes
5 answers

What is the point of uWSGI?

I'm looking at the WSGI specification and I'm trying to figure out how servers like uWSGI fit into the picture. I understand the point of the WSGI spec is to separate web servers like nginx from web applications like something you'd write using…
d512
  • 32,267
  • 28
  • 81
  • 107
117
votes
5 answers

Flask vs webapp2 for Google App Engine

I'm starting new Google App Engine application and currently considering two frameworks: Flask and webapp2. I'm rather satisfied with built-in webapp framework that I've used for my previous App Engine application, so I think webapp2 will be even…
Anton Moiseev
  • 2,834
  • 4
  • 24
  • 30
108
votes
4 answers

What exactly is Werkzeug?

From the official documentation: Werkzeug is a WSGI utility library for Python. However, when I run my Flask web application, I notice that the response header from the server contains: HTTP/1.0 200 OK Content-Type: text/html;…
jinglei
  • 3,269
  • 11
  • 27
  • 46
103
votes
8 answers

Python : How to parse the Body from a raw email , given that raw email does not have a "Body" tag or anything

It seems easy to get the From To Subject etc via import email b = email.message_from_string(a) bbb = b['from'] ccc = b['to'] assuming that "a" is the raw-email string which looks something like this. a = """From root@a1.local.tld Thu Jul 25…
user2621078
99
votes
3 answers

WSGI vs uWSGi with Nginx

Could anyone please explain pros/cons when using WSGI VS uWSGI with Nginx. Currently i am building up a production server for the Django website which i have prepared but unable to decide whether should i go with WSGI or uWSGI. Could you please…
fear_matrix
  • 4,912
  • 10
  • 44
  • 65
83
votes
4 answers

Differences and uses between WSGI, CGI, FastCGI, and mod_python in regards to Python?

I'm just wondering what the differences and advantages are for the different CGI's out there. Which one would be best for python scripts, and how would I tell the script what to use?
Parker
  • 8,539
  • 10
  • 69
  • 98
75
votes
7 answers

'WSGIRequest' object has no attribute 'user' Django admin

When I trying to access the admin page it gives me the following error: System check identified no issues (0 silenced). June 21, 2016 - 15:26:14 Django version 1.9.7, using settings 'librato_chart_sender_web.settings' Starting development server at…
Gonçalo Correia
  • 1,595
  • 1
  • 10
  • 14
73
votes
7 answers

Print raw HTTP request in Flask or WSGI

I am debugging a microcontroller I've built which is writing raw HTTP requests line by line. I am using Flask for my backend and I would like to see the entire request as it appears in this format: GET / HTTP/1.1 Content-length: 123 User-agent:…
Tinker
  • 4,165
  • 6
  • 33
  • 72
71
votes
19 answers

Target WSGI script cannot be loaded as Python module

I am trying to deploy mod_wsgi with apache to run a django application but I am getting an error 500 internal server error The apache logs shows: [Thu Jun 23 14:01:47 2011] [error] [client 152.78.95.64] mod_wsgi (pid=16142): Exception occurred…
Adam Thomas
  • 711
  • 1
  • 5
  • 4
66
votes
15 answers

How do I stop getting ImportError: Could not import settings 'mofin.settings' when using django with wsgi?

I can't get wsgi to import my settings file for my project 'mofin'. The list of errors from the apache error log are as follows mod_wsgi (pid=4001): Exception occurred within WSGI script '/var/www/wsgi-scripts/django.wsgi'. Traceback (most recent…
Dan
  • 1,536
  • 1
  • 10
  • 20
64
votes
4 answers

How can I modify Procfile to run Gunicorn process in a non-standard folder on Heroku?

I'm new to heroku and gunicorn so I'm not sure how this works. But I've done some searching and I think I'm close to deploying my Django app (1.5.1). So I know I need a Procfile which has web: gunicorn app.wsgi Because my directories are a bit…
Derek
  • 11,980
  • 26
  • 103
  • 162
1
2 3
99 100