1

I'd like to divide routes into multiple modules, but I don't want to use blueprints as answered in this question. The docs imply I can just import my views files in __init__.py, but I can’t seem to get more than one to work. Should more than one be able to work?

This is a pared-down version of my __init__.py:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

#
# App Configuration
#

gApp = Flask(__name__)

gApp.config.from_object(__name__)

gApp.config.update(dict(
    DEBUG = True,
    ...
))

#
#   Import the views. I don't know why I can't do more than one
#

import tsint.app
import tsint.admin
Community
  • 1
  • 1
Rick
  • 3,298
  • 3
  • 29
  • 47

1 Answers1

0

It turns out, this is perfectly acceptable. As I was trying to re-create the error I got to round out the question, I got it to work. I decided to leave this here to help someone else.

I must’ve gotten an import statement wrong somewhere (Flask is very bad about telling you which import actually fails).

Rick
  • 3,298
  • 3
  • 29
  • 47