This project implements a user authentication system using Django. It includes features for user registration, login, and logout.
- User Registration: Users can sign up with a unique username and password.
- User Login: Registered users can log in using their credentials.
- User Logout: Logged-in users can log out of their accounts.
- Protected Views: Certain views are accessible only to authenticated users.
auth/
: Contains the Django application for authentication.templates/user/
: HTML templates for user-related pages.user/
: Contains views and forms related to user authentication.manage.py
: Django's command-line utility for administrative tasks.db.sqlite3
: SQLite database file.
-
Clone the repository:
git clone https://github.com/khaledkamr/django-authentication.git cd django-authentication
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate
-
Install the required packages:
pip install -r requirements.txt
-
Apply the migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the application:
Open your web browser and navigate to
http://127.0.0.1:8000/
.