Good day

Thanks for the reply. This is exactly the approach which I am going to
take. I have already started my own command. I am hoping to do it in
such a fashion that other people can benefit from it.

Thanks.

On Oct 29, 6:57 pm, Mike Ramirez <gufym...@gmail.com> wrote:
> On Thursday 29 October 2009 09:21:26 Johan wrote:
>
> > The information you provided is very helpful and I have been wondering
> > about overriding templates.However, my question pertain not to
> > templates as in the templating system used in django but rather to the
> > 'template' directories used by django-admin.py when the startproject
> > and startapp commands are executed. At the moment these commands
> > merely copies some files within the django installation directory. In
> > the case of a new project's settings.py it is copied and then modified
> > by adding a new secret key and the project url string.
>
> You can add to it by writing your own management command. With something like
> this:
>
> from django.core.management.base import LabelCommand, CommandError
> from django.core.management import call_command
>
> class = Command(LabelCommand):
>   def handle_label(self, project_name, **options):
>     # create initial project, use startapp for app.
>     call_command('startproject', project_name)
>     output = []
>     #do stuff to template dir settings for project
>
>    return u'\n'.join(output)
>
> Inside the command startproject[1] you can see how SECRET_KEY value is
> intially set. call_command[2] is the suggested way of accessing the other
> commands within your apps.  Then use this command to start your projects or
> apps.
>
> Hope This Helps
>
> Mike
>
> [1]http://code.djangoproject.com/browser/django/trunk/django/core/manage...
> [2]http://code.djangoproject.com/browser/django/trunk/django/core/manage...
>
> --
>
>  signature.asc
> < 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to