Skip to content

AndrewJBateman/python-django-todos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ Python Django Todo

  • 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

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • User can add todo tasks to a list and then update or delete items
  • Styling done using Bootstrap

📷 Screenshots

screen print

📶 Technologies

💾 Setup

  • 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

💻 Code Examples

  • 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)

🆒 Features

  • Bootstrap styling

📋 Status & To-do list

  • 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.

👏 Inspiration

📁 License

  • N/A

✉️ Contact