Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Python FF tutorial
# Clone the repo, move the files around and clean up the folder
git clone https://github.com/chrisjws-harness/flaskSaaS.git && mv flaskSaaS/*(DN) . && rm -rf flaskSaaS
# Setup and run the application
make install && make dev
python manage.py initdb
harness-featureflags==1.0.5
pip3 install -r requirements.txt
from featureflags.client import CfClient, Target
meta = {
"account": "<your account id here>",
"org": "default",
"environment": "PyCharm",
"project": "Python_FF"
}
try:
api_key = "<your key>"
cf = CfClient(api_key)
ff_identifier = "guest"
ff_name = "guest"
target = Target(identifier=ff_identifier, name=ff_name, **meta)
except Exception as e:
print(e)
flags["welcome_text"] = cf.string_variation("message", target, "test")
python manage.py runserver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment