Project for the course "Software Development"
This is the main project structure:
chalktalk
├── chalktalk # Python files
│ ├── static # Static files (css, js, images)
│ │ ├── css
│ │ ├── fonts
│ │ ├── images
│ │ └── js
│ └── templates # Jinja2 HTML templates
├── runserver.py # Script file used to launch application
├── setup_test_db.py # Script to set up a database with dummy values
└── tests # Unit & integration tests
Do the following steps to set up a development instance of the program.
Make sure Python 3 and SQLite3 are installed.
pip3 install virtualenv
git clone https://github.com/frestr/chalktalk.git
virtualenv chalktalk
For Linux/Mac:
source chalktalk/bin/activate
cd chalktalk
For Windows:
chalktalk/Scripts/activate.bat
cd chalktalk
pip3 install -r requirements.txt
Copy the settings example file:
cp chalktalk/settings.py.example chalktalk/settings.py
and change the content of settings.py to contain the file location of the database (doesn't have to exist yet).
For example, if the database file is located in the project root directory, the file path can be
DATABASE_URL = 'sqlite:///database.db'
Copy the secret settings example file:
cp chalktalk/secret_settings.py.example chalktalk/secret_settings.py
and change the cookie signing key and the Dataporten OAUTH credentials. If Dataporten is not to be used, the values should be kept unchanged.
If you want to generate a test database with some dummy values, do
./setup_test_db.py
cp dummy.db database.db
If not, just make sure the database file exists:
touch database.db
For Linux/Mac:
export FLASK_APP=runserver.py
flask run
For Windows:
set FLASK_APP=runserver.py
flask run
To run the tests, do:
python -m unittest discover
in the project root directory