mod-wsgi

How do I redirect domain.com to WWW.domain.com under Django?

How do I go about redirecting all requests for domain.com/... to www.domain.com/... with a 301 in a django site? Obviously this can't be done in urls.py because you only get the path part of the URL in there. I can't use mod rewrite in .htaccess, because .htaccess files do nothing under Django (I think). I'm guessing something in midd...

Django memory usage going up with every request

I moved my first Django project from DjangoEurope to Webfaction, and that started an issue looking like a memory leak. With every single request memory usage of the server process goes up about 500kb. It never goes down. This goes on until Webfaction kills it for using too much memory. I can clearly see this when I refresh the Django's ...

It is said best way to deploy django is using wsgi, I am wondering why?

We are deploying django application, I found in the documentation that it is recommended to use WSGI appoach for doing that. Before deploying I wanted to know, why it is recommended over other two approaches i.e. using mod_python and fastcgi... Thanks a lot. ...

Baby steps to a solution with django and mod-wsgi on os x

I'm running apache / os x and serving up localhost pages to test django on my laptop. I've already verified all the following • python is working fine and up to date (2.5.1) • django available to python and up to date (1,1,0, 'final', 0) • mod_wsgi module is loaded among apache modules in my apache config - Check! • path to django ...

Have to Restart Apache When Using Django On Apache with mod_wsgi

I'm creating a web app with Django. Since I'm very familiar with Apache I setup my development environment to have Django run through Apache using mod_wsgi. The only annoyance I have with this is that I have to restart Apache everytime I change my code. Is there a way around this? ...

mod_wsgi excessively slow at startup?

I'm developing a django website which for production uses mod_wsgi - there are barely any visitors so anytime I visit it seems mod wsgi starts up and opens the python processes - it takes about 1-2 entire minutes for it to fully load. Is there anything I could do to not make it slow on initial startup? Is this a common problem or could ...

mod-deflate does not work with mod-wsgi in daemon mode

My client program is sending a gzip-ed http request, which is decompressed by the mod-deflate InputFilter in Apache. This works when I am using mod-wsgi (without any custom configurations) to serve a django site that is receiving compressed requests. However, when I turn on daemon mode via the WSGIDaemonProcess directive, the django site...

django + mod_wsgi +apache

Hi. When I run my django project on apache with mod_wsgi, I receive something like that: [Wed Mar 10 08:46:43 2010] [error] [client 10.13.1.145] Traceback (most recent call last): [Wed Mar 10 08:46:43 2010] [error] [client 10.13.1.145] File "/usr/local/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/core/handlers...

Problem with Django setup using mod_wsgi and apache on centos 5.4

I am trying to setup apache with mod_wsgi to serve Django through a nginx proxy on CentOS 5.4. I want to start by configuring Apache with Wsgi to serve on a local port, but I get a 403 error when I run curl localhost:8080 # Httpd config: Listen 127.0.0.1:8080 NameVirtualHost 127.0.0.1:8080 <VirtualHost 127.0.0.1:8080> ServerName st...

Dynamic mass hosting using mod_wsgi

Hi, I am trying to configure an apache server using mod_wsgi for dynamic mass hosting. Each user will have it's own instance of a python application located in /mnt/data/www/domains/[user_name] and there will be a vhost.map telling me which domain maps to each user's directory (the directory will have the same name as the user). What i d...

Trying to get django app to work with mod_wsgi on CentOS 5

I'm running CentOS 5, and am trying to get a django application working with mod_wsgi. I'm using .wsgi settings I got working on Ubuntu. I'm also using an alternate installation of python (/opt/python2.6/) since my django application needs >2.5 and the OS uses 2.3 Here is the error: [Thu Mar 04 10:52:15 2010] [error] [client 10.1.0.251...

Error in django using Apache & mod_wsgi

Hey, I've been doing some changes to my django develpment env, as some of you suggested. So far I've managed to configure and run it successfully with postgres. Now I'm trying to run the app using apache2 and mod_wsgi, but I ran into this little problem after I followed the guidelines from the django docs. When I access localhost/myapp...

how to send file via http with python

Hello, I have a problem. I use Apache with mod_wsgi and webpy, and when i send a file on http, a lot packets are lost. This is my code : web.header('Content-Type','video/x-flv') web.header('Content-length',sizeFile) f = file(FILE_PATH, 'rb') while True: buffer = f.read(4*1024) if buffer : yield buffer ...

With Apache/mod_wsgi how can I redirect to ssl and require Auth?

I have a Media Temple DV server hosting dev.example.com with django mounted at /. There is a legacy directory in my httpsdocs I need to continue to serve at /legacy. But for this directory I need to redirect anyone coming over http over to https, then prompt for http basic auth. In the virtual host conf, I'm pointing the root to a djang...

CentOS: make python 2.6 see django

In a harrowing attempt to get mod_wsgi to run on CentOS 5.4, I've added python 2.6 as an optional library following the instructions here. The configuration seems fine except that when trying to ping the server the Apache log prints this error: mod_wsgi (pid=20033, process='otalo', application='127.0.0.1|'): Loading WSGI script '...

Matplotlib and WSGI/mod_python not working on Apache.

Everything works as supposed to on the Django development server. In Apache, the django app also works except when matplotlib is used. Here's the error I get: No module named multiarray. Exception Type: ImportError Exception Value: No module named multiarray Exception Location: /usr/share/pyshared/numpy/core/numerictypes.py in <modu...

Getting HTTP GET variables using Tipfy

Hey everyone, I'm currently playing around with tipfy on Google's Appengine and just recently ran into a problem: I can't for the life of me find any documentation on how to use GET variables in my application, I've tried sifting through both tipfy and Werkzeug's documentations with no success. I know that I can use request.form.get('va...

django (under mod_wsgi) and php

Hello Under my debian copy, I run a django site runs via apache2 and mod_wsgi. Now I want to include a wordpress to it, for that I need to install php - apache bindings. I am curious what library is recommended for this, aswell as how shall I be doing the apache2 config file ? Here is my current apache 2 000-default file: <VirtualHost ...

Configuration problems with django and mod_wsgi

Hi, I've got problems on getting django to work on apache 2.2 with mod_wsgi. Django is installed and mod_wsgi too. I can even see a 404 page when accessing the path and I can login to django admin. But if I want to install the tagging module I get the following error: Traceback (most recent call last): File "setup.py", line 49, in <...

mod_wsgi daemon mode vs threaded fastcgi

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 django built in fastcgi(./manage.py method=threaded maxchildren=15) and mod_wsgi in 'daemon' ...