· 8 years ago · Nov 16, 2017, 09:46 PM
1"""
2Django settings for HermesDjango project.
3
4Generated by 'django-admin startproject' using Django 1.11.6.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.11/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.11/ref/settings/
11"""
12
13from pathlib import Path
14import cloudinary
15
16# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
17BASE_DIR = Path(__file__).resolve().parent.parent.parent
18
19MEDIA_ROOT = str(BASE_DIR / 'media')
20
21STATIC_ROOT = str(BASE_DIR / 'static_root')
22
23STATICFILES_DIRS = [str(BASE_DIR / 'static')]
24
25
26# Quick-start development settings - unsuitable for production
27# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
28
29# SECURITY WARNING: keep the secret key used in production secret!
30SECRET_KEY = 'o3oe72g9bm_#0**e1nud=3105%bdy&n%x326n0&3drvj2)+s*h'
31
32ALLOWED_HOSTS = []
33
34
35# Application definition
36
37INSTALLED_APPS = [
38 'rest_framework',
39 'hermes_apps.API',
40 'hermes_apps.html_provider',
41 'django.contrib.admin',
42 'django.contrib.auth',
43 'django.contrib.contenttypes',
44 'django.contrib.sessions',
45 'django.contrib.messages',
46 'django.contrib.staticfiles',
47]
48
49MIDDLEWARE = [
50 'django.middleware.gzip.GZipMiddleware',
51 'django.middleware.security.SecurityMiddleware',
52 'django.contrib.sessions.middleware.SessionMiddleware',
53 'django.middleware.common.CommonMiddleware',
54 'django.middleware.csrf.CsrfViewMiddleware',
55 'django.contrib.auth.middleware.AuthenticationMiddleware',
56 'django.contrib.messages.middleware.MessageMiddleware',
57 'django.middleware.clickjacking.XFrameOptionsMiddleware',
58]
59
60ROOT_URLCONF = 'config.urls'
61
62TEMPLATES = [
63 {
64 'BACKEND': 'django.template.backends.django.DjangoTemplates',
65 'DIRS': [str(BASE_DIR / 'templates')],
66 'APP_DIRS': True,
67 'OPTIONS': {
68 'context_processors': [
69 'django.template.context_processors.debug',
70 'django.template.context_processors.request',
71 'django.contrib.auth.context_processors.auth',
72 'django.contrib.messages.context_processors.messages',
73 ],
74 },
75 },
76]
77
78# Password validation
79# https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
80
81AUTH_PASSWORD_VALIDATORS = [
82 {
83 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
84 },
85 {
86 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
87 },
88 {
89 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
90 },
91 {
92 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
93 },
94]
95
96
97# Internationalization
98# https://docs.djangoproject.com/en/1.11/topics/i18n/
99
100LANGUAGE_CODE = 'en-us'
101
102TIME_ZONE = 'UTC'
103
104USE_I18N = True
105
106USE_L10N = True
107
108USE_TZ = True
109
110
111# Static files (CSS, JavaScript, Images)
112# https://docs.djangoproject.com/en/1.11/howto/static-files/
113
114STATIC_URL = '/static/'
115
116REST_FRAMEWORK = {
117 # Use Django's standard `django.contrib.auth` permissions,
118 # or allow read-only access for unauthenticated users.
119 #'DEFAULT_PERMISSION_CLASSES': [
120 # 'rest_framework.permissions.IsAuthenticated',
121 #],
122
123 'DEFAULT_AUTHENTICATION_CLASSES': [
124 'rest_framework.authentication.BasicAuthentication',
125 'rest_framework.authentication.SessionAuthentication',
126 ]
127}
128
129cloudinary.config(
130 cloud_name='dbw2vndvd',
131 api_key="693953628698789",
132 api_secret="Vucssvk1siA0ERUV3dQGntbLmnk"
133)