Puput is a powerful and simple Django app to manage a blog. It uses the awesome Wagtail CMS as content management system.
Puput is the catalan name for Hoopoe which is indeed a beautiful bird.
- Built with Wagtail CMS and Django
- Inspired in Wordpress and Zinnia
- Simple & responsive HTML template by default
- SEO friendly urls
- Support for Disqus comments
- Entries by author, tags, categories, archives and search term
- Last & popular entries
- Configurable sidebar widgets
- RSS feeds
- Related entries
- Extensible entry model
If you have a running Django project and you want to add blog site to your project, please follow Standalone blog app steps. Otherwise follow the Wagtail blog app steps if you are currently using Wagtail on your project.
- Install Puput and its dependencies
pip install puput
- Add
PUPUT_APPS
to yourINSTALLED_APPS
insettings.py
file.
from puput import PUPUT_APPS
INSTALLED_APPS += PUPUT_APPS
This includes Puput, Wagtail apps and Third party apps.
If you have on of these apps previously defined in your INSTALLED_APPS
please include manually this apps in order to avoid apps collisions:
INSTALLED_APPS = (
...
'wagtail.wagtailcore',
'wagtail.wagtailadmin',
'wagtail.wagtaildocs',
'wagtail.wagtailsnippets',
'wagtail.wagtailusers',
'wagtail.wagtailimages',
'wagtail.wagtailembeds',
'wagtail.wagtailsearch',
'wagtail.wagtailsites',
'wagtail.wagtailredirects',
'wagtail.wagtailforms',
'wagtail.contrib.wagtailsitemaps',
'wagtail.contrib.wagtailroutablepage',
'compressor',
'taggit',
'modelcluster',
'puput',
)
- Add Wagtail required middleware classes in
settings.py
file
MIDDLEWARE_CLASSES = (
...
'wagtail.wagtailcore.middleware.SiteMiddleware',
'wagtail.wagtailredirects.middleware.RedirectMiddleware',
)
- Add
request
context processor toTEMPLATE_CONTEXT_PROCESSORS
structure insettings.py
file
TEMPLATE_CONTEXT_PROCESSORS = (
...
'django.core.context_processors.request',
)
- Set
WAGTAIL_SITE_NAME
variable insettings.py
file with your site name:
WAGTAIL_SITE_NAME = 'Puput blog'
- Set
MEDIA_ROOT
andMEDIA_URL
variable insettings.py
as described in the Wagtail Docs:
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')
MEDIA_URL = '/media/'
- Place Puput urls at the bottom of the urlpatterns. It also includes Wagtail urls:
urlpatterns = [
...
url(r'', include('puput.urls')),
]
- To make your Django project serve your media files (ex: uploaded contents) during development, don't forget to add this to your urlpatterns:
from django.conf import settings
if settings.DEBUG:
import os
from django.conf.urls import patterns
from django.conf.urls.static import static
from django.views.generic.base import RedirectView
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns() # tell gunicorn where static files are in dev mode
urlpatterns += static(settings.MEDIA_URL + 'images/', document_root=os.path.join(settings.MEDIA_ROOT, 'images'))
urlpatterns += patterns('',
(r'^favicon\.ico$', RedirectView.as_view(url=settings.STATIC_URL + 'myapp/images/favicon.ico'))
)
- Run
python manage.py migrate
andpython manage.py puput_initial_data
to load initial data to start a blog site. - Open your broswer at http://127.0.0.1:8000/blog/ to view your blog home page. Go to http://127.0.0.1:8000/blog_admin/ to view the admin site and edit your content.
- Install Puput and its dependencies
pip install puput
- Add
puput
,wagtail.contrib.wagtailsitemaps
andwagtail.contrib.wagtailroutablepage
to yourINSTALLED_APPS
insettings.py
file. - If you have previously defined Wagtail urls in
urls.py
setPUPUT_AS_PLUGIN = True
in thesettings.py
. This will avoid to include Wagtail urls again when you include necessary Puput urls. - Include Puput urls in
urls.py
before Wagtail urls.
urlpatterns = [
...
url(r'', include('puput.urls')),
url(r'', include(wagtail_urls)),
]
- Run
python manage.py migrate
If you want to run Puput in a Docker container please visit docker-puput for detailed instructions.
Visit Puput documentation for the detailed documentation.