You can try it with Deployment link 🐍
Before setting up and using this project, ensure you have the following prerequisites:
-
Python: Install Python from the official Python website.
-
Git: If you're using Git, you can download it from the official Git website.
-
Google Cloud Developers Console: Create an account and set up an app on the Google Cloud Developers Console. Here, you can generate API keys, IDs, and set URLs for Google authentication.
-
Facebook for Developers: Create an account and set up an app on Meta Connect. Here, you can generate API keys, IDs, and set URLs for Facebook authentication.
-
Clone the Repository: In your terminal, use the following command to clone this repository:
git clone https://github.com/vicnesterenko/Login-with-Google-and-Facebook
-
Create a Virtual Environment:
On Windows:
cd path\to\your\project\directory python -m venv your_venv_name your_venv_name\Scripts\activate
On macOS and Linux:
cd path/to/your/project/directory python3 -m venv your_venv_name source your_venv_name/bin/activate
-
Install Dependencies: Install the required dependencies using pip:
pip install -r requirements.txt
-
Apply Database Migrations:
Run the following commands to apply database migrations:
python manage.py makemigrations python manage.py migrate
-
Create an Admin Account:
python manage.py createsuperuser
-
Configure API Keys and IDs:
Replace
API_KEY
andID
values for each app in the admin page located athttp://127.0.0.1:8000/admin/socialaccount/socialapp/
. -
Start the Django Development Server:
python manage.py runserver
Your application will be accessible at
http://127.0.0.1:8000/
.
For Facebook authentification we need a secure connection(https). To run the server locally or on the deployment platform try this:
-
Install libs:
pip install Werkzeug pip install django-extensions pip install pyOpenSSL
-
Run server with this command:
python manage.py runserver_plus --key-file selftest-key --cert-file selftest-cert localhost:8000
Facebook brings some problems with domains when I deploy it in Pythonanywhere platform. In local usage, it makes authentification for Facebook.
Also, you can check about this problem here Domains problem in Facebook.