├── Procfile
├── db.sqlite3
├── manage.py
├── requirements.txt
├── runtime.txt
├── templates
└── index.html
├── todo
├── __init__.py
├── __pycache__
│ ├── __init__.cpython-310.pyc
│ ├── admin.cpython-310.pyc
│ ├── apps.cpython-310.pyc
│ ├── models.cpython-310.pyc
│ ├── urls.cpython-310.pyc
│ └── views.cpython-310.pyc
├── admin.py
├── apps.py
├── migrations
│ ├── 0001_initial.py
│ ├── __init__.py
│ └── __pycache__
│ │ ├── 0001_initial.cpython-310.pyc
│ │ └── __init__.cpython-310.pyc
├── models.py
├── tests.py
├── urls.py
└── views.py
└── todolist
├── __init__.py
├── __pycache__
├── __init__.cpython-310.pyc
├── settings.cpython-310.pyc
├── urls.cpython-310.pyc
└── wsgi.cpython-310.pyc
├── asgi.py
├── settings.py
├── urls.py
└── wsgi.py
/Procfile:
--------------------------------------------------------------------------------
1 | web: gunicorn todolist.wsgi:application --log-file -
--------------------------------------------------------------------------------
/db.sqlite3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/db.sqlite3
--------------------------------------------------------------------------------
/manage.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 | """Django's command-line utility for administrative tasks."""
3 | import os
4 | import sys
5 |
6 |
7 | def main():
8 | """Run administrative tasks."""
9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todolist.settings')
10 | try:
11 | from django.core.management import execute_from_command_line
12 | except ImportError as exc:
13 | raise ImportError(
14 | "Couldn't import Django. Are you sure it's installed and "
15 | "available on your PYTHONPATH environment variable? Did you "
16 | "forget to activate a virtual environment?"
17 | ) from exc
18 | execute_from_command_line(sys.argv)
19 |
20 |
21 | if __name__ == '__main__':
22 | main()
23 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/requirements.txt
--------------------------------------------------------------------------------
/runtime.txt:
--------------------------------------------------------------------------------
1 | python-3.10.1
--------------------------------------------------------------------------------
/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Django To Do List App
5 |
6 |
128 |
129 |
130 |
131 |
139 |
140 |
141 | {% for todo in todos reversed %}
142 | - {{todo.title | title}} Delete
143 | {% endfor %}
144 |
145 |
146 |
147 |
--------------------------------------------------------------------------------
/todo/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__init__.py
--------------------------------------------------------------------------------
/todo/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/__pycache__/admin.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/admin.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/__pycache__/apps.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/apps.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/__pycache__/models.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/models.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/__pycache__/urls.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/urls.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/__pycache__/views.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/__pycache__/views.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/admin.py:
--------------------------------------------------------------------------------
1 | from django.contrib import admin
2 | from .models import Todo
3 | # Register your models here.
4 |
5 | admin.site.register(Todo)
--------------------------------------------------------------------------------
/todo/apps.py:
--------------------------------------------------------------------------------
1 | from django.apps import AppConfig
2 |
3 |
4 | class TodoConfig(AppConfig):
5 | default_auto_field = 'django.db.models.BigAutoField'
6 | name = 'todo'
7 |
--------------------------------------------------------------------------------
/todo/migrations/0001_initial.py:
--------------------------------------------------------------------------------
1 | # Generated by Django 4.0.5 on 2022-06-12 06:22
2 |
3 | from django.db import migrations, models
4 |
5 |
6 | class Migration(migrations.Migration):
7 |
8 | initial = True
9 |
10 | dependencies = [
11 | ]
12 |
13 | operations = [
14 | migrations.CreateModel(
15 | name='Todo',
16 | fields=[
17 | ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18 | ('title', models.CharField(max_length=10000)),
19 | ],
20 | ),
21 | ]
22 |
--------------------------------------------------------------------------------
/todo/migrations/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/migrations/__init__.py
--------------------------------------------------------------------------------
/todo/migrations/__pycache__/0001_initial.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/migrations/__pycache__/0001_initial.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/migrations/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todo/migrations/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/todo/models.py:
--------------------------------------------------------------------------------
1 | from django.db import models
2 |
3 | # Create your models here.
4 | class Todo(models.Model):
5 | title = models.CharField(max_length=10000)
6 |
7 | def __str__(self):
8 | return self.title
--------------------------------------------------------------------------------
/todo/tests.py:
--------------------------------------------------------------------------------
1 | from django.test import TestCase
2 |
3 | # Create your tests here.
4 |
--------------------------------------------------------------------------------
/todo/urls.py:
--------------------------------------------------------------------------------
1 | from django.urls import path
2 | from . import views
3 |
4 | urlpatterns = [
5 | path('',views.index,name= 'index'),
6 | path('delete/',views.delete, name='delete'),
7 | ]
--------------------------------------------------------------------------------
/todo/views.py:
--------------------------------------------------------------------------------
1 | from django.shortcuts import redirect, render
2 | from .models import Todo
3 | # Create your views here.
4 | def index(request):
5 | todo = Todo.objects.all()
6 | if request.method == 'POST':
7 | new_todo = Todo(
8 | title = request.POST['title']
9 | )
10 | new_todo.save()
11 | return redirect('/')
12 | return render(request,'index.html',{'todos':todo})
13 |
14 | def delete(request,pk):
15 | todo = Todo.objects.get(id=pk)
16 | todo.delete()
17 | return redirect('/')
--------------------------------------------------------------------------------
/todolist/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todolist/__init__.py
--------------------------------------------------------------------------------
/todolist/__pycache__/__init__.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todolist/__pycache__/__init__.cpython-310.pyc
--------------------------------------------------------------------------------
/todolist/__pycache__/settings.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todolist/__pycache__/settings.cpython-310.pyc
--------------------------------------------------------------------------------
/todolist/__pycache__/urls.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todolist/__pycache__/urls.cpython-310.pyc
--------------------------------------------------------------------------------
/todolist/__pycache__/wsgi.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/backendbuilderdev/Django-To-Do-List/19f5700cca2943a2e2fef7de184db2901a1b530f/todolist/__pycache__/wsgi.cpython-310.pyc
--------------------------------------------------------------------------------
/todolist/asgi.py:
--------------------------------------------------------------------------------
1 | """
2 | ASGI config for todolist project.
3 |
4 | It exposes the ASGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.asgi import get_asgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todolist.settings')
15 |
16 | application = get_asgi_application()
17 |
--------------------------------------------------------------------------------
/todolist/settings.py:
--------------------------------------------------------------------------------
1 | """
2 | Django settings for todolist project.
3 |
4 | Generated by 'django-admin startproject' using Django 3.2.5.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/topics/settings/
8 |
9 | For the full list of settings and their values, see
10 | https://docs.djangoproject.com/en/3.2/ref/settings/
11 | """
12 |
13 | from pathlib import Path
14 | import django_heroku
15 | import dj_database_url
16 |
17 | # Build paths inside the project like this: BASE_DIR / 'subdir'.
18 | BASE_DIR = Path(__file__).resolve().parent.parent
19 |
20 |
21 | # Quick-start development settings - unsuitable for production
22 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
23 |
24 | # SECURITY WARNING: keep the secret key used in production secret!
25 | SECRET_KEY = 'django-insecure-lkn)5z!i2j143@=x)(55gbczsvp@vicd@=(!8$h*u4rg4!or!e'
26 |
27 | # SECURITY WARNING: don't run with debug turned on in production!
28 | DEBUG = True
29 |
30 | ALLOWED_HOSTS = ['*']
31 |
32 |
33 | # Application definition
34 |
35 | INSTALLED_APPS = [
36 | 'django.contrib.admin',
37 | 'django.contrib.auth',
38 | 'django.contrib.contenttypes',
39 | 'django.contrib.sessions',
40 | 'django.contrib.messages',
41 | 'django.contrib.staticfiles',
42 | 'todo'
43 | ]
44 |
45 | MIDDLEWARE = [
46 | 'django.middleware.security.SecurityMiddleware',
47 | 'django.contrib.sessions.middleware.SessionMiddleware',
48 | 'django.middleware.common.CommonMiddleware',
49 | 'django.middleware.csrf.CsrfViewMiddleware',
50 | 'django.contrib.auth.middleware.AuthenticationMiddleware',
51 | 'django.contrib.messages.middleware.MessageMiddleware',
52 | 'django.middleware.clickjacking.XFrameOptionsMiddleware',
53 | ]
54 |
55 | ROOT_URLCONF = 'todolist.urls'
56 |
57 | TEMPLATES = [
58 | {
59 | 'BACKEND': 'django.template.backends.django.DjangoTemplates',
60 | 'DIRS': [BASE_DIR/'templates'],
61 | 'APP_DIRS': True,
62 | 'OPTIONS': {
63 | 'context_processors': [
64 | 'django.template.context_processors.debug',
65 | 'django.template.context_processors.request',
66 | 'django.contrib.auth.context_processors.auth',
67 | 'django.contrib.messages.context_processors.messages',
68 | ],
69 | },
70 | },
71 | ]
72 |
73 | WSGI_APPLICATION = 'todolist.wsgi.application'
74 |
75 |
76 | # Database
77 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases
78 |
79 | DATABASES = {
80 | 'default': dj_database_url.config()
81 | }
82 |
83 |
84 | # Password validation
85 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators
86 |
87 | AUTH_PASSWORD_VALIDATORS = [
88 | {
89 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90 | },
91 | {
92 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93 | },
94 | {
95 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96 | },
97 | {
98 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99 | },
100 | ]
101 |
102 |
103 | # Internationalization
104 | # https://docs.djangoproject.com/en/3.2/topics/i18n/
105 |
106 | LANGUAGE_CODE = 'en-us'
107 |
108 | TIME_ZONE = 'UTC'
109 |
110 | USE_I18N = True
111 |
112 | USE_L10N = True
113 |
114 | USE_TZ = True
115 |
116 |
117 | # Static files (CSS, JavaScript, Images)
118 | # https://docs.djangoproject.com/en/3.2/howto/static-files/
119 |
120 | STATIC_URL = '/static/'
121 | django_heroku.settings(locals())
122 |
123 | # Default primary key field type
124 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
125 |
126 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
127 |
--------------------------------------------------------------------------------
/todolist/urls.py:
--------------------------------------------------------------------------------
1 | """todolist URL Configuration
2 |
3 | The `urlpatterns` list routes URLs to views. For more information please see:
4 | https://docs.djangoproject.com/en/3.2/topics/http/urls/
5 | Examples:
6 | Function views
7 | 1. Add an import: from my_app import views
8 | 2. Add a URL to urlpatterns: path('', views.home, name='home')
9 | Class-based views
10 | 1. Add an import: from other_app.views import Home
11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12 | Including another URLconf
13 | 1. Import the include() function: from django.urls import include, path
14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15 | """
16 | from django.contrib import admin
17 | from django.urls import path,include
18 |
19 | urlpatterns = [
20 | path('admin/', admin.site.urls),
21 | path('',include('todo.urls')),
22 | ]
23 |
--------------------------------------------------------------------------------
/todolist/wsgi.py:
--------------------------------------------------------------------------------
1 | """
2 | WSGI config for todolist project.
3 |
4 | It exposes the WSGI callable as a module-level variable named ``application``.
5 |
6 | For more information on this file, see
7 | https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
8 | """
9 |
10 | import os
11 |
12 | from django.core.wsgi import get_wsgi_application
13 |
14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todolist.settings')
15 |
16 | application = get_wsgi_application()
17 |
--------------------------------------------------------------------------------