methuselah
methuselah

Reputation: 13206

Problems with fastcgi when installing Django on Justhost

I am following the following tutorial at http://flailingmonkey.com/install-django-justhost/ to install Django on my Justhost web server. So far I have managed to install Django and Python on my Justhost shared web server.

However, I am now stuck when trying to configure my new site. Every time I run the command: python mysite.fcgi I keep getting the following error message:

Traceback (most recent call last):
  File "mysite.fcgi", line 9, in <module>
    from django.core.servers.fastcgi import runfastcgi
ImportError: No module named fastcgi

Content of mysite.fcgi

#!/home4/xxxxx/python/bin/python
import sys, os    

# Where /home/your_username is the path to your home directory
sys.path.insert(0, "/home4/xxxxx/python")
sys.path.insert(13, "/home4/xxxxx/public_html/django-project/admin")

os.environ['DJANGO_SETTINGS_MODULE'] = 'admin.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")

How do I fix it?

Upvotes: 0

Views: 815

Answers (2)

mrts
mrts

Reputation: 18935

If you need FastCGI support for Django version 1.9 or higher, see https://github.com/NetAngels/django-fastcgi. You still need to install flup separately as @dvicemuse advised.

Also, official Django version 1.8 FastCGI docs may help, see https://docs.djangoproject.com/en/1.8/howto/deployment/fastcgi/#running-django-on-a-shared-hosting-provider-with-apache

Upvotes: 1

dvicemuse
dvicemuse

Reputation: 586

I had the exact same issue. Heres how to solve it

load up your ssh client

cd ~/
pip install django==1.8.7
pip install flup==1.0.2

and you should be good

Upvotes: 2

Related Questions