Login from a Django App

I am creating a Django app that will retrieve some information from OMERO. I am currently looking for a way to tell the app that if
what would be the best way to this?
- Code: Select all
if conn is None:
#go to login page
what would be the best way to this?