diff --git a/.gitignore b/.gitignore
index 9968480b373dc5937dba13dd887444bd319e2c92..3a4dc13051601b1718ecf0a8e1cda27e67f6d8fd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,7 @@ myproject/node_modules
 myproject/env
 myproject/myapp/static/CACHE
 myproject/myapp/__pycache__
+.DS_Store
+myproject/myproject/__pycache__/__init__.cpython-312.pyc
+myproject/myproject/__pycache__/settings.cpython-312.pyc
+myproject/myproject/__pycache__/urls.cpython-312.pyc
diff --git a/myproject/entrypoint.sh b/myproject/entrypoint.sh
index 2087de43a0bf9dd298173c83ad403d4c42b3d509..e882418b2b601205cd56943e47d2b40e728ddc55 100644
--- a/myproject/entrypoint.sh
+++ b/myproject/entrypoint.sh
@@ -7,4 +7,4 @@ python manage.py makemigrations
 echo "Applying migrations"
 python manage.py migrate
 
-python manage.py runserver 0.0.0.0:5432
\ No newline at end of file
+python manage.py runserver 0.0.0.0:8000
\ No newline at end of file
diff --git a/myproject/myapp/forms.py b/myproject/myapp/forms.py
new file mode 100644
index 0000000000000000000000000000000000000000..8391495832258992c1d6540a7c25906897550da8
--- /dev/null
+++ b/myproject/myapp/forms.py
@@ -0,0 +1,16 @@
+from django import forms
+from django.contrib.auth.forms import UserCreationForm 
+from django.contrib.auth.models import User
+
+class CustomRegistrationForm(UserCreationForm):
+    #UserCreationForm comes with username, password1, password2 by default
+    #only email needs to be added for our custom users
+    email = forms.EmailField()
+
+    class Meta(UserCreationForm.Meta):
+        model = User
+        fields = ["username", "email", "password1", "password2"]
+
+class LoginForm(forms.Form):
+    username = forms.CharField()
+    password = forms.CharField(widget=forms.PasswordInput)
\ No newline at end of file
diff --git a/myproject/myapp/models.py b/myproject/myapp/models.py
index 3921a6ba5ce7346b7124042e9add912e83544618..5fdd11c5901e3138d22c26089ea4facf783976ed 100644
--- a/myproject/myapp/models.py
+++ b/myproject/myapp/models.py
@@ -1,4 +1,49 @@
 from django.db import models
+from django.contrib.auth import get_user_model
+from django.contrib.auth.models import User, Group, Permission 
+from django.contrib.contenttypes.models import ContentType
+
+# class UserTypes(User):
+#     USER_TYPE_CHOICES = (
+#         0, 'Basic User',
+#         1, 'Admin',
+#         2, 'ML Engineer',
+#         3, 'Accountant'
+#     )
+
+#     usertype = models.PositiveSmallIntegerField(choices=USER_TYPE_CHOICES) # should we declare default=0 here?
+
+# group_names = ['Basic User', 'Admin', 'ML Engineer', 'Accountant']
+# for group_name in group_names:
+#     Group.objects.get_or_create(name=group_name)
+
+# assign group permissions
+# content_type = ContentType.objects.get_for_model(UserTypes)
+# permission = Permission.objects.create(codename='can_view_user',
+#                                        name='Can View User',
+#                                        content_type=content_type)
+# group = Group.objects.get(name='Admin')
+# group.permissions.add(permission)
+
+
+# User = get_user_model()
+
+# user = User.objects.create_user('username', 'email', 'password')
+#names are not necessary - reduces gdpr concerns aswell
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 
 #   Usertypes
 #   ---------
diff --git a/myproject/myapp/templates/_base.html b/myproject/myapp/templates/_base.html
index 91303bceae2259d94dc929098f2c99a2b00fbaf7..ed5dab0845c94306eac423e69a3628ecc0307fb1 100644
--- a/myproject/myapp/templates/_base.html
+++ b/myproject/myapp/templates/_base.html
@@ -58,7 +58,7 @@
             </li>
             <li>
               <a
-                href="{% url 'login' %}"
+                href="{% url 'user_login' %}"
                 class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent"
                 >Login</a
               >
@@ -79,7 +79,7 @@
             </li>
             <li>
               <a
-                href="user"
+                href="{% url 'users' %}"
                 class="block py-2 px-3 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent"
                 >Dashboard</a
               >
diff --git a/myproject/myapp/templates/login.html b/myproject/myapp/templates/login.html
index c1836bb3d5ab5c73e449837021803958ff2a727e..639ef31f947da0e7e98490a3fad3841f8ca7a202 100644
--- a/myproject/myapp/templates/login.html
+++ b/myproject/myapp/templates/login.html
@@ -6,7 +6,26 @@
                 <h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white">
                     Sign in to your account
                 </h1>
-                <form class="space-y-4 md:space-y-6" action="#">
+                
+                
+                <form method="POST">
+                    {% csrf_token %}
+                    {{ form.as_p }}
+                    <button type="submit">Login</button>
+                    <a href="{% url 'register' %}">Dont have Account Create</a>
+                </form>
+                
+            </div>
+        </div>
+    </div>
+  </section>
+{% endblock content%}
+
+{% comment %}
+
+
+<form class="space-y-4 md:space-y-6" action="#" method="POST">
+                    {% csrf_token %}
                     <div>
                         <label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your email</label>
                         <input type="email" name="email" id="email" class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="name@company.com" required="">
@@ -31,8 +50,6 @@
                         Don’t have an account yet? <a href="#" class="font-medium text-primary-600 hover:underline dark:text-primary-500">Sign up</a>
                     </p>
                 </form>
-            </div>
-        </div>
-    </div>
-  </section>
-{% endblock content%}
\ No newline at end of file
+
+
+{% endcomment %}
\ No newline at end of file
diff --git a/myproject/myapp/templates/register.html b/myproject/myapp/templates/register.html
index baed31f98e5325c326a4449cd4838af0a34e44ca..5fc8c8791d8f32df96e2bf11dee0d200f0cd7dbf 100644
--- a/myproject/myapp/templates/register.html
+++ b/myproject/myapp/templates/register.html
@@ -6,7 +6,28 @@
                 <h1 class="text-xl font-bold leading-tight tracking-tight text-gray-900 md:text-2xl dark:text-white">
                     Create an account
                 </h1>
-                <form class="space-y-4 md:space-y-6" action="#">
+                <form method="POST">
+                    {% csrf_token %}
+                    {{ form.as_p }}
+
+                    <button type="submit">Register</button>
+                    <a href="{% url 'user_login' %}">Already created an account? Login</a>
+                </form>
+            </div>
+        </div>
+    </div>
+  </section>
+{% endblock content%}
+
+{% comment %} 
+<h1> Register </h1> 
+
+
+
+
+ <form class="space-y-4 md:space-y-6" action="#" method="POST">
+                    {% csrf_token %}
+                    
                     <div>
                         <label for="email" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Your email</label>
                         <input type="email" name="email" id="email" class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500" placeholder="name@company.com" required="">
@@ -32,8 +53,5 @@
                         Already have an account? <a href="#" class="font-medium text-primary-600 hover:underline dark:text-primary-500">Login here</a>
                     </p>
                 </form>
-            </div>
-        </div>
-    </div>
-  </section>
-{% endblock content%}
\ No newline at end of file
+
+{% endcomment %}
diff --git a/myproject/myapp/urls.py b/myproject/myapp/urls.py
index 0bfffe4b6eb67419573cded5331b253a1b5391ee..c2d522b6ef25b754900564e5c8a061cd061f920f 100644
--- a/myproject/myapp/urls.py
+++ b/myproject/myapp/urls.py
@@ -1,21 +1,16 @@
 from django.urls import path
-from .views import index
-from .views import users
-from .views import maintenance
-from .views import handler404
-from .views import handler500
-from .views import register
-from .views import login
+from .views import index, users, maintenance, handler404, handler500, register, user_login
+
 
 
 urlpatterns = [
     # path('', index, name='index'), <- uncomment when index/main page will be ready
     path('', index),
-    path('user/',users),
+    path('user/',users, name='users'),
     path('404/', handler404),
     path('500/', handler500),
     path('maintenance/', maintenance),
     path('register/', register, name='register'),
-    path('login/', login, name='login'),
+    path('login/', user_login, name='user_login'),
 ]
 
diff --git a/myproject/myapp/views.py b/myproject/myapp/views.py
index 3c8d3d964e9d26260f88da816e6868bbb2cf6325..9488d61632231521dce44412d621fd9d86c231c3 100644
--- a/myproject/myapp/views.py
+++ b/myproject/myapp/views.py
@@ -1,6 +1,14 @@
-from django.shortcuts import render
+from django.shortcuts import render, redirect
 from django.template import RequestContext
 
+from django.contrib.auth import authenticate, login, logout
+from django.contrib.auth.forms import UserCreationForm 
+from django.contrib.auth.models import User
+from django.contrib import messages
+
+from .forms import CustomRegistrationForm, LoginForm
+
+
 def index(request):
     return render(request, 'index.html')
 
@@ -20,8 +28,40 @@ def handler500(request, *args, **kwargs):
 def maintenance(request):
     return render(request, 'maintenance.html')
 
-def login(request):
-    return render(request, 'login.html')
+def user_login(request):
+    if request.method == 'POST':
+        form = LoginForm(request.POST)
+
+        if form.is_valid():
+            username = form.cleaned_data.get('username')
+            password = form.cleaned_data.get('password')
+
+            user = authenticate(request, username=username, password=password)  # Passing request along with username and password
+
+            if user:
+                login(request, user=user)  # Passing request along with user
+                return redirect('users')
+            else:
+                messages.error(request, 'Invalid username or password.')
+        else:
+            pass
+
+    else:
+        form = LoginForm()
+    return render(request, 'login.html', {'form': form})
+
 
 def register(request):
-    return render(request, 'register.html')
\ No newline at end of file
+    if request.method == 'POST':
+        form = CustomRegistrationForm(request.POST)
+        if form.is_valid():
+            form.save()
+            return redirect('user_login')
+    else:
+        form = CustomRegistrationForm()
+
+    return render(request, 'register.html', {'form': form})
+
+def user_logout(request):
+    logout(request)
+    return redirect('user_login')
diff --git a/myproject/myproject/settings.py b/myproject/myproject/settings.py
index 41a1691f3ad37378040ca69c9a03f7c7633ace46..a32ffa3dfec665deb4b89c4628b73d19b3f96d73 100644
--- a/myproject/myproject/settings.py
+++ b/myproject/myproject/settings.py
@@ -154,3 +154,5 @@ STATIC_URL = 'static/'
 DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
 
 IMAGE_URL = 'static/src/images/'
+
+LOGIN_REDIRECT_URL = '/'