开发者

Django: Name error at ROUTE/

I've a Django project advisor with core application.

My routes are separ开发者_运维知识库ated into a small group of files.

I try to include them from the main urls.py, but django fails with the following exception


NameError at /ask

name 'advisor' is not defined

Request Method:  GET
Request URL:  http://localhost:8000/ask
Django Version:  1.2.4
Exception Type:  NameError
Exception Value:  

name 'advisor' is not defined

Here is the code that include routes under the ask/ url, though advisor.core registered at setting.py

(r'^ask/$', include(advisor.core.urls.ask)),

and this is advisor.core.urls.ask contents


from django.conf.urls.defaults import patterns

urlpatterns = patterns(
    'core.views.ask',
    r'^$', 'ask',
    r'^private/$', 'private',
    r'^ngos/$', 'ngos'
)

What is going wrong with my code?

Sultan


(r'^ask/$', include('advisor.core.urls.ask')),
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜