From 8fef4f742478b0491d180495493fde4c39580ade Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 15 Feb 2020 15:09:21 +0100 Subject: [PATCH] Yeah, up to a good start, I know... --- admin.py | 3 - apps.py | 5 -- __init__.py => expcs/__init__.py | 0 expcs/asgi.py | 16 +++++ expcs/settings.py | 120 +++++++++++++++++++++++++++++++ expcs/urls.py | 21 ++++++ expcs/wsgi.py | 16 +++++ manage.py | 21 ++++++ migrations/__init__.py | 0 models.py | 3 - tests.py | 3 - views.py | 3 - 12 files changed, 194 insertions(+), 17 deletions(-) delete mode 100644 admin.py delete mode 100644 apps.py rename __init__.py => expcs/__init__.py (100%) create mode 100644 expcs/asgi.py create mode 100644 expcs/settings.py create mode 100644 expcs/urls.py create mode 100644 expcs/wsgi.py create mode 100755 manage.py delete mode 100644 migrations/__init__.py delete mode 100644 models.py delete mode 100644 tests.py delete mode 100644 views.py diff --git a/admin.py b/admin.py deleted file mode 100644 index 8c38f3f..0000000 --- a/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/apps.py b/apps.py deleted file mode 100644 index 65261af..0000000 --- a/apps.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.apps import AppConfig - - -class ExpcsConfig(AppConfig): - name = 'expcs' diff --git a/__init__.py b/expcs/__init__.py similarity index 100% rename from __init__.py rename to expcs/__init__.py diff --git a/expcs/asgi.py b/expcs/asgi.py new file mode 100644 index 0000000..9a99c24 --- /dev/null +++ b/expcs/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for expcs 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/3.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expcs.settings') + +application = get_asgi_application() diff --git a/expcs/settings.py b/expcs/settings.py new file mode 100644 index 0000000..e387def --- /dev/null +++ b/expcs/settings.py @@ -0,0 +1,120 @@ +""" +Django settings for expcs project. + +Generated by 'django-admin startproject' using Django 3.0.3. + +For more information on this file, see +https://docs.djangoproject.com/en/3.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.0/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/3.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'v))#wh%^fu%zq6jy6p50-ywc$s)b0$611honu0j!@*p%_!w1h!' + +# 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', +] + +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 = 'expcs.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 = 'expcs.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.0/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/3.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/3.0/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/3.0/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/expcs/urls.py b/expcs/urls.py new file mode 100644 index 0000000..6716a44 --- /dev/null +++ b/expcs/urls.py @@ -0,0 +1,21 @@ +"""expcs URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.0/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/expcs/wsgi.py b/expcs/wsgi.py new file mode 100644 index 0000000..e1f7b78 --- /dev/null +++ b/expcs/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for expcs 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/3.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expcs.settings') + +application = get_wsgi_application() diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..0d44037 --- /dev/null +++ b/manage.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expcs.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() diff --git a/migrations/__init__.py b/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/models.py b/models.py deleted file mode 100644 index 71a8362..0000000 --- a/models.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.db import models - -# Create your models here. diff --git a/tests.py b/tests.py deleted file mode 100644 index 7ce503c..0000000 --- a/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/views.py b/views.py deleted file mode 100644 index 91ea44a..0000000 --- a/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here.