Skip to content
Snippets Groups Projects
Commit 5702a9fd authored by Zdenek Kubala's avatar Zdenek Kubala
Browse files

working reg+login

parent 4060c092
No related branches found
No related tags found
No related merge requests found
__pycache__
*.py[cod]
*$py.class
# Distribution / packaging
.Python build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
*.manifest
*.spec
# Log files
pip-log.txt
pip-delete-this-directory.txt
*.log
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
.pytest_cache/
nosetests.xml
coverage.xml
*.cover
.hypothesis/
# Translations
*.mo
*.pot
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pyflow
__pypackages__/
# Environment
.env
.venv
env/
venv/
ENV/
# If you are using PyCharm #
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/gradle.xml
.idea/**/libraries
*.iws /out/
# Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache
*.sublime-workspace
*.sublime-project
# sftp configuration file
sftp-config.json
# Package control specific files Package
Control.last-run
Control.ca-list
Control.ca-bundle
Control.system-ca-bundle
GitHub.sublime-settings
# Visual Studio Code #
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history
......@@ -126,3 +126,8 @@ STATIC_URL = '/static/'
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
# Custom settings AUTH
LOGIN_REDIRECT_URL = 'index'
LOGOUT_REDIRECT_URL = 'index'
......@@ -71,16 +71,19 @@
<span class="head-heavy-2xs">{{ user }}</span>
{% comment %}
{% endcomment %}
<form action="{% url "accounts/logout" %}" method="post">
<form action="{% url "logout" %}" method="post">
{% csrf_token %}
<button class="text-grey-200 hover:text-white" title="Odhlásit se"><i class="ico--log-out"></i></button>
</form>
{% else %}
{% comment %}
{% endcomment %}
<a class="btn btn--grey-125 btn--hoveractive btn--to-white" href="{% url "accounts/login" %}">
<a class="btn btn--grey-125 btn--hoveractive btn--to-white" href="{% url "login" %}">
<div class="btn__body ">přihlášení</div>
</a>
<a class="btn btn--grey-125 btn--hoveractive btn--to-white" href="{% url "django_registration_register" %}">
<div class="btn__body ">registrace</div>
</a>
{% endif %}
</div>
</div>
......
{% extends "base.html" %}
{% comment %}
<h2>Sign up</h2>
<form method="post">
{% csrf_token %}
......@@ -19,3 +20,4 @@
</form>
{% endblock %}
{% endcomment %}
{% extends "registration/registration_base.html" %}
{% extends "base.html" %}
{% comment %}
{% extends "django_registration/registration_base.html" %}
{% endcomment %}
{% load i18n %}
{% block title %}{% trans "Log in" %}{% endblock %}
......@@ -11,8 +14,10 @@
<input type="hidden" name="next" value="{{ next }}" />
</form>
{% comment %}
<p>{% trans "Forgot your password?" %} <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a>.</p>
<p>{% trans "Not a member?" %} <a href="{% url 'registration_register' %}">{% trans "Register" %}</a>.</p>
<p>{% trans "Nemáte účet?" %} <a href="{% url 'django_registration_register' %}">{% trans "Register" %}</a>.</p>
{% endcomment %}
{% endblock %}
......
{% extends "django_registration/registration_base.html" %}
{% load i18n %}
{% block title %}{% trans "Logged out" %}{% endblock %}
{% block content %}
<p>{% trans "Successfully logged out" %}.</p>
{% endblock %}
{% extends "base.html" %}
{% comment %}
{% extends "django_registration/registration_base.html" %}
{% endcomment %}
{% load i18n %}
{% block title %}{% trans "Profile" %}{% endblock %}
{% block content %}
<form method="post" action="">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="{% trans 'Log in' %}" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{% comment %}
<p>{% trans "Forgot your password?" %} <a href="{% url 'auth_password_reset' %}">{% trans "Reset it" %}</a>.</p>
<p>{% trans "Not a member?" %} <a href="{% url 'registration_register' %}">{% trans "Register" %}</a>.</p>
{% endcomment %}
{% endblock %}
{% comment %}
**registration/login.html**
It's your responsibility to provide the login form in a template called
registration/login.html by default. This template gets passed four
template context variables:
``form``
A Form object representing the login form. See the forms
documentation for more on Form objects.
``next``
The URL to redirect to after successful login. This may contain a
query string, too.
``site``
The current Site, according to the SITE_ID setting. If you don't
have the site framework installed, this will be set to an instance
of RequestSite, which derives the site name and domain from the
current HttpRequest.
``site_name``
An alias for site.name. If you don't have the site framework
installed, this will be set to the value of
request.META['SERVER_NAME']. For more on sites, see The
"sites" framework.
{% endcomment %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment