Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

508
Views
TypeError: __init__() obtuvo un argumento de palabra clave inesperado 'método'

Bueno, estoy escribiendo un proyecto de Flask, pero cuando traté de python manage.py

El rastreo me dijo que:

 Traceback (most recent call last): File "manage.py", line 5, in <module> from app import db,create_app File "/home/humbert/2017-sharing-backend/sharing/app/__init__.py", line 42, in <module> app.register_blueprint(main_blueprint, url_prefix='/main') File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/app.py", line 64, in wrapper_func return f(self, *args, **kwargs) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/app.py", line 951, in register_blueprint blueprint.register(self, options, first_registration) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/blueprints.py", line 154, in register deferred(state) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/blueprints.py", line 173, in <lambda> s.add_url_rule(rule, endpoint, view_func, **options)) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/blueprints.py", line 76, in add_url_rule view_func, defaults=defaults, **options) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/app.py", line 64, in wrapper_func return f(self, *args, **kwargs) File "/home/humbert/venv/local/lib/python2.7/site-packages/flask/app.py", line 1043, in add_url_rule rule = self.url_rule_class(rule, methods=methods, **options) TypeError: __init__() got an unexpected keyword argument 'method'

Creo que mi manage.py es correcto y no puedo descifrar el error.

La parte del error de __init__.py es que:

 from .main import main as main_blueprint app.register_blueprint(main_blueprint, url_prefix='/main') from .auth import auth as auth_blueprint app.register_blueprint(auth_blueprint, url_prefix="/auth") from . import views

Realmente necesito ayuda, gracias!

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Tuve un problema similar. En mi código tenía una línea @bp.route('/<init:id>/delete', method=('POST')) El método de palabra clave debe cambiarse a métodos (con una s)

over 4 years ago · Santiago Trujillo Report

0

Me encontré con un problema similar en mi código y solo tuve que cambiar la palabra clave " método " a " métodos ":

 @app.route('/login', methods = ['GET', 'POST'])
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!