Django 1.7导入错误:没有名为mysite的模块

时间:2014-11-25 03:39:26

标签: django apache

我是djangp的新手,试图用Windows测试运行和mod_wsgi。

这是我的httpd conf

WSGIScriptAlias /hm "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/mysite/mysite/wsgi.py"

<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/mysite/mysite">
Options Indexes FollowSymLinks +ExecCGI
Order deny,allow
Allow from all
Allow from all
AddHandler wsgi-script .py

</Directory>

我有这个项目结构:

  mysite
      -manage.py
      -mysite
        -settings.py
        -wsgi.py

在我的wsgi中,我有:

import os, sys 

base = os.path.dirname(os.path.dirname(__file__))

sys.path.append(base +"\\mysite" ) 
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'


from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

请咨询

0 个答案:

没有答案