faroeqgta

setting.py

Mar 9th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.70 KB | None | 0 0
  1. """
  2. Django settings for my_site project.
  3.  
  4. Generated by 'django-admin startproject' using Django 1.11.10.
  5.  
  6. For more information on this file, see
  7. https://docs.djangoproject.com/en/1.11/topics/settings/
  8.  
  9. For the full list of settings and their values, see
  10. https://docs.djangoproject.com/en/1.11/ref/settings/
  11. """
  12.  
  13. import os
  14. import pymysql
  15.  
  16. # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  17. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  18.  
  19.  
  20. # Quick-start development settings - unsuitable for production
  21. # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/
  22.  
  23. # SECURITY WARNING: keep the secret key used in production secret!
  24. SECRET_KEY = '^6=pbaqiy9m^56&pcxrn4u4#c_q6d+26h#7juz2mtw1c6zllsb'
  25.  
  26. # SECURITY WARNING: don't run with debug turned on in production!
  27. DEBUG = True
  28.  
  29. ALLOWED_HOSTS = []
  30.  
  31.  
  32. # Application definition
  33.  
  34. INSTALLED_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.     'blog',
  42.     'karyawan',
  43.     'kehadiran',
  44.     'homepage',
  45. ]
  46.  
  47. MIDDLEWARE = [
  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.  
  57. ROOT_URLCONF = 'my_site.urls'
  58.  
  59. TEMPLATES = [
  60.     {
  61.         'BACKEND': 'django.template.backends.django.DjangoTemplates',
  62.         'DIRS': ['templates'],
  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.  
  75. WSGI_APPLICATION = 'my_site.wsgi.application'
  76.  
  77.  
  78. # Database
  79. # https://docs.djangoproject.com/en/1.11/ref/settings/#databases
  80.  
  81. # DATABASES = {
  82. #     'default': {
  83. #         'ENGINE': 'django.db.backends.sqlite3',
  84. #         'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
  85. #     }
  86. # }
  87.  
  88.  
  89. DATABASES = {
  90.     'default': {
  91.         'ENGINE': 'django.db.backends.mysql',
  92.         'NAME': 'py_django_mini_hrd',
  93.         'USER': 'root',
  94.         'PASSWORD': '',
  95.         'HOST': 'localhost',
  96.         'PORT': '3306',
  97.     }
  98. }
  99.  
  100. # Password validation
  101. # https://docs.djangoproject.com/en/1.11/ref/settings/#auth-password-validators
  102.  
  103. AUTH_PASSWORD_VALIDATORS = [
  104.     {
  105.         'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
  106.     },
  107.     {
  108.         'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
  109.     },
  110.     {
  111.         'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
  112.     },
  113.     {
  114.         'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
  115.     },
  116. ]
  117.  
  118.  
  119. # Internationalization
  120. # https://docs.djangoproject.com/en/1.11/topics/i18n/
  121.  
  122. LANGUAGE_CODE = 'en-us'
  123.  
  124. TIME_ZONE = 'UTC'
  125.  
  126. USE_I18N = True
  127.  
  128. USE_L10N = True
  129.  
  130. USE_TZ = True
  131.  
  132.  
  133. # Static files (CSS, JavaScript, Images)
  134. # https://docs.djangoproject.com/en/1.11/howto/static-files/
  135.  
  136. STATIC_URL = '/static/'
  137.  
  138. LOGIN_URL = '/login/'
  139.  
  140. #START konfigurasi upload foto
  141. MEDIA_URL = '/media/'
  142.  
  143. MEDIA_ROOT = os.path.join(BASE_DIR,"assets/")
  144. #END konfigurasi upload foto
  145.  
  146. STATICFILES_DIRS = (
  147.     os.path.join(BASE_DIR, "assets"),
  148. )
Advertisement
Add Comment
Please, Sign In to add comment