Code Monkey home page Code Monkey logo

django-safedelete's Introduction

Django Library Management System with Django Soft-Delete functionality

This project demonstrates the implementation of a Library Management System using Django, incorporating soft delete functionality through the django-safedelete package. It includes multiple models, a Django REST Framework (DRF) API, and basic CRUD operations.

Project Structure

  • library_project: Django project directory.
  • library: Django app containing models, views, serializers, and URLs.

Setup

  1. Clone the repository:

    git clone https://github.com/MehediMK/django-safedelete.git
    cd library_project
  2. Create and activate a virtual environment:

    # Create virtual environment
     python3 -m venv venv
    
     # Activate virtual environment (Linux/Mac)
     source venv/bin/activate
    
     # Activate virtual environment (Windows)
     venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
  4. Apply database migrations:

    python manage.py migrate
  5. Create a superuser:

    python manage.py createsuperuser
  6. Run the development server:

    python manage.py runserver
  7. To load dummy data which was existing in fixtures directory

 python manage.py loaddata authors.json
 python manage.py loaddata books.json
  1. Access the Django admin interface at http://127.0.0.1:8000/admin/ to add authors and books.

Docker Instructions

To run the project using Docker, follow these steps:

  1. Make sure Docker is installed on your system. If not, you can download and install Docker from here.

  2. Build the Docker image and start the container:

    docker-compose up --build
  3. Access the Django project at http://localhost:8000.


Features

  • Soft Delete: Utilizes django-safedelete to implement soft delete functionality, allowing records to be marked as deleted without physically removing them from the database.
  • RESTful API: Provides CRUD operations for authors and books through a DRF API.
  • Admin Interface: Allows easy management of library data through the Django admin interface.
  • Fixture Data: Included fixture files provide sample data for authors and books to quickly populate the database.

Usage

Django Admin

  1. Create superuser: python manage.py createsuperuser
  2. Visit http://127.0.0.1:8000/admin/
  3. Log in with superuser credentials.
  4. Add authors and books through the admin interface.

RESTful API

  • Authors: http://127.0.0.1:8000/api/authors/
  • Books: http://127.0.0.1:8000/api/books/

Contributors

Feel free to customize this README file further based on your project's specific details and requirements!

django-safedelete's People

Contributors

mehedimk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.