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.

118 lines
3.0 KiB

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.sessions',
  26. 'django.contrib.messages',
  27. 'django.contrib.staticfiles',
  28. 'hc.accounts',
  29. 'hc.api',
  30. 'hc.front'
  31. )
  32. MIDDLEWARE_CLASSES = (
  33. 'django.contrib.sessions.middleware.SessionMiddleware',
  34. 'django.middleware.common.CommonMiddleware',
  35. 'django.middleware.csrf.CsrfViewMiddleware',
  36. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  37. 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  38. 'django.contrib.messages.middleware.MessageMiddleware',
  39. 'django.middleware.clickjacking.XFrameOptionsMiddleware',
  40. 'django.middleware.security.SecurityMiddleware',
  41. )
  42. ROOT_URLCONF = 'hc.urls'
  43. TEMPLATES = [
  44. {
  45. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  46. 'DIRS': [os.path.join(BASE_DIR, 'templates')],
  47. 'APP_DIRS': True,
  48. 'OPTIONS': {
  49. 'context_processors': [
  50. 'django.template.context_processors.debug',
  51. 'django.template.context_processors.request',
  52. 'django.contrib.auth.context_processors.auth',
  53. 'django.contrib.messages.context_processors.messages',
  54. ],
  55. },
  56. },
  57. ]
  58. WSGI_APPLICATION = 'hc.wsgi.application'
  59. # Database
  60. # https://docs.djangoproject.com/en/1.8/ref/settings/#databases
  61. DATABASES = {
  62. 'default': {
  63. 'ENGINE': 'django.db.backends.postgresql_psycopg2',
  64. 'NAME': 'hc',
  65. 'USER': 'hc',
  66. 'PASSWORD': '',
  67. 'HOST': '192.168.1.111',
  68. 'PORT': 5432,
  69. 'TEST': {'CHARSET': 'UTF8'}
  70. }
  71. }
  72. # Internationalization
  73. # https://docs.djangoproject.com/en/1.8/topics/i18n/
  74. LANGUAGE_CODE = 'en-us'
  75. TIME_ZONE = 'UTC'
  76. USE_I18N = True
  77. USE_L10N = True
  78. USE_TZ = True
  79. SITE_ROOT = "http://localhost:8000"
  80. STATIC_URL = '/static/'
  81. STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
  82. # AWS
  83. EMAIL_BACKEND = 'django_ses_backend.SESBackend'
  84. AWS_SES_ACCESS_KEY_ID = hc_config["aws_ses_access_key"]
  85. AWS_SES_SECRET_ACCESS_KEY = hc_config["aws_ses_secret_key"]
  86. AWS_SES_REGION_NAME = 'eu-west-1'
  87. AWS_SES_REGION_ENDPOINT = 'email.eu-west-1.amazonaws.com'