Commands

reset_password

it’s a script whose goal is to be used in scripts (jmb-sync) when creating local db on developer’s personal pc.

jmb-sync resets the admin password so that browser can prefill password

dj reset_password user pass

jmbcollect

Command to collect info to deploy using bower.

scenario

Each app may depend on a series of external libraries (eg.: jquery, bootstrap, jcrop) that are normally included in the app distribution (under /static folder) with the result that:

  • may be repeated several times in the project assets

  • may not be concatenated to gain better performance

  • may not be updated on a project base

This command aims at delegating to bower the management of these dependencies so that they can be handled with the same mechanism we use for external resources of the project.

Also internal resources (css end js) may be declared so that they can be concatenated by gulp asset management.

setup

Each app must declare a dict named DEPENDENCIES that is a dict with 2 keys and we place it in the __init__ of the project. It’s content is better explained by a single example:

DEPENDENCIES = {
    'EXTERNAL': {
        "fileapi": "~2.0.18",
        "underscore": "^1.8.3",
        "font-awesome": "fontawesome#^4.5.0",
        "Jcrop": "jcrop#^2.0.4"
    },
    'INTERNAL': {
        'js': [
            ('imagefileinput/imagefileinput.js', 'imagefileinput.js'),
            ('imagefileinput/FileAPI/FileAPI.exif.js', 'FileAPI.exif.js'),
        ],
        'css': [
            'style.css',
            ('imagefileinput/imagefileinput.css', 'imagefileinput.css'),
        ],
    },
}

the INTERNAL key is a dict with 2 more keys, js and css that are lists of files to be copied from static to <static>/apps/app_package. In case you want to change the position in the destination you can use a tuple as above. See css for an example of the two possibilities.

usage:

dj jmbcollect
-c

add debugging on console

-l

debug_level