Here's a list of the various aspects and advantages & disadvantages of the frameworks:
Templates
For Pylons, I'd stick with the default of Mako. Django comes with its own templating language, but it's not terribly hard to swap it out. However, the existing contrib apps expect templates to be written in Django's language, so if we do any customization of contrib apps, we'll need to use Django's. It's probably better to stick with that for all web templates, even though we'll be using standalone Mako in the game compiler.
Advantages for Pylons:
- I don't have to rewrite our existing Mako templates
- Mako is significantly more powerful than Django, with arbitrary expressions, defs, template inheritance (beyond layouts)
- Mako filters get pulled from the template namespace automatically, which is a useful convenience when using potentially lots of filters
- Same template system for website and game compiler
- I can extend it with defs, in the template, without needing to write a separate Python module to write new tags
- I like the syntax better; it seems cleaner and easier to remember
- Filters can take arguments; useful for things like indent()
- The inclusion_tag syntax provides cleaner-syntaxed and more flexible blocks of reusable content than Mako's defs. The pitfall is that these are not defined with the other templates; they live in the template_tags directory.
For Pylons, I'd use our custom Diffle DB database wrapper. For Django, I'd use its ORM.
Advantages for Pylons:
- Simpler; I know SQL already, don't need to learn a custom model definition language
- Can handle multiple databases reasonably easily. It seems very difficult to add this to Django; there's been a branch with it since 2006, but no movement on it. It seems like it'd be a real pain to adapt save() and the query methods to a horizontally partitioned database.
- Gives finer-grained control over queries; I can often avoid some extraneous SELECT or UPDATE statements that Django's ORM adds.
- Supports multi-column primary keys, something I've found pretty useful in past DB models.
- The model definition classes are actually kinda convenient to use; would eliminate the mental context switch needed to go between SQL and Python. (I can get similar benefits by moving to SQLAlchemy + Pylons, but then I lose the other advantages of using only a thin wrapper).
- The admin interface is very convenient; it'd let Mike respond to routine complaints from users instead of requiring my intervention. (I might be able to build something similar by introspecting the database, but it'd take time.)
Pylons controllers are basically WSGI apps, setup by the "paster controller" script. Django controllers are functions that take a Request and return a Response. Pylons uses WSGI pretty extensively throughout; in order to understand the choices it's made for controllers, it helps to understand WSGI really well (I don't, yet).
Advantages for Pylons:
- Each Pylons controller is its own WSGI app and in theory can use any other WSGI middleware. (In practice, I'm not sure this works, since Pylons constructs the controller objects with each request.)
- Provides an easy way to attach data to controllers, like a database or mogile connection
- Routes syntax is a little cleaner and more flexible than Django's URL-based dispatching.
- Don't have to use the ugly c, request, session, etc. global variables. Since WSGI apps have a defined signature, they can't take additional parameters, which can be quit inconvenient in Pylons.
- Don't need to mess with StackedObjectProxies. Globals themselves aren't suitable for use in a webapp (they aren't threadsafe), so Pylons has its own version of a threadlocal. Unfortunately this is one hell of a leaky abstraction; you can't do dir() or vars() on it and get back anything sensible, and they break when used in generators.
- More explicit. Less to keep in mind.
- Less verbose. Controllers are just functions, and they can all live in views.py (though you can break them out into separate modules if necessary). Presumably they could be callables if necessary, though that breaks the next point.
- Can be decorated. Django provides a bunch of useful decorators, like @login_required.
Sessions/Login/Registration
Pylons gives you AuthKit by default, but that looks so unpolished, undocumented, and unsuitable to GameClay that I'd probably have to write my own. Django offers the contrib.auth application, which depends on the Session middleware.
Advantages for Pylons:
- Completely flexible, since I'm writing my own. Can include things like IP addresses in the session table, or reference the sessions table to see who's playing which games, or check out what your friends are playing.
- Integrates easily with the rest of the app, eg. templates and other controllers
- Provides usable default controllers for login, logout, and registration
- User objects integrated with request; no need to explicitly check for login
- Can retrieve all sessions through Session model; however, session models have only the key and data, and so if we want to search by user or page, we have to do it ourselves. We probably need to use custom middleware for this; we can't do it as a session backend because we don't know the username at that point, and it'd be a pain to do it as an authentication backend because we'd also need to change the Session model and that's not directly accessible.
- Handles details like tamper-proof sessions, hashing, generating unique sessions, etc. transparently
- Has convenient @login_required decorators for marking posts that require logins. Also allows filter functions; this could be useful once we have shared games and such
Other goodies
With Pylons, you're basically on your own. You can use any Python libraries you need, but you can do that with Django too. Django provides a bunch of nifty features that we might like to use:
Advantages of Django:
- CSRF detection. We need to add this to all our forms otherwise; this is pretty handy middleware.
- Redirects. Particularly if we change the ID or URL scheme. We don't want to ever break URLs; this could be a handy way to avoid that.
- Syndication feeds. There are Python libraries to do this, but the contrib app is likely easier to use
Configuration, Packaging, and Testing
Pylons is based on Paste, setuptools, and nosetests. Django has its own config and packaging system, and uses doctest and unittest for testing. The two are roughly equally easy to use - they both provide single commands to setup most things.
Advantages for Pylons:
- They handle multiple config files very well. Each config file is a separate .ini, so you have a test.ini for testing and a development.ini for development and a production.ini for production. Each of these can be checked in, and you specify the configuration to run when you execute Paster. Django lets you have multiple settings modules, but you have to switch between them with an environment variable or command-line switch, which is kinda annoying.[edit: the command-line switch turns out to not be that annoying in practice, though a little confusing if you don't know about it.]
- Searches for doctests in all locations, not just models and a specific test module. When you have lots of non-DB code, as we do, there will likely be lots of other stuff.
- Easy to specify foreign dependencies via setuptools, and create command-line scripts, and all the other great stuff that setuptools does. Using setuptools with Django is somewhat clumsy; I hope it's possible.
- Using a Python module as a config file keeps everything Pythonic, and gives some added flexibility
- The concept of separate "sites" and "apps" results in a cool architecture where we can potentially utilize other people's contributed apps. I doubt this will be terribly relevant for us, but it may turn up something neat.
Other reviews
http://pythonmag.blogspot.com/2006/02/pylons-vs-turbogears.html
http://jesusphreak.infogami.com/blog/why_django
http://jesusphreak.infogami.com/blog/vrp1
http://www.cmlenz.net/blog/2006/08/the_python_web_.html
18 comments:
We have forked Django and removed the template engine and replaced it with Mako. This includes porting the entire Admin and supporting applications. Check out our project here!
Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa
This phenomenomChina Wholesale is typified by mobile phonethe rise ofbusiness. Incredible range of products available with “Low Price and High Quality” not only reaches directly to their target clients worldwide but also ensures that cheap cell phones wholesale from China means margins you cannot find elsewhere and cell phonesChina Wholesale will skyroket your profits.cosplay costumes
cheap cell phones
cheap cocktail dresses
Cheap Wedding Dresses
cheap jewelry
Tn Requin
him advice during this particular scene Nike Air Riftand advises him to attend school. jeans dieselAs the episode plays out Bubbles takes Sherrod to school and assists him to process himself into the school they visit. Chaussures puma
Or another scene in whichTn Requina young kid is found to be driving an Escalade, Air Maxwhere most of the other kids admire him, Wholesale Polo Shirtsas he acts as someone not of his age buttn requincheap nike shox simply because it is accepted into this drug world but wouldn’t necessarily work in a very clean cut type of town.
sleeping bag
tablecloth
travel luggage
car gps
car parts
GPS navigation
portable GPS
lcd tv
flat tv
digital picture frames
unlocked cell phones
wedding dresses
wedding jewelry
chaussures mode
chaussures Femmes
women's shoes
round tablecloth
discount handbags
chaussures sport
chaussures pas cher
fashion bedding
id lanyard
lanyard
creative gadgets
gift ideas
kids wall stickers
wall stickers
bath curtains
kitchen faucet
bathroom faucet
Adsense of Jordan Shoes : just do it!
Adsense of Moncler Jackets : sends to warm, give you more comforts of life!
Adsense of NFL Jerseys : everything is possible!
Adsense of Christian Louboutin : choice me is choice beautiful foot and body!
Adsense of Puma Shoes : champion is in the first line!
Adsense of Gucci Shoes : Allows you to enjoy the leisure life in the fun!
Adsense of Vibram Fivefingers : taste original life, wear the most morden and comfortable shoes!
Adsense of GHD Hair straighteners : why make our hair so beautiful and lots stylers, for choice me is choice happy!
Adsense of Michael Jordan Shoes : just do it!
The factors you need to be aware of zigtech, the two most important is the durability and Comfort of the zigtech reebok. Paying for high price for reebok from a reputable brand is not a bad idea As They must have used better quality reebok shoes that will withstand The Elements is zigtech shoes. A well manufactured jacket Will show at Signs of Reebok Easytone,easytone and easytone shoes should be easy to use.
Overland Park, Kansas, Sprintchi flat iron argues that this is not the time to solve the dispute before the confirmation of March.chi flat irons For subscribers of Bloomberg yesterday's hearing can be found here.
Plan will control EchoStar Corporation, the largest secured creditor. It would replace the 97 percent stake for $ 944 million for 15 percent higher wages in kind notes guaranteed. Secured creditors
also have chi Straightening irons cheapthe right to buy 97 percent of preferred shares the right to place $ 125 million to fully support EchoStar.
So many kinds of nice Christian louboutin shoes,Christian louboutin boots on our online Christian louboutin store.Discount Christian louboutin sale is wildely offered here covering complete collection of Christian louboutin evening,Christian louboutin peep toe,Christian louboutin platforms,Christian louboutin pumps,Christian louboutin sandals,Christian louboutin slingback and Christian louboutin wedges.
fashion jewelry wholesale
wholesale fashion jewelry
china jewelry wholesale
china fashion jewelry
jewelry wholesale china
fashion jewelry china
wholesale jewelry
jewelry wholesale
Nice information,Ankara escort
many thanks to the author.Ankara escort
It is incomprehensible to me nowAnkara escort
, but in general,Escort ankara bayan
the usefulness and significance is overwhelming.Ankara escort
Thanks again and good luck!
Ankara escort
became the first designer in Wimbledon's 133-year history to create official uniforms for the tournamentescort ankara
As part of this year's event, which starts next week.
will introduces the first ...Escort ankara
determinationEscort ankara
to maintain and enhance the values for which our two brands are famous throughout the world.Eskort ankara
The rugby ralph lauren brand brings to Wimbledon the look of timeless elegance,Escort ankara
drawing on our rich history and traditionsEscort ankara
expert and i like your blog and the information you have
mentioned in this post about the Google tools is really great!
Ankara Escort Bayan
Escort Bayan Ankara
escort bayan
escort
escort istanbul
Bayan Escort
escort bayan ankara
escort bayan ankara
escort ankara ilan
Escort ankara bayan
escort bayan ankara çankaya
Ankara escort bayan
Escort Bayan Ankara
Ankara Escort,
Ankara Eskort
Thanks for sharing. Very impressive
Ankara Escort,
Ankara Escort,
Ankara Escort,
Ankara Escort,
Escort Ankara,
Escort Ankara,
Escort Ankara,
Escort Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Bayan Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Escort Bayan Ankara,
Escort Bayan Kayseri,
Escort Kayseri,
Kayseri Escort,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Ankara,
Escort Ankara,
Ankara Escort,
Escort Bayan Ankara,
Ankara Escort,
Escort Bayan Ankara,
Escort Ankara,
Escort Bayan Ankara,
Escort Bayan Kayseri,
Escort Kayseri,
Kayseri Escort,
Escort Ankara,
Ankara Escort,
Escort Ankara Bayan,
Escort Bayan Ankara,
Escort Ankara,
Escort Bayan,
London Crumpet has a message board where London escorts and agencies can post their messages about their services or announce people about any update of their profile. Visitors can also rate the escorts on Hot or Not gallery and give some credentials to the escorts they like.
Hi, Thank you write.
to share is Escort Bayan Ankara thank you share.
good site admin
Escort Ankara
Escort Ankara
Escort Ankara
Ankara Escort
Ankara Escort
Ankara Escort
Escort Bayan Ankara
Escort Bayan Ankara
Escort Bayan Ankara
Bayan Escort
Escort Bayan
Escort Bayan
Bayan Escort
Escort Bayan
Bayan Escort
Escort İstanbul
İstanbul Escort
Post a Comment