This is the entry point of the application. -------------------------------------------------------------------------------- ** To serve the local development app > juicy serve {project_name} #--------- ** To deploy with Propel ( https://github.com/mardix/propel ) > propel -w #--------- ** To deploy with Gunicorn > gunicorn app_{project_name}:app """ from juice import Juice # Import the project's views import application.{project_name}.views # 'app' variable name is required if you intend to use 'juicy' the cli tool app = Juice(__name__, project="{project_name}")
from flask import Flask import flask_cache import ses_mailer import flask_mail import flask_cloudy import flask_recaptcha from juice import Juice from juice.ext import mail, cache, storage, recaptcha, csrf conffile = "config.py" _ = Juice(__name__, config=conffile) # Recaptcha def test_recaptcha(): assert isinstance(recaptcha, flask_recaptcha.ReCaptcha) # Storage def test_storage(): assert isinstance(storage, flask_cloudy.Storage) # Cache def test_cache(): assert isinstance(cache, flask_cache.Cache) # Mailer def test_mailer_none():
juicy user id 1 -------------------------------------------------------------------------------- """ from juice import Juice, get_env_config, abort import juice.utils as utils from application import config, model from juice.plugins import user, publisher from juice.ext import mail from juice.cli import cli, click # init Juice without registering the views Juice(__name__, skip_views=True) # Load the config conf = get_env_config(config) # ------------------------------------------------------------------------------ def setup_db(): """ Setup models from model.py """ model.db.create_all() def setup_admin_user_publisher(): """ Setup Juice User and Publisher Admin