It is possible to closely integrate frePPLe’s user interface in other web applications.
To create a exceptional and powerful user experience, frePPLe provides:
The implementation requires the following steps:
import jwt
import time
webtoken = jwt.encode(
{
'exp': round(time.time()) + 600, # Validity of the token
'user': USERNAME, # User name
'navbar': True # Whether or not frePPLe should render
# its navigation bar or not
},
'MY_SECRETKEY', # The shared secret between frePPLe and your application
algorithm='HS256'
).decode('ascii')
The external application needs to use an iframe to display frePPLe’s content in.
<iframe src="https://FREPPLE_URL/?webtoken=WEBTOKEN" width="100%" height="100%"
marginwidth="0" marginheight="0" frameborder="no" scrolling="yes" />
On frePPLe’s side the secret needs to be configured in the file djangosettings.py:
...
DATABASES = {
'default': {
...
SECRET_WEBTOKEN_KEY: 'MY_SECRETKEY',
...
}
}
...