├── README.md ├── core ├── __init__.py ├── admin.py ├── apps.py ├── migrations │ └── __init__.py ├── models.py ├── tests.py └── views.py ├── db.sqlite3 ├── manage.py ├── requirements.txt ├── searchdjango ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── wsgi.cpython-39.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py └── templates ├── details.html └── navbar.html └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # Django Search Functionality Course (SUSYS) 2 | 3 | -------------------------------------------------------------------------------- /core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/core/__init__.py -------------------------------------------------------------------------------- /core/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | 3 | # Register your models here. 4 | -------------------------------------------------------------------------------- /core/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class CoreConfig(AppConfig): 5 | default_auto_field = 'django.db.models.BigAutoField' 6 | name = 'core' 7 | -------------------------------------------------------------------------------- /core/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/core/migrations/__init__.py -------------------------------------------------------------------------------- /core/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | 3 | # Create your models here. 4 | -------------------------------------------------------------------------------- /core/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /core/views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | # Create your views here. 4 | -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/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', 'searchdjango.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/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/requirements.txt -------------------------------------------------------------------------------- /searchdjango/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/searchdjango/__init__.py -------------------------------------------------------------------------------- /searchdjango/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/searchdjango/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /searchdjango/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/searchdjango/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /searchdjango/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/searchdjango/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /searchdjango/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/searchdjango/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /searchdjango/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for searchdjango 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/4.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', 'searchdjango.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /searchdjango/settings.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 4 | BASE_DIR = Path(__file__).resolve().parent.parent 5 | 6 | 7 | # Quick-start development settings - unsuitable for production 8 | # See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ 9 | 10 | # SECURITY WARNING: keep the secret key used in production secret! 11 | SECRET_KEY = 'django-insecure-dc&!l78umu#+k&8h4y@@ec!zza1bd@6&!zgpw%4$8(kktr56ap' 12 | 13 | # SECURITY WARNING: don't run with debug turned on in production! 14 | DEBUG = True 15 | 16 | ALLOWED_HOSTS = [] 17 | 18 | 19 | # Application definition 20 | 21 | INSTALLED_APPS = [ 22 | 'django.contrib.admin', 23 | 'django.contrib.auth', 24 | 'django.contrib.contenttypes', 25 | 'django.contrib.sessions', 26 | 'django.contrib.messages', 27 | 'django.contrib.staticfiles', 28 | ] 29 | 30 | MIDDLEWARE = [ 31 | 'django.middleware.security.SecurityMiddleware', 32 | 'django.contrib.sessions.middleware.SessionMiddleware', 33 | 'django.middleware.common.CommonMiddleware', 34 | 'django.middleware.csrf.CsrfViewMiddleware', 35 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 36 | 'django.contrib.messages.middleware.MessageMiddleware', 37 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 38 | ] 39 | 40 | ROOT_URLCONF = 'searchdjango.urls' 41 | 42 | TEMPLATES = [ 43 | { 44 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 45 | 'DIRS': [BASE_DIR/ "templates"], 46 | 'APP_DIRS': True, 47 | 'OPTIONS': { 48 | 'context_processors': [ 49 | 'django.template.context_processors.debug', 50 | 'django.template.context_processors.request', 51 | 'django.contrib.auth.context_processors.auth', 52 | 'django.contrib.messages.context_processors.messages', 53 | ], 54 | }, 55 | }, 56 | ] 57 | 58 | WSGI_APPLICATION = 'searchdjango.wsgi.application' 59 | 60 | 61 | # Database 62 | # https://docs.djangoproject.com/en/4.0/ref/settings/#databases 63 | 64 | DATABASES = { 65 | 'default': { 66 | 'ENGINE': 'django.db.backends.sqlite3', 67 | 'NAME': BASE_DIR / 'db.sqlite3', 68 | } 69 | } 70 | 71 | 72 | # Password validation 73 | # https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators 74 | 75 | AUTH_PASSWORD_VALIDATORS = [ 76 | { 77 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 78 | }, 79 | { 80 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 81 | }, 82 | { 83 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 84 | }, 85 | { 86 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 87 | }, 88 | ] 89 | 90 | 91 | # Internationalization 92 | # https://docs.djangoproject.com/en/4.0/topics/i18n/ 93 | 94 | LANGUAGE_CODE = 'en-us' 95 | 96 | TIME_ZONE = 'UTC' 97 | 98 | USE_I18N = True 99 | 100 | USE_TZ = True 101 | 102 | 103 | # Static files (CSS, JavaScript, Images) 104 | # https://docs.djangoproject.com/en/4.0/howto/static-files/ 105 | 106 | STATIC_URL = 'static/' 107 | 108 | # Default primary key field type 109 | # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field 110 | 111 | DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' 112 | -------------------------------------------------------------------------------- /searchdjango/urls.py: -------------------------------------------------------------------------------- 1 | """searchdjango URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/4.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 18 | 19 | urlpatterns = [ 20 | path('admin/', admin.site.urls), 21 | ] 22 | -------------------------------------------------------------------------------- /searchdjango/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for searchdjango 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/4.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', 'searchdjango.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /templates/details.html/navbar.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/templates/details.html/navbar.html -------------------------------------------------------------------------------- /templates/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/python019/search-functionality-django-course/e77af311e070cd516c6bd2184fcd20d20999cad5/templates/index.html --------------------------------------------------------------------------------