我试图在我的自定义小部件的django表单定义中使用django的reverse()函数,但遇到一个错误:ImproperlyConfigured
The included urlconf urls doesn't have any patterns in it
代码如下:
^{pr2}$
我很确定,我的works.url'的配置正确,因为所有其他页都按预期工作。在
有什么原因,为什么我不能在表单定义中使用reverse()?它是否与此代码运行时有关?有没有办法解决这个问题,或者这里唯一的选择就是硬编码URL?在
以下是完整的错误转储:Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/works/add?category=1&subcategory=1
Django Version: 1.4 pre-alpha
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'