Django 101

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 2 Groups

    Django 101 - Presentation Transcript

    1. Django 101 Robert Coup http://rob.coup.net.nz/
    2. What is Django? “ The Web framework for perfectionists with deadlines Django makes it easier to build better Web apps more quickly and with less code www.djangoproject.com
    3. Who am I? • Robert Coup • CTO of Koordinates - making geospatial data more accessible - http://koordinates.com • OSS contributor • 2 year Djangonaut • robert@coup.net.nz
    4. What’s it for? • Building dynamic Web sites • A high level Web framework • Abstracts common problems • Shortcuts for fast development
    5. Key Features • nice url handling • object : db mapping • forms • templating • admin interface • caching, syndication, middleware, email, sql, modules, authentication, sessions, comments, sitemaps, gis, …
    6. So? And? • work at a nice abstraction level • just Python, no magic • gets out of your way
    7. Architecture • “MVT” • Models describe your data • Views control what a user sees and does • Templates are what they see
    8. Sample App - Yachties • Yacht racing crews • Schedule of races • Notify and Invite crew to races • Know who’s coming
    9. Install Django • Database: Sqlite, Postgres, MySQL, Oracle • Web: Apache, FastCGI, wsgi, dev-server • Use Trunk, checkout from SVN • www.djangoproject.com/download • python setup.py install
    10. Projects and Apps • django-admin startproject yachties • cd yachties • django-admin startapp racing
    11. Models • models.py • describes the fields • turned into database tables • the logic and rules of the application
    12. Settings • settings.py • Just a Python file
    13. Databases • Django will create your tables for you • python manage.py syncdb • Additional SQL commands: • python manage.py sql* • Ability to preload data
    14. Shell • python manage.py shell • from yachties.racing.models import Race • Manipulate your models live
    15. Server • Server for development & debugging • python manage.py runserver • http://localhost:8000/
    16. Automatic Admin Site • Built dynamically from your models • Authentication & validation • Flexible and customisable
    17. URL Handling • All in urls.py • Separates views from how they’re called • Just regular expressions
    18. Views • The “controller” • Just Python functions • that take a request • and return a response
    19. Templates • What the user sees • No code
    20. Templates • Pulls data from a dictionary (“context”) • Simple logic constructs (“tags”) • Simple data manipulation (“filters”) • Inheritance
    21. More • Form generation & handling • Contrib apps: • builtin: admin, forms, gis, feeds, • 3 party: see Google Code rd • Any Python code will work with Django
    22. Support • Quality documentation • Django Book www.djangobook.com • www.djangosnippets.org • Mailing lists, IRC
    23. Google App Engine • Google’s “cloud computing” platform • Python based • Runs Django • Modified model layer • http://code.google.com/appengine/
    24. Sites • Lots of news/journalism sites • Washington Post • Pownce • Koordinates • www.djangosites.org
    25. Questions?

    + Robert CoupRobert Coup, 9 months ago

    custom

    529 views, 1 favs, 0 embeds more stats

    Introduction to Django, given at an Auckland NZPUG more

    More info about this document

    CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

    Go to text version

    • Total Views 529
      • 529 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 22
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags

    Groups / Events