开发者

Django Import Error with URLS and ROOT_URLCONF confusion

In httpd conf,

<VirtualHost *:8080>
    ServerName tweet_search_engine
    DocumentRoot /var/www/microblogsearchengine/twingle
</VirtualHost>

<Directory /var/www/m开发者_开发百科icroblogsearchengine/twingle>
  SetHandler python-program
  PythonHandler django.core.handlers.modpython
  SetEnv DJANGO_SETTINGS_MODULE settings
  PythonOption django.root /var/www/microbloggingsearchengine/twingle
  PythonDebug On
</Directory>

Running python manage.py runserver and visiting localhost:8000 returns a splash page telling me everything is okay. However when I visit this site through apache, I get an import error with urls.

In my settings.py file I have a line,

ROOT_URLCONF = 'twingle.urls'

I'm assuming this is the cause of the error. The project folder contains only 4 files:

__init__.py manage.py settings.py urls.py

I tried replacing twingle.urls with urls.py but then it gave me a different error. What is it I can do to get this working?


Typo in your PythonOption line: django.rooti instead of django.root

Furthermore you might have to add something like this inside your Directory section:

PythonPath "['/var/www/microbloggingsearchengine','/var/www/microbloggingsearchengine/twingle'] + sys.path"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜