from flask_babel import lazy_gettext as gettext from fypress.user import level_required, login_required, User, UserEditForm, UserAddForm, UserEditFormAdmin, UserLoginForm from fypress.folder import FolderForm, Folder from fypress.media import Media from fypress.post import Post, SimpleComment, AkismetForm from fypress.admin.static import messages from fypress.admin.forms import GeneralSettingsForm, SocialSettingsForm from fypress.admin.models import Option, Theme from fypress.utils import get_redirect_target, Paginator from fypress import __version__, __file__ as __fypress_file__, FyPress import json import datetime admin = Blueprint('admin', __name__, url_prefix='/admin') fypress = FyPress() admin_jinja = Environment( loader=PackageLoader('fypress', '_html/templates/'), extensions=['jinja2.ext.autoescape', 'jinja2.ext.with_'], autoescape=True) def render_template(template, **kwargs): kwargs.update(_default_template_ctx_processor()) kwargs.update({ 'url_for': url_for, 'get_flashed_messages': get_flashed_messages, '_': gettext }) kwargs.update(
# -*- coding: UTF-8 -*- from fypress import FyPress from config import Config import re fypress = FyPress(Config, False) from flask.ext.script import Manager from fypress.user import User from fypress.folder import Folder from fypress.post import Post from fypress.admin import Option app = fypress.app db = fypress.db manager = Manager(app) logo = """ ░█▀▀▀ █ █ ░█▀▀█ █▀▀█ █▀▀ █▀▀ █▀▀ ░█▀▀▀ █▄▄█ ░█▄▄█ █▄▄▀ █▀▀ ▀▀█ ▀▀█ ░█ ▄▄▄█ ░█ ▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀ """ @manager.command def init_db(): try: con = db.connect().test() except:
# -*- coding: utf-8 -*- import sys reload(sys) sys.setdefaultencoding("utf-8") from fypress import FyPress from config import ConfigProd fypress = FyPress(ConfigProd) fypress_app = fypress.app
def main(): fypress = FyPress(Config) fypress.run() return 0
# -*- coding: UTF-8 -*- from fypress import FyPress from config import Config import re fypress = FyPress(Config, True) from flask_script import Manager from fypress.user import User from fypress.folder import Folder from fypress.post import Post from fypress.admin import Option app = fypress.app db = fypress.database manager = Manager(app) logo = """ ░█▀▀▀ █ █ ░█▀▀█ █▀▀█ █▀▀ █▀▀ █▀▀ ░█▀▀▀ █▄▄█ ░█▄▄█ █▄▄▀ █▀▀ ▀▀█ ▀▀█ ░█ ▄▄▄█ ░█ ▀ ▀▀ ▀▀▀ ▀▀▀ ▀▀▀ """ @manager.command def init_db(): fypress.database.db.create_all() print '*** FyPress Database initialized.' return True