Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- file views.py
- ==============
- @login_required
- def index(request):
- user_active = request.user
- all_todos = Todo.objects.all().filter(user = user_active)
- return render(request, 'main/index.html', {'todos' : all_todos, 'user' : user_active})
- file main/index.html
- ====================
- <h3 class="">
- {{ user.username }}'s Todo List
- {% if user.is_superuser %}
- <a class="btn btn-sm btn-secondary" href="/users/list">
- <i class="bi bi-people"></i>
- </a>
- {% endif %}
- <a class="btn btn-sm btn-danger" href="/accounts/logout">
- <i class="bi bi-box-arrow-right"></i>
- </a>
- </h3>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement