Best DRY practices for a view function that will be used by all other views.
I tried my best to search for an answer but my efforts yielded nothing. Allow me to give you a simple example to illustrate my problem. Let's pretend that I want to have a login form on every single page on my website. Obviously, the login form will have a corresponding view function. What is the most elegant way to implement the login functionality on every single page? One brute force method would be to include the login view inside all view functions for every page; these view functions would call the login view if the HttpRequest object contains a flag that becomes active when the user clicks the login submit button. This method would work, but it goes against DRY best practices.
Is there a better way to do this? Maybe I can use a custom template tag?
Thanks in advance!!
Ken
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home