Skip to main content

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.2 (Aug-29-2011)

  • syncdb/upgradedb now reflect on the database more to avoid circular model dependencies

0.6.1 (Jul-10-2011)

  • Added “rshell” command for connecting to a remote rfoo server and work with live-running objects

0.6 (May-14-2011)

  • first release

Release files for khufu_script 0.6.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for khufu_script 0.6.2
File Size Uploaded
khufu_script-0.6.2.tar.gz 7.0 kB Details

Release files / khufu_script-0.6.2.tar.gz

Download URL khufu_script-0.6.2.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7f09d847401f227e30c068d7336decc2b6636235bfaa8bdc714a4921f3f6ef2e
BLAKE2b-256 checksum
How to use checksums
5fc52b16301d20b86a3c6a9560200f9a7aa60a1955943557653263494fc92006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.6.2 This release

1 release file

0.6.1

1 release file

0.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page