From bf1e6a5857656f2272b8c0196b09ac200d6ea3c8 Mon Sep 17 00:00:00 2001 From: Cameron Nicolson Date: Sun, 9 Feb 2025 18:36:21 +0000 Subject: [PATCH] redundant example django files --- examples/local_server_settings.py | 114 ------------------------------ examples/manage.py | 22 ------ 2 files changed, 136 deletions(-) delete mode 100644 examples/local_server_settings.py delete mode 100755 examples/manage.py diff --git a/examples/local_server_settings.py b/examples/local_server_settings.py deleted file mode 100644 index e592c65..0000000 --- a/examples/local_server_settings.py +++ /dev/null @@ -1,114 +0,0 @@ -""" -Django settings for hosting the examples server. - -For more information on this file, see -https://docs.djangoproject.com/en/dev/topics/settings/ - -For the full list of settings and their values, see -https://docs.djangoproject.com/en/dev/ref/settings/ -""" - -from pathlib import Path - - -ROOT_DIR = Path(__file__).resolve().parent.parent - -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = "django-insecure-2&ud8x@c@86nm9*7&o*8-3_y_#)n-2ay3jp_ft2t71@v9r*+%9" - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = ["localhost", "0.0.0.0"] - -# Application definition - -INSTALLED_APPS = [ - "django.contrib.admin", - "django.contrib.auth", - "django.contrib.contenttypes", - "django.contrib.sessions", - "django.contrib.messages", - "django.contrib.staticfiles", - "django.contrib.sites", - "blog_improved", -] - -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 = "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 = "example.wsgi.application" - - -# Database -# https://docs.djangoproject.com/en/4.0/ref/settings/#databases - -DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": ROOT_DIR / "example_db.sqlite3", - } -} - - -# Internationalization -# https://docs.djangoproject.com/en/4.0/topics/i18n/ - -LANGUAGE_CODE = "en-gb" - -TIME_ZONE = "UTC" - -USE_I18N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/4.0/howto/static-files/ - -STATIC_ROOT = str(ROOT_DIR / "staticfiles") - -# Default primary key field type -# https://docs.djangoproject.com/en/dev/ref/settings/#default-auto-field -DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/dev/howto/static-files/ -STATIC_ROOT = ROOT_DIR / "staticfiles" - -STATICFILES_DIRS = [ - ROOT_DIR / "static/", -] - -FIXTURE_DIRS = [ - ROOT_DIR / "admin_login.json", - ROOT_DIR / "postlist" / "headlines" / "fixtures" / "postlist_headlines.json" -] diff --git a/examples/manage.py b/examples/manage.py deleted file mode 100755 index 8cecc74..0000000 --- a/examples/manage.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -"""Django's command-line utility for administrative tasks.""" -import os -import sys - - -def main(): - """Run administrative tasks.""" - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'local_server_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()