π Django OAuth2 Authentication (GitHub Login)
A Django web application that implements OAuth2.0 authentication with GitHub, created to demonstrate how to integrate secure social login using environment variables and modern authentication practices.
This project is useful for developers who want to learn how to implement OAuth-based authentication in Django applications.
π Features
π Authentication using GitHub OAuth2
π€ Automatic user login and account creation via GitHub
π Secure credential storage using environment variables (.env)
π§© Modular Django structure with separated apps
π οΈ Ready-to-run development setup
π οΈ Technologies Used
Python
Django
OAuth2.0 (GitHub Authentication)
django-allauth (or similar library)
Environment Variables (.env)
HTML / Django Templates
π¦ Project Structure
The project follows a modular Django structure with separated apps and configuration:
project/ βββ setup/ βββ tech/ βββ templates/ βββ manage.py βββ requirements.txt βοΈ Running the Project Locally 1οΈβ£ Clone the repository git clone https://github.com/raiego/projeto-OAuth2.0-django-python.git cd projeto-OAuth2.0-django-python 2οΈβ£ Create and activate a virtual environment
Windows
python -m venv .venv .venv\Scripts\activate
Linux / macOS
python -m venv .venv source .venv/bin/activate 3οΈβ£ Install dependencies pip install -r requirements.txt 4οΈβ£ Create a .env file
Add your credentials (do not commit this file):
SECRET_KEY=your_secret_key GITHUB_CLIENT_ID=your_client_id GITHUB_SECRET=your_client_secret 5οΈβ£ Run the development server python manage.py runserver
The application will be available at:
http://localhost:8000 π What This Project Demonstrates
This project demonstrates:
OAuth2 authentication flow
Social login integration
Secure environment variable management
Django project organization
π‘ Educational project created for learning authentication and backend development with Django.