From 36531dde2a0327a461b1e398df3702c29c617094 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 8 Oct 2024 15:37:07 +0200 Subject: [PATCH] Removed old project, New project setup with Docker and Svelte --- .gitignore | 23 +++- .npmrc | 1 + .prettierignore | 4 + .prettierrc | 8 ++ README.md | 39 +++++- docker-compose.yml | 17 +++ dockerfile | 51 ++++++++ eslint.config.js | 32 +++++ package.json | 32 +++++ requirements.txt | 2 - src/app.d.ts | 13 ++ src/app.html | 12 ++ src/db.sqlite3 | Bin 159744 -> 0 bytes src/lib/index.ts | 1 + src/manage.py | 22 ---- src/routes/+page.svelte | 2 + src/wishlists/__init__.py | 0 src/wishlists/admin.py | 3 - src/wishlists/apps.py | 6 - src/wishlists/handler/__init__.py | 0 src/wishlists/handler/wishlist/__init__.py | 0 .../handler/wishlist/get_wishlist_handler.py | 16 --- src/wishlists/migrations/0001_initial.py | 40 ------ ...002_alter_wishlist_description_and_more.py | 33 ----- src/wishlists/migrations/__init__.py | 0 src/wishlists/models.py | 30 ----- src/wishlists/templates/owner/index.html | 9 -- src/wishlists/templates/public/index.html | 37 ------ src/wishlists/tests.py | 3 - src/wishlists/urls.py | 9 -- src/wishlists/views.py | 27 ---- src/zauberkiste/__init__.py | 0 src/zauberkiste/asgi.py | 16 --- src/zauberkiste/settings.py | 123 ------------------ src/zauberkiste/urls.py | 19 --- src/zauberkiste/wsgi.py | 16 --- static/favicon.png | Bin 0 -> 1571 bytes svelte.config.js | 18 +++ tsconfig.json | 19 +++ vite.config.ts | 6 + 40 files changed, 274 insertions(+), 415 deletions(-) create mode 100644 .npmrc create mode 100644 .prettierignore create mode 100644 .prettierrc create mode 100644 docker-compose.yml create mode 100644 dockerfile create mode 100644 eslint.config.js create mode 100644 package.json delete mode 100644 requirements.txt create mode 100644 src/app.d.ts create mode 100644 src/app.html delete mode 100644 src/db.sqlite3 create mode 100644 src/lib/index.ts delete mode 100644 src/manage.py create mode 100644 src/routes/+page.svelte delete mode 100644 src/wishlists/__init__.py delete mode 100644 src/wishlists/admin.py delete mode 100644 src/wishlists/apps.py delete mode 100644 src/wishlists/handler/__init__.py delete mode 100644 src/wishlists/handler/wishlist/__init__.py delete mode 100644 src/wishlists/handler/wishlist/get_wishlist_handler.py delete mode 100644 src/wishlists/migrations/0001_initial.py delete mode 100644 src/wishlists/migrations/0002_alter_wishlist_description_and_more.py delete mode 100644 src/wishlists/migrations/__init__.py delete mode 100644 src/wishlists/models.py delete mode 100644 src/wishlists/templates/owner/index.html delete mode 100644 src/wishlists/templates/public/index.html delete mode 100644 src/wishlists/tests.py delete mode 100644 src/wishlists/urls.py delete mode 100644 src/wishlists/views.py delete mode 100644 src/zauberkiste/__init__.py delete mode 100644 src/zauberkiste/asgi.py delete mode 100644 src/zauberkiste/settings.py delete mode 100644 src/zauberkiste/urls.py delete mode 100644 src/zauberkiste/wsgi.py create mode 100644 static/favicon.png create mode 100644 svelte.config.js create mode 100644 tsconfig.json create mode 100644 vite.config.ts diff --git a/.gitignore b/.gitignore index 925c749..79518f7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,21 @@ -/.env -__pycache__/ \ No newline at end of file +node_modules + +# Output +.output +.vercel +/.svelte-kit +/build + +# OS +.DS_Store +Thumbs.db + +# Env +.env +.env.* +!.env.example +!.env.test + +# Vite +vite.config.js.timestamp-* +vite.config.ts.timestamp-* diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..b6f27f1 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +engine-strict=true diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ab78a95 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,4 @@ +# Package Managers +package-lock.json +pnpm-lock.yaml +yarn.lock diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..9573023 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100, + "plugins": ["prettier-plugin-svelte"], + "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] +} diff --git a/README.md b/README.md index b1a605d..5ce6766 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,38 @@ -# Zauberkiste +# create-svelte -A selfhosted wishlist manager. +Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte). + +## Creating a project + +If you're seeing this, you've probably already done this step. Congrats! + +```bash +# create a new project in the current directory +npm create svelte@latest + +# create a new project in my-app +npm create svelte@latest my-app +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +To create a production version of your app: + +```bash +npm run build +``` + +You can preview the production build with `npm run preview`. + +> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..f966a42 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,17 @@ +version: '3' + +services: + zauberkiste: + build: + context: . + target: dev # Build the development target + ports: + - "5173:5173" + - "24678:24678" + volumes: + - .:/app + - /app/node_modules + - ./data:/app/data + container_name: svelte-app-dev + environment: + NODE_ENV: development diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..df6967e --- /dev/null +++ b/dockerfile @@ -0,0 +1,51 @@ +# Stage 1: Base stage +FROM node:18 AS base + +# Set the working directory +WORKDIR /app + +# Copy package.json and package-lock.json +COPY package*.json ./ + +# Install dependencies +RUN npm install + +# Copy the rest of the application files +COPY . . + +# Define build arguments +ARG NODE_ENV +ENV NODE_ENV=$NODE_ENV + +# Stage 2: Development stage +FROM base AS dev + +# Expose ports needed for the development server and hot module reloading +EXPOSE 5173 24678 + +# In development mode, run the dev server +CMD ["npm", "run", "dev", "--", "--host"] + +# Stage 3: Build for production +FROM base AS build + +# Build the Svelte app in production mode +RUN npm run build + +# Stage 4: Production stage +FROM node:18-alpine AS prod + +# Install a lightweight server to serve the production build +RUN npm install -g serve + +# Set the working directory +WORKDIR /app + +# Copy the built files from the build stage +COPY --from=build /app/build /app/build + +# Expose port 5000 for serving the production app +EXPOSE 5000 + +# Serve the production build +CMD ["serve", "-s", "build", "-l", "5000"] diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..39ea393 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,32 @@ +import eslint from '@eslint/js'; +import prettier from 'eslint-config-prettier'; +import svelte from 'eslint-plugin-svelte'; +import globals from 'globals'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, + ...svelte.configs['flat/recommended'], + prettier, + ...svelte.configs['flat/prettier'], + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + }, + { + files: ['**/*.svelte'], + languageOptions: { + parserOptions: { + parser: tseslint.parser + } + } + }, + { + ignores: ['build/', '.svelte-kit/', 'dist/'] + } +); diff --git a/package.json b/package.json new file mode 100644 index 0000000..dff1c99 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "zauberkiste", + "version": "0.0.1", + "private": true, + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --check . && eslint .", + "format": "prettier --write ." + }, + "devDependencies": { + "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/kit": "^2.0.0", + "@sveltejs/vite-plugin-svelte": "^3.0.0", + "@types/eslint": "^9.6.0", + "eslint": "^9.0.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0", + "globals": "^15.0.0", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", + "svelte": "^4.2.7", + "svelte-check": "^4.0.0", + "typescript": "^5.0.0", + "typescript-eslint": "^8.0.0", + "vite": "^5.0.3" + }, + "type": "module" +} diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index fe22a16..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Django>=4.2.7 -mysqlclient \ No newline at end of file diff --git a/src/app.d.ts b/src/app.d.ts new file mode 100644 index 0000000..743f07b --- /dev/null +++ b/src/app.d.ts @@ -0,0 +1,13 @@ +// See https://kit.svelte.dev/docs/types#app +// for information about these interfaces +declare global { + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } +} + +export {}; diff --git a/src/app.html b/src/app.html new file mode 100644 index 0000000..77a5ff5 --- /dev/null +++ b/src/app.html @@ -0,0 +1,12 @@ + + + + + + + %sveltekit.head% + + +
%sveltekit.body%
+ + diff --git a/src/db.sqlite3 b/src/db.sqlite3 deleted file mode 100644 index f1e11f67d8fdd8c4c5f638b523880c4dfcd93827..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159744 zcmeI5TWlLwddE2;MN*c?ku1xMFS16m6`NILaX7p>O%uk^+Fn~qVmoz=Hkb~{ku(V} z3WxHgi!DGWY1;JivgiUW&`k@pK#TUFEehmevoB4H-L|{kqR6&rn-=KPq7R!binRN% zEzs|rnc)nF)CG3hRKlOIk7mw%=bP{QoeO!sbB4U};x(hKOKZ(mU2989U_2lQfoCKs z5D1*L|IgFkA^N{c|3mcOc?r(J4u8)E&fog{FbN3a51ClP`m;j`Tmk_Q009sH0T2KI z5C8!X009sH0TB3<2~17LNaNI@MnL?!_+_yw&c^>X{)_QvWB(odYV2+-GxpuFcgKEw zY-04=qi>DAFnavZH%JsO5C8!X009sH0T2KI5ZEJum#2mUGxgG4!`!GDX4_1qQi|%F z(K=LJZMLdTP7L5X0*(<+R*B{TG#HWHNCOk-tgSs)s$6=a`BmQ(saquB&%DS44b;yYTmoA zZtAVNVc9iMgObe`vKK|tu;OS)*$mfP&8^KnnUPj9igGDVN?x*+q>8o@?odtJqd%!a zu9*5a@nOJVoD|WfUx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src/wishlists/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/wishlists/admin.py b/src/wishlists/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/src/wishlists/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/src/wishlists/apps.py b/src/wishlists/apps.py deleted file mode 100644 index 0d5575f..0000000 --- a/src/wishlists/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class WishlistsConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'wishlists' diff --git a/src/wishlists/handler/__init__.py b/src/wishlists/handler/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/wishlists/handler/wishlist/__init__.py b/src/wishlists/handler/wishlist/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/wishlists/handler/wishlist/get_wishlist_handler.py b/src/wishlists/handler/wishlist/get_wishlist_handler.py deleted file mode 100644 index a9d477e..0000000 --- a/src/wishlists/handler/wishlist/get_wishlist_handler.py +++ /dev/null @@ -1,16 +0,0 @@ -from uuid import UUID - -from django.http import Http404 - -from wishlists.models import Wishlist - - -def get_wishlist_by_uuid(uuid: UUID) -> Wishlist: - return Wishlist.objects.get(id=uuid) - - -def get_wishlist_or_404_by_uuid(uuid: UUID) -> Wishlist: - try: - return get_wishlist_by_uuid(uuid) - except Wishlist.DoesNotExist: - raise Http404("This wishlist does not exist.") diff --git a/src/wishlists/migrations/0001_initial.py b/src/wishlists/migrations/0001_initial.py deleted file mode 100644 index 9241fec..0000000 --- a/src/wishlists/migrations/0001_initial.py +++ /dev/null @@ -1,40 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-27 22:52 - -from django.db import migrations, models -import django.db.models.deletion - - -class Migration(migrations.Migration): - - initial = True - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='Wishlist', - fields=[ - ('id', models.UUIDField(primary_key=True, serialize=False)), - ('name', models.CharField(max_length=200)), - ('description', models.CharField(max_length=2000)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ], - ), - migrations.CreateModel( - name='WishlistItem', - fields=[ - ('id', models.UUIDField(primary_key=True, serialize=False)), - ('name', models.CharField(max_length=200)), - ('description', models.CharField(max_length=2000)), - ('url', models.CharField(max_length=2000)), - ('price', models.FloatField()), - ('image', models.CharField(blank=True, max_length=2000, null=True)), - ('gifted', models.BooleanField(default=False)), - ('created_at', models.DateTimeField(auto_now_add=True)), - ('updated_at', models.DateTimeField(auto_now=True)), - ('wishlist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='wishlists.wishlist')), - ], - ), - ] diff --git a/src/wishlists/migrations/0002_alter_wishlist_description_and_more.py b/src/wishlists/migrations/0002_alter_wishlist_description_and_more.py deleted file mode 100644 index dbb0abe..0000000 --- a/src/wishlists/migrations/0002_alter_wishlist_description_and_more.py +++ /dev/null @@ -1,33 +0,0 @@ -# Generated by Django 4.2.7 on 2023-11-27 23:02 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ('wishlists', '0001_initial'), - ] - - operations = [ - migrations.AlterField( - model_name='wishlist', - name='description', - field=models.CharField(max_length=2000, null=True), - ), - migrations.AlterField( - model_name='wishlistitem', - name='description', - field=models.CharField(max_length=2000, null=True), - ), - migrations.AlterField( - model_name='wishlistitem', - name='price', - field=models.FloatField(null=True), - ), - migrations.AlterField( - model_name='wishlistitem', - name='url', - field=models.CharField(max_length=2000, null=True), - ), - ] diff --git a/src/wishlists/migrations/__init__.py b/src/wishlists/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/wishlists/models.py b/src/wishlists/models.py deleted file mode 100644 index 8728651..0000000 --- a/src/wishlists/models.py +++ /dev/null @@ -1,30 +0,0 @@ -from django.db import models - - -class Wishlist(models.Model): - id = models.UUIDField(primary_key=True) - name = models.CharField(max_length=200) - description = models.CharField(max_length=2000, null=True) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - - def __str__(self): - return f"{self.name} ({self.id})" - - -class WishlistItem(models.Model): - id = models.UUIDField(primary_key=True) - wishlist = models.ForeignKey(Wishlist, on_delete=models.CASCADE) - name = models.CharField(max_length=200) - description = models.CharField(max_length=2000, null=True) - order = models.IntegerField(null=True) - url = models.CharField(max_length=2000, null=True) - price = models.FloatField(null=True) - image = models.CharField(max_length=2000, blank=True, null=True) - gifted = models.BooleanField(default=False) - reveal_date = models.DateTimeField(null=True) - created_at = models.DateTimeField(auto_now_add=True) - updated_at = models.DateTimeField(auto_now=True) - - def __str__(self): - return f"{self.name} ({self.id})" diff --git a/src/wishlists/templates/owner/index.html b/src/wishlists/templates/owner/index.html deleted file mode 100644 index 1d602cf..0000000 --- a/src/wishlists/templates/owner/index.html +++ /dev/null @@ -1,9 +0,0 @@ -{% if wishlist %} -

{{ wishlist.name }}

- Created on {{ wishlist.created_at }} - {% if wishlist.description %} -

{{ wishlist.description }}

- {% endif %} -{% else %} -

Wishlist not found.

-{% endif %} \ No newline at end of file diff --git a/src/wishlists/templates/public/index.html b/src/wishlists/templates/public/index.html deleted file mode 100644 index 16790fe..0000000 --- a/src/wishlists/templates/public/index.html +++ /dev/null @@ -1,37 +0,0 @@ -{% if wishlist %} -

{{ wishlist.name }}

- Created on {{ wishlist.created_at }} - {% if wishlist.description %} -

{{ wishlist.description }}

- {% endif %} - - Public link - - - - - - - - - - - - - {% for item in wishlist_items %} - - - - - - - - {% endfor %} - -
ItemPriceLinkPriorityActions
{{ item.name }}{{ item.price }}{{ item.link }}{{ item.priority }} - Edit - Delete -
-{% else %} -

Wishlist not found.

-{% endif %} \ No newline at end of file diff --git a/src/wishlists/tests.py b/src/wishlists/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/src/wishlists/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/src/wishlists/urls.py b/src/wishlists/urls.py deleted file mode 100644 index be37554..0000000 --- a/src/wishlists/urls.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.urls import path - -from . import views - -urlpatterns = [ - path("public//", views.public, name="public"), - path("owner//", views.owner, name="owner"), - path("", views.index, name="index"), -] diff --git a/src/wishlists/views.py b/src/wishlists/views.py deleted file mode 100644 index 8017973..0000000 --- a/src/wishlists/views.py +++ /dev/null @@ -1,27 +0,0 @@ -from uuid import UUID - -from django.http import HttpResponse, Http404 -from django.template import loader - -from .handler.wishlist.get_wishlist_handler import get_wishlist_or_404_by_uuid -from .models import Wishlist - - -# Create your views here. -def index(request): - return HttpResponse("Hello, world. You're at the wishlists index.") - - -def owner(request, wishlist_id: UUID): - wishlist = get_wishlist_or_404_by_uuid(wishlist_id) - return HttpResponse(f"You are the owner of wishlist '{wishlist.name}'.") - - -def public(request, wishlist_id: UUID): - template = loader.get_template("public/index.html") - wishlist = get_wishlist_or_404_by_uuid(wishlist_id) - context = { - "wishlist": wishlist, - "wishlist_items": wishlist.wishlistitem_set.all(), - } - return HttpResponse(template.render(context, request)) diff --git a/src/zauberkiste/__init__.py b/src/zauberkiste/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/src/zauberkiste/asgi.py b/src/zauberkiste/asgi.py deleted file mode 100644 index 95d3ed5..0000000 --- a/src/zauberkiste/asgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -ASGI config for zauberkiste 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/4.2/howto/deployment/asgi/ -""" - -import os - -from django.core.asgi import get_asgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'zauberkiste.settings') - -application = get_asgi_application() diff --git a/src/zauberkiste/settings.py b/src/zauberkiste/settings.py deleted file mode 100644 index e342bc0..0000000 --- a/src/zauberkiste/settings.py +++ /dev/null @@ -1,123 +0,0 @@ -""" -Django settings for zauberkiste project. - -Generated by 'django-admin startproject' using Django 4.2.7. - -For more information on this file, see -https://docs.djangoproject.com/en/4.2/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/4.2/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/4.2/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "django-insecure-jrs0@9gnu_))f6(%25n30yze^d93#62%l+*8yw+6b^j3_#po9c" - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] - - -# Application definition - -INSTALLED_APPS = [ - "wishlists.apps.WishlistsConfig", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", -] - -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 = "zauberkiste.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 = "zauberkiste.wsgi.application" - - -# Database -# https://docs.djangoproject.com/en/4.2/ref/settings/#databases - -DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": BASE_DIR / "db.sqlite3", - } -} - - -# Password validation -# https://docs.djangoproject.com/en/4.2/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/4.2/topics/i18n/ - -LANGUAGE_CODE = "en-us" - -TIME_ZONE = "Europe/Berlin" - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.2/howto/static-files/ - -STATIC_URL = "static/" - -# Default primary key field type -# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field - -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" diff --git a/src/zauberkiste/urls.py b/src/zauberkiste/urls.py deleted file mode 100644 index f16d636..0000000 --- a/src/zauberkiste/urls.py +++ /dev/null @@ -1,19 +0,0 @@ -""" -URL configuration for zauberkiste project. - -The `urlpatterns` list routes URLs to views. For more information please see: - https://docs.djangoproject.com/en/4.2/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.urls import path, include - -urlpatterns = [path("", include("wishlists.urls"))] diff --git a/src/zauberkiste/wsgi.py b/src/zauberkiste/wsgi.py deleted file mode 100644 index 525d7c0..0000000 --- a/src/zauberkiste/wsgi.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -WSGI config for zauberkiste 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/4.2/howto/deployment/wsgi/ -""" - -import os - -from django.core.wsgi import get_wsgi_application - -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'zauberkiste.settings') - -application = get_wsgi_application() diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000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