mod-wsgi

Error in Django running on Apache/mod_wsgi

Recently i asked a question regarding an error in apache/mod_wsgi recognizing the python script directory. The community kindly answered the question resulting in a successful installation. Now I have a different error, the server daemon (well, technically is a windows service, I say tomato you say...) doesn't find any of the models, her...

How to stop WSGI from hanging apache

I have django running through WSGI like this : <VirtualHost *:80> WSGIScriptAlias / /home/ptarjan/django/django.wsgi WSGIDaemonProcess ptarjan processes=2 threads=15 display-name=%{GROUP} WSGIProcessGroup ptarjan Alias /media /home/ptarjan/django/mysite/media/ </VirtualHost> But if in python I do : def handler(request...

Stackless python stopped mod_python/apache from working.

Hello I installed stackless pyton 2.6.2 after reading several sites that said its fully compatible with vanilla python. After installing i found that my django applications do not work any more. I did reinstall django (1.1) again and now im kind of lost. The error that i get is 500: Internal Server Error The server encountered an int...

Django ImageField validation & PIL

Hello On sunday, I had problems with python modules, when I installed stackless python. Now I have compiled and installed : setuptools & python-mysqldb and i got my django project up and running again. (i also reinstalled django-1.1), Then I compiled and installed, jpeg, freetype2 and PIL. I also started using mod_wsgi instead of ...

Simple rewrite rule for a nginx + apache2 with mod_wsgi

Hi guys, I'm stuck with this, my skills in the web servers area are poor... I have an Nginx acting as a proxy for an Apache2 running with mod_wsgi and mod_rewrite. What I want to do is rewrite every URL from www.example.com to example.com, i.e. stripping the www part from each URL request before serving. This is the layout of the differ...

Apache/Django freezing after a few requests.

I'm running Django through mod_wsgi and Apache (2.2.8) on Ubuntu 8.04. I've been running Django on this setup for about 6 months without any problems. Yesterday, I moved my database (postgres 8.3) to its own server, and my Django site started refusing to load (the browser spinner would just keep spinning). It works for about 10 mintue...

django deployment issue with mod_wsgi

Hello I am trying to deploy my django project which is located at home/doga/headend/ and just to run it on the localhost (will be a LAN accessable project). My main problem is that I can use the site well however the /admin/ folder is giving me Internal Server Error error. anyway here is my etc/apache2/sites-available/default file <Vir...

Share Python Interpreter in Apache Prefork / WSGI

I am attempting to run a Python application within Apache (prefork) with WSGI in such a way that a single Python interpreter will be used. This is necessary since the application uses thread synchronization to prevent race conditions from occurring. Since Apache prefork spawns multiple processes, the code winds up not being shared betwee...

Locally Hosted Google App Engine (WebApp Framework / BigTable)

I have been playing with Google App engine a lot lately, from home on personal projects, and I have been really enjoying it. I've converted a few of my coworkers over and we are interested in using GAE for a few of our projects at work. Our work has to be hosted locally on our own servers. I've done some searching around and I really ca...

Fixing mod_wsgi after upgrading to Snow Leopard.

After upgarding my MBP to 10.6, I get the following in my apache's error.log: [error] [client ::1] Premature end of script headers: django.wsgi WSGI FAQ suggests: If using daemon mode, this is a symptom of the mod_wsgi daemon process crashing when handling a request. You would probably also see the message 'segmentation fault'. See...

django : ImportError No module named myapp.views.hometest

I have fecora 11, set django with mod_wsgi2.5 and apache2.2. And I can run "python manage.py runserver" at local. It works fine. I got error when i test from remote browser. Thanks for any suggestion and help! ...

django - protect some web paths with basic authentication.

hi, i'm fairly new to django and just trying a couple simple experiments to get my feet wet. i'm running django 1.0, apache2 prefork and mod_wsgi. I'm trying to build a site with the following url structure / /members /admin the root is basically a public area. the members path should be protected using basic-authentication (probabl...

IF statement causing internal server error with webpy

I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl' placeholders = { 'site_name' : 'pypular' } # If we passed placeholders vars, append them if extra_placeholders != None: for k, v in extra_placehol...

Why do I get error, KeyError: 'wsgi.input'?

I'm using WSGI and trying to access the get/post data, using this code: import os import cgi from traceback import format_exception from sys import exc_info def application(environ, start_response): try: f = cgi.FieldStorage(fp=os.environ['wsgi.input'], environ=os.environ) output = 'Test: %s' % f['test'].value ...

How to improve performance of python cgi that reads a big file and returns it as a download?

I have this python cgi script that checks if it hasn't been accessed to many times from the same IP, and if everything is ok, reads a big file form disk (11MB) and then returns it as a download. It works,but performance sucks. The bottleneck seems to be reading this huge file over and over: def download_demo(): """ Returns the...

Run Django with URL prefix ("subdirectory") - App works, but URLs broken?

Below are the relevant configuration files, also at http://dpaste.com/97213/ . The apache config is currently working, because accessing 'example.com/' shows me the index.html file I have placed at the document root. I'd like to serve Django/apps at the prefix '/d', so 'example.com/d/' would load the default app, 'example.com/d/app3' ...

nginx with mod_wsgi

I generally run web apps behind nginx with FastCGI. I wanted to experiment with mod_wsgi, however it seems quite out of date. The author mentions that it worked on version 0.5.34, however I'm running 0.7.62 now. The wiki article warns of compilation problems with the module and later versions of nginx. Has anybody used mod_wsgi with ...

Performance of concurrency in Django (apache2 prefork/mod_wsgi), what am I doing wrong?

First of all I am not in any way unhappy with the performance of my Django powered site, its not getting massive traffic, a bit over 1000 visits per day so far. I was curious how well it would cope with heavy traffic peaks so I used the ab-tool to do some benchmarking. I noticed that the performance when the concurrency is larger than ...

Catch contents of PHP session under Apache with Python (mod_wsgi)?

Hi, Is there a way to catch the contents of the PHP session variable $_SESSION['user_id'] with a mod_wsgi Python script? I'm running a script in the background that will decide whether or not the user may proceed to view the document. I would like to do something like this: def allow_access(environ, host): allow_access = False ...

Using Django as a Backend for Cappuccino

I'm new to both Django and Cappuccino. I have a Django site setup and running through Apache via mod_wsgi. I want to use Django as the backend for a Cappuccino application, but a VirtualHost setup in Apache and mod_wsgi to serve a Django application serves static files out of a different location than the normal web root (e.g. http://exa...