Wednesday, February 26, 2014

django + python3 + fastcgi + shared hosting not working

Hello,

I'm trying to deploy a django project on justhost.com. I have a locally installed version of python3 and I'm using the development version of django. I know I have to use fastcgi.

My ~/public_html/uddo/.htaccess is:

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

and my uddo.fcgi is:

#!~/bin/python3
import sys, os

# Add a custom Python path.
## I installed python3 with --previs=~/, so bin and lib folders are in my home directory...
sys.path.insert(0, "~/")
sys.path.insert(13, "~/src/uddo")

# Switch to the directory of your project. (Optional.)
os.chdir("~/src/uddo/")

# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "uddo.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

However, when reaching the site url, I get a 404 Error - File Not Found.
I find only this on apache's error_log:

[Wed Feb 26 06:49:29 2014] [error] [client xxx.xx.xx.xxx] File does not exist: ~/public_html/uddo/uddo.fcgi/

Where "~" is actually the path to my home.

Does anyone know what could be wrong?

--
Héctor Urbina S.
Ingeniero en Bioinformática
Fono: 82049138

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADHcORibYP2iH%2BtAyAr%3DQ_AMx2z5R9suCu4EK6DgtcGhd6vX1A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment