django question

CM cmpython at gmail.com
Mon Jan 6 19:48:54 EST 2014


On Sunday, January 5, 2014 4:50:55 PM UTC-5, Roy Smith wrote:

> One of the things we try to do is put as little in the views as 
> possible.  Views should be all about accepting and validating request 
> parameters, and generating output (be that HTML via templates, or JSON, 
> or whatever).  All the business logic should be kept isolated from the 
> views.  The better (and more disciplined) you are about doing this, the 
> easier it will be to move your business logic to a different framework.

I just started playing with Django and hadn't realized that yet.  So, 
what, you have other modules that you import into Views that you call
functions from to do the business logic?  Do you just keep a modules
folder in the Django project folder I guess? 

Thanks for the tip(s).

> 
> 
> That's not to say it will be *easy*, but you can certainly make things 
> 
> harder on yourself than they need to be if you don't keep things 
> 
> distinct.
> 
> 
> 
> Oh, and yes, the django team does a really amazing job on the docs.




More information about the Python-list mailing list