This Django project implements a user authentication system, including features such as signup, login, logout, password reset, password change, and user profile views. It is designed with improved error handling, secure password reset links, and user feedback messages.
For Code review, please check auth_user/views.py
Login.-.Brave.2024-11-10.19-32-37.mp4
- User Signup: Users can create an account.
- User Login: Existing users can log in.
- Password Reset: Users can reset their passwords via email using secure, one-time links.
- Password Change: Logged-in users can change their passwords.
- Logout: Users can securely log out.
- Dashboard and Profile: Simple profile and dashboard views are accessible to logged-in users.
- Configure EMAIL_BACKEND in settings.py for password reset; Gmail example provided.
- update_session_auth_hash keeps users logged in after password change for convenience.
- Customizable forms (
SignupForm
,LoginForm
,ForgotPasswordForm
) allow additional fields. - try-except blocks prevent errors in critical areas like password reset.
- Django: Django's built-in authentication and form libraries.
- Python: Backend logic and form validation.
- HTML & CSS: Templates for front-end rendering.
- JavaScript (optional): For frontend validation and interactivity.
-
Clone the Repository
git clone https://github.com/your_username/your_project_name.git cd your_project_name
-
Set Up a Virtual Environment
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Dependencies
pip install -r requirements.txt
-
Apply Migrations
python manage.py migrate
-
Create a Superuser (Optional)
python manage.py createsuperuser
-
Run the Development Server
python manage.py runserver
-
Visit the Application Open your web browser and go to
http://127.0.0.1:8000/
.
your_project_name/
├── user_auth/ # Django app for user authentication
│ ├── forms.py # Forms for signup, login, forgot password
│ ├── views.py # Logic for signup, login, password reset, etc.
│ ├── templates/ # HTML templates for each view
│ │ └── user_auth/
│ │ ├── signup.html
│ │ ├── login.html
│ │ ├── forgot_password.html
│ │ ├── change_password.html
│ │ ├── dashboard.html
│ │ └── profile.html
├── manage.py
├── README.md
└── requirements.txt # Project dependencies