Closed kieusonlam closed 8 years ago
Hi everyone,
I using Django 1.9.4 and Python 2.7.11. I got this error when logging out from admin area.
`Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/admin/logout/
Django Version: 1.9.4 Python Version: 2.7.11 Installed Applications: ['material', 'material.frontend', 'material.admin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'material.frontend.middleware.SmoothNavigationMiddleware', 'material.frontend.middleware.UnpjaxMiddleware']
Template error: In template D:\Dev\Python\Projects\Django\env\lib\site-packages\material\frontend\templates\registration\logged_out.html, error at line 0 Reverse for 'login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 1 : {% extends "material/frontend/base_module.html" %} 2 : {% load i18n %} 3 : 4 : 5 : {% block content %} 6 :
Traceback:
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\handlers\base.py" in get_response
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\response.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\response.py" in rendered_content
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\backends\django.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in _render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\loader_tags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\defaulttags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\urlresolvers.py" in reverse
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\urlresolvers.py" in _reverse_with_prefix
Exception Type: NoReverseMatch at /admin/logout/ Exception Value: Reverse for 'login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []`
Any idea?
You have included material.frontend to the INSTALLED_APPS.
material.frontend
Do you have url(r'', include(frontend_urls)), in your urls conf?
url(r'', include(frontend_urls)),
Yes i did include material.frontend to the INSTALLED_APPS.
INSTALLED_APPS = [ 'material', 'material.frontend', 'material.admin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', 'posts', ]
and this is my urls.py from django.conf.urls import url from django.contrib import admin
urls.py
urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', "posts.views.post_home"), ]
I'm new to Django so am i do anything wrong?
If you are going to use material.frontend you need to follow the documention and add url(r'', include(frontend_urls)) to yor urls.py file
url(r'', include(frontend_urls))
If you don't need a material.frontend you can just remove it from INSTALLED_APPS
Hi everyone,
I using Django 1.9.4 and Python 2.7.11. I got this error when logging out from admin area.
`Environment:
Request Method: GET Request URL: http://127.0.0.1:8000/admin/logout/
Django Version: 1.9.4 Python Version: 2.7.11 Installed Applications: ['material', 'material.frontend', 'material.admin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'material.frontend.middleware.SmoothNavigationMiddleware', 'material.frontend.middleware.UnpjaxMiddleware']
Template error: In template D:\Dev\Python\Projects\Django\env\lib\site-packages\material\frontend\templates\registration\logged_out.html, error at line 0 Reverse for 'login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] 1 : {% extends "material/frontend/base_module.html" %} 2 : {% load i18n %} 3 : 4 : 5 : {% block content %} 6 :
Traceback:
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\handlers\base.py" in get_response
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\handlers\base.py" in get_response
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\response.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\response.py" in rendered_content
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\backends\django.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in _render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\loader_tags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in _render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\loader_tags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in _render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\loader_tags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in _render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\loader_tags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\defaulttags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\base.py" in render_annotated
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\defaulttags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\template\defaulttags.py" in render
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\urlresolvers.py" in reverse
File "D:\Dev\Python\Projects\Django\env\lib\site-packages\django\core\urlresolvers.py" in _reverse_with_prefix
Exception Type: NoReverseMatch at /admin/logout/ Exception Value: Reverse for 'login' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []`
Any idea?
You have included
material.frontend
to the INSTALLED_APPS.Do you have
url(r'', include(frontend_urls)),
in your urls conf?Yes i did include
material.frontend
to the INSTALLED_APPS.INSTALLED_APPS = [ 'material', 'material.frontend', 'material.admin', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'debug_toolbar', 'posts', ]
and this is my
urls.py
from django.conf.urls import url from django.contrib import adminurlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^$', "posts.views.post_home"), ]
I'm new to Django so am i do anything wrong?
If you are going to use
material.frontend
you need to follow the documention and addurl(r'', include(frontend_urls))
to yor urls.py fileIf you don't need a
material.frontend
you can just remove it from INSTALLED_APPS