From 0f5d3fae36170970a74eb95bae4dd064c6a5f573 Mon Sep 17 00:00:00 2001 From: ygaspar Date: Fri, 24 Mar 2023 14:58:39 +0000 Subject: [PATCH] feat: add wagtail entry --- docs/CMS/wagtail.md | 53 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 docs/CMS/wagtail.md diff --git a/docs/CMS/wagtail.md b/docs/CMS/wagtail.md new file mode 100644 index 0000000..1aa17a2 --- /dev/null +++ b/docs/CMS/wagtail.md @@ -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', +'', +'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 +... \ No newline at end of file