# Django support for Sublime Text [![Join the chat at https://gitter.im/squ1b3r/Djaneiro](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squ1b3r/Djaneiro?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ## Installation Using [Package Control](https://packagecontrol.io/installation): - Open the Command Pallete (`ctrl+shift+P` or `cmd+shift+P`). - Type “Install Package” and hit return. - Type “Djaneiro” and hit return. Use `HTML (Django) ST3` if using Sublime 3 or earlier. ## URL autocompletion Djaneiro features URL autocompletion functionality. By keeping an up-to-date index of all named URLs and using tab-completion to quickly lookup available names of views, it eliminates all time spent tracking down URL names in `urls.py`. To use this feature: * The django project must be saved as a sublime-project. * `./manage.py` needs to be located in one of the folders in the project. * The setting `python_interpreter` must be set in your project settings. The index is loaded when the project is opened, and refreshed anytime a python file containing the word `urlpatterns` is saved. The autocomplete can be triggered within any `{% url %}` template tag, or inside the method `reverse(`. The appropriate keyword arguments will be displayed if available. ## Snippets for Django templates | Abbreviation | Tag | |----------------|--------------------------------------------------| | autoescape | ``{% autoescape %} {% autoescape %}`` | | block | ``{% block %} {% endblock %}`` | | comment | ``{% comment %} {% endcomment %}`` | | csrf | ``{% csrf_token %}`` | | cycle | ``{% cycle %}`` | | debug | ``{% debug %}`` | | ext | ``{% extends "" %}`` | | extends | ``{% extends "" %}`` | | filter | ``{% filter %} {% endfilter %}`` | | firstof | ``{% firstof %}`` | | for | ``{% for in %} {% endfor %}`` | | fore | ``{% for in %} {% empty %} {% endfor %}`` | | if | ``{% if %} {% endif %}`` | | ifchanged | ``{% ifchanged %} {% endifchanged %}`` | | ife | ``{% if %} {% else %} {% endif %}`` | | ifelse | ``{% if %} {% else %} {% endif %}`` | | ifeq | ``{% ifequal %} {% endifequal %}`` | | ifequal | ``{% ifequal %} {% endifequal %}`` | | ifnotequal | ``{% ifnotequal %} {% endifnotequal %}`` | | inc | ``{% include %}`` | | include | ``{% include %}`` | | load | ``{% load %}`` | | now | ``{% now "" %}`` | | regroup | ``{% regroup by as %}`` | | spaceless | ``{% spaceless %} {% endspaceless %}`` | | ssi | ``{% ssi %}`` | | static | ``{% static %}`` | | templatetag | ``{% templatetag %}`` | | url | ``{% url %}`` | | aurl | ``