部署时无法导入模式django(pythonanywhere)

时间:2013-11-09 07:44:16

标签: python django pythonanywhere

的AoA    我正在尝试将我的项目(我在localhost上创建)部署到pythonanywhere.com我已经遵循了所有指令(安装了django 1.5,设置了wsgi.py文件并更改了所有文件(视图,网址,模型,设置) )根据pythonanywhere ...    现在的问题是当我重新加载应用程序并导航到我的网站时设置python 2.7(virtualenv上的路径),我得到类似这样的错误 - > http://saadfast.pythonanywhere.com/

而配置文件wsgi文件是 - >

activate_this = '/home/saadfast/.virtualenvs/django15/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

import os
import sys

sys.path.insert(0, '/home/saadfast/Wikipedia')

path = '/home/saadfast/Wikipedia'
if path not in sys.path:
    sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'Wikipedia.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

urls.py

from django.conf.urls import patterns, url
import Wikipedia.views


urlpatterns = patterns('',
     url(r'^$', 'Wikipedia.views.home_Page'),
     url(r'^home/$', 'Wikipedia.views.home_Page',name='home_view'),
     url(r'^search/$', 'Wikipedia.views.search_PageItems', name='search_view'),
     url(r'^article/(?P<item>[-\w]+)/$', 'Wikipedia.views.articleItem', name='article_view'),
     url(r'^get/(?P<article_id>\d+)/$', 'Wikipedia.views.article'),
)

它在调试页面上显示的python环境路径是/ usr / local .... 但是pythonanywhere目录中没有/ usr文件夹,目录结构就是这样的

/
 /home
 /temp
 /var

0 个答案:

没有答案