Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0xp3p3x0 committed Jul 26, 2018
0 parents commit 323e78e
Show file tree
Hide file tree
Showing 20 changed files with 167 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FLASK_APP=jobs.app
FLASK_ENV=development
65 changes: 65 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Flask stuff:
instance/
.webassets-cache

# pyenv
.python-version

# Editors
.vscode
.idea

# macOS
.DS_Store

# Virtualenv
venv/
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Build a Job Board with Python & Flask
Empty file added jobs/__init__.py
Empty file.
60 changes: 60 additions & 0 deletions jobs/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import sqlite3
from flask import Flask, render_template

app = Flask(__name__)

db = sqlite3.connect(
'jobs/db.sqlite3', detect_types=sqlite3.PARSE_DECLTYPES
)

# Job
# Title
# Description
# Salary
# Tag

@app.route('/')
@app.route('/jobs')
def jobs():
return render_template('index.html')


@app.route('/job/<job_id>')
def job(job_id):
return render_template('job.html')

# Employer
# name
# description
# address

# Review
# rating
# title
# date
# status (current/former)

@app.route('/employer/<employer_id>')
def employer(employer_id):
return render_template('employer.html')

# User
# username
# password
# name
# email
# phone
# role_id

# Role
# type


@app.route('/user/<user_id>')
def user(user_id):
return render_template('user.html')


@app.route('/admin')
def admin():
return render_template('admin.html')
Binary file added jobs/db.sqlite3
Binary file not shown.
Empty file added jobs/static/css/styles.css
Empty file.
3 changes: 3 additions & 0 deletions jobs/templates/admin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
<h1>Admin</h1>
{% endblock %}
3 changes: 3 additions & 0 deletions jobs/templates/employer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
<h1>Employer</h1>
{% endblock %}
3 changes: 3 additions & 0 deletions jobs/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
<h1>Index</h1>
{% endblock %}
3 changes: 3 additions & 0 deletions jobs/templates/job.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
<h1>Job</h1>
{% endblock %}
11 changes: 11 additions & 0 deletions jobs/templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
3 changes: 3 additions & 0 deletions jobs/templates/user.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% block content %}
<h1>User</h1>
{% endblock %}
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Flask==1.0.2
pytest==3.6.3
python-dotenv==0.8.2
Empty file added tests/__init__.py
Empty file.
10 changes: 10 additions & 0 deletions tests/test_module1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pytest
import sys
import pprint

from jobs import app

@pytest.mark.testing_import
def test_import():
imports = ['os','Flask', 'sqlite3']
types = [v + ':' + str(eval('type(app.' + v + ')')) for v in dir(app) if not v.startswith("__") and v not in imports]
Empty file added tests/test_module2.py
Empty file.
Empty file added tests/test_module3.py
Empty file.
Empty file added tests/test_module4.py
Empty file.
Empty file added tests/test_module5.py
Empty file.

0 comments on commit 323e78e

Please sign in to comment.