From 390d6594c818227cec179d28d22f409cc3bc38f0 Mon Sep 17 00:00:00 2001 From: Maximilian Friedersdorff Date: Mon, 24 Jun 2024 21:16:48 +0100 Subject: [PATCH] Add basic project boilerplate --- config/__init__.py | 0 config/asgi.py | 16 +++ config/settings/__init__.py | 0 config/settings/base.py | 125 ++++++++++++++++++++++ config/settings/development.py | 1 + config/settings/production.py | 0 config/urls.py | 6 ++ config/wsgi.py | 16 +++ reinheit/__init__.py | 0 reinheit/apps/brew/__init__.py | 0 reinheit/apps/brew/admin.py | 3 + reinheit/apps/brew/apps.py | 6 ++ reinheit/apps/brew/migrations/__init__.py | 0 reinheit/apps/brew/models.py | 3 + reinheit/apps/brew/tests.py | 3 + reinheit/apps/brew/views.py | 3 + 16 files changed, 182 insertions(+) create mode 100644 config/__init__.py create mode 100644 config/asgi.py create mode 100644 config/settings/__init__.py create mode 100644 config/settings/base.py create mode 100644 config/settings/development.py create mode 100644 config/settings/production.py create mode 100644 config/urls.py create mode 100644 config/wsgi.py create mode 100644 reinheit/__init__.py create mode 100644 reinheit/apps/brew/__init__.py create mode 100644 reinheit/apps/brew/admin.py create mode 100644 reinheit/apps/brew/apps.py create mode 100644 reinheit/apps/brew/migrations/__init__.py create mode 100644 reinheit/apps/brew/models.py create mode 100644 reinheit/apps/brew/tests.py create mode 100644 reinheit/apps/brew/views.py diff --git a/config/__init__.py b/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config/asgi.py b/config/asgi.py new file mode 100644 index 0000000..b54e4fd --- /dev/null +++ b/config/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for reinhart 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.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") + +application = get_asgi_application() diff --git a/config/settings/__init__.py b/config/settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config/settings/base.py b/config/settings/base.py new file mode 100644 index 0000000..2595b48 --- /dev/null +++ b/config/settings/base.py @@ -0,0 +1,125 @@ +""" +Django settings for reinheit project. + +Generated by 'django-admin startproject' using Django 5.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/5.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.0/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.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-jqgf*tx%8h!t6o#)tl-7(hsc_gkjdosmko*u@)8+4r-frc27r1' + +# 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', + + 'reinheit.apps.brew', +] + +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 = 'config.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 = 'config.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.0/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.0/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.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/config/settings/development.py b/config/settings/development.py new file mode 100644 index 0000000..9e5a695 --- /dev/null +++ b/config/settings/development.py @@ -0,0 +1 @@ +from .base import * # noqa: F401, F403 diff --git a/config/settings/production.py b/config/settings/production.py new file mode 100644 index 0000000..e69de29 diff --git a/config/urls.py b/config/urls.py new file mode 100644 index 0000000..d469a3e --- /dev/null +++ b/config/urls.py @@ -0,0 +1,6 @@ +from django.urls import path +from django.contrib import admin + +urlpatterns = [ + path("admin/", admin.site.urls), +] diff --git a/config/wsgi.py b/config/wsgi.py new file mode 100644 index 0000000..25606a3 --- /dev/null +++ b/config/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for reinhart 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.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") + +application = get_wsgi_application() diff --git a/reinheit/__init__.py b/reinheit/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/reinheit/apps/brew/__init__.py b/reinheit/apps/brew/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/reinheit/apps/brew/admin.py b/reinheit/apps/brew/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/reinheit/apps/brew/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/reinheit/apps/brew/apps.py b/reinheit/apps/brew/apps.py new file mode 100644 index 0000000..d9a704d --- /dev/null +++ b/reinheit/apps/brew/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class BrewConfig(AppConfig): + default_auto_field = "django.db.models.BigAutoField" + name = "reinheit.apps.brew" diff --git a/reinheit/apps/brew/migrations/__init__.py b/reinheit/apps/brew/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/reinheit/apps/brew/models.py b/reinheit/apps/brew/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/reinheit/apps/brew/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/reinheit/apps/brew/tests.py b/reinheit/apps/brew/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/reinheit/apps/brew/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/reinheit/apps/brew/views.py b/reinheit/apps/brew/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/reinheit/apps/brew/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.