Questions tagged [mod-wsgi]

The mod_wsgi module is a python WSGI adapter module for Apache.

The mod_wsgi module is a python WSGI adapter module for Apache. For details on the official channel for getting mod_wsgi help, see http://modwsgi.readthedocs.io/en/develop/finding-help.html.

3241 questions
24
votes
3 answers

django UnreadablePostError: request data read error

I'm working on django project and I got this error email. Stack trace File "/usr/local/lib/python2.7/dist-packages/Django-1.4.3-py2.7.egg/django/core/handlers/wsgi.py", line 180, in _get_post self._load_post_and_files() File…
23
votes
3 answers

Allowing only single active session per user in Django app

I want to restrict logged-in users to only have one active session, i.e. if the user logs in with a new sessionid, the old session should be terminated. I found a lot of help on SO already: here and here I implemented the middleware solution, with a…
23
votes
3 answers

How do I use a conda environment with mod_wsgi?

My first post, and I'm new to both Python and Apache, so please go easy on me. I have a Python web application in a conda environment that serves up content just fine using Flask. Now I need to serve everything with Apache instead of Flask. I can…
Nathaniel
  • 540
  • 1
  • 7
  • 17
23
votes
5 answers

Why do the Django docs suggest a separate server for static files?

From the Django on mod_wsgi page: We recommend using a separate Web server – i.e., one that’s not also running Django – for serving media. Why?
Snowball
  • 11,102
  • 3
  • 34
  • 51
22
votes
3 answers

Where should WSGIPythonPath point in my virtualenv?

I have a folder called python2.7 inside of lib in the virtual environment. After reading half a dozen tutorials, I can't figure out exactly what I'm suppose to point the WSGIPythonPath to. I've seen some pointing to site-packages but some have been…
user83039
  • 3,047
  • 5
  • 19
  • 31
22
votes
2 answers

Speeding Up the First Page Load in django

When I update the code on my website I (naturally) restart my apache instance so that the changes will take effect. Unfortunately the first page served by each apache instance is quite slow while it loads everything into RAM for the first time (5-7…
Jiaaro
  • 74,485
  • 42
  • 169
  • 190
21
votes
2 answers

Tuning mod_wsgi in daemon mode

I'm running wsgi application on apache mod_wsgi in daemon mode. I have these lines in the configuration WSGIDaemonProcess app processes=2 threads=3 display-name=%{GROUP} WSGIProcessGroup app How do I find the optimal combination/tuning of…
vonPetrushev
  • 5,457
  • 6
  • 39
  • 51
19
votes
3 answers

Unescape Python Strings From HTTP

I've got a string from an HTTP header, but it's been escaped.. what function can I use to unescape it? myemail%40gmail.com -> myemail@gmail.com Would urllib.unquote() be the way to go?
Ian
  • 24,116
  • 22
  • 58
  • 96
19
votes
1 answer

Django, Apache2 on Google Kubernetes Engine writing Opencensus Traces to Stackdriver Trace

I have a Django web app served from Apache2 with mod_wsgi in docker containers running on a Kubernetes cluster in Google Cloud Platform, protected by Identity-Aware Proxy. Everything is working great, but I want to send GCP Stackdriver traces for…
Furbeenator
  • 8,106
  • 4
  • 46
  • 54
19
votes
3 answers

Apache strips down "Authorization" header

I'm having a little issue with my Apache 2.2.15 Server. I'm running a Django app on top of it with mod_wsgi. I activated WSGIPassAuthorization On, which made the Basic auth working well. But I recently implemented OAuth2.0 to secure my API (Implicit…
Martin Latrille
  • 749
  • 1
  • 5
  • 12
18
votes
3 answers

Where do I put "WSGIPassAuthorization On"?

I'm trying to see the Authorization header in Django, using mod_wsgi. I read that Apache holds back the Authorization header by default, I've put << WSGIPassAuthorization On >> in my Apache VirtualHost block and . . . nada. How do I figure out…
chernevik
  • 3,922
  • 9
  • 41
  • 55
18
votes
1 answer

How do I use Flask routes with Apache and mod_wsgi?

I've got my Apache server setup and it is handling Flask responses via mod_wsgi. I've registered the WSGI script via the alias: [httpd.conf] WSGIScriptAlias /service "/mnt/www/wsgi-scripts/service.wsgi" I've added the corresponding WSGI file at…
Sir Eisenhower
  • 251
  • 1
  • 2
  • 7
18
votes
2 answers

What is the purpose of the sub-interpreter API in CPython?

I'm unclear on why the sub-interpreter API exists and why it's used in modules such as the mod_wsgi apache module. Is it mainly used for creating a security sandbox for different applications running within the same process, or is it a way to allow…
James Whetstone
  • 341
  • 1
  • 3
  • 10
18
votes
3 answers

How to get mod_wsgi to pick up my virtualenv

I'm very new to working with Flask- according to http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/ under the heading "Working with Virtual Environments" I read: For Python 3 add the following lines to the top of your .wsgi file: activate_this…
Timothy Lombard
  • 917
  • 1
  • 11
  • 31
18
votes
1 answer

Deploying Django (fastcgi, apache mod_wsgi, uwsgi, gunicorn)

Can someone explain the difference between apache mod_wsgi in daemon mode and django fastcgi in threaded mode. They both use threads for concurrency I think. Supposing that I'm using nginx as front end to apache mod_wsgi. UPDATE: I'm comparing…
Roman Dolgiy
  • 1,521
  • 1
  • 15
  • 21