Coder Social home page Coder Social logo

flask-wdb's People

Contributors

techniq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

www3838438

flask-wdb's Issues

Update required for init_app method

Hello,

I am trying to use flask-wdb via the pattern

wdb = Wdb()
wdb.init_app(app)

I am getting this error
File "/usr/local/lib/python3.8/site-packages/flask_wdb.py", line 18, in init_app
app.wsgi_app = WdbMiddleware(app.wsgi_app, start_disabled, theme)
TypeError: init() takes from 2 to 3 positional arguments but 4 were given

I think a little update is needed.

how to use in application factory?

i do it like this in init.py

from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
from flask_wtf.csrf import CsrfProtect
from flask.ext.mongoengine import MongoEngine
from flask_wdb import Wdb


bootstrap = Bootstrap()
moment = Moment()
db = MongoEngine()
csrf = CsrfProtect()
wdb = Wdb()


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    config[config_name].init_app(app)

    bootstrap.init_app(app)
    moment.init_app(app)
    db.init_app(app)
    wdb.init_app(app)
    csrf = CsrfProtect(app)

    from .main import main as main_blueprint
    app.register_blueprint(main_blueprint)

    return app

but there's an error:

Traceback (most recent call last):
  File "manage.py", line 15, in <module>
    app = create_app(os.getenv('FLASK_CONFIG') or 'default')
  File "/home/go/brand_new/app/__init__.py", line 27, in create_app
    wdb.init_app(app)
  File "/home/go/flasky/flasky/local/lib/python2.7/site-packages/flask_wdb.py", line 18, in init_app
    app.wsgi_app = WdbMiddleware(app.wsgi_app, start_disabled, theme)
TypeError: __init__() takes at most 3 arguments (4 given)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.