Django. The Web Framework for Perfectionists with Deadlines. By: Udi h Bauman, BeeTV. This guy is happy with his vehicle. http://www.flickr.com/photos/24859010@N05/2350218142/. If only he knew of the alternatives. http://www.flickr.com/photos/26418031@N04/2485301661/.
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
F I N
Plus de contenu associé
Transcription de la présentation
Django • The Web Framework for Perfectionists with Deadlines By: Udi h Bauman, BeeTV
How can Django do it? • Django automates the stuff repeating in every software project • & let’s you only work on what differentiates them
Metaphor • Suppose you were a constructing company • You get a customer request & spend a few months building what he wants
Metaphor • Although every building is different, there are things repeating themselves every time • Ground works • Electricity • Water • Skeleton • &c • &c
Metaphor • Suppose some infra company came & said: • Just define to us what the customer need • Within few hours we’ll build the basic building • & in another day or so, we’ll help you complete it by answering all of the customer specific needs • So, you can deliver the building in <3 days
Metaphor • You’ll probably laugh at them & say: • It’s probably pre-built/pre-assembled stuff • That limits what I can do • With low quality & scalability • & I’ll also need to pay you a lot
Metaphor • What if the company will answer • It’s not pre-built - we build it by your definition • It doesn’t limit you to do anything, on the contrary it helps you do whatever you want • It has better quality & scalability than what you can build • It costs you nothing
Demo • Let’s develop an Issue Tracking system • Issues data model • Users management (permissions, groups) • Rich Web UI (search, filters, last actions) • Scalable deployment (any # of users)
Meaning: Deadlines • Example: highest paid gov. officials analytics site • Requested at saturday night (22:00) • Skeleton ready & data entry start (23:00) • Site complete & in production (24:00)
Language of choice in • The organizations attracting the best programmers in the world • Such as:
More than a scripting language • Pure OOP • Native threading • Functional features • Runs some of the largest Web sites • Such as:
Why do I love Python? • Succinct yet very readable syntax • Very fast code-run-test cycle (no build) • Great introspection (saves tons of time) • Built-in data structures (Map, Immutable List) • Syntax sugar features (list mapping, &c) • Shell
Programming Languages Evolution Tree • Regarding “Evolutionary dead end” of Java • If you’ll check out history, the languages that are designed by a company or committee, such as Java & Cobol, are usually the evolutionary dead-ends • See also Paul Graham’s famous article: http://www.paulgraham.com/javacover.html
Reusable Apps? • Your modules are very loose coupled, & can be used in other projects • You can plug into your project many 3rd party reusable apps, immediately adding to your product complex functionality • No need for coding
Example: Pinax • A project containing many reusable apps you can immediately use to start with a full-featured web site, without a line of code • Using it you can get a full-pledged Web2.0 social networking site, as basis for your web site (Example” http://cloud27.com) • 1st version developed over a weekend
Django features • Django has a lot of built-in stuff, to boost productivity • Nevertheless, it strives to remain as small as possible, to support any extension & not limit what you can do
ORM • title, year = row[0], row[1] • query = Show.objects.filter(title=title) • if query.count() >0: • show = query[0] • else: # if not found, create one • show = Show() • show.title = title.encode('utf-8') • show.prod_year = year • show.save()
Geo • class District(models.Model): • name = models.CharField(max_length=35) • num = models.IntegerField() • poly = models.PolygonField() • objects = models.GeoManager() • class School(models.Model): • name = models.CharField(max_length=35) • point = models.PointField() • objects = models.GeoManager()
More built-in stuff • Feeds • Comments • Flat pages • Middleware • Caching • Signals • s
Django powered sites • Many newspapers (LA Times, Washington Post, NY Times projects, Guardian API) • A django based site even won a Politzer! • BitBucket (mercurial OSS repository) • Pounce, Fluther, SuggestionBox, Tabblo, Revver (popular Web2.0 services) • Curse (very high-traffic gaming site)
Scalability • Django runs on regular web servers, such as Apache, Lighty or Ngynx, using a built-in Python or WSGI adapter • This makes it very lightweight & scalable, as any LAMP deployment • There are examples of sites that handle MM reqs/hour, using less than 10 servers
Google AppEngine • Based on Django • Django apps can be easily deployed
IT acceptance • IT environments today are mostly familiar with Java • Solution: use Jython that compiles Python to bytecode • Package a Django project as .war • Sun constantly improves Jython & maintains compatibility /w Django
Implications • On Outsourcing (no need for many out-sourced/off-shore programmers) • On Build-vs-Buy (why buy when you can build any information system in an hour?)
Why not Rails? • Rails is also great, great people love it • However, I've got several things in which I think Rails is inferior, which people should consider • Performance & scalability • Emphasis on good design (no Magic in Django) • Maturity • Underlying language
Connexion au compte
Connectez-vous pour publier votre contenu sur SlideServe.