kingsj / django-html5boilerplate Goto Github PK
View Code? Open in Web Editor NEWThis project forked from mechanism/django-html5boilerplate
Paul Irish's HTML 5 Boilerplate set up for Django with templates and media folders
This project forked from mechanism/django-html5boilerplate
Paul Irish's HTML 5 Boilerplate set up for Django with templates and media folders
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.