I cannot understand why my django app does not understand template tags. I get this error:
Invalid block tag: 'csrf_tokan', expected 'endblock'
urls.py:
urlpatterns = patterns('',
url(r'^index/', 'myproj.views.index'),
url(r'^admin/', include(admin.site.urls)),
)
views.py:
@staff_member_required
def index(request):
return render(request, 'index.html', locals())
index.html:
{% extends "admin/base.html" %}
{% block content %}
{% csrf_tokan %}
{% endblock %}
Any ideas?
You need to do:
{% extends "admin/base.html" %}
{% block content %}
{% csrf_token %}
{% endblock %}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With