You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To shut down the development docker deployment, run
201
190
202
-
.. code-block:: bash
191
+
.. code-block:: bash
203
192
204
-
docker compose down
193
+
docker compose down
205
194
206
195
The directory `app/eventyay` is mounted into the docker, thus live editing is supported.
207
196
197
+
Configuration
198
+
-------------
199
+
200
+
Our configuration are based on TOML files. First of all, check the ``BaseSettings`` class in *app/eventyay/config/next_settings.py* for possible keys and original values.
201
+
Other than that, the configuration is divided to three running environments:
202
+
203
+
* ``development``: With default values in *eventyay.development.toml*.
204
+
* ``production``: With default values in *eventyay.production.toml*.
205
+
* ``testing``: With default values in *eventyay.testing.toml*.
206
+
207
+
The values in these files will override ones in ``BaseSettings``.
208
+
209
+
Running environment is selected via the ``EVY_RUNNING_ENVIRONMENT`` environment variable. It is pre-set in *manage.py*, *wsgi.py* and *asgi.py*.
210
+
For example, if you want to run a command in production environment, you can do:
- Create a file named *eventyay.local.toml* in the same folder as *manage.py* file.
220
+
- Add only the values you want to override in this file. For example, to override the ``debug`` value in production environment, you only need to add one line:
221
+
222
+
.. code-block:: toml
223
+
224
+
debug = true
225
+
226
+
- You can also override values via environment variables. The environment variable names are the upper case versions of the setting keys, prefixed by ``EVY_``.
227
+
For example, to override the ``debug`` value in production environment, you can set the environment variable ``EVY_DEBUG`` to ``true``.
228
+
229
+
.. code-block:: bash
230
+
231
+
export EVY_DEBUG=true
232
+
233
+
- Dotenv (*.env*) file is also supported, but please be aware that the values from *.env* file will be overriden by environment variables.
234
+
235
+
- Sensitive data like passwords, API keys should be provided via files in *.secrets* directory, each file for a key.
236
+
The file name follows the pattern of environment variable names above (with prefix), the file content is the value.
237
+
For example, to provide a value for the ``secret_key`` setting, you should create a file named ``EVY_SECRET_KEY`` and put the value inside.
238
+
239
+
- If you deployed the app via Docker containers, you can provide the secret data via `Docker secrets`_.
240
+
241
+
Why TOML?
242
+
~~~~~~~~~
243
+
244
+
TOML has rich data types. In comparison with *ini* format that this project used before, *ini* doesn't have "list" type, we had to define a convention to encode lists in strings.
245
+
This method is not portable, not understood by other tools and libraries, and error-prone.
246
+
TOML has dedicated syntax for lists, making it easier to read and write such configurations, and developers can use different tools and libraries without worrying about incompatibility.
247
+
248
+
Due to this reason, overriding configuration via environment variables are not encouraged. The environment variables only have one data type: string!
249
+
208
250
209
251
Deployment
210
252
----------
@@ -247,5 +289,4 @@ This project is maintained by **FOSSASIA**. See the AUTHORS file for a list of a
0 commit comments