Saved searches
Use saved searches to filter your results more quickly
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.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: ‘NoneType’ object has no attribute ‘startswith’ #146
AttributeError: ‘NoneType’ object has no attribute ‘startswith’ #146
Comments
Install bakery demo, create new page of type standard page and see above error:-
[01/May/2017 09:45:23] "GET /admin/pages/preview/ HTTP/1.1" 200 487 [01/May/2017 09:45:23] "GET /admin/pages/preview_loading/ HTTP/1.1" 200 54 Internal Server Error: /admin/pages/26/edit/preview/ Traceback (most recent call last): File "/home/dave/Env/ve/lib/python3.5/site-packages/django/core/handlers/exception.py", line 42, in inner response = get_response(request) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/core/handlers/base.py", line 217, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/core/handlers/base.py", line 215, in _get_response response = response.render() File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/response.py", line 109, in render self.content = self.rendered_content File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/response.py", line 86, in rendered_content content = template.render(context, self._request) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 208, in render return self._render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/loader_tags.py", line 174, in render return compiled_parent._render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/loader_tags.py", line 70, in render result = block.nodelist.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/ve/lib/python3.5/site-packages/django/template/library.py", line 225, in render _dict = self.func(*resolved_args, **resolved_kwargs) File "/home/dave/wagtaildemo/demo/templatetags/demo_tags.py", line 39, in top_menu if calling_page else False) AttributeError: 'NoneType' object has no attribute 'startswith' [01/May/2017 09:45:23] "POST /admin/pages/26/edit/preview/ HTTP/1.1" 500 23634
The text was updated successfully, but these errors were encountered:
Tried a fresh install virtualenv using python 2.7 rather than python 3.5, same error
(demo) dave@crowthorne:~/wagtaildemo$ pip install -r requirements.txt Collecting Django=1.10 (from -r requirements.txt (line 1)) Using cached Django-1.10.7-py2.py3-none-any.whl Collecting psycopg2==2.6 (from -r requirements.txt (line 2)) Collecting django-compressor>=1.4 (from -r requirements.txt (line 3)) Using cached django_compressor-2.1.1-py2.py3-none-any.whl Collecting django-modelcluster>=0.6 (from -r requirements.txt (line 4)) Collecting wagtail=1.9 (from -r requirements.txt (line 5)) Using cached wagtail-1.9.1-py2.py3-none-any.whl Collecting django-taggit>=0.14.0 (from -r requirements.txt (line 6)) Using cached django_taggit-0.22.1-py2.py3-none-any.whl Collecting django-libsass>=0.2 (from -r requirements.txt (line 7)) Collecting libsass==0.8.2 (from -r requirements.txt (line 8)) Collecting Pillow==3.2.0 (from -r requirements.txt (line 9)) Collecting html5lib==0.999999 (from -r requirements.txt (line 10)) Collecting django-redis==3.8.2 (from -r requirements.txt (line 13)) Collecting elasticsearch==1.2.0 (from -r requirements.txt (line 14)) Using cached elasticsearch-1.2.0-py2.py3-none-any.whl Collecting dj-database-url==0.3.0 (from -r requirements.txt (line 17)) Using cached dj_database_url-0.3.0-py2.py3-none-any.whl Collecting whitenoise=3.1 (from -r requirements.txt (line 18)) Using cached whitenoise-3.3.0-py2.py3-none-any.whl Collecting uwsgi=2.0 (from -r requirements.txt (line 19)) Collecting django-appconf>=1.0 (from django-compressor>=1.4->-r requirements.txt (line 3)) Using cached django_appconf-1.0.2-py2.py3-none-any.whl Collecting rjsmin==1.0.12 (from django-compressor>=1.4->-r requirements.txt (line 3)) Collecting rcssmin==1.0.6 (from django-compressor>=1.4->-r requirements.txt (line 3)) Collecting pytz>=2015.2 (from django-modelcluster>=0.6->-r requirements.txt (line 4)) Using cached pytz-2017.2-py2.py3-none-any.whl Collecting Unidecode>=0.04.14 (from wagtail=1.9->-r requirements.txt (line 5)) Using cached Unidecode-0.04.20-py2.py3-none-any.whl Collecting djangorestframework>=3.1.3 (from wagtail=1.9->-r requirements.txt (line 5)) Using cached djangorestframework-3.6.2-py2.py3-none-any.whl Collecting django-treebeard=3.0 (from wagtail=1.9->-r requirements.txt (line 5)) Collecting requests=2.11.1 (from wagtail=1.9->-r requirements.txt (line 5)) Using cached requests-2.13.0-py2.py3-none-any.whl Collecting beautifulsoup4>=4.5.1 (from wagtail=1.9->-r requirements.txt (line 5)) Downloading beautifulsoup4-4.5.3-py2-none-any.whl (85kB) 100% |████████████████████████████████| 92kB 3.8MB/s Collecting Willow=0.4 (from wagtail=1.9->-r requirements.txt (line 5)) Using cached Willow-0.4-py2.py3-none-any.whl Requirement already satisfied: six in /home/dave/Env/demo/lib/python2.7/site-packages (from libsass==0.8.2->-r requirements.txt (line 8)) Collecting redis>=2.10.0 (from django-redis==3.8.2->-r requirements.txt (line 13)) Using cached redis-2.10.5-py2.py3-none-any.whl Collecting urllib3=1.8 (from elasticsearch==1.2.0->-r requirements.txt (line 14)) Using cached urllib3-1.21-py2.py3-none-any.whl Installing collected packages: Django, psycopg2, django-appconf, rjsmin, rcssmin, django-compressor, pytz, django-modelcluster, Unidecode, djangorestframework, django-treebeard, Pillow, requests, beautifulsoup4, Willow, html5lib, django-taggit, wagtail, libsass, django-libsass, redis, django-redis, urllib3, elasticsearch, dj-database-url, whitenoise, uwsgi Successfully installed Django-1.10.7 Pillow-3.2.0 Unidecode-0.4.20 Willow-0.4 beautifulsoup4-4.5.3 dj-database-url-0.3.0 django-appconf-1.0.2 django-compressor-2.1.1 django-libsass-0.7 django-modelcluster-3.1 django-redis-3.8.2 django-taggit-0.22.1 django-treebeard-4.1.0 djangorestframework-3.6.2 elasticsearch-1.2.0 html5lib-0.999999 libsass-0.8.2 psycopg2-2.6 pytz-2017.2 rcssmin-1.0.6 redis-2.10.5 requests-2.13.0 rjsmin-1.0.12 urllib3-1.21 uwsgi-2.0.15 wagtail-1.9.1 whitenoise-3.3.0 (demo) dave@crowthorne:~/wagtaildemo$ python manage.py runserver localhost:8001 Performing system checks. System check identified no issues (0 silenced). May 01, 2017 - 09:52:20 Django version 1.10.7, using settings 'wagtaildemo.settings' Starting development server at http://localhost:8001/ Quit the server with CONTROL-C. [01/May/2017 09:52:27] "GET /admin/ HTTP/1.1" 200 13117 [01/May/2017 09:52:31] "GET /admin/pages/25/edit/ HTTP/1.1" 200 77485 [01/May/2017 09:52:34] "GET /admin/pages/preview/ HTTP/1.1" 200 487 [01/May/2017 09:52:34] "GET /admin/pages/preview_loading/ HTTP/1.1" 200 54 [01/May/2017 09:52:38] "GET /admin/pages/preview/ HTTP/1.1" 200 487 [01/May/2017 09:52:39] "GET /admin/pages/preview_loading/ HTTP/1.1" 200 54 Internal Server Error: /admin/pages/25/edit/preview/ Traceback (most recent call last): File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/core/handlers/exception.py", line 42, in inner response = get_response(request) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response response = self._get_response(request) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 217, in _get_response response = self.process_exception_by_middleware(e, request) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 215, in _get_response response = response.render() File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/response.py", line 109, in render self.content = self.rendered_content File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/response.py", line 86, in rendered_content content = template.render(context, self._request) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/backends/django.py", line 66, in render return self.template.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 208, in render return self._render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 174, in render return compiled_parent._render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 199, in _render return self.nodelist.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/loader_tags.py", line 70, in render result = block.nodelist.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 994, in render bit = node.render_annotated(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/base.py", line 961, in render_annotated return self.render(context) File "/home/dave/Env/demo/local/lib/python2.7/site-packages/django/template/library.py", line 225, in render _dict = self.func(*resolved_args, **resolved_kwargs) File "/home/dave/wagtaildemo/demo/templatetags/demo_tags.py", line 39, in top_menu if calling_page else False) AttributeError: 'NoneType' object has no attribute 'startswith' [01/May/2017 09:52:39] "POST /admin/pages/25/edit/preview/ HTTP/1.1" 500 24659
Did you create a fresh virtualenv for this bakerydemo instance? Based on the output, it looks like you have artifacts from the old wagtaildemo. That file does not exist in the new repo.
The ‘demo’ virtualenv above was created new, and populated as shown above.
Right. Inspecting the output you posted, it looks as though you cloned the other wagtail demo repo, built it, and reported an error for it in this repo.
For instance, your output from pip install -r requirements.text lists libraries that do not exist in the requirements file in this repo.
You are right, I have confused the bakery demo with the orig wagtail demo. Will close this issue here.