Social networking application built with Python Django and Django Rest Framework (DRF), using PostgreSQL as the database.
-
User Authentication
- Login and signup using email and password.
- Authentication required for all APIs except signup/login.
-
User Search Functionality
- API to search users by email and name (paginated).
- Exact email matches and partial name matches supported.
-
Friendship Operations
- APIs for sending/accepting/rejecting friend requests.
- List friends (accepted friend requests).
- List pending friend requests.
- Limit users to sending 3 friend requests per minute.
-
Clone the repository:
git clone https://github.com/your-username/social-networking.git
-
Navigate to the project directory:
cd social-networking
-
Install Python dependencies:
pip install -r requirements.txt
-
Database Setup:
- Ensure PostgreSQL is running.
- Create a new database for the project.
-
Configuration:
-
Create a
.env
file in the project root. -
Add the environment variables to the
.env
file: -
DEBUG
: Set toTrue
orFalse
for Django debugging. -
SECRET_KEY
: Django secret key for encryption.
DJANGO_POSTGRES_HOST
: PostgreSQL host.DJANGO_POSTGRES_PORT
: PostgreSQL port.DJANGO_POSTGRES_USER
: PostgreSQL username.DJANGO_POSTGRES_PASSWORD
: PostgreSQL password.DJANGO_POSTGRES_DATABASE
: PostgreSQL database name.
Note: Replace the placeholders with your actual values for the environment variables.
-
-
Run Migrations:
python manage.py migrate
-
Start the Django Development Server:
python manage.py runserver
-
Access the application: Open your web browser and go to
http://localhost:8000