├── db.sqlite3 ├── manage.py ├── mytodoapp ├── __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 │ ├── 0002_delete_todo.py │ ├── 0003_todo.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-310.pyc │ │ ├── 0002_auto_20220428_0341.cpython-310.pyc │ │ ├── 0002_auto_20220430_0155.cpython-310.pyc │ │ ├── 0002_delete_todo.cpython-310.pyc │ │ ├── 0003_auto_20220428_0341.cpython-310.pyc │ │ ├── 0003_auto_20220430_0156.cpython-310.pyc │ │ ├── 0003_todo.cpython-310.pyc │ │ ├── 0004_remove_todo_user.cpython-310.pyc │ │ └── __init__.cpython-310.pyc ├── models.py ├── tests.py ├── urls.py └── views.py ├── templates ├── base.html └── index.html ├── todo ├── __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 └── todoapp ├── __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 └── __init__.py ├── models.py ├── tests.py ├── urls.py └── views.py /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/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', 'todo.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 | -------------------------------------------------------------------------------- /mytodoapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__init__.py -------------------------------------------------------------------------------- /mytodoapp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | from .models import todo 4 | # Register your models here. 5 | admin.site.register(todo) -------------------------------------------------------------------------------- /mytodoapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class MytodoappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'mytodoapp' 7 | -------------------------------------------------------------------------------- /mytodoapp/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2022-04-27 22:13 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='todo', 19 | fields=[ 20 | ('sno', models.AutoField(primary_key=True, serialize=False)), 21 | ('title', models.CharField(max_length=100)), 22 | ('desc', models.TextField()), 23 | ('time', models.DateTimeField(auto_now_add=True)), 24 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 25 | ], 26 | options={ 27 | 'verbose_name': 'todo', 28 | 'verbose_name_plural': 'todos', 29 | }, 30 | ), 31 | ] 32 | -------------------------------------------------------------------------------- /mytodoapp/migrations/0002_delete_todo.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2022-04-29 21:09 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('mytodoapp', '0001_initial'), 10 | ] 11 | 12 | operations = [ 13 | migrations.DeleteModel( 14 | name='todo', 15 | ), 16 | ] 17 | -------------------------------------------------------------------------------- /mytodoapp/migrations/0003_todo.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.2.8 on 2022-04-29 21:11 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 | ('mytodoapp', '0002_delete_todo'), 15 | ] 16 | 17 | operations = [ 18 | migrations.CreateModel( 19 | name='todo', 20 | fields=[ 21 | ('sno', models.AutoField(primary_key=True, serialize=False)), 22 | ('title', models.CharField(max_length=100)), 23 | ('desc', models.TextField()), 24 | ('time', models.DateTimeField(auto_now_add=True)), 25 | ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), 26 | ], 27 | options={ 28 | 'verbose_name': 'todo', 29 | 'verbose_name_plural': 'todos', 30 | }, 31 | ), 32 | ] 33 | -------------------------------------------------------------------------------- /mytodoapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__init__.py -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0001_initial.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0001_initial.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0002_auto_20220428_0341.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0002_auto_20220428_0341.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0002_auto_20220430_0155.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0002_auto_20220430_0155.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0002_delete_todo.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0002_delete_todo.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0003_auto_20220428_0341.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0003_auto_20220428_0341.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0003_auto_20220430_0156.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0003_auto_20220430_0156.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0003_todo.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0003_todo.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/0004_remove_todo_user.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/0004_remove_todo_user.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/migrations/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/mytodoapp/migrations/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /mytodoapp/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | 4 | # Create your models here. 5 | 6 | 7 | # Create your models here. 8 | 9 | class todo(models.Model): 10 | """Model definition for todo.""" 11 | sno = models.AutoField(primary_key=True) 12 | title = models.CharField(max_length=100) 13 | user = models.ForeignKey(User,on_delete=models.CASCADE) 14 | desc = models.TextField() 15 | time = models.DateTimeField(auto_now_add=True) 16 | 17 | 18 | class Meta: 19 | """Meta definition for todo.""" 20 | 21 | verbose_name = 'todo' 22 | verbose_name_plural = 'todos' 23 | 24 | def __str__(self): 25 | return self.title 26 | 27 | -------------------------------------------------------------------------------- /mytodoapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /mytodoapp/urls.py: -------------------------------------------------------------------------------- 1 | from django.urls import path 2 | from . import views 3 | 4 | urlpatterns = [ 5 | path('',views.index ,name="index" ), 6 | path('addtodo',views.addtodo ,name="addtodo" ), 7 | 8 | path('signup',views.signup , name="signup"), 9 | path('login',views.ulogin , name="login"), 10 | path('logout/',views.ulogout ,name="logout" ), 11 | path('delete/',views.udelete ,name="delete" ), 12 | ] 13 | -------------------------------------------------------------------------------- /mytodoapp/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import redirect, render 2 | from django.contrib.auth.models import User 3 | from .models import todo 4 | from django.contrib import messages 5 | from django.contrib.auth import authenticate, login, logout 6 | # Create your views here. 7 | def index(request): 8 | user = request.user 9 | if user.is_authenticated: 10 | todos = todo.objects.filter(user=user).order_by('-time') 11 | dic ={'todos':todos,'user':user} 12 | return render(request,'index.html',dic) 13 | else: 14 | return render(request,'index.html') 15 | 16 | 17 | 18 | 19 | 20 | def addtodo(request): 21 | user = request.user 22 | if user.is_authenticated: 23 | if request.method == "POST": 24 | title = request.POST.get('title') 25 | desc = request.POST.get('desc') 26 | 27 | todos=todo(title=title,desc=desc,user=user) 28 | todos.save() 29 | 30 | return redirect(index) 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | def signup(request): 41 | u=request.user 42 | if u.is_authenticated: 43 | return redirect("index") 44 | elif not u.is_authenticated : 45 | if request.method == "POST": 46 | fname = request.POST.get('fname') 47 | lname = request.POST.get('lname') 48 | uname = request.POST.get('uname') 49 | phone = request.POST.get('phone') 50 | email = request.POST.get('email') 51 | pass1 = request.POST.get('pass1') 52 | pass2 = request.POST.get('pass2') 53 | # print(fname,lname,uname,phone,email,pass1,pass2) 54 | if pass1 != pass2 : 55 | messages.error(request,"Passwords Is Diffrent") 56 | user = User.objects.create_user(uname,email,pass1) 57 | user.first_name = fname 58 | user.last_name = lname 59 | 60 | user.save() 61 | login(request, user) 62 | messages.success(request,"Your Account Is Created") 63 | return redirect("index") 64 | print("signup") 65 | 66 | dic={'user':u} 67 | if not u.is_authenticated: 68 | return redirect("index",dic) 69 | if u.is_authenticated: 70 | return redirect("index") 71 | 72 | 73 | def ulogin(request): 74 | user = request.user 75 | if request.method == "POST": 76 | uname=request.POST.get('uname') 77 | password=request.POST.get('password') 78 | user=authenticate(username= uname, password=password) 79 | print(uname,password) 80 | if user is not None: 81 | login(request, user) 82 | messages.success(request, "Successfully Logged In") 83 | dic={'user':request.user} 84 | if not user.is_authenticated: 85 | return redirect("index",dic) 86 | if user.is_authenticated: 87 | return redirect("index") 88 | 89 | 90 | 91 | else: 92 | messages.error(request, "Invalid credentials! Please try again") 93 | # return redirect("home") 94 | 95 | return redirect("index") 96 | 97 | 98 | 99 | def ulogout(request): 100 | user = request.user 101 | logout(request) 102 | return redirect(index) 103 | 104 | 105 | def udelete(request,sno): 106 | user = request.user 107 | item = todo.objects.get(sno=sno , user=user).delete() 108 | # item.delete() 109 | return redirect(index) -------------------------------------------------------------------------------- /templates/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {% block title %} {% endblock title %} 14 | 15 | 16 | 17 | 18 | 19 | 59 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | {% for message in messages %} 259 | 260 | 261 | 265 | 266 | {% endfor %} {% block body %} {% endblock body %} 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 284 | 285 | 286 | -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'base.html' %} 2 | 3 | {% block title %} Todos List {% endblock title %} 4 | 5 | {% block username %} {{user.first_name|title}} {{user.last_name|title}}{% endblock username %} 6 | 7 | {% block body %} 8 | 9 | 15 | 16 | {% if user.is_authenticated %} {% load humanize %} {% for todo in todos%} 17 | 18 |
19 |

{{todo.title|title}}

20 |

{{todo.time|naturaltime}}

21 | 22 | 23 | 26 | 27 | 28 | 45 | 46 | 47 |
48 |

{{todo.desc|title}}

49 |
50 | {% endfor %} {% else %} 51 |
52 | 53 |

54 | 55 | DEAR PERSON 56 |

57 |

58 | 59 | WELCOME TO TODOS LIST 60 |

61 |

62 | PLEASE LOGIN AND USE FEATCHERS 63 |

64 | 65 |
66 | {% endif %} {% endblock body %} -------------------------------------------------------------------------------- /todo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todo/__init__.py -------------------------------------------------------------------------------- /todo/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todo/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /todo/__pycache__/settings.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todo/__pycache__/settings.cpython-310.pyc -------------------------------------------------------------------------------- /todo/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todo/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /todo/__pycache__/wsgi.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todo/__pycache__/wsgi.cpython-310.pyc -------------------------------------------------------------------------------- /todo/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for todo 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', 'todo.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /todo/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for todo project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.2.8. 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 | 15 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 16 | BASE_DIR = Path(__file__).resolve().parent.parent 17 | 18 | 19 | # Quick-start development settings - unsuitable for production 20 | # See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ 21 | 22 | # SECURITY WARNING: keep the secret key used in production secret! 23 | SECRET_KEY = 'django-insecure-&)jrwh14abu52yeqk429ohgt-rfu@fmr=9av9sei1=@svm)s08' 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 | 'mytodoapp.apps.MytodoappConfig', 41 | 'django.contrib.humanize' 42 | ] 43 | 44 | MIDDLEWARE = [ 45 | 'django.middleware.security.SecurityMiddleware', 46 | 'django.contrib.sessions.middleware.SessionMiddleware', 47 | 'django.middleware.common.CommonMiddleware', 48 | 'django.middleware.csrf.CsrfViewMiddleware', 49 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 50 | 'django.contrib.messages.middleware.MessageMiddleware', 51 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 52 | ] 53 | 54 | ROOT_URLCONF = 'todo.urls' 55 | 56 | TEMPLATES = [ 57 | { 58 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 59 | 'DIRS': ['templates'], 60 | 'APP_DIRS': True, 61 | 'OPTIONS': { 62 | 'context_processors': [ 63 | 'django.template.context_processors.debug', 64 | 'django.template.context_processors.request', 65 | 'django.contrib.auth.context_processors.auth', 66 | 'django.contrib.messages.context_processors.messages', 67 | ], 68 | }, 69 | }, 70 | ] 71 | 72 | WSGI_APPLICATION = 'todo.wsgi.application' 73 | 74 | 75 | # Database 76 | # https://docs.djangoproject.com/en/3.2/ref/settings/#databases 77 | 78 | DATABASES = { 79 | 'default': { 80 | 'ENGINE': 'django.db.backends.postgresql', 81 | 'NAME' : 'todos', 82 | 'USER' : 'postgres', 83 | 'PASSWORD' : 'po2881928', 84 | 'HOST' : 'localhost', 85 | 'PORT' : '5432' 86 | 87 | # 'NAME': BASE_DIR / 'db.sqlite3', 88 | } 89 | } 90 | 91 | 92 | # Password validation 93 | # https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators 94 | 95 | AUTH_PASSWORD_VALIDATORS = [ 96 | { 97 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 98 | }, 99 | { 100 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 101 | }, 102 | { 103 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 104 | }, 105 | { 106 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 107 | }, 108 | ] 109 | 110 | 111 | # Internationalization 112 | # https://docs.djangoproject.com/en/3.2/topics/i18n/ 113 | 114 | LANGUAGE_CODE = 'en-us' 115 | 116 | TIME_ZONE = 'UTC' 117 | 118 | USE_I18N = True 119 | 120 | USE_L10N = True 121 | 122 | USE_TZ = True 123 | 124 | 125 | # Static files (CSS, JavaScript, Images) 126 | # https://docs.djangoproject.com/en/3.2/howto/static-files/ 127 | 128 | STATIC_URL = '/static/' 129 | 130 | # Default primary key field type 131 | # https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field 132 | 133 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 134 | -------------------------------------------------------------------------------- /todo/urls.py: -------------------------------------------------------------------------------- 1 | """todo 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 | 20 | urlpatterns = [ 21 | path('admin/', admin.site.urls), 22 | path('', include('mytodoapp.urls')) 23 | ] 24 | -------------------------------------------------------------------------------- /todo/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for todo 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', 'todo.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /todoapp/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__init__.py -------------------------------------------------------------------------------- /todoapp/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/__pycache__/admin.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/admin.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/__pycache__/apps.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/apps.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/__pycache__/models.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/models.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/__pycache__/urls.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/urls.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/__pycache__/views.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/__pycache__/views.cpython-310.pyc -------------------------------------------------------------------------------- /todoapp/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import todo 3 | # Register your models here. 4 | admin.site.register(todo) -------------------------------------------------------------------------------- /todoapp/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class TodoappConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'todoapp' 7 | -------------------------------------------------------------------------------- /todoapp/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Abdul-Basit-Ansari/Todo-List-django-postgresql/6390a7f73e4a59541c4966bc0d1e81e921b9880e/todoapp/migrations/__init__.py -------------------------------------------------------------------------------- /todoapp/models.py: -------------------------------------------------------------------------------- 1 | # from django.db import models 2 | # from django.contrib.auth.models import User 3 | 4 | # # Create your models here. 5 | 6 | 7 | # # Create your models here. 8 | 9 | # class todo(models.Model): 10 | # """Model definition for todo.""" 11 | # sno = models.AutoField(primary_key=True) 12 | # title = models.CharField(max_length=100) 13 | # user = models.ForeignKey(User,on_delete=models.CASCADE) 14 | # desc = models.TextField() 15 | # time = models.DateTimeField(auto_now_add=True) 16 | 17 | 18 | # class Meta: 19 | # """Meta definition for todo.""" 20 | 21 | # verbose_name = 'todo' 22 | # verbose_name_plural = 'todos' 23 | 24 | # def __str__(self): 25 | # return self.title 26 | 27 | -------------------------------------------------------------------------------- /todoapp/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /todoapp/urls.py: -------------------------------------------------------------------------------- 1 | # from django.urls import path 2 | # from . import views 3 | # urlpatterns = [ 4 | # path('',views.index ,name="index" ), 5 | # ] 6 | -------------------------------------------------------------------------------- /todoapp/views.py: -------------------------------------------------------------------------------- 1 | # from django.shortcuts import render 2 | 3 | # # Create your views here. 4 | # def index(request): 5 | # return render(request,'index.html') --------------------------------------------------------------------------------