Is there any way, in Flask, to handle the issue of duplicate function names for views across files? Just to be clear, I'm talking about the name of the function, not the route defined for the function. So imagine in file1.py I've got:
@app.route('/some/unique/route')
def duplicateFunctionName():
...python code...
And then in file2.py I've got:
@app.route('/another/unique/route/name')
def duplicateFunctionName():
...python code...
And then in main.py I import these view functions:
import file1
import file2
<<code to run the flask server>>
The problem is that in large projects it's really hard to keep the function names unique. At some point you're bound to have two functions called def saveData() or whatever, and it's really hard to debug those issues. Is there an elegant solution to this problem?
from fileN import *the two functions will remain in their own namespaces asfile1.duplicateFunctionNameandfile2.duplicateFunctionName.