A small podcast Wagtail app
django==4.2.1
wagtail==5.0
wagtailmedia==0.14.0
apt install python3-magic
pip install python-magic
pip install -r requirements.txt
To your settings file,
add to the INSTALLED_APPS
# wagtail
'wagtail.contrib.forms',
'wagtail.contrib.redirects',
'wagtail.contrib.settings', # extra
'wagtail.embeds',
'wagtail.sites',
'wagtail.users',
'wagtail.snippets',
'wagtail.documents',
'wagtail.images',
'wagtail.search',
'wagtail.admin',
'wagtail.core',
'modelcluster',
'taggit',
# custom
'podcastbird657',
'wagtailmedia',
add to the MIDDLEWARE settings
'django.contrib.sites.middleware.CurrentSiteMiddleware',
add to the TEMPLATES settings
TEMPLATES = [
{
'OPTIONS': {
'context_processors': [
'wagtail.contrib.settings.context_processors.settings',
},
},
]
set the WAGTAILIMAGES_FORMAT_CONVERSIONS setting
WAGTAILIMAGES_FORMAT_CONVERSIONS = {
'bmp': 'webp',
'jpeg': 'webp',
'jpg': 'webp',
'JPG': 'webp',
'webp': 'webp',
'png': 'webp',
}
python3 manage.py migrate
python3 manage.py update_index
To the django projects' url.py add
from django.urls import path, re_path, include
# Wagtail
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls
from wagtail.core import urls as wagtail_urls
from wagtail.contrib.sitemaps.views import sitemap
and
urlpatterns += [
re_path('sitemap.xml', sitemap),
# Wagtail
re_path(r'^wagtail/', include(wagtailadmin_urls)),
re_path(r'^documents/', include(wagtaildocs_urls)),
re_path(r'', include(wagtail_urls)),
]
python manage.py collectstatic
Some commands is good to have in cron to run once every hour.
crontab -e
0 * * * * /path/to/env/bin/python3 /path/to/project/manage.py publish_scheduled_pages
0 * * * * /path/to/env/bin/python3 /path/to/project/manage.py search_garbage_collect
crontab -l
pip install pylint
To the Django settings.py add
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
To the Django project url.py add
from django.conf import settings
from django.conf.urls.static import static
and at the bottom of the file add
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
RSS feed guidelines for Google Podcasts
<itunes:category> - Example: <itunes:category text="Games & Hobbies"/>
Recommended categories:
- Arts
- Business
- Comedy
- Education
- Games & Hobbies
- Government & Organizations
- Health
- Kids & Family
- Music
- News & Politics
- Religion & Spirituality
- Science & Medicine
- Society & Culture
- Sports & Recreation
- TV & Film
- Technology
pip install black
black . --skip-string-normalization
python3 -m build --sdist