Our front-end guru wants to take the plunge and get to know more about our middle and back (and way-back) ends. There are more than a couple steps down the road to mastery, but the essentials are enough to get you well on your way. This is a brief (link-farm) guide for someone with some programming experience, but new to Python/Django — heavy on my biases. Have fun, Tim!
I’ll assume you’re on a Debian-based/derived system and have access to apt-get. If not, you can probably install all of these by downloading individually or relying on easy_install/PyPI.
Python
These are the resources to get you familiar with the language, culture, and communities. I personally like to start with books. I’ve read many, but thanks to Python’s clean/simple design, only a couple are actually necessary to make you proficient.
Install: sudo apt-get install python python-ipython python-setuptools
python -c 'import this'(Zen of Python)- Python glossary
- Python tutorial
- Python Standard Library
- Python wiki
- PyPI
- Book: Python in a Nutshell (best Nutshell book ever written, regexes and libs coverage pretty comprehensive, but hoping for Py3k coverage soon!)
- Alternative free/open book: Dive Into Python
- Book: Python Cookbook (also online ASPN Cookbook)
- PEP 8 (style guide)
- Programming FAQs
- Editor configuration (vim: set ts=4 ai sw=4 et tw=72; research equivalents your favorite editor; emacs good alternative)
- ReStructuredText (ReST)
- Python mailing list
- Python IRC
- Find a Python user group (ours is Portland)
- The here/near future (Python 3)
Tools
If you only get one thing out of this article, let it be this: Use ipython to interactively discover the language and libraries. It’s the most powerful REPL of any language I’ve encountered, and is what really makes Python rise to the top for learnability.
Install: sudo apt-get python-ipython pylint pyflakes pychecker mercurial python-nose pydb python-coverage python-sphinx
- Interactive play:
ipython(try:foo.<tab>andfoo?and discover everything!) - PyPI installables:
easy_install - Testing: nose
- Debugging: pydb (extended Python debugger)
- Lint/correctness: pylint, pyflakes, pychecker
- Code coverage: python-coverage
I’ve skipped some really useful tools that go beyond the essentials. If you’re going to become a Python zealot, you’ll want most of your tools to be written in Python. These might include Mercurial, Bazaar, Trac, MoinMoin, Sphinx. We still need investigate the use of Selenium and Twill for web testing. (We’re now using PostgreSQL for all our database work for several reasons, but one of the most significant is its REPL similar in introspective capability to ipython.)
Django
Our choice of Django was not an easy one, but after some time with Pylons and TurboGears (and even RoR), it was the winner. It’s also arguably sort of the official Python web framework and does appear to have critical mass (AFAICT). The Django website lists many of the following resources pretty clearly, but I have found these to be the most useful, and so worth enumerating here.
Install: sudo apt-get python-django python-psycopg2 python-sqlite3
- Django tutorial
- Django cheat sheet
- Book: The Django Book (especially chs 3-5,12)
- Django documentation
- Django Master Class presentation
- Django FAQs
- Django mailing list
- Testing Django page
- Long Django testing discussion
- Django Debug Toolbar
- Especially informative blog: B-List
- Most Django blogs
Please include any of your favorite resources for Python/Django newbies in the comments.
I used http://www.poromenos.org/tutorials/python to do some simple things and I think it's a good overview of the really basic python language features. It's probably what you are looking for if you just do some simple scripting or reading some code or if you just need to customize some little things in existing apps.
Thanks for the tutorial link, Bernhard. That's a pretty short tut, but it makes me wonder how many people are trying to use web frameworks without first knowing the language. Seems backwards to me, but maybe lots of folks are trying that. Surely RoR (and its hype) have had many Ruby newbies messing around before really know what's going on. Maybe the same is true in Django. I guess you could get a ways on a small project without necessarily being very proficient in the underlying language.