mod-wsgi

Weird behaviour with two Trac instances under Apache + mod_wsgi

I am trying to configure two Trac instances in order to access them via browser each one with a different url: http://trac.domain.com/trac1 http://trac.domain.com/trac2 First time I access them Apache response is fine, I get the first Trac with /trac1, then the second one in /trac2. But when I access /trac1 again, it keeps giving me t...

Python 3.1.1 with --enable-shared : will not build any extensions

Summary: Building Python 3.1 on RHEL 5.3 64 bit with --enable-shared fails to compile all extensions. Building "normal" works fine without any problems. Please note that this question may seem to blur the line between programming and system administration. However, I believe that because it has to deal directly with getting language s...

multiple django sites with apache & mod_wsgi

Hello, I want to host several sites with under the same server which uses Debian 5, say I have site1,site2 and site3 and assume my ip is 155.55.55.1 155.55.55.1:80 for my site1 , script resides at /opt/django/site1/ 155.55.55.1:8080 for my site2 , script resides at /opt/django/site2/ 155.55.55.1:8090 for my site3 , script resides at /opt...

Apache lags when responding to gzipped requests

For an application I'm developing, the user submits a gzipped HTTP POST request (content-encoding: GZIP) with multipart form data (content-type: multipart/form-data). I use mod_deflate as an input filter to decompress and the web request is processed in Django via mod_wsgi. Generally, everything is fine. But for certain requests (dete...

mod_wsgi, wsgi daemon visible behind _both_ http and https

Hi, I have apache vhost configured with SSL and mod_wsgi its working fine: < VirtualHost 127.0.0.1:443 > #[...] SSLEngine on #[...] WSGIScriptAlias / /home/maciek/workspace/imid2py/wsgihandler.py WSGIDaemonProcess web2py user=maciek group=www-data \ home=/home/maciek/workspace/imid2py/ \ processes=10 maxi...

Mixing Python web platforms PHP, e.g. - Mediawiki, Wordpress, etc.

Is anyone developing application integrated with Mediawiki - using Django or other Python web development platforms using mod_wsgi? Would be very interested to find out what has been done in this direction and maybe there is some code available for re-use. (I've started creating wiki extensions working with MW database in python whose ...

Detect prematurely closed connection in web.py

Is there a way in Web.py to detect and handle connection being closed by user while the request is processing? I tried setting unloadhook handler, but it doesn't get called in this case. It's only called after the request was successfully completed: class handler: def __init__(self): pass def GET(self): try: ...

How to Disable Django / mod_WSGI Page Caching

I have Django running in Apache via mod_wsgi. I believe Django is caching my pages server-side, which is causing some of the functionality to not work correctly. I have a countdown timer that works by getting the current server time, determining the remaining countdown time, and outputting that number to the HTML template. A javascript...

Django + WSGI: Refreshing Issues?

I'm developing a Django site. I'm making all my changes on the live server, just because it's easier that way. The problem is, every now and then it seems to like to cache one of the *.py files I'm working on. Sometimes if I hit refresh a lot, it will switch back and forth between an older version of the page, and a newer version. My se...

MOD_WSGI difficulties on Mac OS X Snow Leopard

I've been trying to get MOD_WSGI working on Apache via XAMPP on my Mac OS X Snow Leopard all day today without any success. I've followed all the instructions, searched the internet for solutions, etc but no luck so far. Below are my exact steps and details. When I run localhost all I get is a white screen. When I remove "LoadModule wsgi...

Django + dbxml + Apache = problems. Any solutions?

I'm trying to set up a Django application using WSGI. That works fine. However, I am having some issues with part of my Django app that uses BDB XML. My Apache config is as follows: Listen 8000 WSGISocketPrefix /tmp/wsgi <VirtualHost *:8000> ServerName <server name> DocumentRoot <path to doc root> LogLevel info WSGIScr...

Server software choice for Django live/staging

For developing our Django web app, I'd like to move to an autonomous system that automatically updates the source (from VCS) of a staging copy of the app which has near identical properties to the live version of the application. The general idea of doing this has already been covered here on SO #625256. The Django documentation also t...

How do you generate random unique identifiers in a multi process and multi thread environment?

Every solution I come up with is not thread save. def uuid(cls,db): u = hexlify(os.urandom(8)).decode('ascii') db.execute('SELECT sid FROM sessions WHERE sid=?',(u,)) if db.fetch(): u=cls.uuid(db) else: db.execute('INSERT INTO sessions (sid) VALUES (?)',(u,)) return u ...

[mod-wsgi] from multiprocessing import Queue

Is it possible to make this work between mod_wsgi sub interpreters? from threading import Thread from multiprocessing import Queue def sid(q): u = 0 while True: u += 1 q.put(u) q = Queue(2) t = Thread(target=sid, args=(q,)) t.daemon = True t.start() def application(environ, response): o = str(q.get()) respons...

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 sec for this particular site). Subsequent requests only take 0.5 - 1.5 seconds so I woul...

Weird MySQL Python mod_wsgi Can't connect to MySQL server on 'localhost' (49) problem

There have been similar questions on StackOverflow about this, but I haven't found quite the same situation. This is on a OS X Leopard machine using MySQL Some starting information: MySQL Server version 5.1.30 Apache/2.2.13 (Unix) Python 2.5.1 mod_wsgi 3 mysqladmin also has skip-networking listed as OFF I am able to connect to m...

Django: Large file uploads - custom processing with mod_wsgi

I'm doing file uploads using Django's File Upload mechanism with a custom handler (by subclassing django.core.files.uploadhandler.FileUploadHandler) which does some additional processing in the receive_data_chunk(self, raw_data, start) function. I was curious when the handler is actually called (i.e. after the file has been completely ...

error: can't start new thread

Hello my friends. I have a site that runs with follow configuration: Django + mod-wsgi + apache In one of user's request, I send another HTTP request to another service, and solve this by httplib library of python. But sometimes this service don't get answer too long, and timeout for httplib doesn't work. So I creating thread, in th...

Restrict certain URLs to a single thread

I have a nice little threading problem with a library I use to generate and serve dynamic graphs and charts in Zope. See this question for a description of my original problem. As the website is already in production, I don't have time to debug that library (I'm not an expert in either C nor threading), hence I'm looking for the quick f...

static site apache and dynamic/member site django

I have a site for static content, accessible to all that runs on apache. As an adjunct to that, there is a members site that runs on django. I haven't had any issue 'sharing' my .css and making both sides equivalent in appearance, but what I can't quite seem to grok is getting my django site to be django password protected (with the ad...