.. _manage_defernia.py: .. program:: manage_defernia.py :program:`manage_defernia.py` --- Defernia manager script ========================================================= This scripts provides several subcommands that manage Defernia instances. .. option:: -c config --config config Required option. It specify the path of a configruation file. If there's no such file, it confirms would you create a such file. .. sourcecode:: console $ manage_defernia.py --config instance.cfg instance.cfg doesn't exist yet; would you create it? [y] .. option:: -h --help Show the help message and exit. .. _manage_defernia.py-initdb: .. program:: manage_defernia.py initdb :program:`manage_defernia.py initdb` --- Database initialization ---------------------------------------------------------------- Creates tables into a database. .. sourcecode:: console $ manage_defernia.py initdb --config instance.cfg It doesn't print anything unless errors happened. .. _manage_defernia.py-runserver: .. program:: manage_defernia.py runserver :program:`manage_defernia.py runserver` --- Builtin development web server -------------------------------------------------------------------------- Runs the development web server. .. sourcecode:: console $ manage_defernia.py runserver --config instance.cfg * Running on http://127.0.0.1:5000/ .. option:: -t host --host host The host to bind. Default is ``127.0.0.1``. .. option:: -p port --port port The port number to bind. Default is 5000. .. option:: -d --no-debug Disables the debug mode. Debug mode enabled by default. .. option:: -r --no-reload Don't reload automatically even if a file has changed. .. _manage_defernia.py-shell: .. program:: manage_defernia.py shell :program:`manage_defernia.py shell` --- Interactive shell --------------------------------------------------------- It's similar to Python builtin interactive shell, but it also includes the following variables in the global scope: :data:`engine` (:class:`sqlalchemy.engine.base.Engine`) The SQLAlchemy connection to the database spcified by configuration. :data:`session` (:class:`defernia.orm.Session`) The SQLAlchemy session bound to the above :data:`engine`. :data:`~flask.g` The context local globals provided by Flask. :data:`app ` (:class:`flask.Flask`) The Flask application instance. :mod:`defernia` (module) Defernia top-level package. :class:`~defernia.user.User` (class) Defernia user model class. .. sourcecode:: console $ manage_defernia.py shell -c dev.cfg >>> Internal API ------------ .. automodule:: manage_defernia :members: