2012-03-20 93 views
0

我第一次使用django-non rel。我已經有一個簡單的Django項目。我創建了一個名爲job_board的應用程序,並將其添加到安裝的應用程序元組中。我複製了現有模型,視圖和模板並更新了網址。django-non rel沒有找到

做manage.py runserver命令後,我得到的錯誤:

name 'job_board' is not defined

INSTALLED_APPS = (
    # 'django.contrib.admin', 
    'django.contrib.contenttypes', 
    'django.contrib.auth', 
    'django.contrib.sessions', 
    'job_board', 
    'djangotoolbox', 
    'autoload', 
    'dbindexer', 

    # djangoappengine should come last, so it can override a few manage.py commands 
    'djangoappengine', 
) 


urlpatterns = patterns('', 
    ('^_ah/warmup$', 'djangoappengine.views.warmup'), 
    (r'^$', job_board.views.main_page), 
    (r'^edit-job/$', job_board.views.edit_job), 
    (r'^edit-job/(?P<job_id>\d+)$', job_board.views.edit_job), 
    (r'^job-details/(?P<job_id>\d+)$', job_board.views.job_details), 
    (r'^edit-location/$', job_board.views.edit_location), 
    (r'^edit-location/(?P<job_id>\d+)/(?P<location_id>\d+)$', job_board.views.edit_location), 
    (r'^edit-customer/$', job_board.views.edit_customer), 
    (r'^edit-customer/(?P<job_id>\d+)/(?P<customer_id>\d+)$', job_board.views.edit_customer), 
) 

我缺少什麼?

回答

2

如果您直接在urls.py中使用模塊(而不是將其作爲字符串引用),則需要先將其導入。

+0

哇我很笨。謝謝我是python和django的新手,經常忽略導入模塊。謝謝! – dardub 2012-03-20 20:10:20