Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 1 | """ |
| 2 | Django settings for hiccup_server project. |
| 3 | |
| 4 | Generated by 'django-admin startproject' using Django 1.9.7. |
| 5 | |
| 6 | For more information on this file, see |
| 7 | https://docs.djangoproject.com/en/1.9/topics/settings/ |
| 8 | |
| 9 | For the full list of settings and their values, see |
| 10 | https://docs.djangoproject.com/en/1.9/ref/settings/ |
| 11 | """ |
| 12 | |
| 13 | import os |
| 14 | |
| 15 | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
| 16 | BASE_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.9/howto/deployment/checklist/ |
| 21 | |
| 22 | # SECURITY WARNING: keep the secret key used in production secret! |
| 23 | SECRET_KEY = '7u+#ha3hk!x+*)clhs46%n*)w1q+5s4+yoc#1!nm0b%fwwrud@' |
| 24 | |
| 25 | # SECURITY WARNING: don't run with debug turned on in production! |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 26 | DEBUG = True |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 27 | |
Dirk Vogt | 20539e5 | 2016-08-26 11:17:35 +0200 | [diff] [blame] | 28 | ALLOWED_HOSTS = ['*'] |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 29 | |
| 30 | |
| 31 | # Application definition |
| 32 | |
| 33 | INSTALLED_APPS = [ |
| 34 | 'django.contrib.admin', |
| 35 | 'django.contrib.auth', |
| 36 | 'django.contrib.contenttypes', |
| 37 | 'django.contrib.sessions', |
| 38 | 'django.contrib.messages', |
| 39 | 'django.contrib.staticfiles', |
Dirk Vogt | 47d80ba | 2016-08-26 09:31:39 +0200 | [diff] [blame] | 40 | 'rest_framework', |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 41 | 'rest_framework.authtoken', |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 42 | 'crashreports', |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 43 | 'taggit', |
Dirk Vogt | d134521 | 2016-09-14 14:31:45 +0200 | [diff] [blame] | 44 | 'crispy_forms', |
Dirk Vogt | f5a1553 | 2016-09-26 15:52:24 +0200 | [diff] [blame] | 45 | 'bootstrap3', |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 46 | 'django_extensions', |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 47 | ] |
| 48 | |
| 49 | MIDDLEWARE_CLASSES = [ |
| 50 | 'django.middleware.security.SecurityMiddleware', |
| 51 | 'django.contrib.sessions.middleware.SessionMiddleware', |
| 52 | 'django.middleware.common.CommonMiddleware', |
| 53 | 'django.middleware.csrf.CsrfViewMiddleware', |
| 54 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
| 55 | 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', |
| 56 | 'django.contrib.messages.middleware.MessageMiddleware', |
| 57 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', |
| 58 | ] |
| 59 | |
| 60 | ROOT_URLCONF = 'hiccup.urls' |
| 61 | |
| 62 | TEMPLATES = [ |
| 63 | { |
| 64 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', |
| 65 | 'DIRS': [], |
| 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 | #WSGI_APPLICATION = 'hiccup_server.wsgi.application' |
| 79 | |
| 80 | |
| 81 | # Database |
| 82 | # https://docs.djangoproject.com/en/1.9/ref/settings/#databases |
| 83 | |
| 84 | DATABASES = { |
| 85 | 'default': { |
| 86 | 'ENGINE': 'django.db.backends.sqlite3', |
| 87 | 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | |
| 92 | # Password validation |
| 93 | # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators |
| 94 | |
| 95 | AUTH_PASSWORD_VALIDATORS = [ |
| 96 | { |
| 97 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', |
| 98 | }, |
| 99 | { |
| 100 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', |
| 101 | }, |
| 102 | { |
| 103 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', |
| 104 | }, |
| 105 | { |
| 106 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', |
| 107 | }, |
| 108 | ] |
| 109 | |
| 110 | |
| 111 | # Internationalization |
| 112 | # https://docs.djangoproject.com/en/1.9/topics/i18n/ |
| 113 | |
| 114 | LANGUAGE_CODE = 'en-us' |
| 115 | TIME_ZONE = 'Europe/Amsterdam' |
| 116 | USE_I18N = True |
| 117 | USE_L10N = True |
| 118 | USE_TZ = True |
| 119 | |
Dirk Vogt | 47d80ba | 2016-08-26 09:31:39 +0200 | [diff] [blame] | 120 | REST_FRAMEWORK = { |
Dirk Vogt | f2a3342 | 2016-10-11 17:17:26 +0200 | [diff] [blame] | 121 | 'DEFAULT_AUTHENTICATION_CLASSES': ( |
| 122 | 'rest_framework.authentication.BasicAuthentication', |
| 123 | 'rest_framework.authentication.SessionAuthentication', |
| 124 | 'rest_framework.authentication.TokenAuthentication', |
| 125 | ), |
Dirk Vogt | 47d80ba | 2016-08-26 09:31:39 +0200 | [diff] [blame] | 126 | 'DEFAULT_PERMISSION_CLASSES': ( |
| 127 | 'rest_framework.permissions.IsAuthenticated', |
Dirk Vogt | d134521 | 2016-09-14 14:31:45 +0200 | [diff] [blame] | 128 | ), |
| 129 | 'DEFAULT_FILTER_BACKENDS': ('rest_framework.filters.DjangoFilterBackend',) |
Dirk Vogt | 47d80ba | 2016-08-26 09:31:39 +0200 | [diff] [blame] | 130 | } |
| 131 | |
Dirk Vogt | f130c75 | 2016-08-23 14:45:01 +0200 | [diff] [blame] | 132 | # Static files (CSS, JavaScript, Images) |
| 133 | # https://docs.djangoproject.com/en/1.9/howto/static-files/ |
| 134 | |
| 135 | STATIC_URL = '/static/' |
Dirk Vogt | 20539e5 | 2016-08-26 11:17:35 +0200 | [diff] [blame] | 136 | |
| 137 | STATIC_ROOT = "/home/hiccup/static/static" |
Dirk Vogt | d8b956b | 2016-11-22 15:03:21 +0100 | [diff] [blame^] | 138 | |
| 139 | try: |
| 140 | from local_settings import * |
| 141 | except ImportError as e: |
| 142 | pass |