Introduction to django (and py)
-
Upload
adrianandreias -
Category
Technology
-
view
962 -
download
2
description
Transcript of Introduction to django (and py)
{
Introduction To Django (+ py)
Adrian Andreiaș, Elvsofthttp://twitter.com/adiandreias
• Worked as software engineer (C++, C#)• Graduated UBB, Cluj in 2003• Founded Elvsoft in 2004• PHP, then switched to Python & Django• Currently internet hosting & tools
Shameless self promotion
1. Short look at Python2. Introduction To Django3. Django live coding: A Digg app
Summary
• interpreted, general-purpose high-level programming language
• design philosophy emphasizes code readability
• combine "remarkable power with very clear syntax“
• batteries included
Python goals
...
• Readability counts.• There should be one-- and preferably
only one --obvious way to do it....• If the implementation is hard to explain,
it's a bad idea.…
The Zen of Python
Python syntax
• dynamic typed• duck typed = name resolution (late
binding)“if it walks like a duck, and quacks like a duck, then it is a duck"
Python is
Fully:• object-oriented programming• structured programming
Elements of:• functional programming• aspect-oriented programming
Python paradigms
• (google) Python tutorial• (google) Dive Into Python
Learning Python
• The Web framework for perfectionists with deadlines
• Django makes it easier to build better Web apps more quickly and with less code.
Django is
• Loose coupling• Less code• Quick development• DRY (Don't Repeat Yourself)• Explicit is better than implicit• Consistency• Encourage best practices
Django philosophy
• Python developers should (mainly) write Python code (not YAML, XML, SQL)
• No generated code• Use introspection, Luke!• Web development done right:
• validations• separation of concerns• clean URLs• take care sql and mail form injections etc.
Some Django principles
• MTV instead of MVC• Models: Object-relational mapper• Template engine• Views: python functions, Request
in, Response out• URL mapping: list of regular
expressions
Django components
Models
urls.py
Views
Templates (with inheritance!)
• Automatic admin interface• Cache system• Internationalization• Authentication & authorization• Form processing and form sets
Django free stuff
Coding a DIGG app
Other questions?
?