Skip to content

Commit f60dabd

Browse files
committed
Initial commit
0 parents  commit f60dabd

20 files changed

+167
-0
lines changed

.env

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FLASK_APP=jobs.app
2+
FLASK_ENV=development

.gitignore

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
MANIFEST
27+
28+
# PyInstaller
29+
# Usually these files are written by a python script from a template
30+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
31+
*.manifest
32+
*.spec
33+
34+
# Installer logs
35+
pip-log.txt
36+
pip-delete-this-directory.txt
37+
38+
# Unit test / coverage reports
39+
htmlcov/
40+
.tox/
41+
.coverage
42+
.coverage.*
43+
.cache
44+
nosetests.xml
45+
coverage.xml
46+
*.cover
47+
.hypothesis/
48+
.pytest_cache/
49+
50+
# Flask stuff:
51+
instance/
52+
.webassets-cache
53+
54+
# pyenv
55+
.python-version
56+
57+
# Editors
58+
.vscode
59+
.idea
60+
61+
# macOS
62+
.DS_Store
63+
64+
# Virtualenv
65+
venv/

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Build a Job Board with Python & Flask

jobs/__init__.py

Whitespace-only changes.

jobs/app.py

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import sqlite3
2+
from flask import Flask, render_template
3+
4+
app = Flask(__name__)
5+
6+
db = sqlite3.connect(
7+
'jobs/db.sqlite3', detect_types=sqlite3.PARSE_DECLTYPES
8+
)
9+
10+
# Job
11+
# Title
12+
# Description
13+
# Salary
14+
# Tag
15+
16+
@app.route('/')
17+
@app.route('/jobs')
18+
def jobs():
19+
return render_template('index.html')
20+
21+
22+
@app.route('/job/<job_id>')
23+
def job(job_id):
24+
return render_template('job.html')
25+
26+
# Employer
27+
# name
28+
# description
29+
# address
30+
31+
# Review
32+
# rating
33+
# title
34+
# date
35+
# status (current/former)
36+
37+
@app.route('/employer/<employer_id>')
38+
def employer(employer_id):
39+
return render_template('employer.html')
40+
41+
# User
42+
# username
43+
# password
44+
# name
45+
# email
46+
# phone
47+
# role_id
48+
49+
# Role
50+
# type
51+
52+
53+
@app.route('/user/<user_id>')
54+
def user(user_id):
55+
return render_template('user.html')
56+
57+
58+
@app.route('/admin')
59+
def admin():
60+
return render_template('admin.html')

jobs/db.sqlite3

32 KB
Binary file not shown.

jobs/static/css/styles.css

Whitespace-only changes.

jobs/templates/admin.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% block content %}
2+
<h1>Admin</h1>
3+
{% endblock %}

jobs/templates/employer.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% block content %}
2+
<h1>Employer</h1>
3+
{% endblock %}

jobs/templates/index.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% block content %}
2+
<h1>Index</h1>
3+
{% endblock %}

jobs/templates/job.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% block content %}
2+
<h1>Job</h1>
3+
{% endblock %}

jobs/templates/layout.html

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title></title>
5+
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
6+
</head>
7+
<body>
8+
{% block content %}
9+
{% endblock %}
10+
</body>
11+
</html>

jobs/templates/user.html

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% block content %}
2+
<h1>User</h1>
3+
{% endblock %}

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Flask==1.0.2
2+
pytest==3.6.3
3+
python-dotenv==0.8.2

tests/__init__.py

Whitespace-only changes.

tests/test_module1.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import pytest
2+
import sys
3+
import pprint
4+
5+
from jobs import app
6+
7+
@pytest.mark.testing_import
8+
def test_import():
9+
imports = ['os','Flask', 'sqlite3']
10+
types = [v + ':' + str(eval('type(app.' + v + ')')) for v in dir(app) if not v.startswith("__") and v not in imports]

tests/test_module2.py

Whitespace-only changes.

tests/test_module3.py

Whitespace-only changes.

tests/test_module4.py

Whitespace-only changes.

tests/test_module5.py

Whitespace-only changes.

0 commit comments

Comments
 (0)