Skip to content

This project is intended for developers looking to implement user authentication with enhanced security measures in their Django applications. You can clone this repository, follow the installation instructions, and run it locally to see how Django Axes works in practice.

License

Notifications You must be signed in to change notification settings

dhanvina/django-axes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django Axes Example Project

This is a simple Django project demonstrating how to implement Django Axes for securing user login by preventing brute-force attempts. The project includes user authentication, login form, and lockout functionality when a user exceeds the allowed number of failed login attempts.

Table of Contents

Prerequisites

Before you begin, ensure you have the following installed:

  • Python (3.6 or higher)
  • pip (Python package installer)
  • Django (3.2 or higher)

Installation

  1. Clone the repository:

    Open your terminal and run the following command:

    git clone https://github.com/dhanvina/django-axes.git
    cd django-axes
  2. Install the required packages:

    Install Django and Django Axes using pip:

    pip install django django-axes
  3. Apply migrations:

    Run the following command to set up the database and apply migrations, including those for Django Axes:

    python manage.py migrate
  4. Create a superuser account:

    You need a superuser to access the Django admin interface and manage users

    python manage.py createsuperuser

    Follow the prompts to set a username and password.

Running the Project

  1. Start the development server:

    Run the following command to start the server:

    python manage.py runserver
  2. Access the application:

    Open your web browser and go to http://127.0.0.1:8000/login/ to access the login page.

  3. Log in:

    Use the superuser credentials you created earlier to log in. You can also attempt to log in with incorrect credentials to test the lockout feature

Testing

  1. Attempt Failed Logins:

    Go to the login page and try logging in with incorrect credentials three times. After the third failed attempt, you will be redirected to a lockout page.

  2. View Axes Attempts in Admin:

    Go to the Django admin interface at http://127.0.0.1:8000/admin/ and log in with your superuser credentials. You will see a section for Axes attempts where you can manage failed login attempts.

About

This project is intended for developers looking to implement user authentication with enhanced security measures in their Django applications. You can clone this repository, follow the installation instructions, and run it locally to see how Django Axes works in practice.

Topics

Resources

License

Stars

Watchers

Forks