ColeReinhart / red-portal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TSCT Portal

Build Status

The unofficial learning management system for Thaddeus Stevens College of Technology built on Python, Flask, and PostgreSQL.

Installation

Create a virtual environment then install the project:

$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ pip install -e .

Developer dependencies can be installed with:

(venv) $ pip install -e '.[test]'

Flask commands require the following environment variables to be set:

(venv) $ export FLASK_APP=portal
(venv) $ export FLASK_ENV=development

Database Setup

To run the application locally, you need a running instance of PostgreSQL. Create a database and user according to the configuration settings in portal/__init__.py. Then you can run the following command to create the necessary tables:

(venv) $ flask init-db

If you want to run tests, you'll have to create a second database according to the configuration in tests/conftest.py.

Running The App

(venv) $ flask run

Tests and Coverage

(venv) $ pytest
(venv) $ pytest -v
(venv) $ coverage run -m pytest

The first command will run the test functions defined in the tests/ directory. The second gives a more detailed output. Run the third command to generate a report of the code covered by the tests. You can view this report in the terminal with coverage report or with more detail in the browser with coverage html.

About


Languages

Language:Python 79.7%Language:HTML 15.8%Language:CSS 4.5%