{ "info": { "author": "Laurent Peuch", "author_email": "cortex@worlddomination.be", "bugtrack_url": null, "classifiers": [], "description": "# Introduction\n\nOften, when you use a client-side javascript framework (e.g. backbone/ember/angular/wathever), you'll want small templates to render your page. The problem starts when:\n* you still want to be able to use django template engine\n* and you want a cool place to define your small templates.\n\nThose are the 2 issues that this django app tries to address. It also comes with helper functionalities for those kind of templates, like the `verbatim` templatetags from django 1.5 dev code that allows you to define a zone where django won't interpret anything to avoid conflicts with template languages like `mustache.js`.\n\nWith it, you define all your small templates in the same directory and you'll be able to access them in the `fragments` javascript object that contains the (rendered by django) templates.\n\n# Installation\n\nFrom pip:\n\n pip install django-template-fragments\n\nFrom setup.py:\n\n git clone git://github.com/Psycojoker/django-template-fragments.git\n cd django-template-fragments\n python setup.py install\n\nCreate a dir where you want to store your fragments, then add `FRAGMENTS_DIR` to your `settings.py`, it must be an absolute path.\n\nI like to define my `FRAGMENTS_DIR` like this:\n\n import os\n PROJECT_PATH = os.path.abspath(os.path.split(__file__)[0])\n SUBPROJECT_PATH = os.path.split(PROJECT_PATH)[0]\n\n FRAGMENTS_DIR = os.path.join(SUBPROJECT_PATH, \"fragments\")\n\nThis will set it to the directory `project_name/fragments` (where your `settings.py` is in `project_name/project_name/settings.py`).\n\nNext, write some small html snippets in this dir.\n\nThen add something like this to your `urls.py`\n\n url(r'^', include('fragments.urls')),\n\nAnd somewhere in your base template\n\n