Django for Designers: Difference between revisions

(→‎Part 2: URLs, basic views, templates, static files: Removed, by moving it to a new page)
Then, we'll need to have our file import the bookmark model and send data to the index view.
We'll add an import statement:
<source lang="python">
from django.shortcuts import render
from bookmarks.models import Bookmark
And we'll edit index(request):
<source lang="python">
def index(request):
bookmarks = Bookmark.objects.all()
We also want our tag view to show real bookmarks. We only want to show bookmarks that have been tagged with the given tag. So we can write:
<source lang="python">
Anonymous user