Django Library Users
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

__init__.py 783B

1234567891011121314151617181920212223242526272829
  1. from django.urls.base import reverse
  2. def url_by_name(name, request, just_url=False):
  3. base_url = reverse(name)
  4. if just_url:
  5. return base_url
  6. else:
  7. nxt = request.GET.get('next', request.get_full_path())
  8. return base_url + '?next=%s' % nxt
  9. def url_login(request, just_url=False):
  10. return url_by_name('users-login', request, just_url)
  11. def url_logout(request, just_url=False):
  12. return url_by_name('users-logout', request, just_url)
  13. def url_profile(request, just_url=False):
  14. return url_by_name('users-profile', request, just_url)
  15. def url_recover(request, just_url=False):
  16. return url_by_name('users-recover', request, just_url)
  17. def url_register(request, just_url=False):
  18. return url_by_name('users-register', request, just_url)