Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.6.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'south',
'webface',
'myadmin')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')
Template error:
In template /home/bat/webapps/1rifles/venv/src/onerifles/myadmin/templates/myadmin/index.html, error at line 23
'str' object has no attribute 'regex
21 : <div class="form-group">
22 : <div class="col-sm-11">
23 : <a href=" {% url 'add_post' %} " class="btn btn-danger">Создать</a>
24 : </div>
25 : </div>
Traceback:
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/bat/webapps/1rifles/venv/src/onerifles/myadmin/views.py" in index_page
13. return render(request, 'myadmin/index.html', {'posts':posts})
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/shortcuts/__init__.py" in render
53. return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/loader.py" in render_to_string
169. return t.render(context_instance)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
140. return self._render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in _render
134. return self.nodelist.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
123. return compiled_parent._render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in _render
134. return self.nodelist.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/loader_tags.py" in render
62. result = block.nodelist.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/base.py" in render
840. bit = self.render_node(node, context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/debug.py" in render_node
78. return node.render(context)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/template/defaulttags.py" in render
433. url = reverse(view_name, args=args, kwargs=kwargs, current_app=context.current_app)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse
509. return iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in _reverse_with_prefix
387. possibilities = self.reverse_dict.getlist(lookup_view)
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse_dict
296. self._populate()
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate
273. for name in pattern.reverse_dict:
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in reverse_dict
296. self._populate()
File "/home/bat/webapps/1rifles/venv/local/lib/python2.7/site-packages/django/core/urlresolvers.py" in _populate
263. p_pattern = pattern.regex.pattern
Exception Type: AttributeError at /admin/
Exception Value: 'str' object has no attribute 'regex'
Конфиги урлов:
root url conf
urlpatterns = patterns('',
url(r'^api/', include('webface.urls')),
url(r'^admin/', include('myadmin.urls')),
)
App conf
urlpatterns = patterns('',
url(r'^$', views.index_page, name='index_page' ),
url(r'^post/add/$', views.add_post, name='add_post'),
)