Posts tagged: WEB DEVELOPMENT

dpaste.com update

My little pastebin site, dpaste.com, has been chugging along nicely since I announced it here about six weeks ago. Today I updated to the very latest Pygments codebase, which allowed me to add colorizers for Apache config files and bash scripts.

I’ve also started to add some Django-specific rules to the Python colorizer; it now recognizes Django model field types (model.CharField and the like). My thanks go to everyone who’s been using it, especially those who have given me feature suggestions and problem reports.

STFU

E-Scribe is not, strictly speaking, a standards organization. However, I think the time is right to release this draft document on an important Internet standard. The document is presented inline here for convenience; however, the preferred permanent reference is: http://e-scribe.com/stfu

Recent trends in internet-based application development have
fostered the rapid spread of asynchronous, Javascript-based techniques
known by the umbrella term "Ajax" and by related terms such as "AHAH",
"POX", and so on.

This brief paper argues for a plaintext, synchronous alternative style
with some compelling advantages, one of which is (naturally) a catchy
name.

Synchronous Text/plain For User-agents -- STFU -- is a content-
delivery standard offering simple, reliable, high-performance routing
of content to Internet end-users. Implementation is orders of
magnitude faster than for typical Ajax applications, with a
corresponding drop in defect rates.

It's that simple. STFU.

  * well-tested
  * cross-platform
  * highly scalable
  * enterprise-ready
  * supports Unicode!
  * compliant with Section 508 Accessibility Requirements

One prominent adopter of STFU technology is the Internet Engineering
Task Force, which uses it for the dissemination of their most
important documents:

  ietf.org/rfc/rfc-index-latest

STFU also sidesteps technical quandaries related to markup formats,
such as those summarized here:

  hixie.ch/advocacy/xhtml

It's no accident that the author of the above (widely cited) document
chose to deliver his important message via STFU. 

Sometimes the debates over emerging standards and technologies become
wearisome, and pragmatic individuals find themselves wishing for a
magic phrase that might quiet the true believers and allow all
involved to move on to more productive activities. May we recommend:

STFU!

If you are already using STFU, you are welcome to display this PNG badge:

The Django Book

Congratulations to Adrian and Jacob on the launch of their GFDL-licensed book on Django. From the Django blog:

This is a pre-release, which means we’re actively looking for comments, typo fixes, corrections and other suggestions from readers like you, all around the world. We’ll try to incorporate your suggestions into the final product, which will be published by Apress early next year. Amazon.com is accepting preorders for the print edition, and the number of preorders so far has been astounding.

Notes on my new Django setup

My personal record of using revision control for source code has been pretty spotty. Today I took steps toward fixing that by working out a system for managing my Django projects. I wanted revision control (Subversion), I wanted Django’s “runserver” for development and mod_python for deployment, and I didn’t want it to be a pain.

Some highlights of the process:

  • I used my pastebin site as the test mule. I checked in the current live site’s source code, created “trunk”, “tags”, and “branches” directories per the Subversion manual, and checked out a copy of the trunk into a staging directory.

Handling legacy URLs with Django

One of the great things about Django is its simple and flexible URL handling. If your Django work, like mine, includes converting existing sites, you’ll probably be doing some URL cleanup along the way. Django’s “generic views” system includes a view called “redirect_to” that handles cases like this. A rule might look like this:

urlpatterns = patterns('django.views.generic.simple',
    ('^foo/oldsite/BadOldUrl33247.blech$', 'redirect_to', {'url': '/bar/nice-new-url/'}),
    )

But because the URL pattern building happens in Python, if you have many of these you can do better than filling your urls.py with variants of that line. Here’s the root urlconf for one of my sites: