Authkit: Change sign-in form (simple)

After using Authkit with *form* authentication method for a while, I want to change sign-in form to have the same theme as other pages and also add project name to the form. Finally, I found this site, which is (nearly) identical @sirn suggestion. They told me how to change this form so thank both of them.

However, I want to make a very simple modification first so I simplified the example. In development.ini, I just add “authkit.form.template.obj”.

authkit.setup.enable = true
authkit.setup.method = form, cookie
authkit.form.authenticate.user.type = basaasa.users.authkit_elixir_driver:UsersFromDatabase = basaasa.model
authkit.cookie.secret = SomeSec
authkit.cookie.signoutpath = /auth/signout
authkit.form.template.obj = basaasa.lib.auth:make_template #I added this line

Then I added to /basaasa/lib.

def make_template():
    return """


BasaAsa: Signin




def make_template() is required to return template, which is format string. Format string is just normal string with format specifier(s), for example: “xxx %s xxx”. For “def make_template()”, %s will be replace by an action, which is used as form action.

I do not plan to really use this example in BasaAsa but an example in the link in the paragraph above. However I hope this will remind me in the future how template work in Authkit and how to replace it.


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / เปลี่ยนแปลง )

Twitter picture

You are commenting using your Twitter account. Log Out / เปลี่ยนแปลง )

Facebook photo

You are commenting using your Facebook account. Log Out / เปลี่ยนแปลง )

Google+ photo

You are commenting using your Google+ account. Log Out / เปลี่ยนแปลง )

Connecting to %s