Everything was working perfectly uptil the admin part,I was able to log in as admin , but when I tried to put that view in the regular template, I was getting the following error:
OperationalError at /
no such table: collection_smartphone
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.8.3
Exception Type: OperationalError
Exception Value:
no such table: collection_smartphone
Exception Location: /usr/local/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py in execute, line 318
Python Executable: /usr/bin/python
Python Version: 2.7.6
Python Path:
['/home/vatsal/projects/hellowebapp/hellowebapp',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gst-0.10',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
Server time: Fri, 17 Jul 2015 13:57:04 +0000
Error during template rendering
In template /home/vatsal/projects/hellowebapp/hellowebapp/collection/templates/index.html, error at line 4
Invalid block tag: 'endfor', expected 'endblock'
1 {% extends 'layouts/base.html' %}
2 {% block title %}Homepage - {{ block.super }}{% endblock %}
3 {% block content %}
4 {% for thing in things}
5 <h2>{{ thing.name }}</h2>
6 <p>{{ thing.description }}</p>
7
{% endfor %}
8
9 {% endblock %}
10
This is my index.html file:
{% extends 'layouts/base.html' %}
{% block title %}Homepage - {{ block.super }}{% endblock %}
{% block content %}
{% for thing in things}
<h2>{{ thing.name }}</h2>
<p>{{ thing.description }}</p>
{% endfor %}
{% endblock %}
Why does it say no such table collection_smartphone? Where should I add it?