Esempio n. 1
0
app.config['DEBUG'] = True
# Disable CSRF checking in WTForms
app.config['WTF_CSRF_ENABLED'] = False
# This is still necessary for SocketIO
app.config['SECRET_KEY'] = config_value('secret_key')
app.url_map.redirect_defaults = False
socketio = SocketIO(app)
scheduler = digits.scheduler.Scheduler(config_value('gpu_list'), True)

### Register filters and views

app.jinja_env.globals['server_name'] = config_value('server_name')
app.jinja_env.globals['server_version'] = digits.__version__
app.jinja_env.globals['caffe_version'] = config_value('caffe_root')['ver_str']
app.jinja_env.globals['caffe_flavor'] = config_value('caffe_root')['flavor']
app.jinja_env.globals['dir_hash'] = fs.dir_hash('digits/static')
app.jinja_env.filters['print_time'] = utils.time_filters.print_time
app.jinja_env.filters['print_time_diff'] = utils.time_filters.print_time_diff
app.jinja_env.filters['print_time_since'] = utils.time_filters.print_time_since
app.jinja_env.filters['sizeof_fmt'] = utils.sizeof_fmt
app.jinja_env.filters['has_permission'] = utils.auth.has_permission
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True

import digits.views
app.register_blueprint(digits.views.blueprint)
import digits.dataset.views
app.register_blueprint(digits.dataset.views.blueprint, url_prefix='/datasets')
import digits.dataset.generic.views
app.register_blueprint(digits.dataset.generic.views.blueprint, url_prefix='/datasets/generic')
import digits.dataset.images.views
Esempio n. 2
0
app.config['WTF_CSRF_ENABLED'] = False
# This is still necessary for SocketIO
app.config['SECRET_KEY'] = os.urandom(12).encode('hex')
app.url_map.redirect_defaults = False
socketio = SocketIO(app, async_mode='gevent')
app.config['store_cache'] = StoreCache()
app.config['store_url_list'] = config_value('model_store')['url_list']
scheduler = digits.scheduler.Scheduler(config_value('gpu_list'), True)

# Register filters and views

app.jinja_env.globals['server_name'] = config_value('server_name')
app.jinja_env.globals['server_version'] = digits.__version__
app.jinja_env.globals['caffe_version'] = config_value('caffe')['version']
app.jinja_env.globals['caffe_flavor'] = config_value('caffe')['flavor']
app.jinja_env.globals['dir_hash'] = fs.dir_hash(
    os.path.join(os.path.dirname(digits.__file__), 'static'))
app.jinja_env.filters['print_time'] = utils.time_filters.print_time
app.jinja_env.filters['print_time_diff'] = utils.time_filters.print_time_diff
app.jinja_env.filters['print_time_since'] = utils.time_filters.print_time_since
app.jinja_env.filters['sizeof_fmt'] = utils.sizeof_fmt
app.jinja_env.filters['has_permission'] = utils.auth.has_permission
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True

import digits.views  # noqa
app.register_blueprint(digits.views.blueprint)
import digits.dataset.views  # noqa
app.register_blueprint(digits.dataset.views.blueprint, url_prefix='/datasets')
import digits.dataset.generic.views  # noqa
app.register_blueprint(digits.dataset.generic.views.blueprint, url_prefix='/datasets/generic')
import digits.dataset.images.views  # noqa
Esempio n. 3
0
app.config['DEBUG'] = True
# Disable CSRF checking in WTForms
app.config['WTF_CSRF_ENABLED'] = False
# This is still necessary for SocketIO
app.config['SECRET_KEY'] = config_value('secret_key')
app.url_map.redirect_defaults = False
socketio = SocketIO(app, async_mode='gevent')
scheduler = digits.scheduler.Scheduler(config_value('gpu_list'), True)

### Register filters and views

app.jinja_env.globals['server_name'] = config_value('server_name')
app.jinja_env.globals['server_version'] = digits.__version__
app.jinja_env.globals['caffe_version'] = config_value('caffe_root')['ver_str']
app.jinja_env.globals['caffe_flavor'] = config_value('caffe_root')['flavor']
app.jinja_env.globals['dir_hash'] = fs.dir_hash('digits/static')
app.jinja_env.filters['print_time'] = utils.time_filters.print_time
app.jinja_env.filters['print_time_diff'] = utils.time_filters.print_time_diff
app.jinja_env.filters['print_time_since'] = utils.time_filters.print_time_since
app.jinja_env.filters['sizeof_fmt'] = utils.sizeof_fmt
app.jinja_env.filters['has_permission'] = utils.auth.has_permission
app.jinja_env.trim_blocks = True
app.jinja_env.lstrip_blocks = True

import digits.views
app.register_blueprint(digits.views.blueprint)
import digits.dataset.views
app.register_blueprint(digits.dataset.views.blueprint, url_prefix='/datasets')
import digits.dataset.generic.views
app.register_blueprint(digits.dataset.generic.views.blueprint,
                       url_prefix='/datasets/generic')