I am new on django. I tried this but I can’t deploy. How can I do
#!/usr/bin/python
import sys
import os
base = os.path.dirname(os.path.abspath(__file__)) + '/..'
sys.path.append(base)
os.environ['DJANGO_SETTINGS_MODULE'] = 'myfirstapp.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
AddHandler fcgid-script .fcgi
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^(media/.*)$ - [L]
RewriteRule ^(adminmedia/.*)$ - [L]
RewriteCond %{REQUEST_URI} !(cgi-bin/myproject.fcgi)
RewriteRule ^(.*)$ mysite.fcgi/$1 [L]
Here’s the alwaysdata wiki entry for setting up Django with fastcgi. Only down-side: it’s written in French.
Well, I don’t speak French, but what it basically says is:
publicin the folder of your django project.In that directory create the file
django.fcgiwith the following content:Next, create a .htaccess in the
publicfolder with the following content:If you’re planning to include the django admin interface, create this symbolic link in your
publicdirectory:In the end your folder tree hierarchy should somehow look like this:
Hope this helps. I talked with the admin, and he said he will soon provide an English wiki. Let’s hope this is going to happen anytime soon.
UPDATE: There is an English wiki article now.