Commit 125ce2c5 authored by JayCay's avatar JayCay

added Log in

parent 8e6380b2
...@@ -134,4 +134,5 @@ STATICFILES_DIRS = [ ...@@ -134,4 +134,5 @@ STATICFILES_DIRS = [
# Tells django where to put static files after collectstatic # Tells django where to put static files after collectstatic
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
LOGIN_REDIRECT_URL = 'reviews_index'
LOGOUT_REDIRECT_URL = 'reviews_index' LOGOUT_REDIRECT_URL = 'reviews_index'
\ No newline at end of file
...@@ -25,6 +25,7 @@ from profs import views as profs_views ...@@ -25,6 +25,7 @@ from profs import views as profs_views
urlpatterns = [ urlpatterns = [
url(r'^signup/$', accounts_views.signup, name='signup'), url(r'^signup/$', accounts_views.signup, name='signup'),
url(r'^login/$', auth_views.LoginView.as_view(template_name='templates/login.html'), name='login'),
url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'), url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
url(r'^admin/', admin.site.urls), url(r'^admin/', admin.site.urls),
url(r'^$', reviews_views.index, name="reviews_index"), url(r'^$', reviews_views.index, name="reviews_index"),
......
No preview for this file type
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<ul> <ul>
<li><a href="{% url 'reviews_index' %}">Home</a></li> <li><a href="{% url 'reviews_index' %}">Home</a></li>
<li><a href="{% url 'profs_index' %}">Profs</a></li> <li><a href="{% url 'profs_index' %}">Profs</a></li>
<li><a href="{% url 'login' %}">Log in</a></li>
<li>{{ user.username }}</li> <li>{{ user.username }}</li>
</ul> </ul>
</nav> </nav>
......
{% extends 'templates/base.html' %}
{% block content %}
<div class="container">
<h1 class="text-center logo my-4">
<a href="{% url 'reviews_index'%}">Academe</a>
</h1>
<div class="row justify-content-center">
<div class="col-lg-4 col-md-6 col-sm-8">
<div class="card">
<div class="card-body">
<h3 class="card-title">Log in</h3>
<form method="post" novalidate>
{% csrf_token %}
{% include 'templates/includes/form.html' %}
<button type="submit" class="btn btn-primary btn-block">Log in</button>
</form>
</div>
<div class="card-footer text-muted text-center">
New to Academe? <a href="{% url 'signup' %}">Sign up</a>
</div>
</div>
<div class="text-xenter py-2">
<small>
<a href="#" class="text-muted">Forgot your password?</a>
</small>
</div>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment