Python Forum
AssertionError: View function mapping is overwriting an existing endpoint function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AssertionError: View function mapping is overwriting an existing endpoint function
#8
(Apr-17-2019, 12:52 PM)DeaD_EyE Wrote: Please edit your original post. Put the code into code tags. Otherwise there is no indentation and no line numbers.
 [python] your code [/python] 
I think the problem is that you try to reuse the app object in the other module. You should look for blueprints: Example structure:
 web ├── app.py ├── __init__.py ├── __main__.py ├── pages.py └── __pycache__ ├── app.cpython-37.pyc ├── __main__.cpython-37.pyc └── pages.cpython-37.pyc 
app.py:
 from flask import Flask import pages app = Flask(__name__) app.register_blueprint(pages.bp) app.run() 
pages.py
 from flask import Blueprint # this is the blueprint object which # have to registered with app bp = Blueprint('main_page', __name__, template_folder='templates') @bp.route('/') @bp.route('/test123') def index(): return 'index' @bp.route('/auth') def auth(): return 'auth' @bp.route('/info') def info(): return 'info' 
Additional ressources:
I am not an expert, I didn't really understand. And how do I edit the post?
Reply


Messages In This Thread
RE: AssertionError: View function mapping is overwriting an existing endpoint function - by Zhavi221 - Apr-17-2019, 01:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The function of double underscore back and front in a class function name? Pedroski55 9 967 Feb-19-2024, 03:51 PM
Last Post: deanhystad
  Mapping a value to an interval JazonKuer 12 2,283 Mar-17-2023, 07:59 PM
Last Post: Gribouillis
  AssertionError when trying the sys module in python BliepMonster 10 2,419 Nov-21-2022, 08:43 PM
Last Post: BliepMonster
  access is denied error 5 for network drive mapping ? ahmedbarbary 2 1,945 Aug-17-2022, 10:09 PM
Last Post: ahmedbarbary
  Requests Session Overwriting and cookie jar muzikman 0 1,421 Dec-13-2021, 02:22 PM
Last Post: muzikman
  Exit function from nested function based on user input Turtle 5 3,150 Oct-10-2021, 12:55 AM
Last Post: Turtle
  Mapping a range ebolisa 5 3,751 Jun-12-2021, 11:17 PM
Last Post: ebolisa
Question Stopping a parent function from a nested function? wallgraffiti 1 3,810 May-02-2021, 12:21 PM
Last Post: Gribouillis
Question exiting the outer function from the inner function banidjamali 3 3,745 Feb-27-2021, 09:47 AM
Last Post: banidjamali
  Passing argument from top-level function to embedded function JaneTan 2 2,359 Oct-15-2020, 03:50 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020