Building a Wiki using Django - Excellent #bcmem presentation by @bkmontgomery

UPDATE: Brad Tweets to say that he actually uses vim for his coding, not XCode as I observed below.  Thanks Brad!


9 am session:  Brad Montgomery
Zero to Wiki in 30 minutes or Building a Wiki with Django
Brad’s official notes on this session with source code, presentation, and contact  info http://bradmontgomery.net/barcampmemphis
@bkmontgomery on twitter

Django is a python framework

Brad’s IDE: XCode on OSX

Django creates an app as a collection of empty files that Brad’s

going to code into

FILES
 models.py
Include libraries with the from statement e.g.
from django.db import models

Using “creoleparser” to import wiki markup language from

‘creole’ lib

Django “Automatic admin” creates an automatic CRUD interface so that content developers can start filling up the system before the real UI is live
  - This is available immediately once the model is defined and connected w/Django

Slug: 255 char UID for each wiki page.  /These-slugs-show-up-as-verbose-URls
Slug is a newspaper term for something I’ve forgotten already

Django promotes “Clean URLs”.  URLConf maps URLs to callback functions aka views.  See “urls.py“.

Django’s output is consumed through TEMPLATES - xml, html, csv, json, etc
 - The template language is not python
 - Consists of tags, variables, filters, etc
   - Tags: Presentational logic { % for page in pages % } { % endfor % }
- Filters:  {{page|title}} or {{t|timesince}}

Templates can be extended
blocks can be overridden

Creole offers a **text2html** function to convert wiki markup to presentable HTML!

We’re looking at the creole wiki markup in Brad’s editor page

Now onto DJANGO FORMS
Forms are derived from a Form class
Forms consist of fields.
The type of the field determines the possible inputs it can expect

class WikiPageForm inherits from ModelForm
excludes Slug from the form so end users can’t change it

- that would break the app!

Django has a SLUGIFY method
All text is escaped by default in Django.

The actual app development took Brad about two hours

Django hit v1.0 a month ago. it’s about 2 years old

Brad offers a list of django resources at the end of his shot.

djangoproject.com, a google groups mailing list, #django on freenode IRC, books, more?

There may be an inactive python user group in Memphis?

Q&A:

Q:
How do you think Django stacks up with ruby(rails), PHP, etc Django design is borrowed from rails in some ways

A:
Brad hasn’t used Ruby much Brad doesn’t find PHP frameworks quite as clean/elegant as Django.
Brad’s been using Python for a year or so, Django for a few months.

One pro to Django - Python has more code libraries available than does Ruby

Django doesn’t have as many sample apps from which to draw inspiration

Share and Enjoy:
  • E-mail this story to a friend!
  • TwitThis
  • Facebook
  • StumbleUpon
  • Digg
  • LinkedIn
  • del.icio.us
  • Google Bookmarks
  • Live
  • Yahoo! Buzz

These related posts might interest you...

  1. Great New Community Building Resource Launches This Week  ...
  2. Wiki project: Define and illustrate your data  ...
  3. Social Networking Behind the Firewall at Microsoft, Best Buy, IBM, and More  ...