diff --git a/manage.py b/manage.py new file mode 100755 index 0000000..bb1dd90 --- /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', 'website.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/requirements.txt b/requirements.txt index e69de29..7073226 100644 --- a/requirements.txt +++ b/requirements.txt @@ -0,0 +1 @@ +django==3.0.5 diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000..d8b4b05 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +export PATH=env/bin:${PATH} + +./manage.py runserver diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..2810d47 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +set -e + +export PATH=env/bin:${PATH} + +echo "> Running formatter..." +black website/ --check + +echo "> Running linter..." +flake8 website/ + +echo "> Running isort..." +isort -rc -c website/ + +echo "> Running type checker..." +mypy website/ diff --git a/website/__init__.py b/website/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/website/settings.py b/website/settings.py new file mode 100644 index 0000000..c68f350 --- /dev/null +++ b/website/settings.py @@ -0,0 +1,75 @@ +""" +Django settings for website project. + +Generated by 'django-admin startproject' using Django 3.0.5. + +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 = "gd(%^4!762m4y*c56t(ppm&-5+*a*6-&5)n%nc^aqfi%54^u_j" + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + "django.contrib.staticfiles", +] + +MIDDLEWARE = [ + "django.middleware.security.SecurityMiddleware", + "django.middleware.common.CommonMiddleware", + "django.middleware.csrf.CsrfViewMiddleware", + "django.middleware.clickjacking.XFrameOptionsMiddleware", +] + +ROOT_URLCONF = "website.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", + ], + }, + }, +] + +WSGI_APPLICATION = "website.wsgi.application" + +LANGUAGE_CODE = "en-gb" + +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/website/urls.py b/website/urls.py new file mode 100644 index 0000000..e39cb2c --- /dev/null +++ b/website/urls.py @@ -0,0 +1,3 @@ +from django.urls import path + +urlpatterns = [] diff --git a/website/wsgi.py b/website/wsgi.py new file mode 100644 index 0000000..2ff8aaf --- /dev/null +++ b/website/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for website 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", "website.settings") + +application = get_wsgi_application()