未加星标

Sublime Text plugin review: Djaneiro

字体大小 | |
[开发(python) 所属分类 开发(python) | 发布者 店小二04 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏
Sublime Text plugin review: Djaneiro

by Daniel Bader ― Get free updates of new posts here .

A review of Djaneiro, a Sublime Text plugin for Django development.


Sublime Text plugin review: Djaneiro

I’ll admit I was skeptical at first when a friend of mine recommended Djaneiro to enhance my Django development workflow in Sublime Text.

I’d been happy with the python development setup I built for myself over the years and I didn’t really understand what Djaneiro was going to add to that.

But when I tried out Djaneiro I was impressed how helpful it turned out to be! I decided to write another Sublime Text plugin review to share my findings.

Djaneiro’s main selling points are adding:

syntax highlighting for Django HTML templates ; and code completion snippets for Django HTML templates and Python files .

In this review I’ll explain how Djaneiro can make your Django development workflow more productive and I’ll go over the pros and cons of the plugin as I experienced them. After that I’ll take a look at alternatives to Djaneiro in the Sublime Text plugin landscape. At the end I’ll share my final verdict and rating.

Pros

Syntax highlighting for Django templates: In its default configuration Sublime Text doesn’t have syntax definitions for Django’s HTML templating syntax.

This means that typos and syntax errors in templates are harder to catch visually. As you can see in the screenshot below (in the editing pane on the left), the standard HTML syntax highlighting in Sublime Text 3 uses a uniform white color for Django’s template tags.

Djaneiro adds a HTML (Django) syntax that properly highlights Django’s template tags. As you can see in the right-hand editing pane in the screenshot, proper syntax highlighting makes these templates quite a bit easier to read. Also, syntax errors and typos stand out more due to the proper highlighting.

This simple change adds a lot of value I found that I was making fewer typos in my templates with Djaneiro’s syntax highlighting. Also, templates seemed easier to read and scan quickly with Djaneiro installed.


Sublime Text plugin review: Djaneiro

Improved syntax highlighting for Django Python files: Djaneiro also makes some small tweaks to the default Python syntax highlighting. For example, it knows the standard Django settings constants like INSTALLED_APPS and highlights them differently so that they stand out more and typos are easier to find.

This also happens for things like field definitions when writing Django model classes, which I found handy. In summary I found that the syntax highlighting changes introduced by Djaneiro make it easier to grasp the structure of the code I’m writing.


Sublime Text plugin review: Djaneiro

Code completion snippets for Django templates and Python files: Another helpful feature provided by Djaneiro is a library of pre-made code completion snippets for common Django code and patterns.

For example, you can insert an {% if _____ %} {% endif %} block by typing if as an abbreviation and hitting the auto-complete key ( Tab by default). You can see a quick demo of that in the screenshot below. Generally, I found the list of snippets included with Djaneiro to be comprehensive and well-chosen.

Besides snippets for Django HTML templates Djaneiro also includes a snippet library for Django Python code. These snippets let you quickly scaffold out whole view definitions or a barebones model classes, for example.

Once you’ve gotten used to these snippets they can save you a lot of typing. Be sure to check out the full list of snippets in the Djaneiro README .


Sublime Text plugin review: Djaneiro
Cons

Snippets might get in the way: Because Djaneiro adds quite a substantial number of new code snippets I found myself triggering some of them accidentally, especially in the beginning. I really don’t want to hold this up against Djaneiro because the snippets do add a lot of value once I learned to use them well.

It’s possible to disable individual code snippets in Sublime Text but unfortunately this process is a bit involved.

If you find that the snippets get in your way occasionally you can temporarily switch them off by selecting a different syntax highlighting definition. Just open the Sublime Text Command Palette , type Set syntax , and select the default HTML or Python syntax.

Alternatives

There are a few more Django-specific plugins available on Package Control but Djaneiro seems to be the most popular and also the most powerful of the pack.

The verdict

I’ve grown quite fond of Djaneiro since I started using it. I immediately loved the improved syntax highlighting for Django templates and I’d say Djaneiro is worth installing for that feature alone.

Once I’d gotten the hang of Djaneiro’s code snippets and their shortcodes I felt a noticeable improvement in my productivity. The snippets added by Djaneiro cover many things I encountered in day to day Django development. It’s great not having to go through the work of writing these snippets myself.

I’d recommend any Django developer using Sublime Text to at least try out Djaneiro for a few days. There aren’t any substantial downsides to it and I’m sure it will make you more productive. You can install Djaneiro via Package Control .

(5 out of 5 snakes)

本文开发(python)相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程

主题: DjangoHTMLPythonADM
分页:12
转载请注明
本文标题:Sublime Text plugin review: Djaneiro
本站链接:http://www.codesec.net/view/481610.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 开发(python) | 评论(0) | 阅读(41)