diff --git a/website/db.sqlite3 b/website/db.sqlite3
index 84cb1acc..cd50d136 100644
Binary files a/website/db.sqlite3 and b/website/db.sqlite3 differ
diff --git a/website/home/models.py b/website/home/models.py
index 71a83623..b55e5304 100644
--- a/website/home/models.py
+++ b/website/home/models.py
@@ -1,3 +1,6 @@
from django.db import models
-# Create your models here.
+# class Navbar(models.Model):
+ # title=models.CharField(max_length=50)
+ # url=models.CharField(max_length=50)
+ #
diff --git a/website/home/static/css/style.css b/website/home/static/home/css/style.css
similarity index 70%
rename from website/home/static/css/style.css
rename to website/home/static/home/css/style.css
index 21bbb5dc..a451b1af 100644
--- a/website/home/static/css/style.css
+++ b/website/home/static/home/css/style.css
@@ -22,12 +22,14 @@ html {
background-position: 100%;
}
-body {
+.centered {
position: absolute;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
top: 50%;
+}
+body{
font-size: 1.2em;
font-family: 'Roboto', sans-serif;
line-height: 1.4;
@@ -65,4 +67,38 @@ p > strong {
}
}
+ul.navbar {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ background-color: #333;
+ position: fixed;
+ top: 0;
+ width:100%;
+ text-align:center;
+
+}
+
+
+li a.navbar {
+
+ display: block;
+ color: white;
+ text-align: center;
+ padding: 14px 16px;
+ text-decoration: none;
+}
+
+li {
+ float:left;
+}
+li a:hover.navbar {
+ background-color: #111;
+}
+
+#active {
+ background-color: #4CAF50;
+}
+
diff --git a/website/home/templates/home.html b/website/home/templates/home.html
deleted file mode 100644
index 24feec72..00000000
--- a/website/home/templates/home.html
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
- {% load static %}
-
-
- Home
-
-
-
-
-
-
-
- {% block content %}
- {% endblock %}
-{% csrf_token %}
-
- Test!
- {{ currencyTotal }}
-
-
diff --git a/website/home/templates/underline.svg b/website/home/templates/underline.svg
deleted file mode 100644
index 7bbe7581..00000000
--- a/website/home/templates/underline.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/website/sent_emails/20210209-001944-140059386095208.log b/website/sent_emails/20210209-001944-140059386095208.log
new file mode 100644
index 00000000..e20b3c8a
--- /dev/null
+++ b/website/sent_emails/20210209-001944-140059386095208.log
@@ -0,0 +1,25 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+Subject: Password reset on 127.0.0.1:8000
+From: webmaster@localhost
+To: pederas@pederasov.pl
+Date: Mon, 08 Feb 2021 22:19:44 -0000
+Message-ID: <161282278468.9046.5088568393660450551@Spudnik>
+
+
+You're receiving this email because you requested a password reset for your user account at 127.0.0.1:8000.
+
+Please go to the following page and choose a new password:
+
+http://127.0.0.1:8000/users/reset/Mg/ahs0ww-f913be8dd50f0a6adf4815cf32e8183a/
+
+Your username, in case you’ve forgotten: bobi
+
+Thanks for using our site!
+
+The 127.0.0.1:8000 team
+
+
+
+-------------------------------------------------------------------------------
diff --git a/website/sent_emails/20210209-002007-139656085868384.log b/website/sent_emails/20210209-002007-139656085868384.log
new file mode 100644
index 00000000..ef08d1c2
--- /dev/null
+++ b/website/sent_emails/20210209-002007-139656085868384.log
@@ -0,0 +1,25 @@
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+Subject: Password reset on 127.0.0.1:8000
+From: webmaster@localhost
+To: pederas@pederasov.pl
+Date: Mon, 08 Feb 2021 22:20:07 -0000
+Message-ID: <161282280735.9109.220494091957288379@Spudnik>
+
+
+You're receiving this email because you requested a password reset for your user account at 127.0.0.1:8000.
+
+Please go to the following page and choose a new password:
+
+http://127.0.0.1:8000/users/reset/Mg/ahs0xj-30b0b07164a6b8b220b0e9cbbb048aa0/
+
+Your username, in case you’ve forgotten: bobi
+
+Thanks for using our site!
+
+The 127.0.0.1:8000 team
+
+
+
+-------------------------------------------------------------------------------
diff --git a/website/templates/base.html b/website/templates/base.html
new file mode 100644
index 00000000..ad6a1974
--- /dev/null
+++ b/website/templates/base.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+ {% block title %}CurrencyProj{% endblock %}
+ {% load static %}
+
+
+
+
+
+
+
+
+
+
+ {% block content %}
+ {% endblock %}
+
+
+
diff --git a/website/templates/home.html b/website/templates/home.html
new file mode 100644
index 00000000..6769b8d6
--- /dev/null
+++ b/website/templates/home.html
@@ -0,0 +1,16 @@
+
+{% extends 'base.html' %}
+
+{% block title %}Home{% endblock %}
+
+{% block content %}
+{% if user.is_authenticated %}
+ Hi {{ user.username }}!
+ {{ currencyTotal }}
+ Log Out
+ Reset Password
+{% else %}
+ You are not logged in
+ Log In
+{% endif %}
+{% endblock %}
diff --git a/website/templates/registration/login.html b/website/templates/registration/login.html
new file mode 100644
index 00000000..c6eb2df7
--- /dev/null
+++ b/website/templates/registration/login.html
@@ -0,0 +1,12 @@
+{% extends 'base.html' %}
+
+{% block title %}Login{% endblock %}
+
+{% block content %}
+Log In
+
+{% endblock %}
diff --git a/website/templates/registration/password_reset_complete.html b/website/templates/registration/password_reset_complete.html
new file mode 100644
index 00000000..ab769f65
--- /dev/null
+++ b/website/templates/registration/password_reset_complete.html
@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+
+{% block title %}Password reset complete{% endblock %}
+
+{% block content %}
+Password reset complete
+Your new password has been set. You can log in now on the log in page .
+{% endblock %}
diff --git a/website/templates/registration/password_reset_confirm.html b/website/templates/registration/password_reset_confirm.html
new file mode 100644
index 00000000..2f343fd3
--- /dev/null
+++ b/website/templates/registration/password_reset_confirm.html
@@ -0,0 +1,20 @@
+{% extends 'base.html' %}
+
+{% block title %}Enter new password{% endblock %}
+
+{% block content %}
+
+{% if validlink %}
+
+Set a new password!
+
+
+{% else %}
+
+The password reset link was invalid, possibly because it has already been used. Please request a new password reset.
+
+{% endif %}
diff --git a/website/templates/registration/password_reset_done.html b/website/templates/registration/password_reset_done.html
new file mode 100644
index 00000000..8a47de55
--- /dev/null
+++ b/website/templates/registration/password_reset_done.html
@@ -0,0 +1,8 @@
+{% extends 'base.html' %}
+
+{% block title %}Email Sent{% endblock %}
+
+{% block content %}
+ Check your inbox.
+ We've emailed you instructions for setting your password. You should receive the email shortly!
+{% endblock %}
diff --git a/website/templates/registration/password_reset_form.html b/website/templates/registration/password_reset_form.html
new file mode 100644
index 00000000..1d39fc3a
--- /dev/null
+++ b/website/templates/registration/password_reset_form.html
@@ -0,0 +1,14 @@
+{% extends 'base.html' %}
+
+{% block title %}Forgot Your Password?{% endblock %}
+
+{% block content %}
+ Forgot your password?
+ Enter your email address below, and we'll email instructions for setting a new one.
+
+
+{% endblock %}
diff --git a/website/templates/registration/signup.html b/website/templates/registration/signup.html
new file mode 100644
index 00000000..cdfd15a6
--- /dev/null
+++ b/website/templates/registration/signup.html
@@ -0,0 +1,13 @@
+{% extends 'base.html' %}
+
+{% block title %}Sign Up{% endblock %}
+
+{% block content %}
+ Sign up
+
+{% endblock %}
+
diff --git a/website/users/admin.py b/website/users/admin.py
new file mode 100644
index 00000000..8c38f3f3
--- /dev/null
+++ b/website/users/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/website/users/apps.py b/website/users/apps.py
new file mode 100644
index 00000000..4ce1fabc
--- /dev/null
+++ b/website/users/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class UsersConfig(AppConfig):
+ name = 'users'
diff --git a/website/users/models.py b/website/users/models.py
new file mode 100644
index 00000000..71a83623
--- /dev/null
+++ b/website/users/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/website/users/tests.py b/website/users/tests.py
new file mode 100644
index 00000000..7ce503c2
--- /dev/null
+++ b/website/users/tests.py
@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.
diff --git a/website/users/urls.py b/website/users/urls.py
new file mode 100644
index 00000000..3dc60e32
--- /dev/null
+++ b/website/users/urls.py
@@ -0,0 +1,8 @@
+from django.urls import path
+
+from .views import SignUpView
+
+
+urlpatterns = [
+ path('signup/', SignUpView.as_view(), name='signup'),
+]
diff --git a/website/users/views.py b/website/users/views.py
new file mode 100644
index 00000000..c4214a4d
--- /dev/null
+++ b/website/users/views.py
@@ -0,0 +1,11 @@
+from django.contrib.auth.forms import UserCreationForm
+from django.urls import reverse_lazy
+from django.views import generic
+
+
+# need to make oauth facebook login
+class SignUpView(generic.CreateView):
+ form_class = UserCreationForm
+ success_url = reverse_lazy('login')
+ template_name = 'registration/signup.html'
+
diff --git a/website/website/settings.py b/website/website/settings.py
index da82ad63..73035865 100644
--- a/website/website/settings.py
+++ b/website/website/settings.py
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathlib import Path
+import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -38,6 +39,7 @@ INSTALLED_APPS = [
'django.contrib.messages',
'django.contrib.staticfiles',
'home',
+ 'users',
]
MIDDLEWARE = [
@@ -55,7 +57,7 @@ ROOT_URLCONF = 'website.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
- 'DIRS': [],
+ 'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@@ -120,3 +122,9 @@ USE_TZ = True
STATIC_URL = '/static/'
STATIC_ROOT= "/media/kanina/AtmoSphere/Projects/CurrencySite/website/static/"
+
+LOGIN_REDIRECT_URL = "/"
+LOGOUT_REDIRECT_URL = "/"
+
+EMAIL_BACKEND = "django.core.mail.backends.filebased.EmailBackend"
+EMAIL_FILE_PATH = str(BASE_DIR.joinpath('sent_emails'))
diff --git a/website/website/urls.py b/website/website/urls.py
index 39d80ee8..ae37dbef 100644
--- a/website/website/urls.py
+++ b/website/website/urls.py
@@ -14,13 +14,17 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
-from django.urls import path
+from django.urls import path, include
from home.views import homePage
from django.conf import settings
from django.conf.urls.static import static
+from django.contrib.auth import views
+from django.views.generic.base import TemplateView
urlpatterns = [
- path("", homePage, name="home"),
+ path("", homePage, name='home'),
path('admin/', admin.site.urls),
+ path("users/", include('django.contrib.auth.urls')),
+ path('users/', include('users.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)