Skip to content Skip to sidebar Skip to footer

One Single Mysql Database For Many Web2py Applications

I have 3 apps under my web2py framework. Can I use one single MySQL database for all of them (by prefixing tables) so users just need only one single registration to access those 3

Solution 1:

If multiple apps share the same database table, all but one of the apps must define that table with migrate=False to prevent migration attempts. Note, Auth.define_tables() also takes a migrate argument, so to turn off migrations specifically for the Auth tables, you can do:

auth.define_tables(migrate=False)

You can also turn off migrations for an entire database connection within an application with:

db = DAL(..., migrate_enabled=False)

See here for more about inter-app cooperation.

Post a Comment for "One Single Mysql Database For Many Web2py Applications"