Skip to content

A full-stack blog application integrating Django Rest Framework with React, featuring AWS S3 media storage and PostgreSQL database for efficient content management and media handling.

License

Notifications You must be signed in to change notification settings

ahmed8047762/AWS-services-DRF-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

My Blog Project

A full-stack blog application integrating Django Rest Framework with React, featuring AWS S3 media storage and PostgreSQL database for efficient content management and media handling.

Tech Stack

Backend

  • Django Rest Framework (DRF)
  • PostgreSQL
  • AWS S3 for media storage
  • Django CORS headers
  • Django Debug Toolbar

Frontend

  • React
  • Vite
  • Modern UI components
  • Responsive design

Features

  • Blog post creation and management
  • Media file uploads to AWS S3
  • Responsive UI
  • Cross-Origin Resource Sharing (CORS) enabled
  • Secure configuration settings
  • Debug toolbar for development

Prerequisites

Before running this project, make sure you have:

  • Python 3.x
  • npm (Node Package Manager)
  • PostgreSQL
  • AWS Account with S3 bucket configured
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/ahmed8047762/AWS-services-DRF-integration
cd myblogproject
  1. Set up the backend:
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Set up environment variables
cp .env.example .env
# Edit .env with your configurations

# Run migrations
python manage.py migrate
  1. Set up the frontend:
cd frontend
npm install

Configuration

  1. Configure your .env file with necessary AWS S3 credentials:

    • AWS_S3_ACCESS_KEY_ID
    • AWS_S3_SECRET_ACCESS_KEY
    • AWS_STORAGE_BUCKET_NAME
  2. Configure AWS S3:

    • Create an S3 bucket
    • Set up appropriate IAM user with necessary permissions
    • Update bucket policy for public access if required

Running the Application

  1. Start the backend server:
python manage.py runserver
  1. Start the frontend development server:
cd frontend
npm run dev

The application will be available at:

Development

  • Backend API endpoints are available at /api/
  • Django admin interface is available at /admin/
  • Frontend development server runs on port 5173 by default

Production Deployment

For production deployment:

  1. Set appropriate environment variables:

    • Set DEBUG=False
    • Configure proper ALLOWED_HOSTS
    • Enable security settings
    • Set up proper CORS configuration
  2. Configure proper security settings:

    • Enable SSL
    • Set secure cookie settings
    • Configure proper CORS origins

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a new Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A full-stack blog application integrating Django Rest Framework with React, featuring AWS S3 media storage and PostgreSQL database for efficient content management and media handling.

Topics

Resources

License

Stars

Watchers

Forks