Home

Awesome

Django support for Sublime Text

Join the chat at https://gitter.im/squ1b3r/Djaneiro

Installation

Using Package Control:

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 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

AbbreviationTag
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<a href="{% url '' %}></a>
verbatim{% verbatim %} {% endverbatim %}
widthratio{% widthratio %}
with{% with as %} {% endwith %}
trans{% trans %}
blocktrans{% blocktrans with as %} {% endblocktrans %}

...and some non-official stuff:

AbbreviationTag
super{{ block.super }}
extrahead{% block extrahead %} {% endblock extrahead %}
extrastyle{% block extrastyle %} {% endblock extrastyle %}
var{{ }}
tag{% %}
staticu{{ STATIC_URL }}
media{{ MEDIA_URL }}

Snippets for Django model fields

AbbreviationTag
mautomodels.AutoField()
mbautomodels.BigAutoField()
mbigintmodels.BigIntegerField()
mbinmodels.BinaryField()
mboolmodels.BooleanField()
mcharmodels.CharField()
mdatemodels.DateField()
mdatetimemodels.DateTimeField()
mdecimalmodels.DecimalField()
mdurationmodels.DurationField()
memailmodels.EmailField()
mfilemodels.FileField()
mfilepathmodels.FilePathField()
mfloatmodels.FloatField()
mgipmodels.GenericIPAddressField()
mimgmodels.ImageField()
mintmodels.IntegerField()
mjsonmodels.JSONField()
mnullboolmodels.BooleanField(null=True)
mphonemodels.PhoneNumberField()
mposintmodels.PositiveIntegerField()
mposbigintmodels.PositiveBigIntegerField()
mpossmallintmodels.PositiveSmallIntegerField()
msautomodels.SmallAutoField()
mslugmodels.SlugField()
msmallintmodels.SmallIntegerField()
mtextmodels.TextField()
mtimemodels.TimeField()
murlmodels.URLField()
musstatemodels.USStateField()
muuidmodels.UUIDField()
fkmodels.ForeignKey()
m2mmodels.ManyToManyField()
o2omodels.OneToOneField()

Snippets for Django form fields

AbbreviationCode
fboolforms.BooleanField()
fcharforms.CharField()
fchoiceforms.ChoiceField()
fcomboforms.ComboField()
fdateforms.DateField()
fdatetimeforms.DateTime()
fdecimalforms.DecimalField()
fdurationforms.DurationField()
femailforms.EmailField()
ffileforms.FileField()
ffilepathforms.FilePathField()
ffloatforms.FloatField()
fgipforms.GenericIPAddressField()
fimgforms.ImageField()
fintforms.IntegerField()
fipforms.IPAddressField()
fmochoiceforms.ModelChoiceField()
fmomuchoiceforms.ModelMultipleChoiceField()
fmuchoiceforms.MultipleChoiceField()
fmuvalforms.MultipleValueField()
fnullboolforms.NullBooleanField()
fregexforms.RegexField()
fslugforms.SlugField()
fsdatetimeforms.SplitDateTime()
ftimeforms.TimeField()
ftchoiceforms.TypedChoiceField()
ftmuchoiceforms.TypedMultipleChoiceField()
furlforms.URLField()
fuuidforms.UUIDField()

Snippets for Django Views

AbbreviationCode
viewFunction Based View
createviewGeneric Create View
updateviewGeneric Update View
deleteviewGeneric Delete View
detailviewGeneric Detail View
listviewGeneric List View
templateviewGeneric Template View
adminviewGeneric Admin View
tabularinlineTabular Inline View
stackedinlineStacked Inline View
dispatchdispatch method for CBVs
get_context_dataget_context_data method for CBVs

Snippets for Django Models

AbbreviationCode
ModelSimple Model Class
Model_fullFull Model Class(with TODOs)

Snippets for Python

AbbreviationCode
init__init__(self, *args, **kwargs)
pdbimport pdb ; pdb.set_trace()
ipdbimport ipdb ; ipdb.set_trace()
npdbfrom nose.tools import set_trace; set_trace()
tracebackimport traceback; traceback.print_exc();
utfccoding: utf-8

Completions

Abbreviation
null
blank
choices
db_column
db_index
db_tablespace
default
related_name
editable
error_message
help_message
primary_key
unique
unique_together
unique_for_date
unique_for_month
unique_for_year
verbose_name
verbose_name_plural
validators
auto_now_add
auto_now
required
label
initial
widget
localized
return
RequestContext
context_instance
render_to_response
render
redirect
get_object_or_404
get_list_or_404