Skip to content

Commit

Permalink
Add a note about core configs that will no work.
Browse files Browse the repository at this point in the history
  • Loading branch information
pdelboca committed Oct 27, 2023
1 parent af6e9dd commit 2d795e4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ the following way:
1) All uppercase
2) Replace periods (\'.\') with two underscores (\'\_\_\')
3) Keys must begin with \'CKAN\' or \'CKANEXT\'
4) Keys that do not begin with \'CKAN\', add \'CKAN\_\_\_\' (3 underscores) at the beginning.

Some examples:

ckan.site_id --> CKAN__SITE_ID
ckanext.s3filestore.aws_bucket_name --> CKANEXT__S3FILESTORE__AWS_BUCKET_NAME

For keys that don\'t normally begin with \'CKAN\', add \'CKAN\_\_\_\' (3
underscores) to the beginning to help the extension identify these keys,
e.g.:

sqlalchemy.url --> CKAN___SQLALCHEMY__URL
beaker.session.secret --> CKAN___BEAKER__SESSION__SECRET


Starting from CKAN 2.10 (and ckanext-envvars 0.0.4), if a configuration option is defined using CKAN's
[configuration declaration](https://docs.ckan.org/en/latest/maintaining/configuration.html#config-declaration)
the key is not further processed. This allows to keep eg upper case setttings like SECRET_KEY, WTF_CSRF_ENABLED, e.g:
Expand All @@ -36,6 +30,13 @@ the key is not further processed. This allows to keep eg upper case setttings li
WTF_CSRF_ENABLED --> CKAN___WTF_CSRF_ENABLED


Important note
--------------

CKAN requires a proper connection to a database to initialize and load plugins,
therefore `ckanext-envvars` cannot be used to set `sqlalchemy.url`.
Also, plugins are first loaded from the `ckan.ini` file so setting `CKAN__PLUGINS` will not have the desire effect.


Requirements
------------
Expand Down Expand Up @@ -93,7 +94,7 @@ To run the tests, do:

#### ckanext-envvars on PyPI

ckanext-envvars is availabe on PyPI as [ckanext-envvars](https://pypi.org/project/ckanext-envvars).
ckanext-envvars is availabe on PyPI as [ckanext-envvars](https://pypi.org/project/ckanext-envvars).

##### Releasing a New Version of ckanext-envvars

Expand Down

0 comments on commit 2d795e4

Please sign in to comment.