Monthly Archives: March 2012

Sublime Text 2 Editor

Best tools for Django.

sublime text editor

Then install some packages copy the stuff in here.
then press command ~ and past it in and press enter.

For mac

Best plugins are

  • soda theme
  • sftp
  • Theme – Soda
  • SublimeCodeIntel
  • SideBarEnhancements
  • WordHighlight

– Command + P, type in the name of the file you wish to access (fuzzy finder)
– Command + shift + p – shows you all commands aka the command palette (sort of like the Tools menu)
– Control + Command + P – switching between different projects
– Command + / – commenting/uncommenting
– Command + ] – Indent
– Command + [ – Unindent
– Control + Command + Up – move selected line up
– Control + Command + Down – move selected line down
– Command + Number – switches to an open tab. Command + 1 goes to the 1st tab, Command + 2 – 2nd tab, etc.
– Shift + Command + F – searches through the whole project
– Shift + Control + K – deletes selected code or line

Linking Sublime to command subl
sudo ln -s “/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl” /bin/subl

A few other great sites
http://www.rockettheme.com/magazine/1319-using-sublime-text-2-for-development
http://1p1e1.tumblr.com/post/14262857223/9-reasons-you-must-install-sublime-text-2-code-like-a
http://net.tutsplus.com/tutorials/tools-and-tips/sublime-text-2-tips-and-tricks/

Eclipse
I do a lot of work in the Eclipse IDE.
Here are a few of my tips using that IDE–
Getting autocomplete in eclipse with the PyDev plugin, press the following sequence of keys:
f [control] [space]
(I’ll do my best to keep this post updated.)

Key Resources to Learn Python & Django

Ok so you want to learn about Python and Django. Well read on and learn.

Python vs Other Languages

Understand the difference between Django and other languages.

Pythonic Style Coding

Advanced Python Features

Certain programming concepts in Python just don’t exist in Java, for instance closures and meta-programmin. Read the following articles to understand these concepts.

Python/Django Tutorials

These tutorials will help you get started and warmed up if you have programmed before. A must try. Some are videos, examples.

Best of Django Documentation

Read these parts of the official Django docs

  • Managers / Querysets how Django interacts with relational databases.
  • Request-Response / User, HTTP request information. The concept of Users and authentication is built into Django
  • Views / Templates – A good introduction on how the application-level code connects to the client-side HTML/JS/CSS code.
  • Django workflow handle requests coming from the HTTP server. This will help you understanding middleware, context processors and views work together and the sequence of events firing each. Read request/response cycle info from Simon Willison and James Bennett detailed information.

Python Tools

  • IPython – Although not specific to Django, IPython is a huge improvement over the standard Python shell. With its tab complete feature, it saves me a few extra seconds of distraction whenever I can’t remember a function or module name.
  • PDB / iPDB – The Python debugger tool is incredibly helpful going through a new piece of code, giving power to stop code at arbitrary points and inspect the variables at those points. iPDB gives you the power of PDB along with the features of iPython.
  • Eclipse for Django, if you use Eclipse, this is how to use with Python/Django
  • Sublime text editor, I’ve tried them all this one just works best.

Additional Resources