Wizards-Outh Django is a powerful authentication API built with Django, offering features similar to Clerk.com for seamless user management and authentication.
- User registration and login
- API key management
- Passwordless authentication
- Multi-factor authentication
- Social login with Google and Facebook
- Python 3.8 or higher
- pip (Python package installer)
-
Create a Virtual Environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the Package To install the package, use the following command:
pip install wizards-auth-django
-
Configure Django Settings:
- Add
'users'
to yourINSTALLED_APPS
insettings.py
. - Configure your database settings in
settings.py
. - Set up email backend for passwordless authentication.
- Add
-
Apply Migrations: Run the following command to apply migrations:
python manage.py migrate
-
Run the Development Server: Start the Django development server using:
python manage.py runserver
-
Access the API: Open your browser and go to
http://localhost:8000
to access the API.
To register a new user, send a POST request to /api/register/
with the following JSON payload:
{
"username": "newuser",
"password": "password123"
}
To log in, send a POST request to /api/login/
with the following JSON payload:
{
"username": "newuser",
"password": "password123"
}
To generate a new API key, send a POST request to /api/api-key/generate/
with an authenticated user.
POST /api/register/
: Register a new userPOST /api/login/
: Log in a userGET /api/protected/
: Access a protected route (requires authentication)POST /api/api-key/generate/
: Generate a new API key (requires authentication)GET /api/api-key/list/
: List all active API keys (requires authentication)POST /api/api-key/deactivate/
: Deactivate an API key (requires authentication)
For more detailed documentation, please refer to the project's GitHub repository.