A web app for the Janelia Charity Club
This web app makes use of the python flask web framework. Please make sure you have Python 3 installed on your system.
First of all, clone the repo to your local computer. In a command line, type
$ git clone git@github.com:WomensCodingCircle/jcc-app.gitNavigate to the folder jcc-app, then type
$ virtualenv --no-site-packages env
$ source env/bin/activate
$ pip install --upgrade pip
$ pip install -r requirements.txtIf you get an error with the itsdangerous package, type
$ pip install git+https://github.com/pallets/itsdangerous.git@master\##egg\=itsdangerousand just install the requirements textfile again. If the installation runs successfully, you need to run a database migration. Set the FLASK_APP environment variable with
$ export FLASK_APP=app/__init__.pyThen run the database migration with
$ flask db upgradeIf that worked out, you should be able to start the application with
$ python run.pyNow just open the URL which is printed out after 'Running on..' in a browser and you'll see your Flask app there!
A database migration is a script, which describes the changes to the schema of a data model. Right now, we are using the flask-migrate module to create database migrations:
https://flask-migrate.readthedocs.io/en/latest/
If you changed the data model of the application, you need to run the database migration again. If you haven't done so already, set the FLASK_APP environment variable
$ export FLASK_APP=app/__init__.pyCreate a migration:
$ flask db migrateApply the migration:
$ flask db upgradeLog into the VM and find the app under
/var/www/projects/jcc-appGet the latest version of the app from Github:
$ git fetch
$ git rebase origin/masterRestart the service for the app:
$ sudo systemctl restart jcc-app