add allauth configuration and message tags
This commit is contained in:
parent
286c477efc
commit
ab313a2a66
3 changed files with 26 additions and 4 deletions
|
@ -10,6 +10,7 @@ from sys import path
|
||||||
# Normally you should not import ANYTHING from Django directly
|
# Normally you should not import ANYTHING from Django directly
|
||||||
# into your settings, but ImproperlyConfigured is an exception.
|
# into your settings, but ImproperlyConfigured is an exception.
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
from django.contrib.messages import constants as messages
|
||||||
|
|
||||||
|
|
||||||
def get_env_variable(var_name):
|
def get_env_variable(var_name):
|
||||||
|
@ -247,7 +248,6 @@ ALLAUTH_APPS = (
|
||||||
'allauth.socialaccount',
|
'allauth.socialaccount',
|
||||||
'allauth.socialaccount.providers.google',
|
'allauth.socialaccount.providers.google',
|
||||||
'allauth.socialaccount.providers.linkedin_oauth2',
|
'allauth.socialaccount.providers.linkedin_oauth2',
|
||||||
'allauth.socialaccount.providers.openid',
|
|
||||||
'allauth.socialaccount.providers.twitter',
|
'allauth.socialaccount.providers.twitter',
|
||||||
'allauth.socialaccount.providers.xing',
|
'allauth.socialaccount.providers.xing',
|
||||||
)
|
)
|
||||||
|
@ -266,9 +266,23 @@ LOCAL_APPS = (
|
||||||
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#installed-apps
|
||||||
INSTALLED_APPS = DJANGO_APPS + ALLAUTH_APPS + LOCAL_APPS
|
INSTALLED_APPS = DJANGO_APPS + ALLAUTH_APPS + LOCAL_APPS
|
||||||
|
|
||||||
|
MESSAGE_TAGS = {
|
||||||
|
messages.DEBUG: '',
|
||||||
|
messages.ERROR: 'text-danger',
|
||||||
|
messages.INFO: 'text-info',
|
||||||
|
messages.SUCCESS: 'text-success',
|
||||||
|
messages.WARNING: 'text-warning',
|
||||||
|
}
|
||||||
########## END APP CONFIGURATION
|
########## END APP CONFIGURATION
|
||||||
|
|
||||||
|
|
||||||
|
########## ALLAUTH CONFIGURATION
|
||||||
|
LOGIN_REDIRECT_URL = '/'
|
||||||
|
SOCIALACCOUNT_QUERY_EMAIL = True
|
||||||
|
########## END ALLAUTH CONFIGURATION
|
||||||
|
|
||||||
|
|
||||||
########## CRISPY FORMS CONFIGURATION
|
########## CRISPY FORMS CONFIGURATION
|
||||||
CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
||||||
########## END CRISPY_FORMS CONFIGURATION
|
########## END CRISPY_FORMS CONFIGURATION
|
||||||
|
|
|
@ -51,9 +51,9 @@
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
<li><a href="#">{% trans "My Profile" %}</a></li>
|
<li><a href="#">{% trans "My Profile" %}</a></li>
|
||||||
{% if user.is_staff %}<li><a href="{% url 'admin:index' %}">{% trans "Admin site" %}</a></li>{% endif %}
|
{% if user.is_staff %}<li><a href="{% url 'admin:index' %}">{% trans "Admin site" %}</a></li>{% endif %}
|
||||||
<li><a href="{% url 'logout' %}">{% trans "Logout" %}</a></li>
|
<li><a href="{% url 'account_logout' %}">{% trans "Logout" %}</a></li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li><a href="{% url 'login' %}?next={{ request.path }}">{% trans "Sign In" %}</a></li>
|
<li><a href="{% url 'account_login' %}?next={{ request.path }}">{% trans "Sign In" %}</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div><!--/.nav-collapse -->
|
</div><!--/.nav-collapse -->
|
||||||
|
@ -64,6 +64,14 @@
|
||||||
|
|
||||||
<h1>{% block page_title %}Example Base Template{% endblock page_title %}</h1>
|
<h1>{% block page_title %}Example Base Template{% endblock page_title %}</h1>
|
||||||
|
|
||||||
|
{% if messages %}
|
||||||
|
<ul class="list-unstyled">
|
||||||
|
{% for message in messages %}
|
||||||
|
<li{% if message.tags %} class="{{ message.tags }}"{% endif %}>{{ message }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>Use this document as a way to quick start any new project.</p>
|
<p>Use this document as a way to quick start any new project.</p>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
|
@ -9,6 +9,6 @@ You can visit your <a href="{{ dashboard_url }}">Dashboard</a> to view and modif
|
||||||
{% endblocktrans %}</p>
|
{% endblocktrans %}</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>{% trans "This is your entry to our customer self service sytem." %}</p>
|
<p>{% trans "This is your entry to our customer self service sytem." %}</p>
|
||||||
<p>{% url 'login' as login_url %}{% url 'dashboard' as dashboard_url %}{% blocktrans %}If you are already a customer you can <a href="{{ login_url }}?next={{ dashboard_url }}">Sign in</a> to view and modify your hosting options.{% endblocktrans %}</p>
|
<p>{% url 'account_login' as login_url %}{% url 'dashboard' as dashboard_url %}{% blocktrans %}If you are already a customer you can <a href="{{ login_url }}?next={{ dashboard_url }}">Sign in</a> to view and modify your hosting options.{% endblocktrans %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
|
Loading…
Reference in a new issue