Skip to content

e_library as a final project for python students

Notifications You must be signed in to change notification settings

binbawany/e_library

Repository files navigation

Django E-Library Project

Overview

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.


Features

  • User authentication (registration, login, logout).
  • Book catalog management.
  • Feedback and reviews for books.
  • Production-ready setup with Docker Compose.

Prerequisites

  • Python 3.12+
  • PostgreSQL 15+
  • Docker and Docker Compose
  • Git

Installation

1. Clone the Repository

git clone https://github.com/binbawany/e_library.git
cd <repository-name>

2. Set Up Environment Variables

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

3. Build and Run with Docker Compose

docker-compose up --build -d

Accessing the Application


Folder Structure

  • /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.

Running Locally (Without Docker)

  1. Install dependencies:
    pip install -r requirements.txt
  2. Apply migrations:
    python manage.py migrate
  3. Run the development server:
    python manage.py runserver

Troubleshooting

  • 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.

Contribution

  1. Fork the repository.
  2. Create a new branch:
    git checkout -b feature-name
  3. Commit changes and push:
    git add .
    git commit -m "Add feature"
    git push origin feature-name
  4. Open a pull request.

License

This project is licensed under the MIT License.


Author

About

e_library as a final project for python students

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published