From 70916e75779a35935f30068cf8300f54c890767e Mon Sep 17 00:00:00 2001 From: poka Date: Thu, 1 Oct 2020 05:04:41 +0200 Subject: [PATCH] Add skeleton for Django --- backend/backend/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 142 bytes .../__pycache__/settings.cpython-38.pyc | Bin 0 -> 2272 bytes .../backend/__pycache__/urls.cpython-38.pyc | Bin 0 -> 919 bytes .../backend/__pycache__/wsgi.cpython-38.pyc | Bin 0 -> 545 bytes backend/backend/asgi.py | 16 +++ backend/backend/settings.py | 120 ++++++++++++++++++ backend/backend/urls.py | 21 +++ backend/backend/wsgi.py | 16 +++ backend/db.sqlite3 | 0 backend/manage.py | 22 ++++ 11 files changed, 195 insertions(+) create mode 100644 backend/backend/__init__.py create mode 100644 backend/backend/__pycache__/__init__.cpython-38.pyc create mode 100644 backend/backend/__pycache__/settings.cpython-38.pyc create mode 100644 backend/backend/__pycache__/urls.cpython-38.pyc create mode 100644 backend/backend/__pycache__/wsgi.cpython-38.pyc create mode 100644 backend/backend/asgi.py create mode 100644 backend/backend/settings.py create mode 100644 backend/backend/urls.py create mode 100644 backend/backend/wsgi.py create mode 100644 backend/db.sqlite3 create mode 100755 backend/manage.py diff --git a/backend/backend/__init__.py b/backend/backend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/backend/__pycache__/__init__.cpython-38.pyc b/backend/backend/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6037eeb1b12d2131cee4337e9bfe863aff91a6ca GIT binary patch literal 142 zcmWIL<>g`kf_vG;@gVv!h(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vQKO;XkRlguV zJ5fI+wM;+VP`9`wv7}f(DKR-aH7^BD$H!;pWtPOp>lIYq;;_lhPbtkwwF4RU8HgDG D{ox=B literal 0 HcmV?d00001 diff --git a/backend/backend/__pycache__/settings.cpython-38.pyc b/backend/backend/__pycache__/settings.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1481e470fc725f082cc645e749c61c31642e3486 GIT binary patch literal 2272 zcmb7FTXWM!6qX&uc0>#z;Z|rtl+utwq@teU%j@Wdb{#i* z?cd;`ee8eeFVRC^`qV$r85pMYNWR45Fw@ksR;zRQ&e?CzS+$BqfrH;42h@CXhU5NB zUZ#Hqc-e-V{tg4;3=U;b*2%b8Bb(uH7SH{h`Gx&^G(jU1XY@`yJIHfJoLd6YwW zR6q+zuyclh&Y(q9L}$@Cw1m#vdE*RPHWtx}%^@CLKo`*^bQxW-d6GdNz2@zVQAAgb zv*;T780XL@*En?jb(Um|bLa*V!R7|KnU0^P<1Lc0d1DEEW}HX2jb+GT1?~%QUqqi9 zm(Z%lt=+NiWjIbK_bku$MT!|Co=wG$ABy`{`v7}L3_`z$+e{LK9qi%IVi<}0N8&0< zebz1H5>KSe3fahVRqRth5l5g~(k5Jj@C-0rKg1&O0N%A2@jVg#tV94$Fvd88w(rW=lL1g>en8q(9w#gh;aL}poxbCU4xvo+JI4#MU?HF-p?GLH zeN6vPtPppm0{sPB&aGu)zG<;;^yR_9;O^tcmUrJJIdU?pN3u1bTE~xGbsddn_dTQc7X8GAr!^{JkeJF=Y=Xu{_QkQ1Jx ztr_D9haYel>(=-<|5PcxQ0rxbFIRT8xS%wfW;)9^ntG*C*P<(9x(3uHk`)BNak_zV z9^sDFci5z!(f%=e^p!&x-iibej^=CGIH%TkDs?sH>q<=xlLI_@K9hJ_HGxIxzz>lL z=LA7%IH^T(sIa6}`wVNuC61MJ#mk|EA4X43i&P^Xar!q? zY@ZgO-gj|G+9wg_vA5o*##~D;MFkm-bLbYizIHjzne>)k;Z8 zY9(GME4q?|)#58kOMh-Q6;0b~?3T@!O0@#Y29#K_s?>K{%8qK58f6s#D>c_q-9 g`#$@Qf6p)R`9zlc2j;~r2U7mT_&2`-5r$XpUlkJl#Q*>R literal 0 HcmV?d00001 diff --git a/backend/backend/__pycache__/urls.cpython-38.pyc b/backend/backend/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..66883b9a7695db06a955a13c0ced126dbf1ae165 GIT binary patch literal 919 zcma)5O>fgM7*5i(D_IAB!M8M07gM-ZFo7l}CLs>MF1=)K?51hs582MxcIDUbmvZ33 zi35Lt3%pKK6d@taQXJcP{k+ffyl<{fP9hJ+x1Gs;2A=obZTe#Xn^*9dr!Y}(=~15s zmCu7^;Jfvp8t`x#`W_2u$b#)~JNgn7{_=2)|MG}!5}NqP02o+6kSM-xYP`lVl6dqA&{yVF$@{T z77>E6u~wM{##H7erCTBjskGd(+@`tYmJl5{eV{W62BP|%1Z%@&^dlTYPa}(GH#Bt4EiI>mXAA1pv3BOrJ-BB=D5dGyC0wl zO=(#ZI^xZ7ub5vw{RqCd(=Uu&^{|pVf+@Sf#r)J*Vh!&4|L@zur0T92zu=PA6+80* P!;E1HpG^G8VDkG9qBR{q literal 0 HcmV?d00001 diff --git a/backend/backend/__pycache__/wsgi.cpython-38.pyc b/backend/backend/__pycache__/wsgi.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d64d758d166af3e7f2af54c18c7d89e5f1c6eb90 GIT binary patch literal 545 zcmYk4!A=`75Qe=@AnCSL98k}`Mk?!~-m0o95)cKo;Sf-zTpY8WY@B%Q)!Kx@wTHe2 z9C@NjKJ>zgSLms;39VwuGa8R({?B7y?Chij*YAZFKNCV8n_zRbG5CzzzeA(Qn5aZi zlZ+GeEkn!JxRnq{=Iy&J)mB^g6r+d_8(4y2OIhnx%E}THn@nU?8J)|Z zot;du-wCRet_G$p3YMz`a~7Lx&!*bITjl}MSqPQ?z`1g{&(vJn!u?~)UCF`n_t^oT zx$EG#g37p?5^UhtzR)~5F%3NVh8L}*UrWi3l&V|l?n0XhT;RM zn}=MPKOCt`;FViQBwzC4VBZHBJbzaI?;C-vx{2M7>j{6tFF<@3P5VWczM`+`UzbRz A%>V!Z literal 0 HcmV?d00001 diff --git a/backend/backend/asgi.py b/backend/backend/asgi.py new file mode 100644 index 0000000..6dcedac --- /dev/null +++ b/backend/backend/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for backend 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.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_asgi_application() diff --git a/backend/backend/settings.py b/backend/backend/settings.py new file mode 100644 index 0000000..9aeeba5 --- /dev/null +++ b/backend/backend/settings.py @@ -0,0 +1,120 @@ +""" +Django settings for backend project. + +Generated by 'django-admin startproject' using Django 3.1.1. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.1/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/3.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'kkw+99i97l4#@d6f!hj=nz60v^p@0f3l8jgew10vfz%1h5elwp' + +# 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 = 'backend.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 = 'backend.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.1/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.1/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.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/backend/backend/urls.py b/backend/backend/urls.py new file mode 100644 index 0000000..e79761b --- /dev/null +++ b/backend/backend/urls.py @@ -0,0 +1,21 @@ +"""backend URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/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/backend/backend/wsgi.py b/backend/backend/wsgi.py new file mode 100644 index 0000000..006352d --- /dev/null +++ b/backend/backend/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for backend 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.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') + +application = get_wsgi_application() diff --git a/backend/db.sqlite3 b/backend/db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/backend/manage.py b/backend/manage.py new file mode 100755 index 0000000..87ac254 --- /dev/null +++ b/backend/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python3 +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.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()