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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions .idea/django-password-generator.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Images/Screenshot (31).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Images/Screenshot (32).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Django Password Generator
> <img src="https://github.com/Amir10t/django-password-generator/blob/master/Images/Screenshot%20(31).png" width=49.5%>
> <img src="https://github.com/Amir10t/django-password-generator/blob/master/Images/Screenshot%20(32).png" width=49.5%>
Binary file added generator/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file added generator/__pycache__/admin.cpython-312.pyc
Binary file not shown.
Binary file added generator/__pycache__/apps.cpython-312.pyc
Binary file not shown.
Binary file added generator/__pycache__/models.cpython-312.pyc
Binary file not shown.
Binary file added generator/__pycache__/views.cpython-312.pyc
Binary file not shown.
Binary file not shown.
3 changes: 0 additions & 3 deletions generator/templates/generator/about.html

This file was deleted.

78 changes: 50 additions & 28 deletions generator/templates/generator/home.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<div class="container text-center">
<h1>Password Generator</h1>

<form action="{% url 'password' %}">
<select name="length">
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12" selected="selected">12</option>
<option value="13">13</option>
<option value="14">14</option>
</select> Length
<br>
<input type="checkbox" name="uppercase"> Uppercase
<br>
<input type="checkbox" name="numbers"> Numbers
<br>
<input type="checkbox" name="special"> Special Characters
<br>

<input type="submit" value="Generate Password" class="btn btn-primary">
</form>
</div>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
body {
background: rgba(146,253,243,0.8);
background: linear-gradient(56deg,rgba(241,243,146,1) 0%, rgba(146,253,243,0.8) 81%);
background: -moz-linear-gradient(34deg,rgba(241,243,146,1) 0%, rgba(146,253,243,0.8) 81%);
background: -webkit-linear-gradient(34deg,rgba(241,243,146,1) 0%, rgba(146,253,243,0.8) 81%);
background: -o-linear-gradient(34deg,rgba(241,243,146,1) 0%, rgba(146,253,243,0.8) 81%);
background: -ms-linear-gradient(34deg,rgba(241,243,146,1) 0%, rgba(146,253,243,0.8) 81%);
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr="rgba(241,243,146,1)", endColorstr="rgba(146,253,243,0.8)");
background-repeat: no-repeat;
background-attachment: fixed;
height: 1%;
}
</style>
</head>
<body>
<div class="container text-center">
<h1 style="color: white">Password Generator</h1>

<form action="{% url 'password' %}">
{# <select name="length">#}
{# <option value="6">6</option>#}
{# <option value="7">7</option>#}
{# <option value="8">8</option>#}
{# <option value="9">9</option>#}
{# <option value="10">10</option>#}
{# <option value="11">11</option>#}
{# <option value="12" selected="selected">12</option>#}
{# <option value="13">13</option>#}
{# <option value="14">14</option>#}
{# </select> Length#}
<input type="number" max="72" value="1" name="length"> : Length
<br>
<input type="checkbox" name="uppercase"> Uppercase
<br>
<input type="checkbox" name="numbers"> Numbers
<br>
<input type="checkbox" name="special"> Special Characters
<br>

<input type="submit" value="Generate Password" class="btn btn-primary">

<p class="fixed-bottom">Upgraded by <a href="https://github.com/Amir10t/" target="_blank">Amir Talebi</a>
</form>
</div>
</body>
</html>
33 changes: 26 additions & 7 deletions generator/templates/generator/password.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">

<div class="container text-center">
<h1>Your password is:</h1>
<h2 class="alert alert-success">{{ password }}</h2>
<a href="{% url 'home' %}" class="btn btn-info">Home</a>
</div>
<html>
<head>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<style>
body {
background: rgba(243,122,301,1);
background: linear-gradient(296deg,rgba(245,243,122,0.8) 0%, rgba(243,122,301,1) 38%);
background: -moz-linear-gradient(154deg,rgba(245,243,122,0.8) 0%, rgba(243,122,301,1) 38%);
background: -webkit-linear-gradient(154deg,rgba(245,243,122,0.8) 0%, rgba(243,122,301,1) 38%);
background: -o-linear-gradient(154deg,rgba(245,243,122,0.8) 0%, rgba(243,122,301,1) 38%);
background: -ms-linear-gradient(154deg,rgba(245,243,122,0.8) 0%, rgba(243,122,301,1) 38%);
filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr="rgba(245,243,122,0.8)", endColorstr="rgba(243,122,301,1)");
background-repeat: no-repeat;
background-attachment: fixed;
height: 1%;
}
</style>
</head>
<body>
<div class="container text-center">
<h1 style="color: white">Your password is:</h1>
<h2 class="alert alert-success">{{ password }}</h2>
<a href="{% url 'home' %}" class="btn btn-info">Home</a>
</div>
</body>
</html>
8 changes: 3 additions & 5 deletions generator/views.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
from django.shortcuts import render
from django.http import HttpResponse
import random

# Create your views here.

def home(request):
return render(request, 'generator/home.html')

def about(request):
return render(request, 'generator/about.html')

def password(request):
characters = list('abcdefghijklmnopqrstuvwxyz')

Expand All @@ -20,7 +16,9 @@ def password(request):
if request.GET.get('numbers'):
characters.extend(list('0123456789'))

length = int(request.GET.get('length',12))
length = int(request.GET.get('length',12)) if request.GET.get('length')!='' else 12
if length > 72:
length = 72

thepassword = ''
for x in range(length):
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added password_generator/__pycache__/wsgi.cpython-312.pyc
Binary file not shown.
1 change: 0 additions & 1 deletion password_generator/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@
urlpatterns = [
path('', views.home, name='home'),
path('password/', views.password, name='password'),
path('about/', views.about, name='about'),
]