Generate a Django project

This commit is contained in:
Jesse Braham 2025-05-26 20:13:27 +02:00
parent f392c84663
commit cc7410337e
8 changed files with 137 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# Virtual environment
venv/
# Django database
db.sqlite3

0
fullsterkur/__init__.hy Normal file
View File

15
fullsterkur/asgi.hy Normal file
View File

@ -0,0 +1,15 @@
"
ASGI config for fullsterkur 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.2/howto/deployment/asgi/
"
(import os)
(import django.core.asgi [get_asgi_application])
((. os.environ setdefault) "DJANGO_SETTINGS_MODULE" "fullsterkur.settings")
(setv application (get_asgi_application))

59
fullsterkur/settings.hy Normal file
View File

@ -0,0 +1,59 @@
"
Django settings for fullsterkur project.
Generated by 'django-admin startproject' using Django 5.2.1.
For more information on this file, see
https://docs.djangoproject.com/en/5.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/5.2/ref/settings/
"
(import pathlib [Path])
(setv BASE_DIR (. (. ((. (Path __file__) resolve)) parent) parent))
(setv SECRET_KEY "django-insecure-s=0@zbq)19oclq(kmtls9hxmp=3q=gr5e-7ji+t6n8gaxfcoum")
(setv DEBUG True)
(setv ALLOWED_HOSTS [])
(setv INSTALLED_APPS ["django.contrib.admin"
"django.contrib.auth"
"django.contrib.contenttypes"
"django.contrib.sessions"
"django.contrib.messages"
"django.contrib.staticfiles"])
(setv 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"])
(setv ROOT_URLCONF "fullsterkur.urls")
(setv TEMPLATES [{"BACKEND" "django.template.backends.django.DjangoTemplates"
"DIRS" []
"APP_DIRS" True
"OPTIONS" {"context_processors" ["django.template.context_processors.request"
"django.contrib.auth.context_processors.auth"
"django.contrib.messages.context_processors.messages"]}}])
(setv WSGI_APPLICATION "fullsterkur.wsgi.application")
(setv DATABASES {"default" {"ENGINE" "django.db.backends.sqlite3"
"NAME" (/ BASE_DIR "db.sqlite3")}})
(setv 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"}])
(setv LANGUAGE_CODE "en-us")
(setv TIME_ZONE "UTC")
(setv USE_I18N True)
(setv USE_TZ True)
(setv STATIC_URL "static/")
(setv DEFAULT_AUTO_FIELD "django.db.models.BigAutoField")

21
fullsterkur/urls.hy Normal file
View File

@ -0,0 +1,21 @@
"
URL configuration for fullsterkur project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.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'))
"
(import django.contrib [admin])
(import django.urls [path])
(setv urlpatterns [(path "admin/" (. admin.site urls))])

15
fullsterkur/wsgi.hy Normal file
View File

@ -0,0 +1,15 @@
"
WSGI config for fullsterkur 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.2/howto/deployment/wsgi/
"
(import os)
(import django.core.wsgi [get_wsgi_application])
((. os.environ setdefault) "DJANGO_SETTINGS_MODULE" "fullsterkur.settings")
(setv application (get_wsgi_application))

16
manage.hy Normal file
View File

@ -0,0 +1,16 @@
"Django's command-line utility for administrative tasks."
(import os)
(import sys)
(defn main []
"Run administrative tasks."
((. os.environ setdefault) "DJANGO_SETTINGS_MODULE" "fullsterkur.settings")
(try
(import django.core.management [execute_from_command_line])
(except [exc ImportError]
(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))
(when (= __name__ "__main__")
(main))

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
Django==5.2.1
hy==1.1.0