3

I'm currently trying to set up my first homepage using Django and have encountered some problems.

The server I've got my project on is running Django in FastCGI-mode and they have supplied me with a quick guide to set the settings I need to run Django, which looks something like this.

mysite.fcgi

#!/usr/bin/local/python
import sys, os

sys.path.append("/home/users/username")

from django.core.handler.wsgi import WSGIHandler
from flup.server.fcgi import WSGIServer

os.chdir("/home/users/username/mysite")

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

WSGIServer(WSGIHandler()).run()

.htaccess

Addhandler fastcgi-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]

When I run manage.py runfcgi I get this message:

WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 200 OK
Content-Type: text/html; charset=utf-8

<!-- The html from my main template --!>

Help would be much appreciated :)

2
  • Which web server you used, nginx , apache?? May 13, 2013 at 1:16
  • @GianfrancoLemmo - Sorry, forgot to mention that, I use apache
    – oyvindym
    May 13, 2013 at 8:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.