From 05e4b688deae512f4e274a8ce7db9446627b424e Mon Sep 17 00:00:00 2001 From: Valex609 Date: Wed, 29 Oct 2025 18:26:10 -0800 Subject: [PATCH] DjangoDemo code --- .gitignore | 3 + src/banjo/__init__.py | 0 src/banjo/admin.py | 5 + src/banjo/apps.py | 5 + src/banjo/migrations/__init__.py | 0 src/banjo/models.py | 8 ++ src/banjo/tests.py | 3 + src/banjo/views.py | 3 + src/banjo2/__init__.py | 0 src/banjo2/admin.py | 6 + src/banjo2/apps.py | 5 + src/banjo2/migrations/0001_initial.py | 24 ++++ src/banjo2/migrations/0002_banjo2_featured.py | 19 +++ .../migrations/0003_auto_20251029_1723.py | 18 +++ src/banjo2/migrations/__init__.py | 0 src/banjo2/models.py | 8 ++ src/banjo2/tests.py | 3 + src/banjo2/views.py | 3 + src/db.sqlite3 | Bin 0 -> 139264 bytes src/djangoproject/__init__.py | 0 src/djangoproject/djangoproject/__init__.py | 0 src/djangoproject/djangoproject/settings.py | 123 ++++++++++++++++++ src/djangoproject/djangoproject/urls.py | 21 +++ src/djangoproject/djangoproject/wsgi.py | 16 +++ src/djangoproject/manage.py | 15 +++ src/djangoproject/settings.py | 122 +++++++++++++++++ src/djangoproject/urls.py | 24 ++++ src/djangoproject/wsgi.py | 16 +++ src/manage.py | 15 +++ src/pages/__init__.py | 0 src/pages/admin.py | 3 + src/pages/apps.py | 5 + src/pages/migrations/__init__.py | 0 src/pages/models.py | 3 + src/pages/tests.py | 3 + src/pages/views.py | 6 + 36 files changed, 485 insertions(+) create mode 100644 .gitignore create mode 100644 src/banjo/__init__.py create mode 100644 src/banjo/admin.py create mode 100644 src/banjo/apps.py create mode 100644 src/banjo/migrations/__init__.py create mode 100644 src/banjo/models.py create mode 100644 src/banjo/tests.py create mode 100644 src/banjo/views.py create mode 100644 src/banjo2/__init__.py create mode 100644 src/banjo2/admin.py create mode 100644 src/banjo2/apps.py create mode 100644 src/banjo2/migrations/0001_initial.py create mode 100644 src/banjo2/migrations/0002_banjo2_featured.py create mode 100644 src/banjo2/migrations/0003_auto_20251029_1723.py create mode 100644 src/banjo2/migrations/__init__.py create mode 100644 src/banjo2/models.py create mode 100644 src/banjo2/tests.py create mode 100644 src/banjo2/views.py create mode 100644 src/db.sqlite3 create mode 100644 src/djangoproject/__init__.py create mode 100644 src/djangoproject/djangoproject/__init__.py create mode 100644 src/djangoproject/djangoproject/settings.py create mode 100644 src/djangoproject/djangoproject/urls.py create mode 100644 src/djangoproject/djangoproject/wsgi.py create mode 100644 src/djangoproject/manage.py create mode 100644 src/djangoproject/settings.py create mode 100644 src/djangoproject/urls.py create mode 100644 src/djangoproject/wsgi.py create mode 100644 src/manage.py create mode 100644 src/pages/__init__.py create mode 100644 src/pages/admin.py create mode 100644 src/pages/apps.py create mode 100644 src/pages/migrations/__init__.py create mode 100644 src/pages/models.py create mode 100644 src/pages/tests.py create mode 100644 src/pages/views.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..4b608f6813b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +django/ +__pycache__/* +*.pyc \ No newline at end of file diff --git a/src/banjo/__init__.py b/src/banjo/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/banjo/admin.py b/src/banjo/admin.py new file mode 100644 index 00000000000..711ab7ed9a7 --- /dev/null +++ b/src/banjo/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin + +from .models import Banjo +admin.site.register(Banjo) +# Register your models here. diff --git a/src/banjo/apps.py b/src/banjo/apps.py new file mode 100644 index 00000000000..2c7374246af --- /dev/null +++ b/src/banjo/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class BanjoConfig(AppConfig): + name = 'banjo' diff --git a/src/banjo/migrations/__init__.py b/src/banjo/migrations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/banjo/models.py b/src/banjo/models.py new file mode 100644 index 00000000000..e8123c8007b --- /dev/null +++ b/src/banjo/models.py @@ -0,0 +1,8 @@ +from django.db import models + +# Create your models here. +class Banjo(models.Model): + title = models.TextField() + description = models.TextField() + price = models.TextField() + summary = models.TextField(default='heelo world') \ No newline at end of file diff --git a/src/banjo/tests.py b/src/banjo/tests.py new file mode 100644 index 00000000000..7ce503c2dd9 --- /dev/null +++ b/src/banjo/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/src/banjo/views.py b/src/banjo/views.py new file mode 100644 index 00000000000..91ea44a218f --- /dev/null +++ b/src/banjo/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/src/banjo2/__init__.py b/src/banjo2/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/banjo2/admin.py b/src/banjo2/admin.py new file mode 100644 index 00000000000..e0b23bb4894 --- /dev/null +++ b/src/banjo2/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +# Register your models here. +from .models import Banjo2 + +admin.site.register(Banjo2) \ No newline at end of file diff --git a/src/banjo2/apps.py b/src/banjo2/apps.py new file mode 100644 index 00000000000..d2da6859658 --- /dev/null +++ b/src/banjo2/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class Banjo2Config(AppConfig): + name = 'banjo2' diff --git a/src/banjo2/migrations/0001_initial.py b/src/banjo2/migrations/0001_initial.py new file mode 100644 index 00000000000..90cd5c7c912 --- /dev/null +++ b/src/banjo2/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 2.1.7 on 2025-10-30 00:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Banjo2', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=120)), + ('description', models.TextField(blank=True, null=True)), + ('price', models.DecimalField(decimal_places=2, max_digits=10000)), + ('summary', models.TextField()), + ], + ), + ] diff --git a/src/banjo2/migrations/0002_banjo2_featured.py b/src/banjo2/migrations/0002_banjo2_featured.py new file mode 100644 index 00000000000..1f031453c64 --- /dev/null +++ b/src/banjo2/migrations/0002_banjo2_featured.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.7 on 2025-10-30 01:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('banjo2', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='banjo2', + name='featured', + field=models.BooleanField(default=True), + preserve_default=False, + ), + ] diff --git a/src/banjo2/migrations/0003_auto_20251029_1723.py b/src/banjo2/migrations/0003_auto_20251029_1723.py new file mode 100644 index 00000000000..3e142bc7767 --- /dev/null +++ b/src/banjo2/migrations/0003_auto_20251029_1723.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2025-10-30 01:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('banjo2', '0002_banjo2_featured'), + ] + + operations = [ + migrations.AlterField( + model_name='banjo2', + name='summary', + field=models.TextField(blank=True), + ), + ] diff --git a/src/banjo2/migrations/__init__.py b/src/banjo2/migrations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/banjo2/models.py b/src/banjo2/models.py new file mode 100644 index 00000000000..fc4ceb1e530 --- /dev/null +++ b/src/banjo2/models.py @@ -0,0 +1,8 @@ +from django.db import models + +class Banjo2(models.Model): + title = models.CharField(max_length=120) # max_length = required + description = models.TextField(blank=True, null=True) + price = models.DecimalField(decimal_places=2, max_digits=10000) + summary = models.TextField(blank=True, null=False) + featured = models.BooleanField() diff --git a/src/banjo2/tests.py b/src/banjo2/tests.py new file mode 100644 index 00000000000..7ce503c2dd9 --- /dev/null +++ b/src/banjo2/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/src/banjo2/views.py b/src/banjo2/views.py new file mode 100644 index 00000000000..91ea44a218f --- /dev/null +++ b/src/banjo2/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/src/db.sqlite3 b/src/db.sqlite3 new file m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de29bb2d diff --git a/src/djangoproject/djangoproject/__init__.py b/src/djangoproject/djangoproject/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/djangoproject/djangoproject/settings.py b/src/djangoproject/djangoproject/settings.py new file mode 100644 index 00000000000..eed7427befb --- /dev/null +++ b/src/djangoproject/djangoproject/settings.py @@ -0,0 +1,123 @@ +""" +Django settings for djangoproject project. + +Generated by 'django-admin startproject' using Django 2.1.7. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '1&3f8cxav@sf^i6_hye3pbcbtms3mckiq)xgevvn^yu^@!kz1k' + +# 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', + #own + 'banjo2', +] + + +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 = 'djangoproject.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 = 'djangoproject.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.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/2.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/src/djangoproject/djangoproject/urls.py b/src/djangoproject/djangoproject/urls.py new file mode 100644 index 00000000000..0169a827fd0 --- /dev/null +++ b/src/djangoproject/djangoproject/urls.py @@ -0,0 +1,21 @@ +"""djangoproject URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.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 + +urlpatterns = [ + path('admin/', admin.site.urls), +] diff --git a/src/djangoproject/djangoproject/wsgi.py b/src/djangoproject/djangoproject/wsgi.py new file mode 100644 index 00000000000..cd645342ace --- /dev/null +++ b/src/djangoproject/djangoproject/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for djangoproject 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/2.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings') + +application = get_wsgi_application() diff --git a/src/djangoproject/manage.py b/src/djangoproject/manage.py new file mode 100644 index 00000000000..1c25e641338 --- /dev/null +++ b/src/djangoproject/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == '__main__': + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.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) diff --git a/src/djangoproject/settings.py b/src/djangoproject/settings.py new file mode 100644 index 00000000000..aebdec434d0 --- /dev/null +++ b/src/djangoproject/settings.py @@ -0,0 +1,122 @@ +""" +Django settings for djangoproject project. + +Generated by 'django-admin startproject' using Django 2.1.7. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '=n5b+yt@++**xjz3(8tb24+yn)j+g95*fs6=(m05fng__lrxwu' + +# 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', + 'banjo2', + 'pages', +] + +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 = 'djangoproject.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 = 'djangoproject.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.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/2.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/src/djangoproject/urls.py b/src/djangoproject/urls.py new file mode 100644 index 00000000000..ad5730fcf00 --- /dev/null +++ b/src/djangoproject/urls.py @@ -0,0 +1,24 @@ +"""djangoproject URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.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 + +from pages import views + +urlpatterns = [ + path('', views.home_view, name='home'), + path('admin/', admin.site.urls), +] diff --git a/src/djangoproject/wsgi.py b/src/djangoproject/wsgi.py new file mode 100644 index 00000000000..cd645342ace --- /dev/null +++ b/src/djangoproject/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for djangoproject 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/2.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.settings') + +application = get_wsgi_application() diff --git a/src/manage.py b/src/manage.py new file mode 100644 index 00000000000..1c25e641338 --- /dev/null +++ b/src/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == '__main__': + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoproject.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) diff --git a/src/pages/__init__.py b/src/pages/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/pages/admin.py b/src/pages/admin.py new file mode 100644 index 00000000000..8c38f3f3dad --- /dev/null +++ b/src/pages/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/src/pages/apps.py b/src/pages/apps.py new file mode 100644 index 00000000000..acdb960739b --- /dev/null +++ b/src/pages/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class PagesConfig(AppConfig): + name = 'pages' diff --git a/src/pages/migrations/__init__.py b/src/pages/migrations/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/pages/models.py b/src/pages/models.py new file mode 100644 index 00000000000..71a83623907 --- /dev/null +++ b/src/pages/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/src/pages/tests.py b/src/pages/tests.py new file mode 100644 index 00000000000..7ce503c2dd9 --- /dev/null +++ b/src/pages/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/src/pages/views.py b/src/pages/views.py new file mode 100644 index 00000000000..86aea120381 --- /dev/null +++ b/src/pages/views.py @@ -0,0 +1,6 @@ +from django.http import HttpResponse +from django.shortcuts import render + +# Create your views here. +def home_view(*args, **kwargs): + return HttpResponse("

Hello World

") \ No newline at end of file