· 8 years ago · Jul 06, 2017, 03:44 PM
1wsgi.py
2import os
3os.environ.setdefault("DJANGO_SETTINGS_MODULE",
4 "hellowebapp.settings")
5
6from django.core.wsgi import get_wsgi_application
7from whitenoise.django import DjangoWhiteNoise
8
9application = get_wsgi_application()
10application = DjangoWhiteNoise(application)
11
12Procfile
13web: waitress-serve --port=$PORT hellowebapp.wsgi:application
14
15Settings.py
16"""
17Django settings for hellowebapp project.
18
19Generated by 'django-admin startproject' using Django 1.9.6.
20
21For more information on this file, see
22https://docs.djangoproject.com/en/1.9/topics/settings/
23
24For the full list of settings and their values, see
25https://docs.djangoproject.com/en/1.9/ref/settings/
26"""
27
28import os
29
30# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
31BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
32
33
34# Quick-start development settings - unsuitable for production
35# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
36
37# SECURITY WARNING: keep the secret key used in production secret!
38SECRET_KEY = 'wzt4i_vdimu)8ozf%q$*2&hq+u+#8u-8og1zt1-b6k^3*5h9(j'
39
40# SECURITY WARNING: don't run with debug turned on in production!
41DEBUG = True
42
43ALLOWED_HOSTS = []
44
45
46# Application definition
47
48INSTALLED_APPS = [
49 'collection',
50 'django.contrib.admin',
51 'django.contrib.auth',
52 'django.contrib.contenttypes',
53 'django.contrib.sessions',
54 'django.contrib.messages',
55 'django.contrib.staticfiles',
56 'django.contrib.humanize',
57 'registration',
58]
59
60MIDDLEWARE_CLASSES = [
61 'django.middleware.security.SecurityMiddleware',
62 'django.contrib.sessions.middleware.SessionMiddleware',
63 'django.middleware.common.CommonMiddleware',
64 'django.middleware.csrf.CsrfViewMiddleware',
65 'django.contrib.auth.middleware.AuthenticationMiddleware',
66 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
67 'django.contrib.messages.middleware.MessageMiddleware',
68 'django.middleware.clickjacking.XFrameOptionsMiddleware',
69]
70
71ROOT_URLCONF = 'hellowebapp.urls'
72
73TEMPLATES = [
74 {
75 'BACKEND': 'django.template.backends.django.DjangoTemplates',
76 'DIRS': [],
77 'APP_DIRS': True,
78 'OPTIONS': {
79 'context_processors': [
80 'django.template.context_processors.debug',
81 'django.template.context_processors.request',
82 'django.contrib.auth.context_processors.auth',
83 'django.contrib.messages.context_processors.messages',
84 ],
85 },
86 },
87]
88
89WSGI_APPLICATION = 'hellowebapp.wsgi.application'
90
91
92# Database
93# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
94
95DATABASES = {
96 'default': {
97 'ENGINE': 'django.db.backends.sqlite3',
98 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
99 }
100}
101
102
103# Password validation
104# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
105
106AUTH_PASSWORD_VALIDATORS = [
107 {
108 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
109 },
110 {
111 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
112 },
113 {
114 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
115 },
116 {
117 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
118 },
119]
120
121
122# Internationalization
123# https://docs.djangoproject.com/en/1.9/topics/i18n/
124
125LANGUAGE_CODE = 'en-us'
126
127TIME_ZONE = 'UTC'
128
129USE_I18N = True
130
131USE_L10N = True
132
133USE_TZ = True
134
135
136# Static files (CSS, JavaScript, Images)
137# https://docs.djangoproject.com/en/1.9/howto/static-files/
138
139STATIC_URL = '/static/'
140STATIC_ROOT = 'staticfiles'
141STATICFILES_DIRS = (
142 os.path.join(BASE_DIR, 'static'),
143)
144
145ACCOUNT_ACTIVATION_DAYS = 7
146
147EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
148DEFAULT_FROM_EMAIL = 'testing@example.com'
149EMAIL_HOST_USER = ''
150EMAIL_HOST_PASSWORD = ''
151EMAIL_USE_TLS = False
152EMAIL_PORT = 1025
153
154LOGIN_REDIRECT_URL = "home"