Python 3.x Django:具有公共前缀的url和视图中具有参数的{%url%}

Python 3.x Django:具有公共前缀的url和视图中具有参数的{%url%},python-3.x,django-views,django-urls,django-1.8,Python 3.x,Django Views,Django Urls,Django 1.8,在我的urls.py中,我定义了如下内容: url(r'file-(?P<fid>\d+)\.html', detail, name='detail'), url(r'file-(?P<fid>\d+)/history', history, name='history'), url(r'file-(?P<fid>\d+)/edit', edit, name='edit'), url(r'file-(?P<fid>\d+)/comments', co

在我的
urls.py
中,我定义了如下内容:

url(r'file-(?P<fid>\d+)\.html', detail, name='detail'),
url(r'file-(?P<fid>\d+)/history', history, name='history'),
url(r'file-(?P<fid>\d+)/edit', edit, name='edit'),
url(r'file-(?P<fid>\d+)/comments', comments, name='comments'),
url(r'file-(?P<fid>\d+)/delete', delete, name='delete'),
url(r'^file-(?P<fid>\d+)', include(
    url(r'^\.html', detail, name='detail'),
    url(r'^/history', history, name='history'),
    url(r'^/edit', edit, name='edit'),
    url(r'^/comments', comments, name='comments'),
    url(r'^/delete', delete, name='delete'),
)),
我知道为什么会出现这个错误-在
url(r'^\.html',detail,name='detail'),
-中没有参数,我的问题是:如何使用
{%url%}
将此url模式与include-in视图一起使用

Django:1.8.2 Python:3.4.2

url(r'^file-(?P<fid>\d+)', include(
    url(r'^\.html', detail, name='detail'),
    url(r'^/history', history, name='history'),
    url(r'^/edit', edit, name='edit'),
    url(r'^/comments', comments, name='comments'),
    url(r'^/delete', delete, name='delete'),
)),
NoReverseMatch at /files/

Reverse for 'detail' with arguments '(2,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []

Request Method: GET
Request URL:    xxx.xxx.xxx.xxx
Django Version: 1.8.2
Exception Type: NoReverseMatch
Exception Value: Reverse for 'detail' with arguments '(2,)' and keyword arguments '{}' not found. 0 pattern(s) tried: []