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
39
votes
4 answers

Stop processing Flask route if request aborted

I have a flask REST endpoint that does some cpu-intensive image processing and takes a few seconds to return. Often, this endpoint gets called, then aborted by the client. In these situations I would like to cancel processing. How can I do this in…
Crashthatch
  • 1,283
  • 2
  • 13
  • 20
35
votes
3 answers

How do I deploy a Flask application in IIS?

Can anyone help me get a Flask application running on IIS 6? I have tried to use isapi-wsgi, but when I visit the Virtual Directory address I get a page that says "The specified module could not be found." Are there other options for this? Below…
James
  • 522
  • 1
  • 6
  • 7
35
votes
2 answers

Do browsers preserve order of inputs with same name on GET/POST?

I have this HTML code with multiple inputs with the same name: The order of the values is…
Benjamin Wohlwend
  • 30,958
  • 11
  • 90
  • 100
35
votes
2 answers

How to solve import errors while trying to deploy Flask using WSGI on Apache2

I am having an issue deploying a flask app on apache2 using wsgi. I have posted the error logs and config files below. I have tried moving things around, renaming them, etc, but all give me an internal server error. Not sure why I'm getting the…
Shane Reustle
  • 8,633
  • 8
  • 40
  • 51
33
votes
31 answers

django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded

The scenario is, I cloned the Django code for OpenShift-V3 from here . When I ran the code with python manage.py runserver, I got this error: django.core.exceptions.ImproperlyConfigured: WSGI application 'application' could not be loaded; Error…
user7139313
32
votes
1 answer

tornado vs wsgi(with gunicorn)

I read this about Tornado: On the other hand, if you already have a WSGI app and want to run it on a blazing fast tornado.httpserver.HTTPServer, wraps it with tornado.wsgi.WSGIContainer. But you need to be careful. Since your original…
schemacs
  • 2,783
  • 8
  • 35
  • 53
30
votes
3 answers

Differentiate nginx, haproxy, varnish and uWSGI/Gunicorn

I am really new to sys admin stuff, and have only provisioned a VPS with nginx(serving the static files) and gunicorn as the web server. I have lately been reading about different other stuff. I came to know about other tools: nginx :…
whatf
  • 6,378
  • 14
  • 49
  • 78
29
votes
2 answers

Fixing broken pipe error in uWSGI with Python

While hitting a REST resource (my_resource) in Python, the uWSGI server is throwing the following error in its log: SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) on request my_resource (ip )…
Juan Carlos Coto
  • 11,900
  • 22
  • 62
  • 102
29
votes
6 answers

Setting up Django on AWS Elastic Beanstalk: WSGIPath not found

I've been trying for several days now to set up Django under Amazon Web Services' Elastic Beanstalk. I think the problem I'm hitting is this one: ERROR - Your WSGIPath refers to a file that does not exist. I followed the tutorial here and all goes…
28
votes
8 answers

Serving Flask app with waitress on windows

I am able to run a webserver using the following code from flask import Flask from waitress import serve app = Flask(__name__, static_url_path='/static') ... serve(app, port=8080) The problem is that I can access it only from the machine where it…
llulai
  • 627
  • 1
  • 6
  • 9
27
votes
2 answers

AWS Elastic Beanstalk - Script timed out before returning headers: application.py

I have an existing Elastic Beanstalk flask app on AWS that occasionally will not initialize and gives the following error: [Mon Jan 23 10:06:51.550205 2017] [core:error] [pid 7331] [client 127.0.0.1:43790] script timed out before returning headers:…
user2752159
  • 1,182
  • 3
  • 13
  • 29
27
votes
2 answers

uwsgi options --wsgi-file and --module not recognized

I am trying to run a Django app using uwsgi. Most instructions I have found refer to a "--wsgi-file" and "--module" to specify the application, but "uwsgi" makes no mention of these options, and when I try and use them: uwsgi -s /tmp/uwsgi.sock…
aaa90210
  • 11,295
  • 13
  • 51
  • 88
27
votes
2 answers

uWSGI won't reload, restart or let me run service

I have a fairly big issue. I am very new to uwsgi and am not 100% sure on how to debug this issue but I will give you information on where I am at. I have previously had sites working on this configuration and suddenly it isn't working. I am…
Daniel Tate
  • 2,075
  • 4
  • 24
  • 50
26
votes
4 answers

Gunicorn Environment Variable Setting

I'm currently having difficulty passing environment variables into Gunicorn for my Django project. I'm on the latest 19.1 version. I have a wsgi.py file like so: import os import sys from django.core.wsgi import get_wsgi_application BASE_DIR =…
Huw
  • 533
  • 1
  • 7
  • 15
26
votes
2 answers

What is going on when I set app.wsgi_app = ProxyFix(app.wsgi_app) when running a Flask app on gunicorn?

I built a basic web app using Flask, and was able to run it from a virtual machine using its native http server. I quickly realized that with this set up, requests are blocking (I couldn't make concurrent requests for resources; any new request…
Ashley Temple
  • 311
  • 1
  • 4
  • 8