You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.1 KiB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
  1. """
  2. Django settings for hc project.
  3. Generated by 'django-admin startproject' using Django 1.8.2.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/1.8/topics/settings/
  6. For the full list of settings and their values, see
  7. https://docs.djangoproject.com/en/1.8/ref/settings/
  8. """
  9. import json
  10. import os
  11. BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  12. hc_config = json.loads(open(os.path.expanduser("~/hc_config.json")).read())
  13. # Quick-start development settings - unsuitable for production
  14. # See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/
  15. # SECURITY WARNING: keep the secret key used in production secret!
  16. SECRET_KEY = '9)gjy!j50uvbcy#y9ifoh@9pf%3m5^-9h0jv@+3^ln$%az8e(7'
  17. # SECURITY WARNING: don't run with debug turned on in production!
  18. DEBUG = True
  19. ALLOWED_HOSTS = []
  20. # Application definition
  21. INSTALLED_APPS = (
  22. 'django.contrib.admin',
  23. 'django.contrib.auth',
  24. 'django.contrib.contenttypes',
  25. 'django.contrib.humanize',
  26. 'django.contrib.sessions',
  27. 'django.contrib.messages',
  28. 'django.contrib.staticfiles',
  29. 'hc.accounts',
  30. 'hc.api',
  31. 'hc.front'
  32. )
  33. MIDDLEWARE_CLASSES = (
  34. 'django.contrib.sessions.middleware.SessionMiddleware',
  35. 'django.middleware.common.CommonMiddleware',
  36. 'django.middleware.csrf.CsrfViewMiddleware',
  37. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  38. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  39. 'django.contrib.messages.middleware.MessageMiddleware',
  40. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  41. 'django.middleware.security.SecurityMiddleware',
  42. )
  43. ROOT_URLCONF = 'hc.urls'
  44. TEMPLATES = [
  45. {
  46. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  47. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  48. 'APP_DIRS': True,
  49. 'OPTIONS': {
  50. 'context_processors': [
  51. 'django.template.context_processors.debug',
  52. 'django.template.context_processors.request',
  53. 'django.contrib.auth.context_processors.auth',
  54. 'django.contrib.messages.context_processors.messages',
  55. ],
  56. },
  57. },
  58. ]
  59. WSGI_APPLICATION = 'hc.wsgi.application'
  60. # Database
  61. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  62. DATABASES = {
  63. 'default': {
  64. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  65. 'NAME': 'hc',
  66. 'USER': 'hc',
  67. 'PASSWORD': '',
  68. 'HOST': '192.168.1.112',
  69. 'PORT': 5432,
  70. 'TEST': {'CHARSET': 'UTF8'}
  71. }
  72. }
  73. # Internationalization
  74. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  75. LANGUAGE_CODE = 'en-us'
  76. TIME_ZONE = 'UTC'
  77. USE_I18N = True
  78. USE_L10N = True
  79. USE_TZ = True
  80. SITE_ROOT = "http://localhost:8000"
  81. STATIC_URL = '/static/'
  82. STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
  83. # AWS
  84. EMAIL_BACKEND = 'django_ses_backend.SESBackend'
  85. AWS_SES_ACCESS_KEY_ID = hc_config["aws_ses_access_key"]
  86. AWS_SES_SECRET_ACCESS_KEY = hc_config["aws_ses_secret_key"]
  87. AWS_SES_REGION_NAME = 'eu-west-1'
  88. AWS_SES_REGION_ENDPOINT = 'email.eu-west-1.amazonaws.com'