O'Reilly logo

Spring Python 1.1 by Greg Lee Turnquist

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Securing the application

Before we get going, let's go ahead and plug-in some security. In the security chapter, we discussed how security can be conveniently added after the fact. But it's even better if we start with it first. We will do so by adding a simple login page, and hard wiring three accounts: a customer, a bank manager, and a bank supervisor.

  1. Let's revise the boot strap main with some extra features to turn on security.
    import cherrypy import os from springpython.context import ApplicationContext from springpython.security.context import * from ctx2 import * if __name__ == '__main__': cherrypy.config.update({'server.socket_port': 8009}) ctx = ApplicationContext(SpringBankAppContext()) SecurityContextHolder.setStrategy(SecurityContextHolder.MODE_GLOBAL) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required