· 9 years ago · Feb 17, 2017, 05:32 PM
1"""
2Django settings for mysite project.
3
4Generated by 'django-admin startproject' using Django 1.10.5.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.10/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.10/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = '1a#f4ybs+sects6e5g*olu#)md=h4(279%9hsmfn3s4@o!981d'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = ['aztechuhs.pythonanywhere.com',
29 '127.0.0.1']
30
31
32# Application definition
33
34INSTALLED_APPS = [
35 'django.contrib.admin',
36 'django.contrib.auth',
37 'django.contrib.contenttypes',
38 'django.contrib.sessions',
39 'django.contrib.messages',
40 'django.contrib.staticfiles',
41 'my_django_site',
42 'django.contrib.sites',
43]
44
45SITE_ID = 1
46
47MIDDLEWARE = [
48 'django.middleware.security.SecurityMiddleware',
49 'django.contrib.sessions.middleware.SessionMiddleware',
50 'django.middleware.common.CommonMiddleware',
51 'django.middleware.csrf.CsrfViewMiddleware',
52 'django.contrib.auth.middleware.AuthenticationMiddleware',
53 'django.contrib.messages.middleware.MessageMiddleware',
54 'django.middleware.clickjacking.XFrameOptionsMiddleware',
55]
56
57ROOT_URLCONF = 'mysite.urls'
58
59TEMPLATES = [
60 {
61 'BACKEND': 'django.template.backends.django.DjangoTemplates',
62 'DIRS': [],
63 'APP_DIRS': True,
64 'OPTIONS': {
65 'context_processors': [
66 'django.template.context_processors.debug',
67 'django.template.context_processors.request',
68 'django.contrib.auth.context_processors.auth',
69 'django.contrib.messages.context_processors.messages',
70 ],
71 },
72 },
73]
74
75WSGI_APPLICATION = 'mysite.wsgi.application'
76
77
78# Database
79# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
80
81#Settings for LAMP
82DATABASES = {
83 'default': {
84 'ENGINE': 'mysql.connector.django',
85 'NAME': 'my_django_site',
86 'USER': 'django_user',
87 'PASSWORD': 'Mtfbwy_lo2',
88 'HOST': 'localhost',
89 'PORT': '3306',
90 'OPTIONS': {
91 'autocommit': True,
92 },
93 }
94}
95
96# Settings for PythonAnywhere
97# DATABASES = {
98# 'default': {
99# 'ENGINE': 'django.db.backends.mysql',
100# 'NAME': 'aztechuhs$default',
101# 'USER': 'aztechuhs',
102# 'PASSWORD': 'Mtfbwy_lo2',
103# 'HOST': 'aztechuhs.mysql.pythonanywhere-services.com',
104# 'OPTIONS': {
105# 'autocommit': True,
106# },
107# }
108# }
109
110# Password validation
111# https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators
112
113AUTH_PASSWORD_VALIDATORS = [
114 {
115 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
116 },
117 {
118 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
119 },
120 {
121 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
122 },
123 {
124 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
125 },
126]
127
128
129# Internationalization
130# https://docs.djangoproject.com/en/1.10/topics/i18n/
131
132LANGUAGE_CODE = 'en-us'
133
134TIME_ZONE = 'EST'
135
136USE_I18N = True
137
138USE_L10N = True
139
140USE_TZ = False
141
142
143# Static files (CSS, JavaScript, Images)
144# https://docs.djangoproject.com/en/1.10/howto/static-files/
145
146STATIC_URL = '/static/'
147STATIC_ROOT = os.path.join(BASE_DIR, 'static')
148
149
150EMAIL_USE_TLS = True
151EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
152EMAIL_HOST = 'smtp.gmail.com'
153EMAIL_HOST_PASSWORD = 'Mtfbwy_gm2' #my gmail password
154EMAIL_HOST_USER = 'justinkirtz422@gmail.com' #my gmail username
155EMAIL_PORT = 587