cannot solve my flask bluprint assertion error
Question: I'm trying to split my app with using Bluprint in flask, but i got
AssertionError though there's no funtions having same names. i thought if the
function name is different, the default endpoint will be different too. I've
searched for it, but still i couldent get so far. please help ;(

this is my controllers.py

    
    
    import flask
    from flask import render_template, request, redirect, url_for, flash, make_response, g, session, jsonify
    from apps import app, db
    from apps.models import *
    
    from apps.controllers2 import app2
    
    #Set application.debug=true to enable tracebacks on Beanstalk log output.
    #Make sure to remove this line before deploying to production.
    app.debug=True
    app.register_blueprint(app2)
    
    @app.route('/', methods=['GET', 'POST'])
    @app.route('/intro', methods=['GET', 'POST'])
    def hmp_showIntro():
        return render_template('intro.html')
    
    
    if __name__ == '__main__':
        app.run(host='0.0.0.0')
    

and this is separated controller, controller2.py

    
    
    from flask import render_template, request, redirect, url_for, flash, make_response, g, session, jsonify
    from flask import Blueprint
    from apps import app, db
    app2 = Blueprint('app2', __name__)
    
    @app2.route('/main')
    def hmp_showMain():
        return render_template('main.html')
    

and here is what i've got

    
    
     mod_wsgi (pid=15429): Exception occurred processing WSGI script '/opt/python/current/app/apps/controllers.py'.
     Traceback (most recent call last):
       File "/opt/python/current/app/apps/controllers.py", line 17, in <module>
         @app.route('/intro', methods=['GET', 'POST'])
       File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 1013, in decorator
         self.add_url_rule(rule, endpoint, f, **options)
       File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 62, in wrapper_func
         return f(self, *args, **kwargs)
       File "/opt/python/run/venv/lib/python2.7/site-packages/flask/app.py", line 984, in add_url_rule
         'existing endpoint function: %s' % endpoint)
     AssertionError: View function mapping is overwriting an existing endpoint function: hmp_showIntro
    


Answer: Your app already has route to view with `hmp_showIntro` name. Search project
for that function. Or you can do double import of controllers.py.

