Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified MyProfiles/Index/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified MyProfiles/Index/__pycache__/views.cpython-38.pyc
Binary file not shown.
16 changes: 11 additions & 5 deletions MyProfiles/Index/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
from MyProfiles import settings
from django.contrib.auth.hashers import make_password

class User(models.Model):
user_name = models.CharField(max_length = 264, null = False)
password = models.CharField(max_length = 32, null = False)

# Create your models here.
class Profile(models.Model):
'''Profile data table handles the username and passwords of other websites for each respective user'''
# user_id = models.ForeignKey(models.LogIn, on_delete = models.CASCADE)
social_media = models.CharField(max_length = 264, null = True)
user_name = models.CharField(max_length = 264, null = True)
password = models.CharField(max_length = 1000, null = True)

def __str__(self):
return self.name
return self.name

# class LogIn(models.Model):
# '''LogIn data table consists of user name and password to login to the MyProfiles portal'''
# user_name = models.CharField(max_length = 264, unique = True)
# password = models.CharField(max_length = 1000, null = True)

# def __str__(self):
# return self.name
28 changes: 16 additions & 12 deletions MyProfiles/Index/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
from Index.models import Profile

# Create your views here.
def add(request):
return render(request, 'Index/add_account.html')

def login(request):
return render(request, 'Index/login.html')
def index(request):
return render(request, 'Index/register.html')

def list_sites(request):
sites_list = {}
Expand Down Expand Up @@ -35,6 +32,19 @@ def register(request):
)
return render(request, 'Index/success.html')

# def login(request):
# if request.method == 'POST':
# user_name = request.POST.get('inputUserName')
# password = request.POST.get('inputPassword')
# try:
# password_check = LogIn(user_name = user_name)
# except:
# print('No such user')
# if password_check == pbkdf2_sha256.encrypt(password, rounds = 12000, salt_size = 32):
# return render(request, 'Index/list.html')
# else:
# print('Password Incorrect')

def remove(request):
if request.method == 'POST':
social_media_site = request.POST.get('inputSocialMedia')
Expand All @@ -49,10 +59,4 @@ def remove(request):
return render(request, 'Index/success.html')

def contact(request):
return render(request, 'Index/contact.html')

def privacy(request):
return render(request, 'Index/privacy.html')

def terms(request):
return render(request, 'Index/terms.html')
return render(request, 'Index/contact.html')
Binary file modified MyProfiles/MyProfiles/__pycache__/urls.cpython-38.pyc
Binary file not shown.
7 changes: 2 additions & 5 deletions MyProfiles/MyProfiles/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@

urlpatterns = [
path('admin/', admin.site.urls),
re_path(r'^add$', views.add, name = "add"),
re_path(r'^login/$', views.login, name = "login"),
path('', views.index, name = "index"),
re_path(r'^register/$', views.register, name = "register"),
re_path(r'^list/$', views.list_sites, name = "list"),
re_path(r'^remove/$', views.remove, name='remove'),
re_path(r'^contact/$', views.contact, name='contact'),
re_path(r'^privacy/$', views.privacy, name='privacy'),
re_path(r'^terms/$', views.terms, name='terms'),
re_path(r'^login/$', views.login, name='login')
# re_path(r'^login/$', views.login, name='login')
]
5 changes: 3 additions & 2 deletions MyProfiles/templates/Index/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
background-color: antiquewhite;
font-size: larger;
text-align: center;
width: 858w;
height: 78vh;
width: 100vw;
height: 100vh;
padding: 5%;
}
</style>
Expand All @@ -21,6 +21,7 @@
This page is maintaiend and handled by FreeWare lovers. <br>
Go through our GitHub page for any information. <br>
<a href="https://github.com/freewarelovers">GitHub</a>

</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<body style="background-color: rgb(207, 207, 207);">
<div>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="/">My Profiles</a>
<a class="navbar-brand" href="#">My Profiles</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
Expand All @@ -36,28 +36,13 @@
</nav>
</div>
<div>
<form action="/" method="post">
{% csrf_token %}
<div class="jumbotron jumbotron-fluid" style="padding: 5% 20% 5% 20%;">
<div class="form-group">
<label for="inputUserName">User Name of Scial media site</label>
<input type="text" class="form-control" id="inputUserName" name="inputUserName" placeholder="Enter User Name">
<small class="form-text text-muted">We'll never share your user name with anyone.</small>
</div>
<div class="form-group">
<label for="inputPassowrd">Password</label>
<input type="password" class="form-control" id="inputPassowrd" name="inputPassowrd" placeholder="Enter Password">
</div>
<br>
<button type="submit" class="btn btn-primary btn-lg" style="position: absolute; left: 45%;">Submit</button>
<br><br><br><br><br>
</div>
</form>
{% block body_block %}
{% endblock %}
</div>
<div style="position: absolute; bottom: 0%; padding-left: 5%; padding-bottom: 1.5%;">
<p> &#9742; <a href="/contact">Contact</a></p>
<p> &#x1f512; <a href="/privacy">Privacy</a></p>
<p> &#9989; <a href="/terms">Terms</a></p>
<div style="position: absolute; bottom: 0%; padding: 5%">
<p> &#9742; <a href="/contact" target="_blank" rel="noopener noreferrer">Contact</a></p>
<p> &#x1f512; <a href="" target="_blank" rel="noopener noreferrer">Privacy</a></p>
<p> &#9989; <a href="" target="_blank" rel="noopener noreferrer">Terms</a></p>
<p> &copy Copyrights</p>
</div>
</body>
Expand Down
2 changes: 1 addition & 1 deletion MyProfiles/templates/Index/list.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "Index/home.html" %}
{% extends "Index/index.html" %}
{% block body_block %}
<style>
table, th, td {
Expand Down
66 changes: 18 additions & 48 deletions MyProfiles/templates/Index/login.html
Original file line number Diff line number Diff line change
@@ -1,49 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Profiles</title>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">

<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background-color: rgb(207, 207, 207);">
<div>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="/">My Profiles</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</nav>
</div>
<form action="add" method="post">
{% csrf_token %}
<div class="jumbotron jumbotron-fluid" style="padding: 5% 20% 5% 20%;">
<div class="form-group">
<label for="inputUserName">User Name</label>
<input type="text" class="form-control" id="inputUserName" name="inputUserName" placeholder="Enter User Name">
<small class="form-text text-muted">We'll never share your user name with anyone.</small>
</div>
<div class="form-group">
<label for="inputPassowrd">Password</label>
<input type="password" class="form-control" id="inputPassowrd" name="inputPassowrd" placeholder="Enter Password">
</div>
<br>
<button type="submit" class="btn btn-primary btn-lg" style="position: absolute; left: 45%;">Submit</button>
<br><br><br><br><br>
{% extends "Index/index.html" %}
{% block body_block %}
<div>
<div class="jumbotron jumbotron-fluid" style="padding: 5% 20% 5% 20%;">
<form action="{% url 'register' %}" method = "POST">
{% csrf_token %}
<div class="form-group">
<label for="inputUserName">User Name</label>
<input type="text" class="form-control" id="inputUserName" name="inputUserName" placeholder="Enter User Name">
</div>
<div class="form-group">
<label for="inputPassowrd">Password</label>
<input type="password" class="form-control" id="inputPassowrd" name="inputPassowrd" placeholder="Enter Password">
</div>
<button type="submit" class="btn btn-primary btn-lg">Submit</button>
</form>
</div>
</form>
<div style="position: absolute; bottom: 0%; padding-left: 5%; padding-bottom: 1.5%;">
<p> &#9742; <a href="/contact">Contact</a></p>
<p> &#x1f512; <a href="/privacy">Privacy</a></p>
<p> &#9989; <a href="/terms">Terms</a></p>
<p> &copy Copyrights</p>
</div>
</body>
</html>
</div>
{% endblock %}
26 changes: 0 additions & 26 deletions MyProfiles/templates/Index/privacy.html

This file was deleted.

2 changes: 1 addition & 1 deletion MyProfiles/templates/Index/register.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "Index/home.html" %}
{% extends "Index/index.html" %}
{% block body_block %}
<div>
<div class="jumbotron jumbotron-fluid" style="padding: 5% 20% 5% 20%;">
Expand Down
2 changes: 1 addition & 1 deletion MyProfiles/templates/Index/remove.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "Index/home.html" %}
{% extends "Index/index.html" %}

{% block body_block %}
<div>
Expand Down
2 changes: 1 addition & 1 deletion MyProfiles/templates/Index/success.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "Index/home.html" %}
{% extends "Index/index.html" %}
{% block body_block %}
<div class="jumbotron jumbotron-fluid" style="padding: 5% 20% 5% 20%;">
<p>You have succesfully registered a new social media site!!!</p>
Expand Down
26 changes: 0 additions & 26 deletions MyProfiles/templates/Index/terms.html

This file was deleted.