wiki:Python Flask Gotchas Import Database Module Fails

Version 1 (modified by Richard Bramley, 8 years ago) ( diff )

--

Python Flask Gotchas Import Database Module Fails

Tags: Python Flask Gotchas_Category

Problem

It fails with a cannot access database error in the log when it processes the first request after restarting Apache, but subsequent requests cause an database module not found error.

Solution

This could actually be an error that the application does not have access to the database.

Error: Macro BackLinks(None) failed
'Environment' object has no attribute 'get_db_cnx'

Note: See TracWiki for help on using the wiki.