You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to show the user an intermediate page, containing a form, as part of a new admin action.
I have copied the base.html and the base_site.html templates from the Django Suit code base into my own templates/admin directory and then my form's template inherits from those.
When Django tries to display the page, the log shows the following warning/error:
2017-08-08T06:38:19 [root:36] WARNING - Django Suit was unable to retrieve apps list for menu.
The full stack trace:
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/admin/samples/request/
Django Version: 1.10.7
Python Version: 3.5.2
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.humanize',
'django.contrib.staticfiles',
'crispy_forms',
'authtools',
'easy_thumbnails',
'myproject.settings.apps.SuitConfig',
'django.contrib.admin',
'myproject.apps.accounts',
'users',
'methodology',
'projects',
'samples',
'home',
'debug_toolbar']
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',
'debug_toolbar.middleware.DebugToolbarMiddleware']
Template error:
In template /home/gamesbook/dev/myproject/code/myproject/templates/admin/actions/project_register.html, error at line 0
'NoneType' object is not iterable 1 : {% extends "admin/actions/base.html" %}
2 : {% load i18n admin_static admin_modify %}
3 : {% load crispy_forms_tags %}
4 :
5 : {% block content %}
6 : <div id="content-main" class="inner-two-columns">
7 : <div class="inner-center-column">
8 : <h2>{{ action_name }}</h2>
9 : {% crispy project_register_form %}
10 : <fieldset class="module aligned with-legend ">
Traceback:
File "lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
42. response = get_response(request)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/core/handlers/base.py" in _legacy_get_response
249. response = self._get_response(request)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/contrib/admin/options.py" in wrapper
544. return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
149. response = view_func(request, *args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
57. response = view_func(request, *args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/contrib/admin/sites.py" in inner
211. return view(request, *args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapper
67. return bound_func(*args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
149. response = view_func(request, *args, **kwargs)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/utils/decorators.py" in bound_func
63. return func.__get__(self, type(self))(*args2, **kwargs2)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/contrib/admin/options.py" in changelist_view
1569. response = self.response_action(request, queryset=cl.get_queryset(request))
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/contrib/admin/options.py" in response_action
1305. response = func(self, request, queryset)
File "/home/gamesbook/dev/myproject/code/myproject/apps/samples/admin.py" in register_new_project
260. RequestContext(request))
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/shortcuts.py" in render_to_response
21. content = loader.render_to_string(template_name, context, using=using)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader.py" in render_to_string
68. return template.render(context, request)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/backends/django.py" in render
66. return self.template.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
208. return self._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
174. return compiled_parent._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/defaulttags.py" in render
315. return nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
70. result = block.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/loader_tags.py" in render
210. return template.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
210. return self._render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/test/utils.py" in instrumented_test_render
94. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/defaulttags.py" in render
510. return self.nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/defaulttags.py" in render
315. return nodelist.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render
994. bit = node.render_annotated(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/base.py" in render_annotated
961. return self.render(context)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/django/template/defaulttags.py" in render
165. values = list(values)
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/suit/menu.py" in __iter__
59. for each in self.get_menu_items():
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/suit/menu.py" in get_menu_items
64. self.menu_items = self.build_menu()
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/suit/menu.py" in build_menu
78. self.map_native_apps()
File "/home/gamesbook/.venvs/myproject/lib/python3.5/site-packages/suit/menu.py" in map_native_apps
116. for native_app in self.available_apps:
Exception Type: TypeError at /admin/samples/analysisbatchrequest/
Exception Value: 'NoneType' object is not iterable
The text was updated successfully, but these errors were encountered:
If this is a bug please specify versions you're using first.
Django version: 1.10.7
Django Suit version: 2.0a1
Python version: 3.5.3
Issue:
I am trying to show the user an intermediate page, containing a form, as part of a new admin action.
I have copied the
base.html
and thebase_site.html
templates from the Django Suit code base into my owntemplates/admin
directory and then my form's template inherits from those.When Django tries to display the page, the log shows the following warning/error:
2017-08-08T06:38:19 [root:36] WARNING - Django Suit was unable to retrieve apps list for menu.
The full stack trace:
The text was updated successfully, but these errors were encountered: