DuGites / django-profile

Automatically exported from code.google.com/p/django-profile
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Template location setting #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think it would be beneficial to have a setting for the location of
templates. Something like:

TEMPLATE_LOCATION = '/blah/blah/blah/'

Would go in the Settings.py file for the site. I like to keep templates in
one location and would also like to keep compatibility with future releases
without having to change all of the template locations in views.py. 

Original issue reported on code.google.com by joshkap...@gmail.com on 25 Mar 2009 at 10:04

GoogleCodeExporter commented 9 years ago
Hi joshkapple, thanks for reporting.

You can control the template directories and the priority of them via the
TEMPLATE_DIRS settings: 

http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#template-dirs

The reference to the template dir on views.py is relative to these template 
dirs, so,
for example, you can configure:

TEMPLATE_DIRS = ( "my/project/templates",
"my/project/external_apps/userprofile/templates")

And so you can modify the default templates on your project directory, and if 
the
template is not customized, it will be find on the userprofile generic template
directory.

Maybe this will solve the request you propose?

Original comment by david.ru...@gmail.com on 26 Mar 2009 at 10:52

GoogleCodeExporter commented 9 years ago
Oh I see now, newbie mistake. Thanks for the informative post. I am liking this 
django-profile more, the more I use it. 

Original comment by joshkap...@gmail.com on 31 Mar 2009 at 1:36

GoogleCodeExporter commented 9 years ago
Hmm, i have a problem with templates location...

I have installed django-profile via "python setup.py install" but when i go to
myproject/accounts/profile, django can't find the templates'directory.

For all others applications i installed i never put the path in 
"TEMPLATE_DIRS"...
but in this case something doesn't work... 

Original comment by stephane.angel on 2 Apr 2009 at 8:51

GoogleCodeExporter commented 9 years ago
I updated setup.py to use setuptools (like django-friends) and it works, there 
is a
patch (just adapted from the one for django-friends, i don't know if it's 
really a
good thing...)

Original comment by stephane.angel on 2 Apr 2009 at 9:16

Attachments:

GoogleCodeExporter commented 9 years ago
david, did you see my proposed patch for including templates in the package ?
Perhaps just adding "userprofile.templates" made the job but...

Original comment by stephane.angel on 8 Apr 2009 at 9:28

GoogleCodeExporter commented 9 years ago
The patch worked for me. Is it possible to include it in the code?

Original comment by gle...@transifex.com on 12 May 2009 at 11:26

GoogleCodeExporter commented 9 years ago
i agree, it would be very nice if  'userprofile.templates' was added to the 
'packages' list in setup.py .

currently, when deploying with pip and virtualenv (and fabric), you have to do 
some custom scripting to get the 
templates installed.  if they were included in the setup.py, pip could install 
them automatically.

this would be a very nice, simple fix!

Original comment by ammac...@gmail.com on 15 Jul 2009 at 12:20

GoogleCodeExporter commented 9 years ago
Sorry to all for the lack of updates. I've been desconnected of this project 
for a
long time.

I have commited the patch. If any of you would like access to the SVN trunk 
tell me.

Original comment by david.ru...@gmail.com on 15 Jul 2009 at 8:19

GoogleCodeExporter commented 9 years ago
fixed in r419 and r424

Original comment by stephane.angel on 2 Feb 2010 at 5:07