Added debug mode for frontend to handle email activation link changes

This commit is contained in:
Keannu Bernasol 2023-07-23 22:36:19 +08:00
parent a2d1fb8081
commit f550134998
2 changed files with 9 additions and 20 deletions

View file

@ -29,6 +29,7 @@ SECRET_KEY = str(os.getenv('SECRET_KEY'))
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = True
FRONTEND_DEBUG = True
ALLOWED_HOSTS = ['*', '127.0.0.1', 'localhost', '10.0.10.32', '10.0.10.8'] ALLOWED_HOSTS = ['*', '127.0.0.1', 'localhost', '10.0.10.32', '10.0.10.8']
@ -216,7 +217,7 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DOMAIN = '' DOMAIN = ''
if (DEBUG): if (FRONTEND_DEBUG):
DOMAIN = 'exp' DOMAIN = 'exp'
else: else:
DOMAIN = 'stude' DOMAIN = 'stude'

View file

@ -1,26 +1,14 @@
{% load i18n %} {% load i18n %}
{% block subject %}
{% blocktrans %}Account activation on {{ site_name }}{% endblocktrans %}
{% endblock subject %}
{% block text_body %}
{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}
{% trans "Please open the following link to activate your account in-app:" %}
{{ domain }}://{{ url|safe }}
{% trans "Thanks you for using StudE!" %}
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
{% endblock text_body %}
{% block html_body %} {% block html_body %}
<p>{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}</p> <p>{% blocktrans %}You're receiving this email because you need to finish activation process on {{ site_name }}.{% endblocktrans %}</p>
<p>{% trans "Please go to the following page to activate your account in-app:" %}</p> <p>{% trans "Please click on the button below to activate your account in-app:" %}</p>
<p><a href="{{domain}}://{{url}}">{{ domain }}://{{url}}</a></p> <p>
<a href="https://lemeow125.github.io/simple-redirect/#/redirect/{{ domain }}/activation/{{uid}}/{{token}}" style="background-color: #007BFF; color: white; padding: 10px 20px; text-align: center; text-decoration: none; display: inline-block;">
Activate Account
</a>
</p>
<p>{% blocktrans %}Many thanks from the {{ site_name }} team{% endblocktrans %}</p> <p>{% blocktrans %}Many thanks from the {{ site_name }} team{% endblocktrans %}</p>
{% endblock html_body %} {% endblock html_body %}