Skip to content
Personal blogging / podcasting app
Branch: develop
Clone or download
Latest commit 63e1d3f May 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github initial checkin Nov 5, 2018
cast use visible_date instead of pub_date as date for pubDate in feed + te… May 17, 2019
docs initial comments docs commit May 17, 2019
locale/de/LC_MESSAGES translation for comments.. May 16, 2019
tests use visible_date instead of pub_date as date for pubDate in feed + te… May 17, 2019
.coveragerc initial checkin Nov 5, 2018
.editorconfig initial checkin Nov 5, 2018
.gitignore updated for domis use May 4, 2019
.readthedocs.yml bump version number Mar 23, 2019
.travis.yml trying to get travis to build again Apr 15, 2019
AUTHORS.rst added dominik as an author May 5, 2019
CONTRIBUTING.rst fixed test and clone instructions Mar 23, 2019
HISTORY.rst update history May 17, 2019
LICENSE initial checkin Nov 5, 2018
MANIFEST.in add docs and locale to package May 17, 2019
Makefile
README.rst fix(docs): add django-filter to INSTALLED_APPS May 15, 2019
getenv.sh helper scripts Nov 5, 2018
manage.py initial checkin Nov 5, 2018
postactivate helper scripts Nov 5, 2018
pytest.ini first working prototype Nov 7, 2018
release.txt use visible_date instead of pub_date as date for pubDate in feed + te… May 17, 2019
requirements.txt fix: add rest_framework May 15, 2019
requirements_dev.txt updates May 11, 2019
requirements_test.txt fix(tests): add django-filepond to requirements May 15, 2019
runtests.py initial checkin Nov 5, 2018
setup.cfg bump version number May 16, 2019
setup.py better classifiers May 17, 2019
tox.ini trying to get travis to build again Apr 15, 2019

README.rst

Django Cast

https://travis-ci.org/ephes/django-cast.svg?branch=master

Just another blogging / podcasting package

Documentation

The full documentation is at https://django-cast.readthedocs.io.

Installation Screencast

Quickstart

Install Django Cast:

pip install django-cast

Add django-cast and some dependencies to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    "imagekit",
    "ckeditor",
    "ckeditor_uploader"
    "crispy_forms",
    "django_filters",
    "rest_framework",
    "rest_framework.authtoken",
    "filepond.apps.FilepondConfig",
    "cast.apps.CastConfig",
    "watson",
    ...
)

Add required settings:

# CKEditor
CKEDITOR_UPLOAD_PATH = "uploads/ckeditor/"
CKEDITOR_IMAGE_BACKEND = "pillow"
AWS_QUERYSTRING_AUTH = False
X_FRAME_OPTIONS = "SAMEORIGIN"
CKEDITOR_CONFIGS = {
        "default": {
        "removePlugins": "stylesheetparser",
        "allowedContent": True,
        "enterMode": 2,
    },
}

# REST
REST_FRAMEWORK = {
    # Use Django's standard django.contrib.auth permissions,
    # or allow read-only access for unauthenticated users.
    "DEFAULT_AUTHENTICATION_CLASSES": (
        "rest_framework.authentication.SessionAuthentication",
        "rest_framework.authentication.TokenAuthentication",
    )
}

# django imagekit
IMAGEKIT_DEFAULT_CACHEFILE_STRATEGY="imagekit.cachefiles.strategies.Optimistic"

Add Django Cast's URL patterns:

from django.urls import path, include

from rest_framework.documentation import include_docs_urls
from rest_framework.authtoken import views as authtokenviews


urlpatterns = [
    ...
    # Cast urls
    path("api/api-token-auth/", authtokenviews.obtain_auth_token),
    path("docs/", include_docs_urls(title="API service")),
    path("ckeditor/", include("ckeditor_uploader.urls")),
    # Uploads
    path("uploads/", include("filepond.urls", namespace="filepond")),
    # Cast
    path("cast/", include("cast.urls", namespace="cast")),
    ...
]

The api token auth urls and the docs urls are both necessary to provide api endpoints with the right namespace. The django-filepond app is used to dispatch uploads to the right media models.

Features

  • Support for responsive images / video / audio media objects
  • Use django template syntax for posts allowing you to use custom template tags for galleries etc. for example
  • Good looking file uploads via filepond
  • Chaptermarks for podcast Episodes

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py tests

Credits

Tools used in rendering this package:

You can’t perform that action at this time.