shabda
Comments
Reactions

Tools of Pro Django developer - aka What powers dinette and almost every app we write.

By : Shabda Raaj

There are some tools and apps which we use with almost all apps we write, and in particular which, we used for dinette. Here they are broken into useful during development, and (also) useful post development.

During Development

  1. Ipython and ipdb
  2. South
  3. Django test utils
  4. Django extensions
  5. Django debug toolbar
Ipython and ipdb

Ipython is a enhanced shell for python. Ipdb similarly add extra capacity to the builtin pdb debugger. It is extremely convenient to drop into a ipython shell right where a complex piece of code is being hit.

from IPython.Shell import IPShellEmbed
ipython = IPShellEmbed()
ipython()

Of course this does not allow you to step through, so if you want to step through your code, you need to do

import ipdb
ipdb.set_trace()

Of course, you can just do pdb.set_trace(), but with tab completion and syntax highlighting, using ipdb is a no brainer.

South

South adds schema migration to Django. It has lot of advanced options, but just three command will get you along way.

Convert a normal app to use the south way.

./manage.py convert_to_south

Once you have made any changes to your apps model, write a new migration which can update the database to latest models.py

./manage.py startmigration appname nameofmigration --auto

Once you have written a migration, write a command to update the db.

./manage.py migrate appanme
Django test utils

When you are running tests, a huge time sink is the time spent dropping and recreating tests. You might add just a single test, and the default Django testrunner will spend a huge time recreating the database. Enter manage.py quicktest which reuses databases between test runs. One of the side effects of this is that if you modify models.py between test runs you should manually recreate the database.

The tests (or whatever little of it exists) for Dinette were written using testutils' testmaker.

Django extensions

Django extensions, (earlier Django command extensions) is a app which adds extra commands to manage.py. It has lot of goodies, but just ./manage.py shell_plus makes it worthwhile. (It imports all the models from all the apps automatically).

Get the full list at Github

Django debug toolbar

I do not personally use it but some people on our team swear by it.

After development

  1. Django-pagination
  2. sorl-thumbnails
  3. django-compressor
  4. Haystack
Django-pagination

I have decided on a standard way to build apps which need pagination. a. Build apps without pagination. b. The night before release spend an hour and add pagination to all pages. Really this is all you need

{% load pagination tags %}
{% autopaginate queryset %}
....
{% paginate %}

There is no change required to the views.

sorl-thumbnails

To thumbnail an image.

{% thumbnail image size %}

"Things should be as simple as possible, but not simpler."

django-compressor

During development we work with multiple unminified js and css files. Django-compressor takes care of minifying and compressing it when we deploy. All we need to do is,

{% compress css %}
...
all css files
....
{% endcompress %}

{% compress js %}
...
all js files
....
{% endcompress %}
Haystack

Haystack is "modular search for Django". It make writing search views as easy as writing the admin. You declaratively tell what fields you want to search on, and Haystack can take care of creating and updating the index, and providing a generic view to handle the search. Check a search view written using Haystack http://uswaretech.com/forum/search/?q=django


To everyone who contributed to these apps, thanks. Django development won't be the same without these great tools. This post was inspired by Kevin Fricovsky's post post, The apps that power Django-Mingus and is stolen about 50% from there. Thanks. :)


We build Amazing web apps, and we can build it for you. Contact us today.


Related Posts


Can we help you build amazing apps? Contact us today.

Topics : python tips

Comments

zach

Nice list of django tools, but I think your missing a few things. First off there should be some mention about the environment your working in, any *nix based OS (Ubuntu, Gentoo, OSX, Chrome, etc) is going to open up a lot of tools when your start using the command line. If you're forced to use Windows at least use CYGWIN or something to get these tools they help out a lot. Also GNU Screen should be mentioned as well as virtualenv because they allow you to isolate your environment and keep different processes running (django shell, test, dev server, etc...), along with whatever SCM (git, hg, svn) you use. All of these tools make developing applications with django much more easier, and help you become a more proficient developer.

commmenttor
shabda

@zach: You are correct of course,

BUt I dont use windows, so I dont know about cygwin. :)
Screen and SCM are Tools any pro dev are using.. Also I <3 Git, and but am tired of git fandom so dont want to write another of those.
We already have an article on virtualenv.

commmenttor
zach

@shabda I agree, I'm getting sick of the git fandom myself, but I've accepted the fact that I'm a victim of it and the idea of distributed source control.

Anyways, when I was writing the last comment I was trying to think of some other useful applications that I've found that help me develop django apps. One thing that I find useful is django-command-extensions (http://code.google.com/p/django-command-extensions/) when developing an application. I tend to leave it out when I'm deploying an project to a production server, I don't use the extra database fields or the admin extensions it gives you. Also along the same lines as Haystack, if your in need of a quick REST Api, I've found a project called django-piston (http://bitbucket.org/jespern/django-piston/overview/) which lets you build REST api's quickly and easily.

commmenttor
shabda

Zach: True. settings.py runing uswaretech.com has a swicth on DEBUG for django-extensions and debug toolbar. So, We use it similarly. Piston is very useful, we just didn't use it during Dinette. :)

commmenttor
pro tools courses

Session information are connected along that can be read as they contain the notices being provided during time. Also, during plenty of duration of pro resources if there comes in any sort of concern you can ask by email. You will get the immediate reaction and then you will get better idea.
Lovely information here thanks for update....

commmenttor
Getting Your Ralph Lauren T-Shirts f¨¹r g¨¹nstige

Tools of Pro Django developer - aka What powers dinette and almost every app we write. - Agiliq Blog | Django web app development

commmenttor
Terry

This article is pretty good to read. Great!!
Thank you for sharing, may I post it on my Tumblr to share to my families?

commmenttor
where to buy nike cowboys authentic jason witten navy orange white elite limited unbeatable price

Daily nfl jersey Summary is certainly beginning to really feel a little outdated
where to buy nike cowboys authentic jason witten navy orange white elite limited unbeatable price http://www.backlightdigital.com/images/team-hockey-jerseys/cheap-jersey-outlet/zkztfqxu-p-779.html

commmenttor
shopping nike vincent jackson womens jersey buccaneers red white gold authentic big sale

The New Ways To Become skilled at nfl jersey And Ways In Which One Can Become a part of The nfl jersey Top dogs
shopping nike vincent jackson womens jersey buccaneers red white gold authentic big sale http://www.comberbachconsulting.com/products/cheap-women-nike-nfl-jerseys/nike-vincent-jackson-womens-jersey-p-7918.html

commmenttor
shop for authentic tony gonzalez jersey womens mens youth black gold white outlet shop

nfl jersey Imitations - - Ideal nfl jersey cheat Which in turn Fools 97.3% of the end users
shop for authentic tony gonzalez jersey womens mens youth black gold white outlet shop http://www.abshearlandscape.com/products/customize-basketball-jerseys/world-stanley-cup-2013-jerseys/crthngac-p-315.html

commmenttor
mulberry shop york

Wet smoking can be done by placing a water dish (in certain smokers only) inside the smokehouse to increase the humidity. You can also dampen wood chips before curing your meat in any kind of smokehouse for a similar result.

commmenttor
harvest of values nike rams authentic chris long orange navy white elite limited barrel of bargains

Alert! Do Not Attempt to go by other kinds of nfl jersey Tutorials Until You Check This 100 % free Ground-breaking report
harvest of values nike rams authentic chris long orange navy white elite limited barrel of bargains http://www.intellisolns.com/img/cheap-real-football-jerseys/usa-mens-soccer-jerseys/nike-rams-authentic-chris-long-p-2853.html

commmenttor
how to buy eli manning womens mens youth jersey authentic elite limited game outlet online sale

nfl jersey Press Methods Acquire The Updates In the moment
how to buy eli manning womens mens youth jersey authentic elite limited game outlet online sale http://www.aleenta.com/blog/china-cheap-hockey-jerseys/customized-wholesale-nfl-jerseys-overnight/mgswfxge-p-253.html

commmenttor
cheap new style nike vikings authentic christian ponder black white gold elite limited outlet

Word of caution - Do Not Attempt to go by some other nfl jersey Manuals Until You Look At FREE Ground-breaking report
cheap new style nike vikings authentic christian ponder black white gold elite limited outlet http://www.flsincorp.net/blue/cheap-team-jerseys-football/longhorns-jerseys-sale/nwxrmcyy-p-152.html

commmenttor
find the top sale nike a.j. green womens jersey bengals green navy white authentic outlet

Regularly nfl jersey Wrap up is without question beginning to feel somewhat outdated
find the top sale nike a.j. green womens jersey bengals green navy white authentic outlet http://www.studio-aiko.com/themeny/cheap-mlb-throwback-hats/chelsea-youth-jersey/nike-aj-green-womens-jersey-p-7201.html

commmenttor
designer cheap nike philip wheeler green black white jersey dolphins pro shop wholesale

Fed up with all nfl jersey stories? I'm on this site to help you!
designer cheap nike philip wheeler green black white jersey dolphins pro shop wholesale http://www.investorschoicellc.com/abouts/cheap-nfl-football-jersey/cheap-custom-baseball-jerseys-products/sdaxvgdg-p-478.html

commmenttor
cheap price low price women flag football jerseys,old school basketball jersey outle

Your nfl jersey-competitors Doesn't Want You To Study This approach
cheap price low price women flag football jerseys,old school basketball jersey outle http://www.alwaysiran.com/products/low-price-women-flag-football-jerseys/old-school-basketball-jersey/

commmenttor
65% discount authentic geno smith black orange white ladies mens kids bargain bonanza

Gossips which experts state nfl jersey attracts to a end, let me provide the follow-up
65% discount authentic geno smith black orange white ladies mens kids bargain bonanza http://www.victorianvintagespeedway.com/flash/buying-cheap-nfl-jerseys-online/wholesale-nike-nfl-football-jerseys-from-china/dhrdlgzb-p-342.html

commmenttor
wholesale cheap nike ryan kerrigan womens jersey redskins blue white black authentic for sale online

Incredible " inside info " Of How One Might Crush nfl jersey Without The Need For Practical knowledge!
wholesale cheap nike ryan kerrigan womens jersey redskins blue white black authentic for sale online http://wisea.org/css/2012-finals-nba-jerseys/nike-ryan-kerrigan-womens-jersey-redskins-blue-white-black-authentic-p-8831.html

commmenttor
find the top sale reggie bush game jersey: lions womens youth navy red white up to 50% off

Find who is preaching about nfl jersey and why you should feel concerned.
find the top sale reggie bush game jersey: lions womens youth navy red white up to 50% off http://www.sigma.com.co/abouts/usa-basketball-jersey-sale/custom-nfl-throwback-jerseys/snvepzku-p-668.html

commmenttor
wholesale nike maurice jones drew womens jersey jaguars black orange white authentic outlet online

To Those People Who Want To gain knowledge of nfl jersey But Find it hard to Move On
wholesale nike maurice jones drew womens jersey jaguars black orange white authentic outlet online http://www.rayoman.com/lib/majestic-youth-jerseys-team/clearance-hockey-jerseys/nrxpglue-p-815.html

commmenttor
full size nike richard sherman womens jersey seahawks orange navy white authentic wholesale

Break the habit of Protesting and complaining And Initiate your personal nfl jersey Advertising campaign As a substitute .
full size nike richard sherman womens jersey seahawks orange navy white authentic wholesale http://cpsquared.org/news/nfl-jerseys-ray-lewis/nike-richard-sherman-womens-jersey-seahawks-orange-navy-white-authentic-p-7000.html

commmenttor
hogan interactive donna 35

En définitive, voilà toute la limite d et son idée de casual luxury On ne peut pas tout mélanger. Le luxe est une idée purement européenne et historique, il s d savoir faire, d héritage culturel. Abercrombie Fitch, c donc tout simplement du casual Or quand on qualifie une relation entre deux adultes consentants de casual en anglais, on sous entend qu n a aucun fond, aucun sentiment. Chez A c cette même idée de casual appliquée à la mode: une mode sans culture et sans idée.

commmenttor
the latest rams james laurinaitis red black white jersey nike womens mens clearance online

Most recent questions about nfl jersey replied and therefore why you must read carefully every single word in this story.
the latest rams james laurinaitis red black white jersey nike womens mens clearance online http://www.florencemeats.com/HTML/cheap-mlb-devo-hats-80s/cheap-real-madrid-jersey/rams-james-laurinaitis-red-black-white-jersey-nike-womens-mens-p-196.html

commmenttor
shopping lamarr houston jersey

Read who's chatting about nfl jersey and precisely why you should worry.
shopping lamarr houston jersey http://www.longlakehockey.com/products/world-cup-jersey/soccer-jerseys-shop-online/ooxdnzoq-p-979.html

commmenttor
full styles authentic trent richardson womens mens youth jersey nike elite limited up to 78% off

This kind of nfl jersey is actually definitely great, it's countless characteristics as well as features.
full styles authentic trent richardson womens mens youth jersey nike elite limited up to 78% off http://www.damistia.com/extras/team-sports-jerseys-cheap/stiched-jerseys/caxvhroh-p-649.html

commmenttor
buy authentic authentic josh gordon blue white red ladies mens kids wholesale

Forewarning. . . Do Not Try to go by other kinds of nfl jersey Manuals Until You Check This Totally free Report
buy authentic authentic josh gordon blue white red ladies mens kids wholesale http://www.cash4giftcards.com/eby/wholesale-discount-nfl-jerseys/mawbybia-p-297.html

commmenttor
hot sale geno smith jersey nike jets authentic geno smith green navy white bargain blitz

Regularly nfl jersey Summary is certainly beginning to really feel a little old
hot sale geno smith jersey nike jets authentic geno smith green navy white bargain blitz http://www.dvmlabs.com/products/russian-ice-hockey-jerseys/cheap-chinese-baseball-jerseys/noaumrhl-p-945.html

commmenttor
this week\'s special kevin kolb blue white jersey throwback bills elite limited for sale online

Two tightly-guarded nfl jersey tips shown in very revealing detail.
this week\'s special kevin kolb blue white jersey throwback bills elite limited for sale online http://www.canadiancollectibles.ca/compics/kids-cheap-nfl-jerseys/euro-soccer-jerseys/catgikyc-p-42.html

commmenttor
replica lv Fascinante

nike air max thea premium nz best price for ugg slippers cheap air max shoes online ugg style boots for men ariat uggs men shoes on sale red bailey button kids ugg boots air max 90 jacquard white cool grey black infrared ugg nightfall boots cheap shoes womens ugg classic chestnut short boots size 6 nike air max breathe free 3 kids ugg dakota on sale ugg tall boots chestnut leather uggs cleaning ugg ultra tall boots male ugg snow boots knit uggs purple sparkly shoes uggs classic mini boots grey air max bw 1991 mens ugg slippers 10 ascot ugg mens stoneman winter boots
replica lv Fascinante http://www.canbytheatre.com/?keyword=replica-lv-Fascinante&id;=11

commmenttor
designer moncler classic down coat women zip fur collar with belt black get more green back

The Incredible Secret Of Methods One Could Crush MONCLER Without Having Any Past experiences!
designer moncler classic down coat women zip fur collar with belt black get more green back http://www.kahbs.com/css/moncler-hooded-jacket/bibzercv-p-546.html

commmenttor
shop discount panthers greg olsen blue white jersey nike womens mens we go an extra mile for you

What the gurus are not stating in relation to nfl jersey and the way that this has impact on you.
shop discount panthers greg olsen blue white jersey nike womens mens we go an extra mile for you http://www.dhabaindianbistro.com/images/women-nfl-jerseys-for-cheap/buy-nike-jerseys-online/vnxdpdga-p-135.html

commmenttor
where to purchase legarrette blount game jersey: patriots womens youth orange navy white outlet shop

5 very closely-shielded nfl jersey industry secrets outlined in very revealing details.
where to purchase legarrette blount game jersey: patriots womens youth orange navy white outlet shop http://www.hcdubai.com/discount/nfl-jerseys-made-in-usa/college-football-replica-jerseys/fwlglsys-p-174.html

commmenttor
online cheap authentic charles tillman navy red white ladies mens kids bargain headquarters

nfl jersey Reproductions : A Really Wonderful nfl jersey trick Which usually Fools 98% of the purchasers
online cheap authentic charles tillman navy red white ladies mens kids bargain headquarters http://www.alonarodeh.com/content/buy-nfl-pro-bowl-jerseys/authentic-cheap-jerseys-nba/authentic-charles-tillman--navy-red-white-ladies-mens-kids-p-9032.html

commmenttor
nail down a great rate nike andre johnson womens jersey texans blue white authentic clearance sale

The Completely new nfl jersey software Work Even If You Sleep!
nail down a great rate nike andre johnson womens jersey texans blue white authentic clearance sale http://3dbeaufort.com/news/cheap-nfl-jerseys-big-and-tall/patriots-kids-jerseys/kwhgsnyw-p-199.html

commmenttor
how to get steve johnson game jersey: bills womens youth navy orange white at our professional store

To Individuals Who Wishes To learn nfl jersey But Aren't able to Get Going
how to get steve johnson game jersey: bills womens youth navy orange white at our professional store http://www.davemcnallyart.com/products/cheap-pro-baseball-hats/steve-johnson-game-jersey--bills-womens-youth-navy-orange-white-p-5644.html

commmenttor
jordan retro 9 cool grey

This will be the correct blog for anyone who desires to learn about this subject. You realize so significantly its nearly challenging to argue with you (not that I really would want?-HaHa). You undoubtedly put a brand new spin on a subject thats been written about for years. Wonderful stuff, just amazing!
jordan retro 9 cool grey http://pqra.org/ATPQ/sys.asp?key=jordan-retro-for-sale-02

commmenttor
new michael vick red black white jersey throwback eagles elite limited online

This is basically the nfl jersey truths your folks doesn't want you to discover
new michael vick red black white jersey throwback eagles elite limited online http://www.quiltsbywendy.com/fpknnb/buy-baseball-jerseys/rare-soccer-jerseys/qufuvuto-p-827.html

commmenttor
louboutin homme invisible movement

Back in Gustavia, there is the luxury lineup of Hermes, Longchamp, Bvlgari, Cartier and Chopard. St. Barth is an excellent place to buy a high end watch. You could expect maybe 20% or so discount off MSRP. Wire cash instead of credit card and you might get an additional discount. There are plenty of one of a kind boutiques as well. Poupette and Marina St. Barth are very popular. A stylist friend in New York, Alexandra Greenawalt, recently visited and shares her St. Barth style favorites.

commmenttor
various coach megan black sunglasses dbk early bird specials

babyliss News Methods Obtain The Up-dates In the moment
various coach megan black sunglasses dbk early bird specials http://www.dhruvts.com/books/coach-canada-outlet/coach-megan-black-sunglasses-dbk-p-7054.html

commmenttor
black friday nike free tr fit womens training shoes silver blue online store

Unprejudiced essay shows Six all new things of babyliss that nobody is talking about.
black friday nike free tr fit womens training shoes silver blue online store http://www.oralmedicinedentist.com/wp-content/girls-nike-free-run-5/nike-free-tr-fit-womens-training-shoes-silver-blue-p-4121.html

commmenttor
buy authentic mens lacoste finham spm shoes white black on sale online

Overseas Rumor : babyliss Looked as A Necessity This afternoon
buy authentic mens lacoste finham spm shoes white black on sale online http://www.plantsteward.com/imagesx/red-lacoste-polo-shirt/mens-lacoste-casual-shoes-shoes-yellow-red-p-3766.html

commmenttor
profumo gucci flora prezzo

Daniel Agger dirig茅 large d'un but ouvert 脿 la 87e minute quand Fabianski ne satisfaisait pas 脿 un coup franc de Gerrard et Arsenal a tenu 脿 passer 脿 la derni猫re huit au milieu de sc猫nes jubilatoires dans le nord de Londres.

commmenttor
cheap replica bags australia

Super Fast Shipping! Great Merchandise Just As Promised! A++++

commmenttor

Reactions

uswaretech

New post. Tools of pro Django developers http://bit.ly/4EON8X

This comment was originally posted on Twitter

uswaretech_blog

Tools of Pro Django developer – aka What powers dinette and almost every app we write.: There are some tools an.. http://bit.ly/8hTmNh

This comment was originally posted on Twitter

KamiSLO

Useful tools and applications for #django developers http://bit.ly/4nW6U8

This comment was originally posted on Twitter

dannyroa

Tools of Pro Django developer – aka What powers dinette and almost every app we write. — The Usware Blog http://bit.ly/6DAEB6

This comment was originally posted on Twitter

steyblind

Very delightful post, Tools of a Pro Django developer with v. concise code/command examples http://bit.ly/6cMCNU #django

This comment was originally posted on Twitter

kuryaki

Tools of Pro Django developer – aka What powers dinette and almost every app we write. http://bit.ly/5umI4p

This comment was originally posted on Twitter

joshuajonah

Lies. I am a pro Django developer. I use South every once in a while, but never use the others :D

This comment was originally posted on Reddit

ubernostrum

I use South. Don’t use any of the others, though — my idea of "pro" tools is stuff like virtualenv, Fabric, etc.

This comment was originally posted on Reddit

kingkilr

Most of that stuff is "shit you damn well better be using" if you develop in Python professionally.

This comment was originally posted on Reddit

shabda

It is a bit tounge in cheek, where pro == me. :)

This comment was originally posted on Reddit

ubernostrum

As I said, I use South, and *none of the other tools you listed*. That included ipython and ipdb: I don’t use them. I use the plain old standard Python interactive interpreter, and I don’t use a debugger, period.

This comment was originally posted on Reddit

shabda

Also I would assume you are using ipython (and with high probablility, ipdb). If not then what is the alternative?

This comment was originally posted on Reddit

djangostories

Tools of Pro Django developer – aka What powers dinette and almost every app we write. — The Usware Blog – Djan.. http://bit.ly/7QSnyB

This comment was originally posted on Twitter

scorpion032

I don’t use a debugger; but I use IPythonEmbed often. The advantage of using IPythonEmbed, at arbitrary place in the code is not appreciated enough. Say I want to use a inlineformset_factory with ordering and make order a hidden field. Now the docs, being how good they are, don’t mention about the can_order=True parameter. I’d in this case, place an ipython shell in the form `__init__` after calling it’s super. Now, I can, **in the shell goodness** examine all the parameters, at that moment. I find that, each form has a new field `ORDER` (I couldn’t have probably guessed it, all caps?), and can modify it’s widget to make it hidden, and exit. It works, I can use the same thing in the code. Heck I could even log all that I write in the ipython shell or get it on shell by hist -n. I can also see the source and the doc string of formset, or any other object by ? and ??. Throw ipython where you want to code, **play on the shell**, now having exactly understood what you need to do by playing enough, code; I find it invaluable.

This comment was originally posted on Reddit

scorpion032

So, it is ‘Tools of _a_ pro django developer’?

This comment was originally posted on Reddit

jsuntheimer

Tools of Pro Django developer – aka What powers dinette and almost every app we write. — The Usware Blog – Djan.. http://bit.ly/8bCIi7

This comment was originally posted on Twitter

delicious50

Tools of Pro Django developer – aka What powers dinette and almost every app we write. — The Usware Blog – Django We http://bit.ly/8JHDVK

This comment was originally posted on Twitter

durden20

@agorist BTW useful article i read about django debug tools, etc. today: http://bit.ly/6cMCNU

This comment was originally posted on Twitter

Post a comment Name :

Email :

Your site url:

Comment :

© Agiliq, 2009-2012