Giter Site home page Giter Site logo

django-cast's Introduction

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",
    "rest_framework.authtoken",
    "filepond.apps.FilepondConfig",
    "cast.apps.CastConfig",
    ...
)

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

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

Running Tests

Does the code actually work?

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

Credits

Tools used in rendering this package:

django-cast's People

Contributors

ephes avatar smartc2016 avatar

Watchers

Bjoern avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.