commit fc0ee7103fa96f07c73fe2cd6336bf53619debd1 Author: histoire Date: Mon Dec 9 00:17:26 2024 -0600 Create skeleton framework diff --git a/catalog/__init__.py b/catalog/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/catalog/__pycache__/__init__.cpython-311.pyc b/catalog/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..d66e0e2 Binary files /dev/null and b/catalog/__pycache__/__init__.cpython-311.pyc differ diff --git a/catalog/__pycache__/admin.cpython-311.pyc b/catalog/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..88ac266 Binary files /dev/null and b/catalog/__pycache__/admin.cpython-311.pyc differ diff --git a/catalog/__pycache__/apps.cpython-311.pyc b/catalog/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000..461a30f Binary files /dev/null and b/catalog/__pycache__/apps.cpython-311.pyc differ diff --git a/catalog/__pycache__/models.cpython-311.pyc b/catalog/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..52c16ab Binary files /dev/null and b/catalog/__pycache__/models.cpython-311.pyc differ diff --git a/catalog/__pycache__/urls.cpython-311.pyc b/catalog/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..72fd2cc Binary files /dev/null and b/catalog/__pycache__/urls.cpython-311.pyc differ diff --git a/catalog/__pycache__/views.cpython-311.pyc b/catalog/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..9f8923e Binary files /dev/null and b/catalog/__pycache__/views.cpython-311.pyc differ diff --git a/catalog/admin.py b/catalog/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/catalog/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/catalog/apps.py b/catalog/apps.py new file mode 100644 index 0000000..a5993c6 --- /dev/null +++ b/catalog/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class CatalogConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'catalog' diff --git a/catalog/migrations/__init__.py b/catalog/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/catalog/migrations/__pycache__/__init__.cpython-311.pyc b/catalog/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..a8bfb21 Binary files /dev/null and b/catalog/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/catalog/models.py b/catalog/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/catalog/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/catalog/tests.py b/catalog/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/catalog/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/catalog/urls.py b/catalog/urls.py new file mode 100644 index 0000000..bee138e --- /dev/null +++ b/catalog/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from . import views + +urlpatterns = [ + +] diff --git a/catalog/views.py b/catalog/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/catalog/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/db.sqlite3 b/db.sqlite3 new file mode 100644 index 0000000..fccf8bc Binary files /dev/null and b/db.sqlite3 differ diff --git a/local_library/__init__.py b/local_library/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/local_library/__pycache__/__init__.cpython-311.pyc b/local_library/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..6b18d4d Binary files /dev/null and b/local_library/__pycache__/__init__.cpython-311.pyc differ diff --git a/local_library/__pycache__/settings.cpython-311.pyc b/local_library/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000..b36b8ce Binary files /dev/null and b/local_library/__pycache__/settings.cpython-311.pyc differ diff --git a/local_library/__pycache__/urls.cpython-311.pyc b/local_library/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..50972ed Binary files /dev/null and b/local_library/__pycache__/urls.cpython-311.pyc differ diff --git a/local_library/__pycache__/wsgi.cpython-311.pyc b/local_library/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000..13f671c Binary files /dev/null and b/local_library/__pycache__/wsgi.cpython-311.pyc differ diff --git a/local_library/asgi.py b/local_library/asgi.py new file mode 100644 index 0000000..8bfcfe6 --- /dev/null +++ b/local_library/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for local_library project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'local_library.settings') + +application = get_asgi_application() diff --git a/local_library/settings.py b/local_library/settings.py new file mode 100644 index 0000000..03f3517 --- /dev/null +++ b/local_library/settings.py @@ -0,0 +1,125 @@ +""" +Django settings for local_library project. + +Generated by 'django-admin startproject' using Django 5.1.2. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-8#v(oh89fqd$rulq*4o%8s85i3s0*+d4a)7z$7i9m7wit*okb&' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + # add new application + 'catalog.apps.CatalogConfig', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'local_library.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'local_library.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/local_library/urls.py b/local_library/urls.py new file mode 100644 index 0000000..117baec --- /dev/null +++ b/local_library/urls.py @@ -0,0 +1,37 @@ +""" +URL configuration for local_library project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('catalog/', include('catalog.urls')), +] + +from django.views.generic import RedirectView + +urlpatterns += [ + path('', RedirectView.as_view(url='catalog/', permanent=True)), +] + +# use static() to add url mapping to serve static files during development +from django.conf import settings +from django.conf.urls.static import static + +urlpatterns += static(settings.STATIC_URL, + document_root=settings.STATIC_ROOT) + diff --git a/local_library/wsgi.py b/local_library/wsgi.py new file mode 100644 index 0000000..ef24760 --- /dev/null +++ b/local_library/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for local_library project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'local_library.settings') + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..d5c4c85 --- /dev/null +++ b/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'local_library.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()