Name: cookiecutter
Owner: The Hyve
Description: Cookiecutter boilerplate for tranSMART data portal. Based on hack4impact flask-base
Created: 2017-05-05 13:15:02.0
Updated: 2017-05-26 16:59:40.0
Pushed: 2017-06-23 10:32:52.0
Homepage: null
Size: 8199
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|---|---|
Piotr Zakrzewski | 2017-05-26 12:24:47.0 | 12 |
Other Committers
User | Most Recent Commit | # Commits | |
---|---|---|---|
Piotr Zakrzewski | piotr@thehyve.nl | 2017-06-23 10:32:50.0 | 40 |
This is a simple request portal with basic support for codebooks and file sharing. It is capable of extracting requested variables from tranSMART ver 1.2. Adapting it to higher version is easily possible. Use config.env to configure which transmart instance to integrate with.
TRANSMART_URL=https://domain.com/transmart
Log in as an admin (see flask-base docs below for details on configuration) and sync studies using Admin Dashboard/tranSMART config
A Flask application template with the boilerplate code already done for you.
Documentation available at http://hack4impact.github.io/flask-base.
Home Page:
Registering User:
Admin Editing Page:
Admin Editing Users:
t clone https://github.com/hack4impact/flask-base.git
flask-base
p install virtualenv
rtualenv -p /path/to/python3.x/installation env
urce env/bin/activate
For mac users it will most likely be
p install virtualenv
rtualenv -p python3 env
urce env/bin/activate
Note: if you are using a python2.x version, point the -p value towards your python2.x path
ode-select --install
Create a file called config.env
that contains environment variables in the following syntax: ENVIRONMENT_VARIABLE=value
. For example,
the mailing environment variables can be set as the following. We recommend using Sendgrid for a mailing SMTP server. But anything else will work as well.
_USERNAME=SendgridUsername
_PASSWORD=SendgridPassword
ET_KEY=SuperRandomStringToBeUsedForEncryption
Other Key value pairs:
ADMIN_EMAIL
: set to the default email for your first admin account (default is flask-base-admin@example.com
)ADMIN_PASSWORD
: set to the default password for your first admin account (default is password
)DATABASE_URL
: set to a postgresql database url (default is data-dev.sqlite
)REDISTOGO_URL
: set to Redis To Go URL or any redis server url (default is http://localhost:6379
)RAYGUN_APIKEY
: api key for raygun (default is None
)FLASK_CONFIG
: can be development
, production
, default
, heroku
, unix
, or testing
. Most of the time you will use development
or production
.Note: do not include the config.env
file in any commits. This should remain private.
p install -r requirements.txt
You need to Redis, and Sass. Chances are, these commands will work:
Sass:
m install sass
Redis:
Mac (using homebrew):
ew install redis
Linux:
do apt-get install redis-server
You will also need to install PostgresQL
Mac (using homebrew):
install postgresql
Linux (based on this issue):
apt-get install libpq-dev
thon manage.py recreate_db
thon manage.py setup_dev
Note that this will create an admin user with email and password specified by the ADMIN_EMAIL
and ADMIN_PASSWORD
config variables. If not specified, they are both flask-base-admin@example.com
and password
respectively.
thon manage.py add_fake_data
urce env/bin/activate
ncho start -f Local
For Windows users having issues with binding to a redis port locally, refer to this issue.
Before you submit changes to flask-base, you may want to auto format your code with python manage.py format
.
Contributions are welcome! Check out our Waffle board which automatically syncs with this project's GitHub issues. Please refer to our Code of Conduct for more information.
To make changes to the documentation refer to the Mkdocs documentation for setup.
To create a new documentation page, add a file to the docs/
directory and edit mkdocs.yml
to reference the file.
When the new files are merged into master
and pushed to github. Run mkdocs gh-deploy
to update the online documentation.
https://medium.freecodecamp.com/how-we-got-a-2-year-old-repo-trending-on-github-in-just-48-hours-12151039d78b#.se9jwnfk5