-
Notifications
You must be signed in to change notification settings - Fork 0
Development
each entry point of the application must instanciate a config object with an explicit
path to a configuration file before any other mobyle module import.
for instance:
import mobyle.common.config
cfg = mobyle.common.config.Config(file = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'development.ini')))
this will create a kind of singleton of the config object, so the other call to config just return this object. if you have a warning with the followin message: > No configuration file available, using defaults then you need to check carefully the config object.
- Create your class using MongoKit syntax ;-)
- import object connection from the mobyle.common.connection module.
- to register the class in mongokit add the decorator @connection.register
- if you need to use an object from mongokit you need to import the module
- If object need to be added to the web dashboard, on mobyle.web://mobyle/web/init.py, add your object to the Dashboard.register() method call.
https://api.travis-ci.org/repos/USERNAME/PROJECTNAME/builds
To configure a log handler with errbit, add airbrakepy to requirements and add to config file:
[handler_errbitHandler]
class=airbrakepy.logging.handlers.AirbrakeHandler
level=DEBUG
args=(api_key="xxx", environment="dev", component_name="mobyle", node_name="mytestserver", use_ssl=False, timeout_in_ms=3000, airbrake_url="http://localhost:3000/notifier_api/v2/notices")
Do not forget to call logging.shutdown() to clean the logging on application shudown