Skip to content

Commit

Permalink
Create flask_cli script
Browse files Browse the repository at this point in the history
  • Loading branch information
tino097 committed Aug 20, 2018
1 parent bdde92a commit d1940a8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions ckan/lib/flask_cli.py
@@ -1,19 +1,35 @@
# encoding: utf-8

import os

import click
from flask import Flask, current_app
from flask.cli import FlaskGroup, with_appcontext
from werkzeug.serving import run_simple

from ckan.common import config
from ckan.config.middleware import make_app
from ckan.lib.cli import (click_config_option, load_config, parse_db_config,
paster_click_group)

import pdb; pdb.set_trace()
os.environ['FLASK_RUN_FROM_CLI'] = 'true'
# os.environ['FLASK_RUN_FROM_CLI'] = 'true'


def _load_config(config=None):

# app = make_app
# app.config.from_file
# return app
pass


def _helper():
print('nothing')


@click.help_option(u'-h', u'--help')
@click_config_option
def run():
#load_config(config or ctx.obj['config'])
# app = _load_config(config)
click.echo('Starting CKAN')
run_simple('localhost', 5000, make_app, use_reloader=True, use_evalex=True)

0 comments on commit d1940a8

Please sign in to comment.