|
1 | 1 | # Production settings |
2 | 2 | import os |
3 | | -from unipath import Path |
| 3 | +from pathlib import Path |
4 | 4 |
|
5 | | -PROJECT_ROOT = Path(__file__).ancestor(2) |
| 5 | +BASE_DIR = Path(__file__).resolve().parent.parent |
6 | 6 |
|
7 | 7 | DEBUG = False |
8 | 8 |
|
9 | 9 | TEMPLATE_DEBUG = DEBUG |
10 | 10 |
|
11 | | -ADMINS = ( |
12 | | - os.environ.get("ADMINS", "Paul Hallett,paulandrewhallett@gmail.com").split(","), |
13 | | -) |
| 11 | +ADMINS = (os.environ.get("ADMINS", "admin,admin@noemail.com").split(","),) |
14 | 12 |
|
15 | 13 | EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend" |
16 | 14 |
|
17 | 15 | MANAGERS = ADMINS |
18 | 16 |
|
19 | 17 | BASE_URL = os.environ.get("BASE_URL", "http://pokeapi.co") |
20 | 18 |
|
21 | | -# Hosts/domain names that are valid for this site; required if DEBUG is False |
22 | | -# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts |
23 | 19 | ALLOWED_HOSTS = [ |
24 | 20 | os.environ.get("ALLOWED_HOSTS", ".pokeapi.co"), |
25 | 21 | "localhost", |
26 | 22 | "127.0.0.1", |
27 | 23 | ] |
28 | 24 |
|
29 | | -TIME_ZONE = os.environ.get("TIME_ZONE", "Europe/London") |
| 25 | +TIME_ZONE = os.environ.get("TIME_ZONE", "UTC") |
30 | 26 |
|
31 | | -LANGUAGE_CODE = os.environ.get("LANGUAGE_CODE", "en-gb") |
| 27 | +LANGUAGE_CODE = os.environ.get("LANGUAGE_CODE", "en-us") |
32 | 28 |
|
33 | 29 | SITE_ID = 1 |
34 | 30 |
|
|
82 | 78 | } |
83 | 79 |
|
84 | 80 | SECRET_KEY = os.environ.get( |
85 | | - "SECRET_KEY", "ubx+22!jbo(^x2_scm-o$*py3e@-awu-n^hipkm%2l$sw$&2l#" |
| 81 | + "SECRET_KEY", "django-insecure-a(!_5+l3$#l1f4n!x+&ns_+8$4q@df*3rh$n#2h@l$2gti7!7-" |
86 | 82 | ) |
87 | 83 |
|
88 | 84 | CUSTOM_APPS = ("pokemon_v2",) |
89 | 85 |
|
90 | 86 | INSTALLED_APPS = ( |
| 87 | + "django.contrib.admin", |
91 | 88 | "django.contrib.auth", |
92 | 89 | "django.contrib.contenttypes", |
93 | 90 | "django.contrib.sessions", |
94 | | - "django.contrib.sites", |
95 | | - "django.contrib.admin", |
96 | 91 | "django.contrib.messages", |
97 | | - "django.contrib.humanize", |
98 | 92 | "corsheaders", |
99 | 93 | "rest_framework", |
100 | 94 | "cachalot", |
101 | 95 | "drf_spectacular", |
102 | 96 | ) + CUSTOM_APPS |
103 | 97 |
|
104 | | - |
105 | | -API_LIMIT_PER_PAGE = 1 |
106 | | - |
107 | 98 | CORS_ORIGIN_ALLOW_ALL = True |
108 | 99 |
|
109 | 100 | CORS_ALLOW_METHODS = "GET" |
|
127 | 118 | "APP_DIRS": True, |
128 | 119 | "OPTIONS": { |
129 | 120 | "context_processors": [ |
130 | | - "django.template.context_processors.debug", |
131 | 121 | "django.template.context_processors.request", |
132 | 122 | "django.contrib.auth.context_processors.auth", |
133 | 123 | "django.contrib.messages.context_processors.messages", |
|
136 | 126 | }, |
137 | 127 | ] |
138 | 128 |
|
139 | | -DEFAULT_AUTO_FIELD = "django.db.models.AutoField" |
| 129 | +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField" |
140 | 130 |
|
141 | 131 | SPECTACULAR_SETTINGS = { |
142 | 132 | "TITLE": "PokéAPI", |
|
154 | 144 |
|
155 | 145 | This API will always be publicly available and will never require any extensive setup process to consume. |
156 | 146 |
|
157 | | -Created by [**Paul Hallett**](https://github.com/phalt) and other [**PokéAPI contributors***](https://github.com/PokeAPI/pokeapi#contributing) around the world. Pokémon and Pokémon character names are trademarks of Nintendo. |
| 147 | +Created by [**Paul Hallett**](https://github.com/phalt) and other [**PokéAPI contributors**](https://github.com/PokeAPI/pokeapi#contributing) around the world. Pokémon and Pokémon character names are trademarks of Nintendo. |
158 | 148 | """, |
159 | 149 | "SORT_OPERATIONS": False, |
160 | 150 | "SERVERS": [{"url": "https://pokeapi.co"}], |
|
0 commit comments