开发者

Problem with Django site on a shared hosting

I have a problem when i try to install a Django website, on a Mocha hosting, and their technical support is so much uninformed... (I strongly don't recomment Mocha hosting for a django hosting) They have mod_wsgi support, and mod_python installed, but when i am uploading the site as in their tutorial http://www.mochasupport.com/kayako/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=448&nav=0,46 but at the end i am getting an error like:

Traceback (most recent call last):

File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent)

File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1202, in _process_target module = import_module(module_name, path=path)

File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 304, in import_module return import(module_name, {}, {}, ['*'])

ImportError: No module named django.core.handlers.modpython

I know this issue has been treated here as well: Error while deploying Django on Apa开发者_如何学编程che

But i don't have access to the terminal, how can i solve it? Is there a way to correctly set the python path without terminal access? Thanks!


Do you double check that you upload a django in

/home/youraccount/webapps/django

Most likely the hosting provieder has harcode (width you account) that path in the apache configuration for the mod_python approach.

Or

Why don't you use mod_wsgi and in the wsgi script add your django, like this.

import os
import sys

sys.path.append('/home/youraccount/webapps/django') # Path to your custom django.
from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings' 
application = WSGIHandler()


Looking at that article, it seems that they don't provide Django for your use. You'll need to upload it as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜