8000 GitHub - milon19/orm-optim: The Art of Django ORM Optimization :smirk:
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

milon19/orm-optim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Art of Django ORM Optimization

Project Setup

  • Clone the repository
git clone https://github.com/milon19/orm-optim.git
  • Create a postgres database
psql -U postgres -c "CREATE DATABASE <dbname>"
  • Go the project directory
cd orm-optim
  • Create a file named .env in the project root directory and add the following lines

Note: Replace <username> and <password> with your postgres username and password. See .env.example file for reference

SECRET_KEY=super-insecure-django-key
DEBUG=True
ALLOWED_HOSTS=*

DB_HOST=localhost
DB_PORT=5432
DB_NAME=<dbname>
DB_USERNAME=<username>
DB_PASSWORD=<password>
  • Create a virtual environment
virtualenv <name>
  • Activate the virtual environment
source <name>/bin/activate
  • Install the dependencies
pip install -r requirements/local.txt
  • Run the migrations
python manage.py migrate
  • Run the server
python manage.py runserver
  • Run management commands to populate the data.
python manage.py generate_sample_data
  • Create a django application (if needed)
mkdir apps/<app_name>
python manage.py startapp <app_name> apps/<app_name>

Introduction

A car rental company needs to build a system where rental companies can list their cars with dynamic pricing across multiple currencies. The system needs to handle weekly pricing, multiple images per car, various rental packages, and additional addons.

Core Business Points

  • Rental companies can list their cars, providing details like location, features etc.
  • Rental companies can set weekly pricing for their cars.
  • Rental companies can set multiple images for their cars.
  • Rental companies can set various rental packages for their cars.
  • Rental companies can set additional addons for rental packages.

Database Models

alt text

Tasks

  • Task 1: Implement an API endpoint to list all the cars. details.

About

The Art of Django ORM Optimization 😏

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages