techniq / flask-wdb Goto Github PK
View Code? Open in Web Editor NEWIntegrate Wdb instead of Werkzeug debugger for Flask applications
License: BSD 3-Clause "New" or "Revised" License
Integrate Wdb instead of Werkzeug debugger for Flask applications
License: BSD 3-Clause "New" or "Revised" License
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.
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.