#305 Refactor the Flask application routes into one or more view modules
Closed: Fixed 5 years ago Opened 5 years ago by jcline.

Currently, all the Flask application routes are in the app.py module where the Flask application is created and configured. Based on a discussion in #269, I propose we do some refactoring to pull all the routes out. The end result should be:

  • The app.py module creates the Flask object, loads the configuration, and applies any other configuration to the app itself. It should contain no other code and its import requirements should be as minimal as possible.

  • All functions decorated with @route should be moved into either a new module, views.py, or a new hubs package, views, that contains an api.py module for API routes and a ui.py (or something) module for all the user-facing routes.

  • The hubs/__init__.py should ensure that the app.py module is always initialized first by importing it, and then importing the views module/package. It should also ensure all the widget routes are registered.

Just so you know, I have worked on this and I now have working code that fixes this issue. But it depends on my other PR so I'll wait until they get merged.

Metadata Update from @abompard:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.