Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    django-auth-remember 0.3

    Download button

    No screenshots available
    Downloads: 207  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael van Tellingen | More programs
    MIT/X Consortium Lic... / FREE
    February 29th, 2012, 22:58 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    django-auth-remember description

    Django app for remember-me functionality (using a token)

    django-auth-remember is a Django app for remember-me functionality (using a token).

    Add the auth_remember authentication backend to django:

    AUTHENTICATION_BACKENDS = (
     'django.contrib.auth.backends.ModelBackend',
     'auth_remember.backend.AuthRememberBackend',
    )


    Add the remember middleware in your settings, right after AuthenticationMiddleware:

    MIDDLEWARE_CLASSES = (
     ...
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'auth_remember.middleware.AuthRememberMiddleware',
     ...
    )


    Add auth_remember to INSTALLED_APPS:

    INSTALLED_APPS = (
     'auth_remember',
    )


    Set the cookie name and expire time (optional):

    AUTH_REMEMBER_COOKIE_NAME = 'remember_token'
    AUTH_REMEMBER_COOKIE_AGE = 86400 * 28 # 4 weeks by default


    Set the expire time of the session to browser close (optional):

    SESSION_EXPIRE_AT_BROWSER_CLOSE = True

    To remember a user add the following code to your authentication handler:

    from auth_remember import remember_user
    remember_user(request, user)


    Use the user.is_fresh attribute to test if the user is fresh:

    {% if user.is_fresh %}
     This user session is fresh
    {% else %}
     This user session is NOT fresh
    {% endif %}


    Under the hood auth_remember uses the session var AUTH_REMEMBER_FRESH to indicate if the user session is fresh. The name of the session var can be changed by setting the AUTH_REMEMBER_SESSION_KEY in you're settings file.

    More information

    See:

    - http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/
    - http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579


    Product's homepage

    Requirements:

    · Python
    · Django

      


    TAGS:

    remember-me functionality | Django authentication | Django | authentication | remember

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM