Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
Hallöchen!

Torsten Bronger writes:

> [...]  If someone wants to create a local variation of a template,
> he simply creates
>
> my_app_local/templates/my_app/my_view.html
>
> and puts my_app_local instead of my_app into INSTALLED_APPS.

Sorry, this was rubbish.  It must read: "... and puts my_app_local
before my_app into INSTALLED_APPS."

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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.



Re: What's the django convention for templates?

2011-12-10 Thread Torsten Bronger
Hallöchen!

Mauro writes:

> [...]
>
> Following the djangobook I've build a projects who has the following 
> strurcture:
>
> projects |
>  ---
> | __init__.py
> | manage.py
> | settings.py
> | urls.py
>
> | app folder |
>  --
>| many files
>| templates |
> 
> | 
> index.php
>
> As you can see the templates directory is stored inside the app
> directory.

I go even one step further:

my_app/templates/my_app/my_view.html

This is redundant but it makes overriding of templates easier.  If
someone wants to create a local variation of a template, he simply
creates

my_app_local/templates/my_app/my_view.html

and puts my_app_local instead of my_app into INSTALLED_APPS.  This
way, you don't have to modify the original files.  This assumes that
you use django.template.loaders.app_directories.Loader in
TEMPLATE_LOADERS.

Tschö,
Torsten.

-- 
Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

-- 
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.



Re: What's the django convention for templates?

2011-12-10 Thread Mauro
Thank you :)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/LCxQRS7kTnkJ.
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.



Re: What's the django convention for templates?

2011-12-09 Thread Vovk Donets
>
>
> As you can see the templates directory is stored inside the app directory.
>
> Reading the django documentation instead they says that the templates dir
> should live inside the root directory of the projects.
>
> I'm wondering, what's is the common convention about it?
>
> I thought to store the templates dir inside each apps, because in this way
> the apps are more pluggables...I'm going wrong?
>
> Thank you
>

Your way is right, nothing wrong wth storing templates in app directory.
For this purpose django even has special app loader, wich loads templates
stored in the app directory.

And this way your app would be closer to "just plug in and use"

As for me, i'm deciding where to store templates basing on app or project
requirements.
-- 
*Vovk Donets*
 python/django developer

skype:  suunbeeam
icq:  232490857
mail:donets.vladi...@gmail.com

-- 
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.



What's the django convention for templates?

2011-12-09 Thread Mauro
Hello, I'm totally new in the django universe and I'm trying out to build a 
little project.

There are many days who I'm following many tutorial on django framework. But 
it's not clear for me how the convention for templates is.

Following the djangobook I've build a projects who has the following 
strurcture:

projects |
 ---
| __init__.py
| manage.py
| settings.py
| urls.py

| app folder |
 --
   | many files
   | templates |

| 
index.php

As you can see the templates directory is stored inside the app directory.

Reading the django documentation instead they says that the templates dir 
should live inside the root directory of the projects.

I'm wondering, what's is the common convention about it?

I thought to store the templates dir inside each apps, because in this way 
the apps are more pluggables...I'm going wrong?

Thank you

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/UX6fBcCAaDkJ.
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.