Pinax Tutorial

Building a flash mob dance
       organizer site
Who are we?

James Tauber                     Daniel Greenfeld

Pinax founder                    Pinax Core Developer

Discoverer of the D^Jango Code   NASA contractor
Tutorial Prerequisites

1. Basic understanding of Django
2. Basic understanding of Python
Flash mob dance site requirements
Flash mob dance site requirements

 Lets us organize big flash mob dance events
Flash mob dance site requirements

 Lets us organize big flash mob dance events

 We want groups so people can participate in dances
Flash mob dance site requirements

 Lets us organize big flash mob dance events

 We want groups so people can participate in dances

 Need to have twitter clone so we can communicate locally
 without giving it away to everyone. We want updates inside
 dances.
What is Pinax?
What is Pinax?

Django with an opinion
What is Pinax?

Django with an opinion

By integrating numerous reusable Django apps to take care of
the things that many sites have in common, it lets you focus on
what makes your site different.
What is Pinax?

Django with an opinion

By integrating numerous reusable Django apps to take care of
the things that many sites have in common, it lets you focus on
what makes your site different.

from magic import pony
import pinax

@pinax
def django(ideas):
 return pony.magic(ideas)
Step 1: Install Pinax

   Taunting the demo gods

 http://downloads.pinaxproject.
com/Pinax-0.7rc1-bundle.tar.gz
Virtualenv sidestep


  Authored by Ian Bicking


  Lets you pin releases in a safe, homogeneous environment
Step 2: Create our project

           pinax-admin clone_project -l

pinax-admin clone_project basic_project flash_dance
Flash Mob Project
Flash Mob Project

Hey, its just a Django project!
Flash Mob Project

Hey, its just a Django project!

What apps do we need?
Flash Mob Project

Hey, its just a Django project!

What apps do we need?

   Dances


   Wall
Flash Mob Project

Hey, its just a Django project!

What apps do we need?

   Dances
      pip install pinax-dances

   Wall
Flash Mob Project

Hey, its just a Django project!

What apps do we need?

   Dances
      pip install pinax-dances

   Wall
     pip install pinax-wall
Step 3: Changing the logo
But Pinax doesn't do what I need!
But Pinax doesn't do what I need!

I want the Wall description field use a rich text editor!
But Pinax doesn't do what I need!

I want the Dance description field use a rich text editor!
I could add a new forms widget.
But Pinax doesn't do what I need!

I want the Dance description field use a rich text editor!
I could add a new forms widge.

But I don't want to fork the Dance (or groups, tribes, projects,
etc) application because I want easy upgrades.
But Pinax doesn't do what I need!

I want the profiles About Me field use a rich text editor

I could add a new forms widget

But I don't want to fork the Dance (or groups, tribes, projects,
etc) application because I want easy upgrades.

I'll do it entirely in the templates using django-wysiwyg!
Step 4: Adding outside app

       django-wysiwyg
Adding an outside app

  pip install django-wysiwyg

  INSTALLED_APPS = (
     ...
     'django_wysiwyg',
      )

  <body class="yui-skin-sam">

-- or --

   $('body').addClass('yui-skin-sam')
Adding an outside app

{% load wysiwyg %}

{% wysiwyg_setup %}

<textarea id="id_description">

</textarea>

{% wysiwyg_editor "id_description" %}
Questions?