Move most of code in pre-gen hook into functions
Move most of code in pre-gen hook into functions


thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template,thorgate/django-project-template