Skip to main content

Peregrine

Peregrine is an opinionated blogging platform which uses the Wagtail CMS on the Django web framework and is geared for coding blogs. It uses Wagtail's fantastic StreamField feature to provide fully structured content body element blocks, completely separating content from the presentation layer (CSS, JS, and HTML).

It uses Wagtail Code Block with PrismJS syntax highlighting under the hood for beautiful code snippets. You can see this in action at PyPhilly.org.

Are you looking for a more robust system, for example, creating a marketing site? The maintainer of Peregrine also contributes to CodeRedCMS, which offers a lot more bells and whistles. Peregrine will remain a basic weblog solutions focused on features to display code.

Getting Started: the Five Minute Install

These instructions will be fleshed out, but if you want to give it a try, here are the basics.

System

mkvirtualenv my_blog
pip install peregrine
django-admin startproject my_blog
cd my_blog

Settings

Your settings file will be located in my_blog/settings.py if you're using the default Django project layout created by the startproject command above. You'll need to add the sections beneath INSTALLED_APPS and MIDDLEWARE, and add 'wagtail.contrib.settings.context_processors.settings', to your TEMPLATES context processors in your settings to look like this.

INSTALLED_APPS = [
    ...
]

PEREGRINE_APPS = [
    "peregrine",
    "bootstrap4",
    "wagtailcodeblock",
    "wagtailcontentstream",

    "wagtail.contrib.forms",
    "wagtail.contrib.redirects",
    "wagtail.embeds",
    "wagtail.sites",
    "wagtail.users",
    "wagtail.snippets",
    "wagtail.documents",
    "wagtail.images",
    "wagtail.search",
    "wagtail.admin",
    "wagtail.core",
    "taggit",
    "modelcluster",

    "wagtail.contrib.settings",
    "wagtail.contrib.modeladmin",
    "wagtail.contrib.table_block",
]


INSTALLED_APPS += PEREGRINE_APPS

MIDDLEWARE = [
    ...
]

PEREGRINE_MIDDLEWARE = [
    "wagtail.contrib.redirects.middleware.RedirectMiddleware",
]

MIDDLEWARE += PEREGRINE_MIDDLEWARE

# WAGTAIL_SITE_NAME is used by Wagtail; others are used by OpenGraph.
WAGTAIL_SITE_NAME = "PyPhilly: Home of FlipperPA"
WAGTAIL_SITE_DESCRIPTION = "PyPhilly is the website of Tim Allen, a web developer living in Philadelphia. Tim has a wide range of interests, but mostly writes about Python, Django, and virtual reality."
WAGTAIL_SITE_URL = "https://PyPhilly.org/"

TEMPLATES = [
    {
        ...

        'OPTIONS': {
            'context_processors': [
                ...

                'wagtail.contrib.settings.context_processors.settings',
            ]
        }
    }
]

URLs

from django.contrib import admin
from django.urls import include, path, re_path

from wagtail.admin import urls as wagtailadmin_urls
from wagtail.documents import urls as wagtaildocs_urls

urlpatterns = [
    path('admin/', admin.site.urls),

    # Wagtail / Peregrine URLs
    path('documents/', include(wagtaildocs_urls)),
    path('cms/', include(wagtailadmin_urls)),
    re_path(r'^', include('peregrine.urls')),
]

Fire it up!

After you've set up your settings, we need to create your database and a superuser. Issue the following commands from your project root directory.

Only run the command peregrine_initial_site if you are running on a new project, as it loads database fixtures!

python manage.py migrate
# ** Be sure to see the note above before running this next command. It isn't necessary if you don't want to. **
python manage.py peregrine_initial_site
python manage.py createsuperuser
python manage.py runserver 0:8000

You should then be able to navigate to http://localhost:8000/cms/ and log in, and start creating!

Maintainer

Contributors

Metadata

Release files for peregrine 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peregrine 0.5.1
File Size Uploaded
peregrine-0.5.1.tar.gz 22.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for peregrine 0.5.1
File Interpreter ABI Platform
peregrine-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 54.4 kB

Release files / peregrine-0.5.1.tar.gz

Download URL peregrine-0.5.1.tar.gz
Size 22.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2497243375d7ff22a0b33a8a54f1908b1b4366253f7dcd4c009921c7442e7b82
BLAKE2b-256 checksum
How to use checksums
4b0321a348a751a01f0f6ec51023b0f87994d166cd300c6f57e60e6b0ad125b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release files / peregrine-0.5.1-py3-none-any.whl

Download URL peregrine-0.5.1-py3-none-any.whl
Size 31.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49eea6bc766efc2c6fd54e760169e73a426b2a202085ba63611af32e1bd7b911
BLAKE2b-256 checksum
How to use checksums
94d4470f8eff874e874fbff9c83631cb594b99f041298697b49288f1901a7915
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page