Skip to main content

Manage script support for Khufu/Pyramid apps

Project description

Overview

khufu_script provides a manage script for Khufu/Pyramid projects. Following the usual Khufu opinions, certain commands assume you are using SQLAlchemy to manage your data.

Usage

Using khufu_script is as easy defining the runner and registering it with disutils console_script entry point.

As an example, consider a Pyramid-based web app with a distribution name of “NoteTaker” and a main package of “notetaker”.

First create notetaker/manage.py with the following content:

import khufu_script
settings = {
    'sqlalchemy.url': 'sqlite:///notetaker.db'
}
main = khufu_script.make_manager(name='NoteTaker',
                                 app_factory='notetaker.app',
                                 config_filename='notetaker-settings.ini',
                                 settings=settings,
                                 db_metadatas=['notetaker.models.Base.metadata']).main
if __name__ == '__main__':
    main()

Next make adjustments to setup.py:

from setuptools import setup

setup(name='NoteTaker',
      # ...
      entry_points={
        'console_scripts': [
            'notetaker-manage = notetaker.manage:main',
            ]
        }
      )

After installing your app you can launch your app by typing:

$ notetaker-manage

Or by running the module directly:

$ python -m notetaker.manage

Available Commands

Commands:
    runserver             Run a reloadable development web server.
    loaddata              Add data based on the YAML from filename
    shell                 Launch a Python shell
    syncdb                Ensure all database tables exist

Credits

Created and maintained by Rocky Burt <rocky AT serverzen DOT com>.

Changes

0.6 (May-14-2011)

  • first release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

khufu_script-0.6.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file khufu_script-0.6.tar.gz.

File metadata

  • Download URL: khufu_script-0.6.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for khufu_script-0.6.tar.gz
Algorithm Hash digest
SHA256 757eeb0618dcfee60f021dd0d44fbc59d41ceac974f4d73413172fcae5650461
MD5 a5c785baae64eb7e681fd1e61259c530
BLAKE2b-256 982d10a23120841db2f9dfcdb322412d6be9dc57a0184db1d767a7cc5e17c769

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page