Skip to main content

A django user authentication and login application.

Project description

Authentication

A django user authentication and login application.

01. To install and use the package, use:

    pip install django-user-login

Instructions

02. Add "authentication" to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'authentication',
    ]

03. Include the authentication URLconf in your project urls.py like this:

path('authentication/', include('authentication.urls')),

04. Run python manage.py migrate to create the User model (you'll need the Admin app enabled).

05. The App requires Django Sessions

06. In your settings.py file include the following:

    SITE_TITLE = 'site-title' # title of your site
    LOGIN_URL = '/authentication/'
    EMAIL_HOST = 'email-host' # e.g. 'smtp-mail.outlook.com'
    EMAIL_PORT = email-port # e.g. 587
    EMAIL_HOST_USER = 'email-address'
    EMAIL_HOST_PASSWORD = 'email password'
    EMAIL_USE_TLS = True
    AUTHENTICATION_DEBUG = Boolean # True or False (use False in production)
    VERIFICATION_CODE_VALIDITY_IN_MINUTES = Integer # range of [1, 60] only

07. For login and logout functionality, use -

  • To Login, use anyone one of these

              - <a href="{% url 'authentication:login' %}">Login</a>
              - <a href='/authentication/'>Login</a>
    
  • To Logout, use anyone one of these

              - <a href="{% url 'authentication:logout' %}">Logout</a>
              - <a href="/authentication/logout/">Logout</a>
    
  • To visit My Account page and edit profile credentials, use any one of these -

              - <a href="{% url 'authentication:account' %}">Account</a>
              - <a href="/authentication/account/">Account</a>
    

08. When AUTHENTICATION_DEBUG = TRUE

    - Live EMAILS will not be sent and verification codes / messages, if any, will be displayed in the terminal.

09. When a user closes their account, the app will not delete the User but set is_active to False (see: User Model) and set_unusable_password() (see: Methods).

10. Check Demo Website

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-user-login-0.3.4.tar.gz (20.1 kB view hashes)

Uploaded Source

Built Distribution

django_user_login-0.3.4-py3-none-any.whl (28.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page