Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/CMS/wagtail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Wagtail
Using Wagtail in an existing Django project

## Setup

```bash
poetry add wagtail
```

## Settings
In your `settings.py` file on the project, add the following:

Into the INSTALLED_APPS
```python
'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail',
'modelcluster',
'taggit',
'<OUR_APP_INTEGRATED_WITH_WAGTAIL>',
'wagtail.admin' # This one should be the last
```

Into the MIDDLEWARE
```python
'wagtail.contrib.redirects.middleware.RedirectMiddleware'
```

Add a STATIC_ROOT setting, if your project does not have one already:
```python
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
```

Add MEDIA_ROOT and MEDIA_URL, if your project does not have these already:
```python
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'
```

Add a WAGTAIL_SITE_NAME (this will be displayed on the main dashboard of the Wagtail admin backend):
```python
WAGTAIL_SITE_NAME = 'My Example Site'
```

## URL configuration
...