Re: Question on Template placement in file system

2015-01-09 Thread JJ Zolper
Generally speaking my impression is most people next to their settings.py 
file have a "templates" folder. This folder of templates is for templates 
used across the site. If you are talking app specific then a "templates" 
folder inside that app is reasonable enough.
 
So for generic templates here it is:
 
myproject/
 myproject/
  settings.py
  wsgi.py
  urls.py
  static/
  templates/
 
and so on and then for app it is:
 
myproject/
 myproject/
  myapp/
models.py
views.py
templates/
  settings.py
  wsgi.py
  urls.py
  static/
  templates/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c05c4505-e0e3-4159-9187-ff9323261896%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question on Template placement in file system

2015-01-08 Thread Collin Anderson
Hi,

The tutorial suggests A) (for a non-reusable app).

https://docs.djangoproject.com/en/1.7/intro/tutorial02/#ref-customizing-your-projects-templates

Collin

On Tuesday, January 6, 2015 at 10:25:10 AM UTC-5, Tobias Dacoir wrote:
>
> I have been working through the official Django 1.7 tutorial and also 
> Tango with Django but I'm confused as to where put my templates - I want to 
> follow best practices as much as possible.
> Now currently I only plan to develop a single project with a single app, 
> but I might want to include 3rd party apps later on.
> So I have created my project and started a new app inside. Since all pages 
> should use the same html template I wanted to place the base.html into the 
> project template folder. Or should I still put everything into the 
> app/template folder?
>
> Suggestion A)
> project_dir/templates/base.html
> project_dir/templates/app/index.html (extends base.html)
>
> Suggestion B)
> project_dir/app_dir/templates/base.html
> project_dir/app_dir/templates/index.html
>
> Suggestion C) (as in the tutorial)
> project_dir/app_dir/templates/base.html
> project_dir/app_dir/templates/app/index.html
>
>
> Later on when somebody goes to my website I want to show him some stuff 
> from my app on the index page already. So on http://mysite.com/ there 
> should already be content from my app, but there will also be static html 
> files like 'contact', 'impress', 'help' and so on, which I wanted to put 
> somewhere in my project folder and not within the app. But everything 
> should rely on the same base.html template so all pages use the same 
> javascript & css files. 
>
> Is there maybe another good tutorial for this available?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e1b599fd-2232-4d87-929e-1d0e3283a7c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Question on Template placement in file system

2015-01-06 Thread Tobias Dacoir
I have been working through the official Django 1.7 tutorial and also Tango 
with Django but I'm confused as to where put my templates - I want to 
follow best practices as much as possible.
Now currently I only plan to develop a single project with a single app, 
but I might want to include 3rd party apps later on.
So I have created my project and started a new app inside. Since all pages 
should use the same html template I wanted to place the base.html into the 
project template folder. Or should I still put everything into the 
app/template folder?

Suggestion A)
project_dir/templates/base.html
project_dir/templates/app/index.html (extends base.html)

Suggestion B)
project_dir/app_dir/templates/base.html
project_dir/app_dir/templates/index.html

Suggestion C) (as in the tutorial)
project_dir/app_dir/templates/base.html
project_dir/app_dir/templates/app/index.html


Later on when somebody goes to my website I want to show him some stuff 
from my app on the index page already. So on http://mysite.com/ there 
should already be content from my app, but there will also be static html 
files like 'contact', 'impress', 'help' and so on, which I wanted to put 
somewhere in my project folder and not within the app. But everything 
should rely on the same base.html template so all pages use the same 
javascript & css files. 

Is there maybe another good tutorial for this available?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b28eb626-ebd9-4db0-9130-a973ce28f324%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.