This is a Django-based web application that demonstrates user authentication functionality, including user registration, login, logout, and a protected dashboard page.
- User Registration: Users can register with a username, email, and password.
- User Login: Registered users can log in using their credentials.
- User Logout: Users can log out of their accounts.
- Dashboard: A protected page accessible only to logged-in users.
- CSRF Protection: Secure forms with CSRF tokens.
AuthenticationForm/ init.py asgi.py settings.py urls.py wsgi.py Users/ init.py admin.py apps.py forms.py models.py tests.py urls.py views.py migrations/ templates/ Users/ login.html register.html dashboard.html index.html db.sqlite3 manage.py README.md
-
Clone the repository:
git clone https://github.com/Phani-LP/Django_Authentication_Forms.git cd Django_Authentication_Forms
-
Create a virtual environment and activate it: python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required dependencies: pip install -r requirements.txt
-
Apply migrations: python manage.py migrate
-
Run the development server: python manage.py runserver
-
Open the application in your browser at http://127.0.0.1:8000/.
- Visit the home page to navigate to the login or registration page.
- Register a new user account.
- Log in with the registered credentials.
- Access the dashboard after logging in.
- Log out to return to the login page.
- AuthenticationForm/settings.py: Contains project settings, including database configuration and installed apps.
- AuthenticationForm/urls.py: Defines the URL routing for the project.
- Users/forms.py: Contains custom forms for user registration and login.
- Users/views.py: Implements the logic for user registration, login, logout, and dashboard.
- Users/templates/Users/: Contains HTML templates for the application.
- db.sqlite3: SQLite database file.