Skip to content

This Django application is designed to store and manage property information efficiently. It utilizes Django's powerful admin interface for CRUD operations and includes custom models to handle various aspects of property data, such as images, locations, and amenities.

Notifications You must be signed in to change notification settings

aa-nadim/inventory-management

Repository files navigation

inventory-management

A Django-based application for managing and storing property information using Django admin. This project allows for efficient handling of property details, including images, locations, policies and amenities

Features

  • Property Management: Store and manage detailed property information.
  • Django Admin Interface: Customized admin panel for easy CRUD operations.

Technologies Used

  • Backend: Python, Django
  • Database: PostgreSQL
  • ORM: Django ORM
  • Containerization: Docker
  • Web-Based Database Management: pgAdmin

Prerequisites

Ensure you have the following installed:

  • Python 3.x
  • PostgreSQL
  • Docker
  • Git

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/aa-nadim/inventory-management.git
    cd inventory-management
  2. Set up a virtual environment:

    python3 -m venv .venv 
    source .venv/bin/activate   # On Windows use `source .venv/bin/activate`
  3. Install the dependencies:

    pip install -r requirements.txt

Database Configuration

  1. Create a config.py file in the inventory-management root directory and add your PostgreSQL credentials:

    # config.py
    DB_USERNAME = 'your_username'
    DB_PASSWORD = 'your_password'
    DB_HOST = 'localhost'
    DB_PORT = 'port'
    DJANGO_DBNAME = 'django_project_database_name'
    SECRET_KEY = 'your SECRET_KEY'
  2. Create a .env file in the inventory-management root directory and add your PostgreSQL credentials:

    DB_USERNAME=your_username
    DB_PASSWORD=your_password
    DB_HOST=localhost
    DB_PORT=port
    DJANGO_DBNAME=django_project_database_name
    SECRET_KEY=your_SECRET_KEY
    
  3. Ensure PostgreSQL is running

Running the Application

  1. start docker

    docker-compose up --build -d
  2. Apply migrations:

    docker exec -it inventoryManagement python manage.py makemigrations
    docker exec -it inventoryManagement python manage.py migrate
  3. Create a superuser:

    docker exec -it inventoryManagement python manage.py createsuperuser

Usage

  1. http://localhost:8000

  2. http://localhost:8000/signup/ -- successful signup --> http://localhost:8000/signup/success/. If the admin permite the Active and Staff status of the user then the user can login into the admin pannel.

  3. when a user sings up, he/she will automaticaly Property Owners group will be assigned to the user.

  4. Initially Property Owners has no permmission for any activities. Admin has to assign the permission to the Property Owners group.

  5. Access the admin panel at http://localhost:8000/admin/ and log in with your superuser credentials.

  6. To see database in pgadmin goto http://localhost:5050 and use your_username=admin@admin.com and your_password=admin123 to login. Then connect to localhost:5432 with your_db_username and your_db_password where host=postgres_db.

Documentation

Command-Line Utility for Sitemap Generation

To generate a sitemap.json file for all country locations.

docker exec -it inventoryManagement python manage.py generate_sitemap

Add accommodation Amenities field

[
   "Free Wi-Fi",
   "Air Conditioning",
   "Swimming Pool",
   "Pet-Friendly",
   "Room Service",
   "Gym Access"
]

Add Localized Accommodation Aolicy field

{
   "pet_policy": {
      "en": "Pets are not allowed.",
      "ar": "لا يُسمح بالحيوانات الأليفة."
   },
   "smoking_policy": {
      "en": "Smoking is prohibited indoors.",
      "ar": "التدخين ممنوع داخل المبنى."
   }
}

Testing Instructions

docker exec -it inventoryManagement pytest --cov=properties --cov-report=term-missing
docker exec -it inventoryManagement pytest --cov=properties --cov-report=html:coverage_report

Open the coverage_report/index.html file in a web browser to view the detailed coverage report.

About

This Django application is designed to store and manage property information efficiently. It utilizes Django's powerful admin interface for CRUD operations and includes custom models to handle various aspects of property data, such as images, locations, and amenities.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published