A Django application to manage your images, video links, embeds and slideshows.
Project description
Installation
Install
pip install django-media-explorer
Update settings
Add these to your INSTALLED_APPS settings
'rest_framework', 'micawber.contrib.mcdjango', 'media_explorer', 'ckeditor',
Add these to your urls.py
("^ckeditor/", include("ckeditor.urls")), ("^", include("media_explorer.urls")),
Copy and paste this code into the bottom of your settings.py file.
try: from media_explorer.settings import * except ImportError: pass
Create tables
Run these migration commands to create your database tables.
python manage.py makemigrations python manage.py migrate
How it works
Add the MediaField and RichTextField fields to your model.
from django.db import models from media_explorer.fields import MediaField, RichTextField class Blog(models.Model): """ Example Blog model """ title = models.CharField(max_length=150) #If you do not provide a type then media can be image/video/gallery lead_media = MediaField() #Providing a type will restrict the element to this type video = MediaField(type="video") #You will see a CKEditor WYSIWYG with DME plugin #NOTE: You cannot use more than one RichText field in a model entry = RichTextField()
After you add media fields to your model you can add data via the admin page (See screenshot - the red-circled button is the DME plugin button. It will allow you to insert media elements into your WYSIWYG)
Go to https://github.com/oxfamamerica/django-media-explorer for more documentation on how to add images, videos and galleries programatically via the API and how to display media in your templates.
Tests
Run this command to run all the DME tests.
python manage.py test media_explorer.tests
Or you can run the tests individually.
python manage.py test media_explorer.tests.elements.tests python manage.py test media_explorer.tests.galleries.tests python manage.py test media_explorer.tests.customfields.tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-media-explorer-0.3.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfff032ee65c434f91ee721d53b34785d7c6b73f8bb68c5f7f3db3e06118edd8 |
|
MD5 | 64fbb23b877ab2eeec4b547cf7450fa3 |
|
BLAKE2b-256 | d3a24043d359b8c4e231f062932ca5197c198948dbb5bcc3ec7cf24bfe8cbccb |
Hashes for django_media_explorer-0.3.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db205f3ecef193700b43b5a03849b035995ccb42fe8eb927c67e1ec06a370e0e |
|
MD5 | ca4a03698d1b4b5084b632826f5f5fb6 |
|
BLAKE2b-256 | 860875ad9990a06a8cc1256bbe7c6f6f326c58e101937235ceb0eae2e3660250 |