Skip to content

Commit f768efc

Browse files
committed
initial commit
1 parent bf0583b commit f768efc

28 files changed

+872
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

.idea/.gitignore

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/Project.xml

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dataSources.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dbnavigator.xml

Lines changed: 455 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/djangotutorial.iml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pipfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
django = "*"
10+
mysqlclient = "*"
11+
python-dotenv = "*"
12+
13+
[requires]
14+
python_version = "3.8"

Pipfile.lock

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

djangotutorial/__init__.py

Whitespace-only changes.

djangotutorial/settings.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
import os
2+
3+
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
4+
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
5+
6+
# SECURITY WARNING: keep the secret key used in production secret!
7+
SECRET_KEY = os.environ.get('SECRET_KEY')
8+
9+
# Basic config
10+
DEBUG = True
11+
ALLOWED_HOSTS = ['0.0.0.0', '127.0.0.1', 'localhost', '127.0.0.1:8000']
12+
WSGI_APPLICATION = 'djangotutorial.wsgi.application'
13+
14+
# Application definition
15+
INSTALLED_APPS = [
16+
'django.contrib.admin',
17+
'django.contrib.auth',
18+
'django.contrib.contenttypes',
19+
'django.contrib.sessions',
20+
'django.contrib.messages',
21+
'django.contrib.staticfiles',
22+
'myapp',
23+
]
24+
25+
# Added middleware
26+
MIDDLEWARE = [
27+
'django.middleware.security.SecurityMiddleware',
28+
'django.contrib.sessions.middleware.SessionMiddleware',
29+
'django.middleware.common.CommonMiddleware',
30+
'django.middleware.csrf.CsrfViewMiddleware',
31+
'django.contrib.auth.middleware.AuthenticationMiddleware',
32+
'django.contrib.messages.middleware.MessageMiddleware',
33+
'django.middleware.clickjacking.XFrameOptionsMiddleware',
34+
]
35+
36+
# URLs
37+
ROOT_URLCONF = 'djangotutorial.urls'
38+
39+
# Database
40+
DATABASES = {
41+
'default': {
42+
'ENGINE': os.environ.get('DB_ENGINE'),
43+
'NAME': os.environ.get('DB_NAME'),
44+
'USER': os.environ.get('DB_USER'),
45+
'PASSWORD': os.environ.get('DB_USER'),
46+
'HOST': os.environ.get('DB_HOST'),
47+
'PORT': os.environ.get('DB_PORT'),
48+
}
49+
}
50+
51+
# Password validation
52+
AUTH_PASSWORD_VALIDATORS = [
53+
{'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',},
54+
{'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',},
55+
{'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',},
56+
{'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',},
57+
]
58+
59+
# Internationalization
60+
LANGUAGE_CODE = 'en-us'
61+
TIME_ZONE = 'EST'
62+
USE_I18N = True
63+
USE_L10N = True
64+
USE_TZ = True
65+
66+
# Base template folder & templating engine
67+
TEMPLATES = [
68+
{
69+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
70+
"DIRS": [os.path.join(BASE_DIR, "djangotutorial/templates/")],
71+
'APP_DIRS': True,
72+
'OPTIONS': {
73+
'context_processors': [
74+
'django.template.context_processors.debug',
75+
'django.template.context_processors.request',
76+
'django.contrib.auth.context_processors.auth',
77+
'django.contrib.messages.context_processors.messages',
78+
],
79+
},
80+
},
81+
]
82+
83+
# Static files (CSS, JavaScript, Images)
84+
STATIC_URL = '/static/'
85+
STATICFILES_DIRS = [
86+
"/myapp/static/",
87+
]
88+
89+
# Etc.
90+
APPEND_SLASH = True

djangotutorial/templates/layout.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{% load static %}
2+
3+
<!DOCTYPE html>
4+
<html lang="en">
5+
6+
<head>
7+
<title>{{title}}</title>
8+
<meta charset="utf-8" />
9+
<meta name="description" content="This is a description">
10+
<link rel="manifest" href="site.webmanifest">
11+
<meta name="HandheldFriendly" content="True" />
12+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
13+
<meta name="theme-color" content="#fafafa">
14+
<link rel="apple-touch-icon" href="icon.png">
15+
16+
17+
{% block styles %}
18+
19+
{% endblock %}
20+
</head>
21+
22+
<body class="{{template}}">
23+
{% block content %}{% endblock %}
24+
</body>
25+
26+
</html>

djangotutorial/urls.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""djangotutorial URL Configuration
2+
3+
The `urlpatterns` list routes URLs to views. For more information please see:
4+
https://docs.djangoproject.com/en/2.2/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, include
18+
19+
urlpatterns = [
20+
path('admin/', admin.site.urls),
21+
path('', include('myapp.urls')),
22+
]

djangotutorial/wsgi.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
WSGI config for djangotutorial 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/2.2/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', 'djangotutorial.settings')
15+
16+
application = get_wsgi_application()

manage.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangotutorial.settings')
9+
try:
10+
from django.core.management import execute_from_command_line
11+
except ImportError as exc:
12+
raise ImportError(
13+
"Couldn't import Django. Are you sure it's installed and "
14+
"available on your PYTHONPATH environment variable? Did you "
15+
"forget to activate a virtual environment?"
16+
) from exc
17+
execute_from_command_line(sys.argv)
18+
19+
20+
if __name__ == '__main__':
21+
main()

myapp/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)