"django" entries

Simplifying Django

Lightweight Django by example

The following comes to you from Julia Elman and Mark Lavin. Julia is a a hybrid designer/developer who has been working her brand of web skills since 2002; and Mark is the Development Director at Caktus Consulting Group in Carrboro, NC where he builds scalable web applications with Django. Together, they are working on Lightweight Django, a book due out later this year that explores bringing Django into modern web practices.

Despite Django’s popularity and maturity, some developers believe that it is an outdated web framework made primarily for “content-heavy” applications. Since the majority of modern web applications and services tend not to be rich in their content, this reputation leaves Django seeming like a less than optimal choice as a web framework.

Let’s take a moment to look at Django from the ground up and get a better idea of where the framework stands in today’s web development practices.

Plain and Simple Django

A web framework’s primary purpose is to help to generate the core architecture for an application and reuse it on other projects. Django was built on this foundation to rapidly create web applications. At its core, Django is primarily a Web Server Gateway Interface (WSGI) application framework that provides HTTP request utilities for extracting and returning meaningful HTTP responses. It handles various services with these utilities by generating things like URL routing, cookie handling, parsing form data and file uploads.

Also, when it comes to building those responses Django provides a dynamic template engine. Right out of the box, you are provided with a long list of filters and tags to create dynamic and extensible templates for a rich web application building experience.

By only using these specific pieces, you easily see how you can build a plain and simple micro-framework application inside a Django project.

We do know that there are some readers who may enjoy creating or adding their own utilities and libraries. We are not trying to take away from this experience, but show that using something like Django allows for fewer distractions. For example, instead of having to decide between Jinja2, Mako, Genshi, Cheetah, etc, you can simply use the existing template language while you focus on building out other parts. Fewer decisions up front make for a more enjoyable application building process.

Read more…

Django Is Python’s Most Mature Web Framework

Testing, Python 3, and Dealing with Technical Debt

Nathan Yergler (@nyergler), Principal Engineer at Eventbrite, and I had a chance to talk Django at OSCON 2013. We talk about why Django is the go-to choice for Pythonistas and about the growing technical debt that each programmer has to deal with on Python projects and beyond.

Key highlights include:

  • Django is mature and feature complete amidst many Python frameworks [Discussed at 0:15]
  • Testing in Django leads to straightforward code that the next programmer can read as well as you can [Discussed at 1:02]
  • Dare we discuss Django’s weaknesses like: Is Django too monolithic? [Discussed at 2:43]
  • Django at long last supports Python 3! Check out Django 1.5 [Discussed at 4:06]
  • Dealing with technical debt while programming [Discussed at 5:36]

You can view the full interview here:

Read more…

Four short links: 3 August 2012

Four short links: 3 August 2012

CV Camouflage, Best Practices, Failure Conference, and Fiber Lessons

  1. Urban Camouflage WorkshopMost of the day was spent crafting urban camouflage intended to hide the wearer from the Kinect computer vision system. By the end of the workshop we understood how to dress to avoid detection for the three different Kinect formats. (via Beta Knowledge)
  2. Starting a Django Project The Right Way (Jeff Knupp) — I wish more people did this: it’s not enough to learn syntax these days. Projects live in a web of best practices for source code management, deployment, testing, and migrations.
  3. FailCona one-day conference for technology entrepreneurs, investors, developers and designers to study their own and others’ failures and prepare for success. Figure out how to learn from failures—they’re far more common than successes. (via Krissy Mo)
  4. Google Fiber in the Real World (Giga Om) — These tests show one of the limitations of Google’s Fiber network: other services. Since Google Fiber is providing virtually unheard of speeds for their subscribers, companies like Apple and I suspect Hulu, Netflix and Amazon will need to keep up. Are you serving DSL speeds to fiber customers? (via Jonathan Brewer)
Four short links: 5 March 2010

Four short links: 5 March 2010

GMail CRM, Django Best Practices, Stats-Think, and WoW Number Crunching

  1. Rapportivea simple social CRM built into Gmail. They replace the ads in Gmail with photos, bio, and info from social media sites. (via ReadWrite Web)
  2. Best Practices in Web Development with Django and Python — great set of recommendations. (via Jon Udell‘s article on checklists)
  3. Think Like a Statistician Without The Math (Flowing Data) — Finally, and this is the most important thing I’ve learned, always ask why. When you see a blip in a graph, you should wonder why it’s there. If you find some correlation, you should think about whether or not it makes any sense. If it does make sense, then cool, but if not, dig deeper. Numbers are great, but you have to remember that when humans are involved, errors are always a possibility. This is basically how to be a scientist: know the big picture, study the details to find deviations, and always ask “why”.
  4. WoW Armory Data Mining — a blog devoted to data mining on the info from the Wow Amory, which has a lot of data taken from the servers. It’s baseball statistics for World of Warcraft. Fascinating! (via Chris Lewis)
Four short links: 19 February 2010

Four short links: 19 February 2010

Data Adjustments, Grasping Telcos, Open Data Panacea Denied, Newspaper Software

  1. How to Seasonally Adjust DataMost statisticians, economists and government agencies that report data use a method called the X12 procedure to adjust data for seasonal patterns. The X12 procedure and its predecessor X11, which is still widely used, were developed by the U.S. Census Bureau. When applied to a data series, the X12 process first estimates effects that occur in the same month every year with similar magnitude and direction. These estimates are the “seasonal” components of the data series. (via bengebre on Delicious)
  2. Vodafone Chief: Mobile Groups Should Be Able to Bypass Google (Guardian) — Vodafone and other telcos want to charge both ends, to charge not just the person with a monthly mobile data subscription but also the companies with whom that person communicates. It’s double-dipping and offensively short-sighted. Vodafone apparently wants to stripmine all the value their product creates. This is not shearing the sheep, this is a recipe for lamb in mint sauce.
  3. Open Data is Not A Panacea, But It Is A StartThe reality is that releasing the data is a small step in a long walk that will take many years to see any significant value. Sure there will be quick wins along the way – picking on MP’s expenses is easy. But to build something sustainable, some series of things that serve millions of people directly, will not happen overnight. And the reality, as Tom Loosemore pointed out at the London Data Store launch, it won’t be a sole developer who ultimately brings it to fruition. (via sebchan on Twitter)
  4. Our GeoDjango EC2 Image for News Apps — Chicago Tribune releasing an Amazon EC2 image of the base toolchain they use. Very good to see participation and contribution from organisations historically seen as pure consumers of technology. All business are becoming technology-driven businesses, realising the old mindset of “leave the tech to those who do it best” isn’t compatible with being a leader in your industry.
Four short links: 8 July 2009

Four short links: 8 July 2009

  1. Stop Whining About Facebook’s Redesign (Slate) — How can I be so sure that you’ll learn to like the redesign? Because you did the last two times Facebook did it. The conclusion is that sites don’t say why they’re redesigning, and that causes the resistance.
  2. C# and CLI under the Community Promise (Miguel de Icaza) — Microsoft have announced they won’t pursue patents relating to C# or the .NET Common Language Infrastructure (CLI): It is important to note that, under the Community Promise, anyone can freely implement these specifications with their technology, code, and solutions. You do not need to sign a license agreement, or otherwise communicate to Microsoft how you will implement the specifications. Good news for Mono and other .NET-compatible projects.
  3. app-engine-patch — a patch that lets most of Django work on Google App Engine. (via caseywest on Twitter)
  4. Scope — talk by Matt Webb, given to Reboot 2009. Every ten slides I sigh happily as new mental connections slide into place, as only Matt can make them. Worth it just for finding this Stewart Brand quote, “We are as gods and might as well get good at it.” That one sentence could direct a lifetime of action.
Four short links: 24 June 2009

Four short links: 24 June 2009

Open Source Kids, Crowdsourcing Lessons, Flickr Secrets, Hadoop Spatial Joins

  1. The Digital OpenThe Digital Open is an online technology community and competition for youth around the world, age 17 and under. Building a community of young open source hackers.
  2. Four Crowdsoucing Lessons from the Guardian’s Spectacular Expenses Scandal ExperimentYour workers are unpaid, so make it fun. How to lure them? By making it feel like a game. “Any time that you’re trying to get people to give you stuff, to do stuff for you, the most important thing is that people know that what they’re doing is having an effect,” Willison said. “It’s kind of a fundamental tenet of social software. … If you’re not giving people the ‘I rock’ vibe, you’re not getting people to stick around.” (via migurski on delicious)
  3. 10+ Deploys/Day: Dev & Ops Cooperation at Flickr — John Allspaw and Paul Hammond’s talk from Velocity. You tell any mainstream company in the world “10 deploys/day” and you’ll be met with disbelief.
  4. Reproducing Spatial Joins using Hadoop and EC2 — bit by bit the techniques for emulating important operations from trad databases are being discovered and shared in the new database scene. (via straup on delicious)
Four short links: 20 May 2009

Four short links: 20 May 2009

Cognitive Surplus, Data Centers=Mainframes, Django Microframework, and a Visit To The Future

  1. Distributed Proofreaders Celebrates 15000th Title Posted To Project Gutenberg — a great use of our collective intelligence and cognitive surplus. If I say one more Clay Shirkyism, someone’s gonna call BINGO. (via timoreilly on Twitter)
  2. Datacenter is the New Mainframe (Greg Linden) — wrapup of a Google paper that looks at datacenters in the terms of mainframes: time-sharing, scheduling, renting compute cycles, etc. I love the subtitle, “An Introduction to the Design of Warehouse-Scale Machines”.
  3. djng, a Django powered microframework — update from Simon Willison about the new take on Django he’s building. Microframeworks let you build an entire web application in a single file, usually with only one import statement. They are becoming increasingly popular for building small, self-contained applications that perform only one task—Service Oriented Architecture reborn as a combination of the Unix development philosophy and RESTful API design. I first saw this idea expressed in code by Anders Pearson and Ian Bicking back in 2005.
  4. Cute! (Dan Meyer) — photo from Dan Meyer’s classroom showing normal highschool students doing something that I assumed only geeks at conferences did. I love living in the future for all the little surprises like this.

Datacenter Power Allocation Chart
Approximate distribution of peak power usage by hardware subsystem in one of Google’s datacenters (circa 2007)

Four short links: 22 Apr 2009

Four short links: 22 Apr 2009

Government, Bayes, SMS, and distributed keystores:

  1. Government Projects the Agile Way — Can It Be Done? (NZ Government) — notes and audio from a workshop at the New Zealand State Services Commission looking to merge agile and government. The pullquotes are mostly generic about agile, but the important thing is that there are agile projects within government and their numbers are growing. Having witnessed the incredibly slow, cautious, and non-agile development processes of government, I know how good this shift can be for budgets and delivery.
  2. DivMod Reverend — general purpose open source Bayesian classifier in Python (the Ruby port is Bishop). Bayes theorem lies behind the 2000-era spam filters, and there have been plenty of open source libraries to do Bayesian classification, but this one caught my eye because it’s from the very good DivMod folks who are behind the very good Twisted framework. (via noahgift’s delicious stream)
  3. RapidSMS — a free and open source messaging framework for building SMS applications. Integrates with Django. (via straup’s delicious stream)
  4. Some Notes on Distributed Key Stores (Leonard Lin) — he had to install and test distributed keystores for a client’s project, and posted his notes. Distributed keystores are one of the recent spates of database-like tools intended to solve some of the problems of big data applications. The distributed stores out there is currently pretty half-baked at best right now. […] Don’t believe the hype. There’s a lot of talk, but I didn’t find any public project that came close to the (implied?) promise of tossing nodes in and having it figure things out. […] Based on the maturity of projects out there, you could write your own in less than a day. It’ll perform as well and at least when it breaks, you’ll be more fond of it. Alternatively, you could go on the conference circuit and talk about how awesome your half-baked distributed keystore is. (via straup’s delicious stream)
Four short links: 10 Jan 2009

Four short links: 10 Jan 2009

Here are four fun links to set the tone for your weekend: high risk money, productive failure, consumer-grade BitTorrent, and architecture criticism for the rest of us.

  1. How Porsche hacked the financial system and made a killing — perhaps “hack” is a little excessive, but it’s a readable short account of how Porsche made a lot of money playing “millionaire’s poker” against hedge funds. (via Ivan Krstić, the author of Apache Security former Director of Security Architecture for the OLPC)
  2. Missteps in Django — a Python programmer documents the mistakes he makes programming in Django. This helps other people as they face similar problems, and shows the Django developers where their expectations differ from those of mortal programmers. I think it’s a great idea because it makes visible the useful mistakes that are how we learn. It also reinforces the idea that it’s okay to make mistakes, we all do it, and they’re as worth of discussion as successes.
  3. Netgear Unveils TV Torrent Player — consumer device with BitTorrent built in. The easier it becomes for mortals to get files through BitTorrent, the harder it is to ignore unauthorised file sharing through BitTorrent, and the more pressing a solution to the business problem will be. (via Glynn Moody)
  4. How Buildings Learn — if you haven’t seen this show, you should. On-the-money criticism of architecture and architects, talking about what’s important when you design things for people. (via Kottke)