views:

68

answers:

2

I'm having trouble deciding which python framework to use for my website. So I've decided to bite the bullet and use Django. My question is how easy (or difficult) will it be to migrate to a different framework in future if I have issues with Django ?

+1  A: 

Your database queries(and object models), url config, and templates to say the least will all be specific to django. That said - if you understand what you're doing, recreating them in another package shouldn't take too long if you really need to at some later time.

edit: this is all assuming you dont integrate third party projects such as sqlalchemy and mako. Django plays nice with the builtins it ships with so it's often more trouble than its worth to use said modules.

dagoof
So as I understand it, what you're basically saying is that if I put some thought into how I code, the third party objects I use etc etc, I can do the migration relatively easily.
coder
Basically yes, if you have an understanding of how the orm is working then it should be simple enough to recreate your models in sqlalchemy later. The templating libraries are all similar, just different syntax for the same few operations (looping, conditionals etc). Sqlalchemy from django's orm will be the biggest change if you try to adjust to a new framework however if you wrap it in elixir ( http://elixir.ematia.de/trac/ ), even that won't be a huge hurdle. And of course when you say "migration", I think "rewriting templates and urlconfs to do the same thing but in a different package."
dagoof
+1  A: 

For the template part, Jinja is pretty similar to Django, but stand-alone. It might help you to migrate your templates to another framework.

(Or use it right away, I've found Jinja similar but quite superior to Django's default template system.)

Marcus Lindblom