Skip to main content

Easily create a flask, nginx, uwsgi and bootstrap project ready for deployment

Project description

This is a structure template for Python command line applications, ready to be released and distributed via setuptools/PyPI/pip for Python 2 and 3.

Please have a look at the corresponding article: http://gehrcke.de/2014/02/distributing-a-python-command-line-application/

Usage

Clone this repository and adopt the bootstrap structure for your own project. This is just a starting point, but I hope a good one. From there on, you should read and follow http://python-packaging-user-guide.readthedocs.org/en/latest/, the definite resource on Python packaging.

Behavior

Flexible invocation

The application can be run right from the source directory, in two different ways:

  1. Treating the bootstrap directory as a package and as the main script:

    $ python -m bootstrap arg1 arg2
    Executing bootstrap version 0.2.0.
    List of argument strings: ['arg1', 'arg2']
    Stuff and Boo():
    <class 'bootstrap.stuff.Stuff'>
    <bootstrap.bootstrap.Boo object at 0x7f43d9f65a90>
  2. Using the bootstrap-runner.py wrapper:

    $ ./bootstrap-runner.py arg1 arg2
    Executing bootstrap version 0.2.0.
    List of argument strings: ['arg1', 'arg2']
    Stuff and Boo():
    <class 'bootstrap.stuff.Stuff'>
    <bootstrap.bootstrap.Boo object at 0x7f149554ead0>

Installation sets up bootstrap command

Situation before installation:

$ bootstrap
bash: bootstrap: command not found

Installation right from the source tree (or via pip from PyPI):

$ python setup.py install

Now, the bootstrap command is available:

$ bootstrap arg1 arg2
Executing bootstrap version 0.2.0.
List of argument strings: ['arg1', 'arg2']
Stuff and Boo():
<class 'bootstrap.stuff.Stuff'>
<bootstrap.bootstrap.Boo object at 0x7f366749a190>

On Unix-like systems, the installation places a bootstrap script into a centralized bin directory, which should be in your PATH. On Windows, bootstrap.exe is placed into a centralized Scripts directory which should also be in your PATH.

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

flaskstrap-0.3.6.tar.gz (8.8 kB view details)

Uploaded Source

File details

Details for the file flaskstrap-0.3.6.tar.gz.

File metadata

  • Download URL: flaskstrap-0.3.6.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for flaskstrap-0.3.6.tar.gz
Algorithm Hash digest
SHA256 8342400e5e7c839179103c524dd67b915ce7216d0211d09d8561bd569bd28f01
MD5 9ed77e9f29d6d76e65815778b1aa89c8
BLAKE2b-256 bc35fb2751563e1813dad56d92c1865924a41bc5bedb6409f7721ca8e5c62181

See more details on using hashes here.

Supported by

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