还有这些
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/org-list/
Django Version: 1.9.8
Python Version: 2.7.15
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'users',
'courses',
'organization',
'operation',
'xadmin',
'crispy_forms',
'captcha']
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']
Template error:
In template C:\Users\asus\PycharmProjects\MxOnline2\templates\org-list.html, error at line 53
u'users' is not a registered namespace 43 : </div>
44 : </li>
45 : </ul>
46 : </div>
47 : <div class="all">共<span class="key">{{ org_nums }}</span>家</div>
48 : <div class="butler_list company list">
49 : <div class="layout">
50 : <div class="head">
51 : <ul class="tab_header">
52 : <li class="{% if sort == '' %}active{% endif %}"><a href="?ct={{ category }}&city={{ city_id }}">全部</a> </li>
53 : <li class="{% if sort == 'students' %}active{% e ndif %}"><a href="?sort=students&ct={{ category }}&city={{ city_id }}">学习人数 ↓</a></li>
54 : <li class="{% if sort == 'courses' %}active{% endif %}"><a href="?sort=courses&ct={{ category }}&city={{ city_id }}">课程数 ↓</a></li>
55 : </ul>
56 : </div>
57 : {% for course_org in all_orgs.object_list %}
58 : <dl class="des difdes">
59 : <dt>
60 : <a href="{% url 'org:org_home' course_org.id %}">
61 : <img width="200" height="120" class="scrollLoading" data-url="{{ MEDIA_URL }}{{ course_org.image }}"/>
62 : </a>
63 : </dt>
Traceback:
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\core\handlers\base.py" in get_response
149. response = self.process_exception_by_middleware(e, request)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\core\handlers\base.py" in get_response
147. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\views\generic\base.py" in view
68. return self.dispatch(request, *args, **kwargs)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\views\generic\base.py" in dispatch
88. return handler(request, *args, **kwargs)
File "C:\Users\asus\PycharmProjects\MxOnline2\apps\organization\views.py" in get
21. "org_nums": org_nums
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\shortcuts.py" in render
67. template_name, context, request=request, using=using)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\loader.py" in render_to_string
97. return template.render(context, request)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\backends\django.py" in render
95. return self.template.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render
206. return self._render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in _render
197. return self.nodelist.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render
992. bit = node.render_annotated(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render_annotated
959. return self.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\loader_tags.py" in render
173. return compiled_parent._render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in _render
197. return self.nodelist.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render
992. bit = node.render_annotated(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render_annotated
959. return self.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\defaulttags.py" in render
326. return nodelist.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render
992. bit = node.render_annotated(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\base.py" in render_annotated
959. return self.render(context)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\defaulttags.py" in render
513. six.reraise(*exc_info)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\template\defaulttags.py" in render
499. url = reverse(view_name, args=args, kwargs=kwargs, current_app=current_app)
File "C:\Users\asus\Envs\mxonline2\lib\site-packages\django\core\urlresolvers.py" in reverse
596. key)
Exception Type: NoReverseMatch at /org-list/
Exception Value: u'users' is not a registered namespace