Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

A template-tag library for Django that allows templates to define Media like Forms do. Moved to https://gitlab.com/morganwahl/django-template-media

License

Notifications You must be signed in to change notification settings

morganwahl/django-template-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A Django templatetag library for using Media instances in templates.

If your template expects certain Javascript or CSS files, it can declare that
using these tags, which create Media instances.

See https://docs.djangoproject.com/en/dev/topics/forms/media/#media-objects

There are two tags template_js and template_css . Their syntax is:

{% media_js "Javascript filename" in template_variable_name %}

This will add the javascript file given to a Media instance in the given
context variable name. If that context variable doesn't exist, it's added and
set to a new Media instance with just that javascript file.

{% media_css "CSS media" "CSS filename" in template_variable_name %}

Ditto above, but for CSS.

About

A template-tag library for Django that allows templates to define Media like Forms do. Moved to https://gitlab.com/morganwahl/django-template-media

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages