|
When a user logs into my site I would like to perform a check on some data and depending on the result, display a custom message to them, rather than the standard message, which is "Welcome back user, you are now logged in". This message seems to be hardcoded in /views/auth.py. Any suggestions on the best way to go about this? I'm not really familiar with the actions api yet, which might do the trick for me? but i figure doing it this way might now make it possible to replace the standard message? |
|
I'm also trying to figure this out since I don't want to see "Welcome back" to someone who logged in for the first time ever. I can point out that this message is not hard coded. The code uses the _(), which provides localization through the gettext package. To solve my problem, I went to osqa/locale/en/LC_MESSAGES and edited django.po so
I then read the gettext documentation and did
followed by a restart of the Django instance. That caused the login title to change. As far as I can tell, the only way to get what you want is to modify views/auth.py . Still, I'm answering this question here since someone looking for what I wanted will likely find you question. |