Skip to content

Commit 0ea1b3b

Browse files
committedNov 14, 2018
heroku app- employee details
1 parent 3f281df commit 0ea1b3b

9 files changed

+330
-0
lines changed
 

‎Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn app:app

‎__pycache__/data.cpython-34.pyc

1.39 KB
Binary file not shown.

‎app.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from flask import Flask, render_template, request
2+
from data import empData
3+
app=Flask(__name__)
4+
5+
6+
emp = empData()
7+
8+
9+
@app.route('/')
10+
11+
def home():
12+
return render_template('home.html')
13+
14+
15+
@app.route('/employee')
16+
def emplo():
17+
return render_template('employee.html',empList=emp)
18+
19+
if(__name__ == '__main__'):
20+
app.run(debug=True)

‎data.py

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
def empData() :
2+
employees = [
3+
{
4+
'id' : 1,
5+
'name' : 'Sumesh',
6+
'dep' : 'Sales',
7+
'doj' : '10/11/2014',
8+
'salary' : '35,000',
9+
'mob' : 9633062855,
10+
'email' : 'jfzlma@gmail.com'
11+
},
12+
{
13+
'id' : 2,
14+
'name' : 'Ratheesh',
15+
'dep' : 'Sales',
16+
'salary' : '80,000',
17+
'doj' : '10/01/2014',
18+
'mob' : 9653265478,
19+
'email' : "fghehf@fgfg.cc"
20+
},
21+
{
22+
'id' : 3,
23+
'name' : 'Mahesh',
24+
'dep' : 'Support',
25+
'doj' : '25/01/2014',
26+
'salary' : '75,000',
27+
'mob' : 8893265478,
28+
'email' : "dfgdghgh@fgfg.cc"
29+
},
30+
{
31+
'id' : 4,
32+
'name' : 'Ganesh',
33+
'dep' : 'Service',
34+
'salary' : '55,000',
35+
'doj' : '25/01/2015',
36+
'mob' : 993265478,
37+
'email' : "asdfgh@fg.cc"
38+
},
39+
{
40+
'id' : 5,
41+
'name' : 'Sumesh',
42+
'dep' : 'Sales',
43+
'doj' : '10/11/2014',
44+
'salary' : '35,000',
45+
'mob' : 9633062855,
46+
'email' : 'jfzlma@gmail.com'
47+
},
48+
{
49+
'id' : 6,
50+
'name' : 'Ratheesh',
51+
'dep' : 'Sales',
52+
'salary' : '80,000',
53+
'doj' : '10/01/2014',
54+
'mob' : 9653265478,
55+
'email' : "fghehf@fgfg.cc"
56+
},
57+
{
58+
'id' : 7,
59+
'name' : 'Mahesh',
60+
'dep' : 'Support',
61+
'doj' : '25/01/2014',
62+
'salary' : '75,000',
63+
'mob' : 8893265478,
64+
'email' : "dfgdghgh@fgfg.cc"
65+
},
66+
{
67+
'id' : 8,
68+
'name' : 'Ganesh',
69+
'dep' : 'Service',
70+
'salary' : '55,000',
71+
'doj' : '25/01/2015',
72+
'mob' : 993265478,
73+
'email' : "asdfgh@fg.cc"
74+
},
75+
{
76+
'id' : 9,
77+
'name' : 'Sumesh',
78+
'dep' : 'Sales',
79+
'doj' : '10/11/2014',
80+
'salary' : '35,000',
81+
'mob' : 9633062855,
82+
'email' : 'jfzlma@gmail.com'
83+
},
84+
{
85+
'id' : 10,
86+
'name' : 'Ratheesh',
87+
'dep' : 'Sales',
88+
'salary' : '80,000',
89+
'doj' : '10/01/2014',
90+
'mob' : 9653265478,
91+
'email' : "fghehf@fgfg.cc"
92+
},
93+
{
94+
'id' : 11,
95+
'name' : 'Mahesh',
96+
'dep' : 'Support',
97+
'doj' : '25/01/2014',
98+
'salary' : '75,000',
99+
'mob' : 8893265478,
100+
'email' : "dfgdghgh@fgfg.cc"
101+
},
102+
{
103+
'id' : 12,
104+
'name' : 'Ganesh',
105+
'dep' : 'Service',
106+
'salary' : '55,000',
107+
'doj' : '25/01/2015',
108+
'mob' : 993265478,
109+
'email' : "asdfgh@fg.cc"
110+
}
111+
]
112+
return employees

‎requirements.txt

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
PAM==0.4.2
2+
Pillow==2.3.0
3+
Twisted-Core==13.2.0
4+
Twisted-Web==13.2.0
5+
adium-theme-ubuntu==0.3.4
6+
apt-xapian-index==0.45
7+
argparse==1.2.1
8+
astroid==1.6.5
9+
backports.functools-lru-cache==1.5
10+
beautifulsoup4==4.2.1
11+
chardet==2.0.1
12+
colorama==0.2.5
13+
command-not-found==0.3
14+
configparser==3.5.0
15+
cvxopt==1.1.4
16+
debtagshw==0.1
17+
decorator==3.4.0
18+
defer==1.0.6
19+
dirspec==13.10
20+
dnspython==1.11.1
21+
duplicity==0.6.23
22+
enum34==1.1.6
23+
fluendo-eula==0.6
24+
futures==3.2.0
25+
gyp==0.1
26+
html5lib==0.999
27+
httplib2==0.8
28+
isort==4.3.4
29+
joblib==0.7.1
30+
lazy-object-proxy==1.3.1
31+
lockfile==0.8
32+
lxml==3.3.3
33+
matplotlib==1.3.1
34+
mccabe==0.6.1
35+
nose==1.3.1
36+
numexpr==2.2.2
37+
numpy==1.8.2
38+
oauthlib==0.6.1
39+
oneconf==0.3.7
40+
openpyxl==1.7.0
41+
pandas==0.13.1
42+
patsy==0.2.1
43+
pexpect==3.1
44+
piston-mini-client==0.7.5
45+
pyOpenSSL==0.13
46+
pycrypto==2.6.1
47+
pycups==1.9.66
48+
pycurl==7.19.3
49+
pygobject==3.12.0
50+
pylint==1.9.3
51+
pyparsing==2.0.1
52+
pyserial==2.6
53+
pysmbc==1.0.14.1
54+
python-apt==0.9.3.5ubuntu1
55+
python-dateutil==1.5
56+
python-debian==0.1.21-nmu2ubuntu2
57+
python-distutils-extra==2.38
58+
pytz==2012c
59+
pyxdg==0.25
60+
reportlab==3.0
61+
requests==2.2.1
62+
scipy==0.13.3
63+
sessioninstaller==0.0.0
64+
simplejson==3.3.1
65+
singledispatch==3.4.0.3
66+
six==1.11.0
67+
software-center-aptd-plugins==0.0.0
68+
ssh-import-id==3.21
69+
statsmodels==0.5.0
70+
system-service==0.1.6
71+
tables==3.1.1
72+
ubuntu-cleaner==1.0.0
73+
unity-lens-photos==1.0
74+
urllib3==1.7.1
75+
vboxapi==1.0
76+
wheel==0.24.0
77+
wrapt==1.10.11
78+
wsgiref==0.1.2
79+
xdiagnose==3.6.3build2
80+
xlrd==0.9.2
81+
xlwt==0.7.5
82+
zope.interface==4.0.5

‎runtime.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python-3.6.6

‎templates/employee.html

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{% extends 'layout.html' %}
2+
3+
4+
{% block content %}
5+
6+
<br>
7+
<br>
8+
<h2>Employee Details</h2>
9+
<br>
10+
11+
<table class="table table-striped table-bordered">
12+
<thead class="thead-dark">
13+
<tr>
14+
<th scope="col">Id</th>
15+
<th scope="col">Name</th>
16+
<th scope="col">Department</th>
17+
<th scope="col">Salary</th>
18+
<th scope="col">Mobile</th>
19+
<th scope="col">Email</th>
20+
<th scope="col">Date of Joining</th>
21+
22+
</tr>
23+
</thead>
24+
<tbody>
25+
26+
{% for emp in empList %}
27+
<tr>
28+
<th scope="row>">{{emp.id}}</th>
29+
<td>{{emp.name}}</td>
30+
<td> {{emp.dep}} </td>
31+
<td> {{emp.salary}} </td>
32+
<td> {{emp.mob}} </td>
33+
<td> {{emp.email}} </td>
34+
<td> {{emp.doj}} </td>
35+
</tr>
36+
37+
{% endfor %}
38+
</tbody>
39+
</table>
40+
41+
42+
43+
44+
45+
<!-- {% for emp in empList %}
46+
<ul class="list-group">
47+
<li class="list-group-item active">Id : {{emp.id}} </li>
48+
<li class="list-group-item">Name : {{emp.name}} </li>
49+
<li class="list-group-item">Department : {{emp.dep}} </li>
50+
<li class="list-group-item">Date of Joining : {{emp.doj}} </li>
51+
<li class="list-group-item">Mobile : {{emp.mob}} </li>
52+
<li class="list-group-item">Email : {{emp.email}} </li>
53+
</ul> -->
54+
55+
56+
<!-- <div class="row">
57+
<div class="row">
58+
<div class="col-sm-6">Name :</div>
59+
<div class="col-sm-6"> <input type="text" placeholder={{emp.name}} class="form-control" readonly> </div>
60+
</div>
61+
</div> -->
62+
63+
64+
65+
66+
<!--
67+
{% endfor %} -->
68+
69+
{% endblock %}

‎templates/home.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% extends 'layout.html' %}
2+
3+
{% block content %}
4+
<br>
5+
<br>
6+
<div class="jumbotron">
7+
<h1>Welcome Home</h1>
8+
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo mollitia assumenda doloribus? Saepe, molestias impedit fuga, sed quaerat voluptate eos repudiandae dignissimos natus, adipisci ullam iure ducimus eaque quos incidunt.</p>
9+
</div>
10+
11+
{% endblock %}

‎templates/layout.html

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
7+
8+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
9+
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
10+
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
11+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
12+
13+
<title>Employee Data</title>
14+
</head>
15+
<body>
16+
<nav class="navbar navbar-expand-sm bg-dark navbar-dark">
17+
<ul class="navbar-nav">
18+
<li class="nav-item active"> <a class="nav-link" href="/" >Home</a></li>
19+
<li class="nav-item"> <a class="nav-link" href="/employee">Employee</a></li>
20+
21+
</ul>
22+
23+
</nav>
24+
<div class="container">
25+
{% block content %}
26+
27+
28+
{% endblock %}
29+
30+
</div>
31+
32+
33+
</body>
34+
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.