kopia lustrzana https://github.com/wagtail/wagtail
docs: Make instructions about adding "wagtail.contrib.settings" to INSTALLED_APPS more explicit
rodzic
e51e3f9fe2
commit
bfce1cea64
|
@ -49,7 +49,15 @@ In the preceding code, the `register_setting` decorator registers your `Navigati
|
|||
|
||||
Now, migrate your database by running the commands `python manage.py makemigrations` and `python manage.py migrate`. After migrating your database, reload your [admin interface](https://guide.wagtail.org/en-latest/concepts/wagtail-interfaces/#admin-interface). You'll get the error _'wagtailsettings' is not a registered namespace_. This is because you haven't installed the [`wagtail.contrib.settings`](../reference/settings.md) module.
|
||||
|
||||
The `wagtail.contrib.settings` module defines models that hold common settings across all your web pages. So, to successfully import the `BaseGenericSetting` and `register_setting`, you must install the `wagtail.contrib.settings` module on your site. To install `wagtail.contrib.settings`, go to your `mysite/settings/base.py` file and add `"wagtail.contrib.settings"` to the `INSTALLED_APPS` list.
|
||||
The `wagtail.contrib.settings` module defines models that hold common settings across all your web pages. So, to successfully import the `BaseGenericSetting` and `register_setting`, you must install the `wagtail.contrib.settings` module on your site. To install `wagtail.contrib.settings`, go to your `mysite/settings/base.py` file and add `"wagtail.contrib.settings"` to the `INSTALLED_APPS` list:
|
||||
|
||||
```python
|
||||
INSTALLED_APPS = [
|
||||
# ...
|
||||
# Add this line to install wagtail.contrib.settings:
|
||||
"wagtail.contrib.settings",
|
||||
]
|
||||
```
|
||||
|
||||
Also, you have to register the _settings_ context processor. Registering _settings_ context processor makes site-wide settings accessible in your templates. To register the _settings_ context processor, modify your `mysite/settings/base.py` file as follows:
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue