Giter Site home page Giter Site logo

django-html5boilerplate's Introduction

Paul Irish's HTML5 Boilerplate as a Django Template
version 0.1 (HTML5 Boilerplate version 0.9.5)
--
by Jusin Marrington (HowlingEverett)
--

This is a simple packaging of Paul Irish's HTML5 Boilerplate into a base
Django template and sensibly laid-out media folder. Use it with rhec's HTML5
Django plugin for an excellent


WHAT'S IN IT?

Paul Irish's HTML5 Boilerplate is a great place to start for next-generation
web project, providing you're a fan of jQuery ;) It packages a whole heap of
useful tools - modernizr to add HTML5 elements to IE6/7/8, jQuery via Google
CDN (with a local fallback), etc. It also overrides console.log() to provide
much more useful behaviour.

For full details of what HTML5 Boilerplate gives you, see
http://html5boilerplate.com/

This packaging of the boilerplate simply wraps it up into a good base Django
template for use in your django projects, with each chunk of the boilerplate
wrapped up into blocks for you to override/customise at your convenience.


HOW TO USE IT

The paths in the base.html template are configured to work with Django's
default MEDIA_ROOT setting; drop the contents of the 'media' folder into your
media root and everything should work. If you're using a different MEDIA_ROOT
than '/media/', then you'll need to update the pathing in the base.html
accordingly

Place the contents of 'templates' folder into a directory you've included in
your TEMPLATE_DIRS list, and rename the 'myapp' subfolder to the name of your
first app. Providing base.html is at the root of a TEMPLATE_DIRS directory,
you can simply {% extends 'base.html' %} in any of your templates to get all
of the HTML5 Boilerplate's included functionality.


USING WITH django-mediagenerator

Add django-mediagenerator to your virtualenv (or what ever alternative you use):
pip install django-mediagenerator

Place django-html5boilerplate somewhere that it can be found as an app, ie:
ln -s ../django-html5boilerplate html5boilerplate

Add html5boilerplate and mediagenerator to INSTALLED_APPS:
INSTALLED_APPS = (
    ...
    'mediagenerator',
    'html5boilerplate',
    ...
)

Add mediagenerator middleware. mediagenerator must be the first item listed.
MIDDLEWARE_CLASSES = (
    'mediagenerator.middleware.MediaMiddleware',
) + MIDDLEWARE_CLASSES


Import the HTML5_MEDIA_BUNDLES into settings.py, or copy the required sections
from media.py into settings.py, ie:

from html5boilerplate.media import HTML5_MEDIA_BUNDLES
MEDIA_BUNDLES += HTML5_MEDIA_BUNDLES

Override boilerplate.html to your taste using a base.html that extends
boilerplate.html. You can simple copy the existing base.html from
html5boilerplate into your templates folder.
Then just extend base.html for all your templates.


STATIC landing.html EXAMPLE

By modifying urls.py to include the following you can quickly test landing.html.

from django.views.generic.simple import direct_to_template

urlpatterns = patterns('',
    ...
    url(r'^$', direct_to_template, {'template': 'landing.html'}),
)


PRODUCTION DEPLOYMENT

Make sure you run ''python manage.py generatemedia'' prior to deployment to
update all static file changes.


CREDIT
All Buttons Pressed:
    http://www.allbuttonspressed.com/projects/django-mediagenerator

django-html5boilerplate's People

Contributors

agentk avatar howlingeverett avatar

Watchers

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.