Wagtail provides the wagtail start command and project template to get you started with a new Wagtail project as quickly as possible, but it's easy to integrate Wagtail into an existing Django project .
Here are the list of step how you can Integrate wagtail into Django project
Step 1:- Installation
First, install the wagtail package from PyPI:
Step 2:- Settings
- In your settings file, add the following apps to INSTALLED_APPS:
- Add the following entry to MIDDLEWARE:
- Add a STATIC_ROOT setting, if your project does not have one already:
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
- Add MEDIA_ROOT and MEDIA_URL settings, if your project does not have these already:
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:
WAGTAIL_SITE_NAME = 'My Example Site'
Step 3:- URL configuration
Now make the following additions to your url.py file:
from django.urls import path, re_path, include
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
urlpatterns = [
Step 4:-User accounts
Superuser accounts receive automatic access to the Wagtail admin interface; use ./manage.py createsuperuser if you don't already have one.
Step 5:- Start developing
You're now ready to add a new app to your Django project and set up page models