Django Authentication API is a feature-rich authentication system built with Django and Django Rest Framework. It provides user registration, login, password reset, email change, and other authentication-related functionalities.
Ensure you have the following prerequisites installed:
-
Clone the repository:
git clone https://github.com/your-username/django-authentication-api.git
-
Navigate to the project directory:
cd django-authentication-api -
Install the required dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
The API should be accessible at http://localhost:8000/api/accounts/.
-
User Account Information:
/account/- Method:
GET - Requires authentication
- Method:
-
User Account Change:
/account/change/- Method:
POST - Requires authentication
- Update user information (first name, last name)
- Method:
-
User Login:
/login/- Method:
POST - Input: Email and password
- Returns user information
- Method:
-
User Signup:
/signup/- Method:
POST - Input: First name, last name, email, and password
- Returns success message
- Method:
-
Account Activation:
/activate-account/- Method:
POST - Input: Activation code
- Activates user account so that users can login
- Method:
-
User Logout:
/logout/- Method:
POST - Requires authentication
- Logs out the user
- Method:
-
Password Reset Request:
/password-reset/- Method:
POST - Input: Email
- Sends a verification code for password reset to the user's email
- Method:
-
Password Reset Verify:
/password-reset/verify/- Method:
POST - Input: Verification code and new password
- Resets the user's password
- Method:
-
Email Change Request:
/email-change/- Method:
POST - Requires authentication
- Sends a verification code for email change to the user's email
- Method:
-
Email Change Verify:
/email-change/verify/- Method:
POST - Input: Verification code and new email
- Changes the user's email
- Method:
-
Password Change:
/password-change/- Method:
POST - Requires authentication
- Input: Old password and new password
- Changes the user's password
- Method:
- Token Authentication is used to secure endpoints where necessary
- Fork the repository.
- Create a new branch for your feature: git checkout -b feature-name.
- Commit your changes: git commit -m 'Add new feature'.
- Push to the branch: git push origin feature-name.
- Submit a pull request.