Closed jonasli closed 7 years ago
As a really quick fix if you want to enjoy the library, replace active
like so:
@register.simple_tag
def active(request, url):
return ''
This is not a fix but you should be able to enjoy the tutorial... I'll have a closer look later.
thank you @adrienbrunet , the workaround works, I can play with it now ...
Can't reproduce for now. Closing it... Feel free to reopen it if you encounter this bug again and have more information on how to reproduce it.
With django 1.10, we can witness this behaviour. I'm on it...
See PR #276
I'm running the examples in this shipped project, following the guide in http://django-angular.readthedocs.io/en/latest/demos.html
but I got below exception ::
Environment:
Request Method: GET Request URL: http://localhost:8000/classic_form/
Django Version: 1.10.1 Python Version: 2.7.12 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.staticfiles', 'djng', 'server') Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware')
Template error: In template /home/jonas/git-repos/django-angular/examples/server/templates/subscribe-form.html, error at line 0 'str' object has no attribute 'path' 1 : {% extends "base.html" %} 2 : {% load static tutorial_tags %} 3 : 4 : {% block container %} 5 :
{% block form_title %}Django's Form Submission{% endblock %}
6 :{% block form_header %}Classic Form Submission in an AngularJS context{% endblock %}
9 :Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/exception.py" in inner
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _legacy_get_response
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in _get_response
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/response.py" in rendered_content
File "/usr/local/lib/python2.7/dist-packages/django/template/backends/django.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render_annotated
File "/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in _render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render
File "/usr/local/lib/python2.7/dist-packages/django/template/base.py" in render_annotated
File "/usr/local/lib/python2.7/dist-packages/django/template/library.py" in render
File "/home/jonas/git-repos/django-angular/examples/server/templatetags/tutorial_tags.py" in active
Exception Type: AttributeError at /classic_form/ Exception Value: 'str' object has no attribute 'path'
I checked the code , looks it's caused by below code in the turorial_tags.py file, do you happen to know how can I fix it ? Thank you so much
@register.simple_tag def active(request, url): if request.path.startswith(reverse(url)): return 'active' return ''