- Python-Django CRUD (Create, Read, Update & Delete) app to manage todo tasks
- Code from a tutorial by Dennis Ivy - see 👏 Inspiration below
- Note: to open web links in a new window use: ctrl+click on link
- User can add todo tasks to a list and then update or delete items
- Styling done using Bootstrap
- Python v3 programming language
- Django v3 server-side web framework
- Bootstrap v4
- Install Python
- Install pip
- Install Django by typing
pip install Django
- Run
django-admin startproject example_proj
to create a new project ref. docs - Open
example_proj
in VS Code - Run
python manage.py startapp new_module
to create Python module - Add code
- Run
pip freeze
to see list of modules installed. Ref. Docs - Run
python manage.py makemigrations
for changes to models etc. - Run
python manage.py migrate
to migrate the migration files. - For Admin panel: to add a superuser Run
python manage.py createsuperuser --username=joe [email protected]
Ref. Docs - Run
python manage.py runserver
to run server on port 8000 and open /admin console
- extract from
tasks/views.py
: task update method
def updateTask(request, pk):
task = Task.objects.get(id=pk)
form = TaskForm(instance=task)
if request.method == 'POST':
form = TaskForm(request.POST, instance=task)
if form.is_valid():
form.save()
return redirect('/')
context = {'form':form}
return render(request, 'tasks/update_task.html', context)
- Bootstrap styling
- Status: Working
- To-do: Work out how to add Bootstrap to each template page but only import once. Add styling to delete and update pages. Add backend database.
- N/A
- Repo created by ABateman, email: [email protected]