Как настроить страницы трясогузки
Я пытаюсь настроить проект django, который использует wagtail CMS для отображения шаблонов (шаблоны уже в файле) на фронтенде, но поскольку я впервые работаю с wagtail, у меня возникли проблемы, и я не знаю, куда обратиться. Я проверил некоторые внешние источники, такие как YouTube, возможно, я получу какие-либо иллюстрации, но, похоже, я ничего не получил.
Вся структура проекта показана ниже, и это показывает, что все шаблоны и html файлы целы, но я не знаю, как их настроить.
Если я запускаю программу с помощью python manage.py runserver
, у меня запускается проект, а после открытия localhost:8000 в браузере я получаю только пустой экран.
Ниже показан файл url.py основного проекта:
# django imports
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.i18n import i18n_patterns
from django.contrib import admin
# wagtail imports
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocuments_urls
urlpatterns = [
url(r'^django-admin/', admin.site.urls),
url(r'^admin/', include(wagtailadmin_urls)),
url(r'^robots\.txt$', TemplateView.as_view(
template_name='robots.txt', content_type='text/plain'
)),
url(r'^documents/', include(wagtaildocuments_urls)),
]
urlpatterns += i18n_patterns(
url(r'', include(wagtail_urls)),
)
Структура проекта:
│ manage.py
│
├───about
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───except_wagtail
│ │ abstract_models.py
│ │ admin.py
│ │ apps.py
│ │ blocks.py
│ │ context_processors.py
│ │ models.py
│ │ settings.py
│ │ sitemap.py
│ │ translation.py
│ │ urls.py
│ │ wagtail_hooks.py
│ │ wsgi.py
│ │ __init__.py
│ │
│ ├───templates
│ │ │ 404.html
│ │ │ 500.html
│ │ │ base.html
│ │ │ base_new.html
│ │ │ robots.txt
│ │ │ sitemap.xml
│ │ │
│ │ ├───about
│ │ │ about_page.html
│ │ │ contact_page.html
│ │ │ event_calendar_page.html
│ │ │ generic_page.html
│ │ │ privacy_page.html
│ │ │ resources_page.html
│ │ │
│ │ ├───index
│ │ │ home_page.html
│ │ │
│ │ ├───knowledge
│ │ │ article_page.html
│ │ │ knowledge_page.html
│ │ │
│ │ ├───news
│ │ │ news_index_page.html
│ │ │ news_page.html
│ │ │
│ │ ├───people
│ │ │ people_page.html
│ │ │ profile_page.html
│ │ │
│ │ ├───projects
│ │ │ project_index_page.html
│ │ │ project_page.html
│ │ │
│ │ ├───search
│ │ │ search.html
│ │ │
│ │ ├───services
│ │ │ service_index_page.html
│ │ │ service_page.html
│ │ │ service_pillar_page.html
│ │ │ working_area_page.html
│ │ │
│ │ ├───_blocks
│ │ │ blockquote.html
│ │ │ carousel_block.html
│ │ │ lightbox_block.html
│ │ │ linked_asset_block.html
│ │ │ paragraph_block.html
│ │ │ people_list_block.html
│ │ │ related_assets_block.html
│ │ │ spacer_block.html
│ │ │
│ │ ├───_includes
│ │ │ │ card.html
│ │ │ │ card_new.html
│ │ │ │ card_old.html
│ │ │ │ card_people.html
│ │ │ │ card_video.html
│ │ │ │ card_with_col.html
│ │ │ │ index_item_search.html
│ │ │ │ index_item_specific_cards.html
│ │ │ │ ld_article.html
│ │ │ │ ld_article.json
│ │ │ │ ld_organization.html
│ │ │ │ ld_organization.json
│
├───index
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───knowledge
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───news
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───people
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───projects
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ __init__.py
│
├───search
│ │ apps.py
│ │ models.py
│ │ translation.py
│ │ views.py
│ │ __init__.py
│
└───services
│ apps.py
│ models.py
│ translation.py
│ __init__.py