How to use the wilson/conf.setSettings function in wilson

To help you get started, we’ve selected a few wilson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chrisdickinson / wilson / tests / urls.js View on Github external
function(assert) {
        "Throws an error when trying to use a bad root URLConf";
        conf.setSettings({
            'ROOT_URLCONF':'dne.dne.dne'
        });


        assert.throws(Error, function() {
            urls.getRoot();
        });

        conf.setSettings({
            'ROOT_URLCONF':undefined
        });
    },
    function(assert) {
github chrisdickinson / wilson / lib / commands.js View on Github external
exports.runcommand = function() {
    var sys = require('sys'),
        conf = require('wilson/conf'),
        core = require('wilson/core/app'),
        application = require('wilson/application'),
        app_and_command = process.argv[2].split(':'),
        app = app_and_command[0],
        command = app_and_command[1],
        appInstance;

    try {
        application.loadApps(conf.settings.APP_OVERRIDES);
        appInstance = application.getApplicationInstance(app);
    } catch(err) {
        conf.setSettings({
            INSTALLED_APPS:{
                core:application.use('wilson/core')
            },
            TEMPLATE_LOADERS:[
                'wilson/template/loaders.application',
                'wilson/template/loaders.filesystem',
            ],
        });
        application.loadApps(conf.settings.APP_OVERRIDES);
        appInstance = application.getApplicationInstance('core');
    }

    if(appInstance) {
        var appCommand = appInstance.app.commands[command];
        if(appCommand) {
            appCommand.apply(appInstance, process.argv.slice(3));