mod-wsgi

Why do no Python DLLs built with MSVC load with mod_wsgi?

I recently updated from Python 2.5 to 2.7 (I tried 2.6 during my hassles) and while everything works fine from the command line or in the Django runserver, mod_wsgi cannot load any module that contains DLLs (pyd) built with MSVC. For example, if I build my own versions of pycrypto or lxml then I will get the following error only from mo...

can't write to file in mod_wsgi app: permission denied

I have a very simple mod_wsgi python application that tries to write to a file: tempfile = open('temp.txt', 'w') This fails with IOError: [Errno 13] Permission denied: 'temp.txt' The folder with myapp.wsgi has world-writable permissions (777). I can write to a file from a simple PHP test script. This is running on Mac OSX 10.6 ...

Problem with Django using Apache2 (mod_wsgi), Occassionally is "unable to import from module" for no apparent reason

I have put my Django web site up to my web server and have it set up using apache2 and mod_wsgi.. everything works fine most of the time but occasionally it will just give the error that it can't import a module (usually from my views file). However, it's not an issue with that module as it usually works, for example, I will get the erro...

Django with mod_wsgi returns 403 error

Hi! I am trying to use Django with Apache (and mod_wsgi). With the default Django webserver everything was going well, but now I get 403 (access forbidden) error when trying to load the page. I searched previous posts here and read official docs but the solutions there weren't helpful. Here are the lines from my httpd.conf: WSGIScrip...

Using Relative Paths To Log Files In Pylons' development.ini

I am working on a Pylons app that runs on top of Apache with mod_wsgi. I would like to send logging messages that my app generates to files in my app's directory, instead of to Apache's logs. Further, I would like to specify the location of logfiles via a relative path so that it'll be easier to deploy my app on other people's servers....

Why does Django/mod_wsgi crash on certain URL lengths?

I've got a weird problem here: I'm getting a 500 error code from Apache serving a Django 1.1 application when the length of the path part of the URL given to Apache is in [23..26,30..33]. For example, http://server/012345678901234567890123 results in a 500 error while http://server/012345678901234567 does not. Each 500 error also result...

Apache mod_wsgi Django setup - Forbidden You don't have permission to access /mysite on this server

I have install python 26, Apache 2.2, modwsgi ap2.2 py26 On windows XP. and apache loads modwsgi fine. when I check localhost: apache says - It works! but when i try to open the Django directory mysite: localhost/mysite i get : Forbidden You don't have permission to access /mysite on this server. I have re-installed and installed this ma...

Webserver on python3

I've create a web app in Python3 all runs beautiful till that day what i have to upload a file... theres no way to find the path or the file in the environ i am using wsgi and i am thinking to migrate to another thing, what are your recommendation? ...

Problems with cgi.FieldStorage

I have an application, what uses wsgi as middleware, everything it's ok, with the Get but, in the POST using a form i am facing a big problem, i don' t find nothing, no matter what i make theenviron['CONTENT-TYPE'] give me this:multipart/form-data; boundary=---------------------------8753104564381071051372446876, the cgi.FieldStroage giv...

How do I write to the apache log files when using mod_wsgi

I have a Django project where I have been logging to a file using the standard library logging module. For a variety of reasons I would like to change it so that it writes to the Apache log files. I've seen quite a bit of discussion of how to do this with mod_python, but not mod_wsgi. How do I do this for a project running under mod_w...

Serving static files with logic in django (keeping a downloadcount)

I have a site which enables the user to download certain files. However I want to keep a download count for each file so going the usual way by putting the static files on a different subdomain and then letting apache do the heavy lifting is not a way as well as HttpResponseRedirecting the user to a subdomain isn't good because then the ...

How to configure my mod_wsgi to run another python app?

I have a WSGI app configured to run from the root of my site. This means that any url under this domain will execute the app. I am trying run a separate python script from within the main WSGI app. I am having a difficult time understanding how to configure my app to execute another local script. The second script needs to receive a POST...

Routes/Pylons Fails Before Touching My Code

I am very puzzled over this error. In a previously functional Pylons app (running on apache/mod_wsgi), Routes has exploded. When I attempt to access my application, no matter what URL I use, I get the Apache "Internal server error" page and the following traceback in /var/log/apache2/error.log. [Sat Oct 02 2010] WSGI Variables [Sat ...

Django and Buildout Deployment Problem

I am trying to deploy my existing django project via buildout, following loosely the instructions here. my buildout.cfg file is: [buildout] parts = django python develop = . eggs = myproject [django] recipe = djangorecipe version = 1.2.3 project = myproject projectegg = mypr...

Mixing authenticated and unauthenticated URLs, Internet Explorer and mod_auth_sspi

Setup: Apache 2.2, mod_auth_sspi 1.0.3/1.0.4, mod_wsgi 3.3, python 2.6.2 Some background information: Whenever IE hits an URL, that requires it to perform NTLM challenge-response, further POST requests to the same domain are performed as follows: A zero-length POST (Content-Length 0) is performed The server replies with 401. WWW-Authe...

Redirect stdout and stderr to file in Django with wsgi

I'm trying to make django work with wsgi in a shared hosting, so I cannot access server logs, I'm trying to redirect the output to a file in my django.wsgi script, like this: saveout = sys.stdout log_out = open('out.log', 'w') sys.stdout = log_out but this is the error that I have (in the only error log that I can access) [Thu Oc...

Setting Python Path in Windows XAMPP using WSGI

I'm setting up a development version of a live server on Webfaction, running Django apps in a virtual Apache server environment (running without any errors) on my local machine - XP, running XAMPP Lite with Python 2.6 - which I can commit changes from via Git. XAMPP is up and running OK with Python, and the server starts perfectly with ...

Apache Can't Access Django Applications

so here's the setting: The whole site is working fine if I remove the application (whose name is myapp) in the INSTALLED_APPS section in the settings file I added WSGIPythonHome in apache2.conf I can successfully access the apps via the the interactive python shell in Django (python manage.py shell). I can create, update and delete...

mod_wsgi: multiple application invokations per request?

I'm using apache with mod_wsgi, and when I start apache and make a request, I see it make one invokation of the application. After a few minutes (the application gets reloaded), and now I see it make two invokations of the application per request. Why's that? Also: is there any easy way to initialize resources (database pools, for examp...

How can I generate an absolute url for a Pylons controller?

I need to generate a URL for use as a callback in an external system in my pylons application. This requires me to provide both the pylons-app-relative controller path (as generated by the url method: >>> relative_url = url(controller='my_cont', action='callback', id=generated_id) >>> print relative_url /my_cont/callback/1234 However,...