Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Collection of Practice
2019
1606821886-practice
Commits
fd6353ba
Commit
fd6353ba
authored
Nov 13, 2019
by
Farah Alhaniy
Browse files
Add accounts implementation
parent
da94c9ab
Changes
3
Hide whitespace changes
Inline
Side-by-side
lists/templates/base.html
View file @
fd6353ba
...
...
@@ -16,11 +16,16 @@
<nav
class=
"navbar navbar-default"
role=
"navigation"
>
<div
class=
"container-fluid"
>
<a
class=
"navbar-brand"
href=
"/"
>
Superlists
</a>
<form
class=
"navbar-form navbar-right"
method=
"POST"
action=
"#"
>
{% if user.is_authenticated %}
<p>
Logged in as {{ user.email }}
</p>
<p><a
id=
"id_logout"
href=
"{% url 'logout' %}"
>
Log out
</a></p>
{% else %}
<form
class=
"navbar-form navbar-right"
method=
"POST"
action=
"{% url 'send_login_email' %}"
>
<span>
Enter email to log in:
</span>
<input
class=
"form-control"
name=
"email"
type=
"text"
/>
{% csrf_token %}
</form>
{% endif %}
</div>
</nav>
...
...
superlists/settings.py
View file @
fd6353ba
...
...
@@ -39,7 +39,13 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'lists'
'lists'
,
'accounts'
,
]
AUTH_USER_MODEL
=
'accounts.ListUser'
AUTHENTICATION_BACKENDS
=
[
'accounts.authentication.PasswordlessAuthenticationBackend'
,
]
MIDDLEWARE
=
[
...
...
@@ -134,3 +140,26 @@ STATIC_URL = '/static/'
# Add configuration for static files storage using whitenoise
# STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
EMAIL_HOST
=
'smtp.gmail.com'
EMAIL_HOST_USER
=
'efaefaaa@gmail.com'
EMAIL_HOST_PASSWORD
=
os
.
environ
.
get
(
'EMAIL_PASSWORD'
)
EMAIL_PORT
=
587
EMAIL_USE_TLS
=
True
LOGGING
=
{
'version'
:
1
,
'disable_existing_loggers'
:
False
,
'handlers'
:
{
'console'
:
{
'level'
:
'DEBUG'
,
'class'
:
'logging.StreamHandler'
,
},
},
'loggers'
:
{
'django'
:
{
'handlers'
:
[
'console'
],
},
},
'root'
:
{
'level'
:
'INFO'
},
}
\ No newline at end of file
superlists/urls.py
View file @
fd6353ba
...
...
@@ -16,8 +16,10 @@ Including another URLconf
from
django.conf.urls
import
include
,
url
from
lists
import
views
as
list_views
from
lists
import
urls
as
list_urls
from
accounts
import
urls
as
accounts_urls
urlpatterns
=
[
url
(
r
'^$'
,
list_views
.
home_page
,
name
=
'home'
),
url
(
r
'^lists/'
,
include
(
list_urls
)),
url
(
r
'^lists/'
,
include
(
list_urls
)),
url
(
r
'^accounts/'
,
include
(
accounts_urls
)),
]
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment