Skip to main content

A django user authentication and login application.

Reason this release was yanked:

faulty

Project description

Authentication

A django user authentication and login application.

1. To install and use the package, use:

    pip install django-user-login

Instructions

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

    INSTALLED_APPS = [
        ...
        'authentication',
    ]

3. The App requires Django Sessions

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

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

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

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

    SITE_TITLE = 'your site title'
    LOGIN_URL = '/authentication/'
    EMAIL_HOST = 'email-host'
    EMAIL_PORT = email-port
    EMAIL_HOST_USER = 'email-address'
    EMAIL_HOST_PASSWORD = 'email-password'
    EMAIL_USE_TLS = True
    FAVICON_URL = '/path/to/favicon.ico'

7 General layout of the starter template / base template

    <!doctype html>
    <html lang="en">
        <head>
            ....
            ....

            <!-- Required meta tags -->
            <meta charset="utf-8">
            <meta name="viewport" content="width=device-width, initial-scale=1">

            <!-- Required Authentication CSS -->
            <link rel="stylesheet" href="{% static 'authentication/css/layout.css' %}">

            ....
            ....
        </head>
        <body>
            ....
            ....

            <!-- Required Authentication Modals -->
            {% include 'authentication/auth_modals.html' %}

            <!-- Required Authentication JavaScript -->
            <script src="{% static 'authentication/js/login.js' %}"></script>
        </body>
    </html>

8. For login and logout functionality, use -

  • To Login, use anyone of these

          - <a href="{% url 'authentication:login' %}">Login</a>
          - <a href='/authentication/'>Login</a>
          - <button class="..." type="..." role="..." data-bs-toggle="modal" data-bs-target="#loginModal">Login</button>
    
  • To Logout, use anyone of these

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

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

9. This app uses Bootstrap, Bootstrap Icons, JQuery and Handlebars. These file can be accessed at -

        <link href="{% static 'authentication/assets/node_modules/bootstrap/dist/css/bootstrap.css' %}" rel="stylesheet">
        <link href="{% static 'authentication/assets/node_modules/bootstrap-icons/font/bootstrap-icons.css' %}" rel="stylesheet">

        <script src="{% static 'authentication/assets/node_modules/bootstrap/dist/js/bootstrap.bundle.js' %}"></script>
        <script src="{% static 'authentication/assets/node_modules/jquery/dist/jquery.js' %}"></script>
        <script src="{% static 'authentication/assets/node_modules/handlebars/dist/handlebars.js' %}"></script>

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.1.7.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

django_user_login-0.1.7-py3-none-any.whl (2.5 MB view details)

Uploaded Python 3

File details

Details for the file django-user-login-0.1.7.tar.gz.

File metadata

  • Download URL: django-user-login-0.1.7.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.12

File hashes

Hashes for django-user-login-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a643cf9d821743a89b8fe536c928f610664546886e90bee3423e97b1b80c0222
MD5 31465674aa13c6bd36a19df2e0da3734
BLAKE2b-256 d47417693571019a13b23156637d5718f22edcbc20146e4efe304a2f6642bf72

See more details on using hashes here.

File details

Details for the file django_user_login-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for django_user_login-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a4077e4526858d4700a2b8d3f667a941c410995e364c1b526169bad41221b269
MD5 2058aba46d1bf78d2f400647bf583404
BLAKE2b-256 7e1efbadbe7b96be57b75e4cb2ae345d978a0bd86852fca81e5062548c9f12c2

See more details on using hashes here.

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