├── .gitignore ├── Django To Do List App.jpg ├── Pipfile ├── Pipfile.lock ├── README.md ├── base ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── admin.cpython-38.pyc │ ├── apps.cpython-38.pyc │ ├── models.cpython-38.pyc │ ├── urls.cpython-38.pyc │ └── views.cpython-38.pyc ├── admin.py ├── apps.py ├── forms.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_auto_20210322_2234.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-38.pyc │ │ └── __init__.cpython-38.pyc ├── models.py ├── templates │ └── base │ │ ├── login.html │ │ ├── main.html │ │ ├── register.html │ │ ├── task.html │ │ ├── task_confirm_delete.html │ │ ├── task_form.html │ │ └── task_list.html ├── tests.py ├── urls.py └── views.py ├── db.sqlite3 ├── manage.py └── todo_list ├── __init__.py ├── __pycache__ ├── __init__.cpython-38.pyc ├── settings.cpython-38.pyc ├── urls.cpython-38.pyc └── wsgi.cpython-38.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py /.gitignore: -------------------------------------------------------------------------------- 1 | ### Django ### 2 | *.log 3 | *.pot 4 | *.pyc 5 | __pycache__/ 6 | local_settings.py 7 | 8 | media 9 | 10 | # If your build process includes running collectstatic, then you probably don't need or want to include staticfiles/ 11 | # in your Git repository. Update and uncomment the following line accordingly. 12 | # /staticfiles/ 13 | 14 | ### Django.Python Stack ### 15 | # Byte-compiled / optimized / DLL files 16 | *.py[cod] 17 | *$py.class 18 | 19 | # C extensions 20 | *.so 21 | 22 | # Distribution / packaging 23 | .Python 24 | build/ 25 | develop-eggs/ 26 | dist/ 27 | downloads/ 28 | eggs/ 29 | .eggs/ 30 | parts/ 31 | sdist/ 32 | var/ 33 | wheels/ 34 | pip-wheel-metadata/ 35 | share/python-wheels/ 36 | *.egg-info/ 37 | .installed.cfg 38 | *.egg 39 | MANIFEST 40 | 41 | # PyInstaller 42 | # Usually these files are written by a python script from a template 43 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 44 | *.manifest 45 | *.spec 46 | 47 | # Installer logs 48 | pip-log.txt 49 | pip-delete-this-directory.txt 50 | 51 | # Unit test / coverage reports 52 | htmlcov/ 53 | .tox/ 54 | .nox/ 55 | .coverage 56 | .coverage.* 57 | .cache 58 | nosetests.xml 59 | coverage.xml 60 | *.cover 61 | *.py,cover 62 | .hypothesis/ 63 | .pytest_cache/ 64 | pytestdebug.log 65 | 66 | # Translations 67 | *.mo 68 | 69 | # Django stuff: 70 | 71 | # Flask stuff: 72 | instance/ 73 | .webassets-cache 74 | 75 | # Scrapy stuff: 76 | .scrapy 77 | 78 | # Sphinx documentation 79 | docs/_build/ 80 | doc/_build/ 81 | 82 | # PyBuilder 83 | target/ 84 | 85 | # Jupyter Notebook 86 | .ipynb_checkpoints 87 | 88 | # IPython 89 | profile_default/ 90 | ipython_config.py 91 | 92 | # pyenv 93 | .python-version 94 | 95 | # pipenv 96 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 97 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 98 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 99 | # install all needed dependencies. 100 | #Pipfile.lock 101 | 102 | # poetry 103 | #poetry.lock 104 | 105 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 106 | __pypackages__/ 107 | 108 | # Celery stuff 109 | celerybeat-schedule 110 | celerybeat.pid 111 | 112 | # SageMath parsed files 113 | *.sage.py 114 | 115 | # Environments 116 | # .env 117 | .env/ 118 | .venv/ 119 | env/ 120 | venv/ 121 | ENV/ 122 | env.bak/ 123 | venv.bak/ 124 | pythonenv* 125 | 126 | # Spyder project settings 127 | .spyderproject 128 | .spyproject 129 | 130 | # Rope project settings 131 | .ropeproject 132 | 133 | # mkdocs documentation 134 | /site 135 | 136 | # mypy 137 | .mypy_cache/ 138 | .dmypy.json 139 | dmypy.json 140 | 141 | # Pyre type checker 142 | .pyre/ 143 | 144 | # pytype static type analyzer 145 | .pytype/ 146 | 147 | # operating system-related files 148 | *.DS_Store #file properties cache/storage on macOS 149 | Thumbs.db #thumbnail cache on Windows 150 | 151 | # profiling data 152 | .prof 153 | -------------------------------------------------------------------------------- /Django To Do List App.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/Django To Do List App.jpg -------------------------------------------------------------------------------- /Pipfile: -------------------------------------------------------------------------------- 1 | [[source]] 2 | name = "pypi" 3 | url = "https://pypi.org/simple" 4 | verify_ssl = true 5 | 6 | [dev-packages] 7 | 8 | [packages] 9 | django = "*" 10 | 11 | [requires] 12 | python_version = "3.8" 13 | -------------------------------------------------------------------------------- /Pipfile.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_meta": { 3 | "hash": { 4 | "sha256": "99c4b9ec1b8891ff787677276760beb6d6d4919c55660da1c713682156a6086c" 5 | }, 6 | "pipfile-spec": 6, 7 | "requires": { 8 | "python_version": "3.8" 9 | }, 10 | "sources": [ 11 | { 12 | "name": "pypi", 13 | "url": "https://pypi.org/simple", 14 | "verify_ssl": true 15 | } 16 | ] 17 | }, 18 | "default": { 19 | "asgiref": { 20 | "hashes": [ 21 | "sha256:5ee950735509d04eb673bd7f7120f8fa1c9e2df495394992c73234d526907e17", 22 | "sha256:7162a3cb30ab0609f1a4c95938fd73e8604f63bdba516a7f7d64b83ff09478f0" 23 | ], 24 | "markers": "python_version >= '3.5'", 25 | "version": "==3.3.1" 26 | }, 27 | "django": { 28 | "hashes": [ 29 | "sha256:32ce792ee9b6a0cbbec340123e229ac9f765dff8c2a4ae9247a14b2ba3a365a7", 30 | "sha256:baf099db36ad31f970775d0be5587cc58a6256a6771a44eb795b554d45f211b8" 31 | ], 32 | "index": "pypi", 33 | "version": "==3.1.7" 34 | }, 35 | "pytz": { 36 | "hashes": [ 37 | "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da", 38 | "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798" 39 | ], 40 | "version": "==2021.1" 41 | }, 42 | "sqlparse": { 43 | "hashes": [ 44 | "sha256:017cde379adbd6a1f15a61873f43e8274179378e95ef3fede90b5aa64d304ed0", 45 | "sha256:0f91fd2e829c44362cbcfab3e9ae12e22badaa8a29ad5ff599f9ec109f0454e8" 46 | ], 47 | "markers": "python_version >= '3.5'", 48 | "version": "==0.4.1" 49 | } 50 | }, 51 | "develop": {} 52 | } 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Django-To-Do-list-with-user-authentication 2 | To Do list app with User Registration, Login, Search and full Create Read Update and DELETE functionality. 3 | 4 | ![DEMO](../master/Django%20To%20Do%20List%20App.jpg) 5 | -------------------------------------------------------------------------------- /base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__init__.py -------------------------------------------------------------------------------- /base/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/__pycache__/views.cpython-38.pyc -------------------------------------------------------------------------------- /base/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import Task 3 | 4 | admin.site.register(Task) 5 | -------------------------------------------------------------------------------- /base/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BaseConfig(AppConfig): 5 | name = 'base' 6 | -------------------------------------------------------------------------------- /base/forms.py: -------------------------------------------------------------------------------- 1 | from django import forms 2 | 3 | # Reordering Form and View 4 | 5 | 6 | class PositionForm(forms.Form): 7 | position = forms.CharField() 8 | -------------------------------------------------------------------------------- /base/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-22 16:37 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Task', 19 | fields=[ 20 | ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 21 | ('title', models.CharField(max_length=200)), 22 | ('description', models.TextField(blank=True, null=True)), 23 | ('complete', models.BooleanField(default=False)), 24 | ('created', models.DateTimeField(auto_now_add=True)), 25 | ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 26 | ], 27 | options={ 28 | 'ordering': ['-complete'], 29 | }, 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /base/migrations/0002_auto_20210322_2234.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-22 17:04 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterModelOptions( 14 | name='task', 15 | options={}, 16 | ), 17 | migrations.AlterOrderWithRespectTo( 18 | name='task', 19 | order_with_respect_to='user', 20 | ), 21 | ] 22 | -------------------------------------------------------------------------------- /base/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/migrations/__init__.py -------------------------------------------------------------------------------- /base/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/base/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /base/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | # Create your models here. 4 | 5 | 6 | class Task(models.Model): 7 | user = models.ForeignKey( 8 | User, on_delete=models.CASCADE, null=True, blank=True) 9 | title = models.CharField(max_length=200) 10 | description = models.TextField(null=True, blank=True) 11 | complete = models.BooleanField(default=False) 12 | created = models.DateTimeField(auto_now_add=True) 13 | 14 | def __str__(self): 15 | return self.title 16 | 17 | class Meta: 18 | order_with_respect_to = 'user' 19 | -------------------------------------------------------------------------------- /base/templates/base/login.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/main.html' %} 2 | {% block content %} 3 | 4 |
5 |

Login

6 |
7 | 8 |
9 |
10 | {% csrf_token %} 11 | {{form.as_p}} 12 | 13 |
14 |

Don't have an account? Register

15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 | {% endblock content %} -------------------------------------------------------------------------------- /base/templates/base/main.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | To Do Items 11 | 12 | 13 | 14 | 15 | 16 | 17 | 199 | 200 | 201 | 202 | 203 |
204 | {% block content %} {% endblock content %} 205 |
206 | 207 | 208 | 209 | 210 | -------------------------------------------------------------------------------- /base/templates/base/register.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/main.html' %} 2 | {% block content %} 3 | 4 |
5 |

Register

6 |
7 | 8 |
9 |
10 | {% csrf_token %} 11 | 12 | {{form.username}} 13 | 14 | 15 | {{form.password1}} 16 | 17 | 18 | {{form.password2}} 19 | 20 |
21 |

Already have an account? Login

22 |
23 | 24 | 25 | 26 | 27 | {% endblock content %} -------------------------------------------------------------------------------- /base/templates/base/task.html: -------------------------------------------------------------------------------- 1 |

Task: {{task}}

-------------------------------------------------------------------------------- /base/templates/base/task_confirm_delete.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/main.html' %} 2 | {% block content %} 3 | 4 |
5 | ← Go Back 6 |
7 | 8 |
9 |
10 | {% csrf_token %} 11 |

Are your sure you want to delete this task? "{{task}}"

12 | 13 |
14 |
15 | 16 | 17 | 18 | {% endblock content %} -------------------------------------------------------------------------------- /base/templates/base/task_form.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/main.html' %} 2 | {% block content %} 3 | 4 |
5 | ← Back 6 |
7 | 8 | 9 |
10 |
11 | {% csrf_token %} 12 | {{form.as_p}} 13 | 14 |
15 |
16 | 17 | 18 | {% endblock content %} -------------------------------------------------------------------------------- /base/templates/base/task_list.html: -------------------------------------------------------------------------------- 1 | {% extends 'base/main.html' %} {% block content %} 2 | 3 | 4 |
5 |
6 |

Hello {{request.user|title}}

7 |

You have {{count}} incomplete task{{ count|pluralize:"s" }}

8 |
9 | 10 | {% if request.user.is_authenticated %} 11 | Logout {% else %} 12 | Login {% endif %} 13 |
14 | 15 | 16 |
17 |
18 | 19 | 20 |
21 | {% if tasks|length > 0 %} 22 | + 23 | {% endif %} 24 |
25 | 26 | 27 | 28 | 32 | 33 | 34 |
35 | {% for task in tasks %} 36 |
37 |
38 | {% if task.complete %} 39 |
40 | {{task}} {% else %} 41 |
42 | {{task}} {% endif %} 43 |
44 |
45 | × 46 |  ⠇ 47 |
48 |
49 | 50 | {% empty %} 51 |
52 |

No new tasks are created.

53 |

Create a New task !

54 |
55 | {% endfor %} 56 |
57 | 58 | 83 | 84 | {% endblock content %} -------------------------------------------------------------------------------- /base/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /base/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from .views import TaskList, TaskDetail, TaskCreate, TaskUpdate, DeleteView, CustomLoginView, RegisterPage, TaskReorder 3 | from django.contrib.auth.views import LogoutView 4 | 5 | urlpatterns = [ 6 | path('login/', CustomLoginView.as_view(), name='login'), 7 | path('logout/', LogoutView.as_view(next_page='login'), name='logout'), 8 | path('register/', RegisterPage.as_view(), name='register'), 9 | 10 | path('', TaskList.as_view(), name='tasks'), 11 | path('task//', TaskDetail.as_view(), name='task'), 12 | path('task-create/', TaskCreate.as_view(), name='task-create'), 13 | path('task-update//', TaskUpdate.as_view(), name='task-update'), 14 | path('task-delete//', DeleteView.as_view(), name='task-delete'), 15 | path('task-reorder/', TaskReorder.as_view(), name='task-reorder'), 16 | ] 17 | -------------------------------------------------------------------------------- /base/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render, redirect 2 | from django.views.generic.list import ListView 3 | from django.views.generic.detail import DetailView 4 | from django.views.generic.edit import CreateView, UpdateView, DeleteView, FormView 5 | from django.urls import reverse_lazy 6 | 7 | from django.contrib.auth.views import LoginView 8 | from django.contrib.auth.mixins import LoginRequiredMixin 9 | from django.contrib.auth.forms import UserCreationForm 10 | from django.contrib.auth import login 11 | 12 | # Imports for Reordering Feature 13 | from django.views import View 14 | from django.shortcuts import redirect 15 | from django.db import transaction 16 | 17 | from .models import Task 18 | from .forms import PositionForm 19 | 20 | 21 | class CustomLoginView(LoginView): 22 | template_name = 'base/login.html' 23 | fields = '__all__' 24 | redirect_authenticated_user = True 25 | 26 | def get_success_url(self): 27 | return reverse_lazy('tasks') 28 | 29 | 30 | class RegisterPage(FormView): 31 | template_name = 'base/register.html' 32 | form_class = UserCreationForm 33 | redirect_authenticated_user = True 34 | success_url = reverse_lazy('tasks') 35 | 36 | def form_valid(self, form): 37 | user = form.save() 38 | if user is not None: 39 | login(self.request, user) 40 | return super(RegisterPage, self).form_valid(form) 41 | 42 | def get(self, *args, **kwargs): 43 | if self.request.user.is_authenticated: 44 | return redirect('tasks') 45 | return super(RegisterPage, self).get(*args, **kwargs) 46 | 47 | 48 | class TaskList(LoginRequiredMixin, ListView): 49 | model = Task 50 | context_object_name = 'tasks' 51 | 52 | def get_context_data(self, **kwargs): 53 | context = super().get_context_data(**kwargs) 54 | context['tasks'] = context['tasks'].filter(user=self.request.user) 55 | context['count'] = context['tasks'].filter(complete=False).count() 56 | 57 | search_input = self.request.GET.get('search-area') or '' 58 | if search_input: 59 | context['tasks'] = context['tasks'].filter( 60 | title__contains=search_input) 61 | 62 | context['search_input'] = search_input 63 | 64 | return context 65 | 66 | 67 | class TaskDetail(LoginRequiredMixin, DetailView): 68 | model = Task 69 | context_object_name = 'task' 70 | template_name = 'base/task.html' 71 | 72 | 73 | class TaskCreate(LoginRequiredMixin, CreateView): 74 | model = Task 75 | fields = ['title', 'description', 'complete'] 76 | success_url = reverse_lazy('tasks') 77 | 78 | def form_valid(self, form): 79 | form.instance.user = self.request.user 80 | return super(TaskCreate, self).form_valid(form) 81 | 82 | 83 | class TaskUpdate(LoginRequiredMixin, UpdateView): 84 | model = Task 85 | fields = ['title', 'description', 'complete'] 86 | success_url = reverse_lazy('tasks') 87 | 88 | 89 | class DeleteView(LoginRequiredMixin, DeleteView): 90 | model = Task 91 | context_object_name = 'task' 92 | success_url = reverse_lazy('tasks') 93 | def get_queryset(self): 94 | owner = self.request.user 95 | return self.model.objects.filter(user=owner) 96 | 97 | class TaskReorder(View): 98 | def post(self, request): 99 | form = PositionForm(request.POST) 100 | 101 | if form.is_valid(): 102 | positionList = form.cleaned_data["position"].split(',') 103 | 104 | with transaction.atomic(): 105 | self.request.user.set_task_order(positionList) 106 | 107 | return redirect(reverse_lazy('tasks')) 108 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/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 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'todo_list.settings') 9 | try: 10 | from django.core.management import execute_from_command_line 11 | except ImportError as exc: 12 | raise ImportError( 13 | "Couldn't import Django. Are you sure it's installed and " 14 | "available on your PYTHONPATH environment variable? Did you " 15 | "forget to activate a virtual environment?" 16 | ) from exc 17 | execute_from_command_line(sys.argv) 18 | 19 | 20 | if __name__ == '__main__': 21 | main() 22 | -------------------------------------------------------------------------------- /todo_list/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/todo_list/__init__.py -------------------------------------------------------------------------------- /todo_list/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/todo_list/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /todo_list/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/todo_list/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /todo_list/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/todo_list/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /todo_list/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/divanov11/Django-To-Do-list-with-user-authentication/d798a5917279981f0f68fef068a02a04e94e2734/todo_list/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /todo_list/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for todo_list 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.0/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', 'todo_list.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /todo_list/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for todo_list project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.0.8. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.0/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.0/ref/settings/ 11 | """ 12 | 13 | import os 14 | 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) 16 | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'd)=^c7!0-oqjmqve%(bt+p#sq6x*ipz2keh741j*-@f@_)f!1t' 24 | 25 | # SECURITY WARNING: don't run with debug turned on in production! 26 | DEBUG = True 27 | 28 | ALLOWED_HOSTS = [] 29 | 30 | 31 | # Application definition 32 | 33 | INSTALLED_APPS = [ 34 | 'django.contrib.admin', 35 | 'django.contrib.auth', 36 | 'django.contrib.contenttypes', 37 | 'django.contrib.sessions', 38 | 'django.contrib.messages', 39 | 'django.contrib.staticfiles', 40 | 'base.apps.BaseConfig', 41 | ] 42 | 43 | MIDDLEWARE = [ 44 | 'django.middleware.security.SecurityMiddleware', 45 | 'django.contrib.sessions.middleware.SessionMiddleware', 46 | 'django.middleware.common.CommonMiddleware', 47 | 'django.middleware.csrf.CsrfViewMiddleware', 48 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 49 | 'django.contrib.messages.middleware.MessageMiddleware', 50 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 51 | ] 52 | 53 | ROOT_URLCONF = 'todo_list.urls' 54 | 55 | TEMPLATES = [ 56 | { 57 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 58 | 'DIRS': [], 59 | 'APP_DIRS': True, 60 | 'OPTIONS': { 61 | 'context_processors': [ 62 | 'django.template.context_processors.debug', 63 | 'django.template.context_processors.request', 64 | 'django.contrib.auth.context_processors.auth', 65 | 'django.contrib.messages.context_processors.messages', 66 | ], 67 | }, 68 | }, 69 | ] 70 | 71 | WSGI_APPLICATION = 'todo_list.wsgi.application' 72 | 73 | 74 | # Database 75 | # https://docs.djangoproject.com/en/3.0/ref/settings/#databases 76 | 77 | DATABASES = { 78 | 'default': { 79 | 'ENGINE': 'django.db.backends.sqlite3', 80 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), 81 | } 82 | } 83 | 84 | 85 | # Password validation 86 | # https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators 87 | 88 | AUTH_PASSWORD_VALIDATORS = [ 89 | { 90 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 91 | }, 92 | { 93 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 94 | }, 95 | { 96 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 97 | }, 98 | { 99 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 100 | }, 101 | ] 102 | 103 | 104 | # Internationalization 105 | # https://docs.djangoproject.com/en/3.0/topics/i18n/ 106 | 107 | LANGUAGE_CODE = 'en-us' 108 | 109 | TIME_ZONE = 'UTC' 110 | 111 | USE_I18N = True 112 | 113 | USE_L10N = True 114 | 115 | USE_TZ = True 116 | 117 | LOGIN_URL = 'login' 118 | 119 | # Static files (CSS, JavaScript, Images) 120 | # https://docs.djangoproject.com/en/3.0/howto/static-files/ 121 | 122 | STATIC_URL = '/static/' 123 | -------------------------------------------------------------------------------- /todo_list/urls.py: -------------------------------------------------------------------------------- 1 | """todo_list URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.0/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('base.urls')), 22 | ] 23 | -------------------------------------------------------------------------------- /todo_list/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for todo_list 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.0/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', 'todo_list.settings') 15 | 16 | application = get_wsgi_application() 17 | --------------------------------------------------------------------------------