Wagtail - Issues **************** - :doc:`dev-wagtail` - :doc:`dev-wagtail-contact-page` - :doc:`dev-wagtail-plugins` - :doc:`project-simple-site` 404 === If deploying on Digital Ocean App Platform, then the *Hostname* in *Sites* needs to match the *Domain* in the Digital Ocean Control Panel, but without ``https://`` e.g:: hatherleigh-info-django-z6gki.ondigitalocean.app .. image:: ./misc/wagtail/2025-11-01-site-hostname.png .. tip:: If the page fails to display (probably a 404 Page Not Found error), then try publishing the page again. Admin template - ``str`` object has no attribute ``id_for_label`` ================================================================= If you browse to *Settings*, *Sites* and get a:: 'str' object has no attribute 'id_for_label' error in th Wagtail admin template, then remove ``string_if_invalid`` from ``settings/base.py`` e.g: .. image:: ./misc/wagtail/2025-06-26-wagtail-string-if-invalid.png Cannot resolve bases ==================== I kept getting this issue:: raise InvalidBasesError( django.db.migrations.exceptions.InvalidBasesError: Cannot resolve bases for [] This can happen if you are inheriting models from an app with migrations (e.g. contrib.auth) I noticed there were no migrations for the ``web`` app, but ``django-admin makemigrations`` didn't create anything:: > django-admin makemigrations No changes detected To solve the issue, I had to specify the ``app`` name e.g:: django-admin makemigrations web Child Pages (e.g. *Contact Us*) =============================== If you create a child page and it doesn't appear in the menu: - Edit the page and click on the *Promote* tab. - Tick *Show in menus* - *For site menus*. DisallowedHost ============== :: django.core.exceptions.DisallowedHost: Invalid HTTP_HOST header: 'https'. You may need to add 'https' to ALLOWED_HOSTS. To solve this issue, I removed ``https`` from the *Hostname* in the *Site* i.e. ``hatherleigh.info`` rather than ``https://hatherleigh.info``. 'NoneType' object has no attribute '_inc_path' ============================================== When saving a page:: 'NoneType' object has no attribute '_inc_path' To solve the issue:: django-admin fixtree --full Search ====== :: wagtailsearch.IndexEntry (postgres.E0005) 'django.contrib.postgres' must be in INSTALLED_APPS .. image:: ./misc/wagtail/2025-12-08-wagtail-search-django-contrib-postgres.png To solve the issue:: # src/settings/base.py DJANGO_APPS = ( # ... "django.contrib.postgres", For more information, see `Search - Database Backend (default)`_ Sites - Home Page ================= .. tip:: When running the development server, the home page may not display. To fix this, *Settings*, *Sites* and tick *Is default site*. .. image:: ./misc/wagtail/2024-03-25-is-default-site.png For more information, `Django Wagtail page not found when i don't use "127.0.0.1:8000"`_: Check the site records under Settings -> Sites in the Wagtail admin. When a request comes in, Wagtail will only serve a page if the hostname matches one named in a site record, or the 'is default site' box is checked. .. _`Django Wagtail page not found when i don't use "127.0.0.1:8000"`: https://stackoverflow.com/questions/44358695/django-wagtail-page-not-found-when-i-dont-use-127-0-0-18000 .. _`Search - Database Backend (default)`: https://docs.wagtail.org/en/v7.2.1/topics/search/backends.html#database-backend-default