Django For Beginners - Full Tutorial
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when they hit errors, such as blank pages, POST requests arriving as GET, or user-specific to-do lists failing.
Recommended by 0 people across 0 different months, 2021 to 2024.
What it is
A roughly three-hour beginner Django course from Tech With Tim that builds a to-do list website step by step. It covers setup, SQLite models, the admin dashboard, templates, forms, Bootstrap, user registration, login and logout, and user-specific pages.
What people said
Cites JeffD · 2021-11 · Stack Overflow · on “Django httpresponse is using get instead of post”
Thank you for taking the time to help! I've been stuck for hours. I'm learning django by going through this fantastic youtube video: [this video] . I believe I copied the code from the video exactly, and I double and triple checked it. Yet, despite declaring method = "post" in "create".html django consistently uses a get response. WHY?! #urls.py from django.urls import path from . import views urlpatterns = [ path('<int:id>', views.index, name='index'), path("",views.home, name = 'home'), path("create/", views.create, name="create"), ] #views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from .models import ToDoList, Item from .forms import Crea
Cites BurniEye · 2022-07 · Stack Overflow · on “Updating id of models without deleting objects in it in Django”
I am studiying the bases of django by watching courses of "Tech with Tim" [this video] I deleted objects in models and my id always incremented instead of making reset. How can I reset my id? enter image description here [LINK] from typing import Text from django.db import models class ToDoList (models.Model): name = models.CharField(max_length = 200) def __str__(self): return self.name class Item(models.Model): todolist = models.ForeignKey(ToDoList, on_delete = models.CASCADE) text = models.CharField(max_length=300) complete = models.BooleanField() def __str__(self): return self.text
Cites jeez · 2022-10 · Stack Overflow · on “I'm trying to create user specific access to my todolist website with Django”
I'm getting an error after I make migrations in the command line. Please help When I try to create a new todo list I get this error: AttributeError at /create/ 'AnonymousUser' object has no attribute 'todolist' -views.py from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from .models import ToDoList, Item from .forms import CreateNewList # Create your views here. def index(response, id): ls = ToDoList.objects.get(id=id) if ls in response.user.todolist.all(): if response.method == "POST": if response.POST.get("save"): for item in ls.item_set.all(): if response.POST.get("c" + str(item.id)) == "clicked": item.complete = True else: item.complete = Fals
Cites ArnavK · 2022-12 · Stack Overflow · on “Not getting the required interface everytime i search using/admin ,”
I am following a yt tutorial on django( [this video] ) where the tutor searches [LINK] and gets the required interface (It starts around 49:00) everytime i search [LINK] i get a DoesNotExist at /admin but when i search [LINK] i get the required interface A question exactly same as mine has been asked before but the thing is i did not make the same error as that person did this is my views.py from django.shortcuts import render from django.http import HttpResponse from .models import ToDoList,Items def index(response,name): ls=ToDoList.objects.get(name=name) item=ls.items_set.get(id=1) return HttpResponse("<h1>%s</h1><br></br><p>%s</p>"%(ls.name,str(item.text))) # Create your views here. this is m
Cites Deltag0ny · 2023-01 · Stack Overflow · on “Django Base Page is blank”
I'm following this [this video] tutorial to learn Django and I've followed part 4 as in the video, but when I reload my page, it's always blank. I've looked at other posts that were also experiencing a blank page, but they don't address my issue and are very old. Some more info: I'm using Django 4.1.4, all the files are appropriately saved and named like in the video and there are no errors in the terminal This is my views.py: from django.shortcuts import render from django.http import HttpResponse from .models import ToDoList, Item # Create your views here. def index(response, id): ls = ToDoList.objects.get(id=id) return render(response, 'main/base.html', {}) def home(response): return render(re
Cites Duncan · 2024-02 · Stack Overflow · on “Django user_id from django db missing in application models.py”
A few days ago I started this tutorial on Django: [this video] The video is about how to set up your first django project, using some libraries from django, as well as bootstrap to style your website. He goes on about how to setup the database, website and everything else you need for the example of a todolist website and at the end of the video series he goes over setting up Users, as well as user specific todo lists. I tried recreating the process and up to the point of the user specific todo lists it was all very understandable and easy to follow. Yet as I tried implementing pretty much the last step of the implementation i get the following error: OperationalError at /create/ table main_todol