Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Pinax Tutorial 09/09/09

8,347 views

Published on

The DjangoCon Pinax Tutorial by James Tauber and Daniel Greenfeld

  • Be the first to comment

Pinax Tutorial 09/09/09

  1. 1. Pinax Tutorial Building a flash mob dance organizer site
  2. 2. Who are we? James Tauber Daniel Greenfeld Pinax founder Pinax Core Developer Discoverer of the D^Jango Code NASA contractor
  3. 3. Tutorial Prerequisites 1. Basic understanding of Django 2. Basic understanding of Python
  4. 4. Flash mob dance site requirements
  5. 5. Flash mob dance site requirements Lets us organize big flash mob dance events
  6. 6. Flash mob dance site requirements Lets us organize big flash mob dance events We want groups so people can participate in dances
  7. 7. 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.
  8. 8. What is Pinax?
  9. 9. What is Pinax? Django with an opinion
  10. 10. 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.
  11. 11. 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)
  12. 12. Step 1: Install Pinax Taunting the demo gods http://downloads.pinaxproject. com/Pinax-0.7rc1-bundle.tar.gz
  13. 13. Virtualenv sidestep Authored by Ian Bicking Lets you pin releases in a safe, homogeneous environment
  14. 14. Step 2: Create our project pinax-admin clone_project -l pinax-admin clone_project basic_project flash_dance
  15. 15. Flash Mob Project
  16. 16. Flash Mob Project Hey, its just a Django project!
  17. 17. Flash Mob Project Hey, its just a Django project! What apps do we need?
  18. 18. Flash Mob Project Hey, its just a Django project! What apps do we need? Dances Wall
  19. 19. Flash Mob Project Hey, its just a Django project! What apps do we need? Dances pip install pinax-dances Wall
  20. 20. Flash Mob Project Hey, its just a Django project! What apps do we need? Dances pip install pinax-dances Wall pip install pinax-wall
  21. 21. Step 3: Changing the logo
  22. 22. But Pinax doesn't do what I need!
  23. 23. But Pinax doesn't do what I need! I want the Wall description field use a rich text editor!
  24. 24. 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.
  25. 25. 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.
  26. 26. 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!
  27. 27. Step 4: Adding outside app django-wysiwyg
  28. 28. Adding an outside app pip install django-wysiwyg INSTALLED_APPS = ( ... 'django_wysiwyg', ) <body class="yui-skin-sam"> -- or -- $('body').addClass('yui-skin-sam')
  29. 29. Adding an outside app {% load wysiwyg %} {% wysiwyg_setup %} <textarea id="id_description"> </textarea> {% wysiwyg_editor "id_description" %}
  30. 30. Questions?

×