0

in my server I have a lot of apps installed like, facebook_connect, userena, guardian and so on...

For example, I realized that if I customize the:

django-userena / userena / templates / userena / emails / activation_email_message.txt

{% load i18n %}{% autoescape off %}{% load url from future %}
{% if not without_usernames %}{% blocktrans with user.username as username %}Dear {{ username }},{% endblocktrans %}
{% endif %}
{% blocktrans with site.name as site %}Thank you for signing up at {{ site }}.{% endblocktrans %}

{% trans "To activate your account you should click on the link below:" %}

{{ protocol }}://{{ site.domain }}{% url 'userena_activate' activation_key %}

{% trans "Thanks for using our site!" %}

{% trans "Sincerely" %},
{{ site.name }}
{% endautoescape %}

For specified website, and I have more than 4 in the same server, I will make a complete mess in my django_site.

My question is:

How to customize the templates or models in some installed apps without completely change the original django_site?

Thanks in advance,

cleliodpaula
  • 819
  • 2
  • 11
  • 27

1 Answers1

2

You cannot change the models, but you can override templates.

In the same directory as manage.py, you would have a directory called templates, there, you can create the following folder hierarchy, and put your custom template.

templates/userena/emails/activation_email_message.txt

karthikr
  • 97,368
  • 26
  • 197
  • 188
  • Is different from the templates folder that I used to work on, in the same folder of settings.py? – cleliodpaula Oct 10 '12 at 16:11
  • It is the same. First, django's template loader would get it from this `templates` directory if present – karthikr Oct 10 '12 at 16:13
  • views - you can write your own and call that in the template instead of the original, models - you can write a wrapper model (extending the base model) - there is no work around for this that i know of – karthikr Oct 10 '12 at 16:20