ConfigurationΒΆ

Gepppetto has a default configuration which can be found in in conf/default.py.

import os

_cur_path = os.path.dirname(os.path.abspath(__name__))

# General Flask configuration.
DEBUG = False
TESTING = False
LOGIN_DISABLED = False
SECRET_KEY = '?\xbf,\xb4\x8d\xa3"<\x9c\xb0@\x0f5\xab,w\xee\x8d$0\x13\x8b83'

# SQLAlchemy specific configuration.
SQLALCHEMY_DATBASE_URI = 'sqlite:///%s/data/geppettov.db' % _cur_path

# Geppetto specific configuration.
# Use mocks when GPIO are not available on system.
MOCK_PINS = False

If you want to override the default settings you can add config file inside the conf directory and override the settings you want to be configured differently. Assume you want to have DEBUG and LOGIN_DISABLED enabled during development. Save the following data to conf/dev.py.

DEBUG = True
LOGIN_DISABLED = True

In order to use this config, export the name of the config file (without suffix .py) to GEPPETTO_ENV and start Geppetto.

$ export GEPPETO_ENV=dev
$ ./server.py

Related Topics

This Page

Fork me on GitHub