This is a Django-based application for managing an online library system. It includes features for user management, book management, and feedback submission. The project is designed for production deployment using Docker, PostgreSQL, and Nginx.
- User authentication (registration, login, logout).
- Book catalog management.
- Feedback and reviews for books.
- Production-ready setup with Docker Compose.
- Python 3.12+
- PostgreSQL 15+
- Docker and Docker Compose
- Git
git clone https://github.com/binbawany/e_library.git
cd <repository-name>
Create a .env
file in the project root with the following variables:
# Django settings
SECRET_KEY=your-secret-key
DEBUG=False
ALLOWED_HOSTS=127.0.0.1,localhost
# Database settings
POSTGRES_DB=e_library
POSTGRES_USER=your-db-user
POSTGRES_PASSWORD=your-db-password
POSTGRES_HOST=db
POSTGRES_PORT=5432
docker-compose up --build -d
- The application will be accessible at http://localhost:80.
- Django admin panel: http://localhost:80/admin
- Create a superuser with:
docker-compose exec web python manage.py createsuperuser
- Create a superuser with:
/templates/
: Contains HTML templates for the application./static/
: Contains static files (CSS, JS, images)./nginx.conf
: Nginx configuration for reverse proxy.Dockerfile
: Multi-stage Dockerfile for production.docker-compose.yml
: Docker Compose configuration.
- Install dependencies:
pip install -r requirements.txt
- Apply migrations:
python manage.py migrate
- Run the development server:
python manage.py runserver
- Database Connection Issues: Ensure the PostgreSQL service is running and the
.env
file is correctly configured. - Static Files Not Loading: Run
python manage.py collectstatic
to gather static files. - Permission Errors: Check Docker volume permissions.
- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Commit changes and push:
git add . git commit -m "Add feature" git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License.
- Bin Bawany
- Email: [email protected]