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.
- Django Rest Framework (DRF)
- PostgreSQL
- AWS S3 for media storage
- Django CORS headers
- Django Debug Toolbar
- React
- Vite
- Modern UI components
- Responsive design
- 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
Before running this project, make sure you have:
- Python 3.x
- npm (Node Package Manager)
- PostgreSQL
- AWS Account with S3 bucket configured
- Git
- Clone the repository:
git clone https://github.com/ahmed8047762/AWS-services-DRF-integration
cd myblogproject
- 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
- Set up the frontend:
cd frontend
npm install
-
Configure your
.env
file with necessary AWS S3 credentials:- AWS_S3_ACCESS_KEY_ID
- AWS_S3_SECRET_ACCESS_KEY
- AWS_STORAGE_BUCKET_NAME
-
Configure AWS S3:
- Create an S3 bucket
- Set up appropriate IAM user with necessary permissions
- Update bucket policy for public access if required
- Start the backend server:
python manage.py runserver
- Start the frontend development server:
cd frontend
npm run dev
The application will be available at:
- Backend: http://localhost:8000
- Frontend: http://localhost:5173
- Backend API endpoints are available at
/api/
- Django admin interface is available at
/admin/
- Frontend development server runs on port 5173 by default
For production deployment:
-
Set appropriate environment variables:
- Set
DEBUG=False
- Configure proper
ALLOWED_HOSTS
- Enable security settings
- Set up proper CORS configuration
- Set
-
Configure proper security settings:
- Enable SSL
- Set secure cookie settings
- Configure proper CORS origins
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.