Skip to content

Commit ebfdda5

Browse files
author
=Nathanael Armstrong
committed
first commit
0 parents  commit ebfdda5

File tree

7 files changed

+224
-0
lines changed

7 files changed

+224
-0
lines changed

.gitignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# File types #
2+
##############
3+
*.pyc
4+
*.swo
5+
*.swp
6+
*.swn
7+
*.env
8+
9+
# Directories #
10+
###############
11+
logs/
12+
13+
# OS generated files #
14+
######################
15+
.DS_Store
16+
ehthumbs.db
17+
Icon
18+
Thumbs.db
19+
*~

manage.py

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
"""Run administrative tasks."""
9+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysql.settings')
10+
try:
11+
from django.core.management import execute_from_command_line
12+
except ImportError as exc:
13+
raise ImportError(
14+
"Couldn't import Django. Are you sure it's installed and "
15+
"available on your PYTHONPATH environment variable? Did you "
16+
"forget to activate a virtual environment?"
17+
) from exc
18+
execute_from_command_line(sys.argv)
19+
20+
21+
if __name__ == '__main__':
22+
main()

mysql/__init__.py

Whitespace-only changes.

mysql/asgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
ASGI config for mysql project.
3+
4+
It exposes the ASGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.asgi import get_asgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysql.settings')
15+
16+
application = get_asgi_application()

mysql/settings.py

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
"""
2+
Django settings for mysql project.
3+
4+
Generated by 'django-admin startproject' using Django 3.1.5.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/topics/settings/
8+
9+
For the full list of settings and their values, see
10+
https://docs.djangoproject.com/en/3.1/ref/settings/
11+
"""
12+
13+
# stuff for heroku
14+
import django_heroku
15+
from decouple import Config
16+
from pathlib import Path
17+
18+
# Build paths inside the project like this: BASE_DIR / 'subdir'.
19+
BASE_DIR = Path(__file__).resolve().parent.parent
20+
21+
22+
# Quick-start development settings - unsuitable for production
23+
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
24+
25+
# SECURITY WARNING: keep the secret key used in production secret!
26+
# Import Secret Keys
27+
SECRET_KEY = Config('SECRET_KEY')
28+
29+
# SECURITY WARNING: don't run with debug turned on in production!
30+
DEBUG = True
31+
32+
ALLOWED_HOSTS = []
33+
34+
35+
# Application definition
36+
37+
INSTALLED_APPS = [
38+
'django.contrib.admin',
39+
'django.contrib.auth',
40+
'django.contrib.contenttypes',
41+
'django.contrib.sessions',
42+
'django.contrib.messages',
43+
'django.contrib.staticfiles',
44+
'django_extensions',
45+
'werkzeug',
46+
'import_export',
47+
'rest_framework',
48+
]
49+
50+
MIDDLEWARE = [
51+
'django.middleware.security.SecurityMiddleware',
52+
'whitenoise.middleware.WhiteNoiseMiddleware',
53+
'django.contrib.sessions.middleware.SessionMiddleware',
54+
'django.middleware.common.CommonMiddleware',
55+
'django.middleware.csrf.CsrfViewMiddleware',
56+
'django.contrib.auth.middleware.AuthenticationMiddleware',
57+
'django.contrib.messages.middleware.MessageMiddleware',
58+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
59+
]
60+
61+
ROOT_URLCONF = 'mysql.urls'
62+
63+
TEMPLATES = [
64+
{
65+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
66+
'DIRS': [],
67+
'APP_DIRS': True,
68+
'OPTIONS': {
69+
'context_processors': [
70+
'django.template.context_processors.debug',
71+
'django.template.context_processors.request',
72+
'django.contrib.auth.context_processors.auth',
73+
'django.contrib.messages.context_processors.messages',
74+
],
75+
},
76+
},
77+
]
78+
79+
WSGI_APPLICATION = 'mysql.wsgi.application'
80+
81+
82+
# Database
83+
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
84+
85+
DATABASES = {
86+
'default': {
87+
'ENGINE': 'django.db.backends.sqlite3',
88+
'NAME': BASE_DIR / 'db.sqlite3',
89+
}
90+
}
91+
92+
93+
# Password validation
94+
# https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators
95+
96+
AUTH_PASSWORD_VALIDATORS = [
97+
{
98+
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
99+
},
100+
{
101+
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
102+
},
103+
{
104+
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
105+
},
106+
{
107+
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
108+
},
109+
]
110+
111+
112+
# Internationalization
113+
# https://docs.djangoproject.com/en/3.1/topics/i18n/
114+
115+
LANGUAGE_CODE = 'en-us'
116+
117+
TIME_ZONE = 'UTC'
118+
119+
USE_I18N = True
120+
121+
USE_L10N = True
122+
123+
USE_TZ = True
124+
125+
STATIC_ROOT = BASE_DIR / 'static'
126+
STATIC_URL = '/static/'
127+
STATICFILES_DIRS = [
128+
]
129+
130+
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

mysql/urls.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""mysql URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/3.1/topics/http/urls/
5+
Examples:
6+
Function views
7+
1. Add an import: from my_app import views
8+
2. Add a URL to urlpatterns: path('', views.home, name='home')
9+
Class-based views
10+
1. Add an import: from other_app.views import Home
11+
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home')
12+
Including another URLconf
13+
1. Import the include() function: from django.urls import include, path
14+
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
15+
"""
16+
from django.contrib import admin
17+
from django.urls import path
18+
19+
urlpatterns = [
20+
path('admin/', admin.site.urls),
21+
]

mysql/wsgi.py

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for mysql project.
3+
4+
It exposes the WSGI callable as a module-level variable named ``application``.
5+
6+
For more information on this file, see
7+
https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/
8+
"""
9+
10+
import os
11+
12+
from django.core.wsgi import get_wsgi_application
13+
14+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysql.settings')
15+
16+
application = get_wsgi_application()

0 commit comments

Comments
 (0)