Skip to content

Commit

Permalink
Merge pull request #789 from davidebbo/fix-db-session
Browse files Browse the repository at this point in the history
Move the session.connect() call to earlier
  • Loading branch information
hyanwong authored Apr 12, 2024
2 parents 3a0b181 + d7fe42f commit 5759383
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@

from gluon.tools import Auth, Service, PluginManager

## Configure session handling: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Sessions-in-database
session.connect(request, response, db)

auth = Auth(db)
service = Service()
plugins = PluginManager()
Expand Down Expand Up @@ -159,9 +162,6 @@
auth.settings.reset_password_requires_verification = True
auth.settings.allow_basic_login = True

## Configure session handling: http://web2py.com/books/default/chapter/29/13/deployment-recipes#Sessions-in-database
session.connect(request, response, db)

##restrict site to only logged in users
## https://groups.google.com/forum/#!topic/web2py/0j92-sPp4bc
##NB: useful url to add a guest user programmatically http://stackoverflow.com/questions/35504306/web2py-how-to-programmatically-register-users/35518991
Expand Down

0 comments on commit 5759383

Please sign in to comment.