简体   繁体   中英

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 Apache

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM