Django Hotels API
This is a Django REST API for managing and retrieving hotels, room types, availability, and bookings.
This service is a sibling of django-trips, and is a core component of the DestinationPak project — a platform designed to make exploring and booking adventures across Pakistan easier and more accessible.
Installation
Simply do:
pip install django-hotels
Usage
Add the app into your installed apps in your project's settings file.
INSTALLED_APPS = [
...
'django_hotels',
]
Migrate
python manage.py migrate
Add the following to your root urls.py or to your desired file location.
urlpatterns = [
...
path('hotels/', include('django_hotels.urls')),
]
This mounts the whole app under your own chosen namespace (hotels/ above - replace with
whatever prefix you like) with the lib's own v1/ version underneath it, e.g.
hotels/v1/hotels/. The app versions itself independently of your project's own API version.
Domain model
HotelOwner (the business/brand)
└── Hotel (one bookable property)
├── HotelImage
└── HotelRoomType (a room category/tier)
└── HotelAvailability (a dated, priced, bookable instance)
└── HotelBooking (a guest or logged-in traveller's booking)
HotelOwner/Hotel deliberately carry no login/auth/permission fields — this package is
tenancy-oblivious, the same way django-trips is. A consuming project owns the membership
layer (who may manage which HotelOwner), not this library.
Local development
All commands assume Docker (make dev.up, make update_db, make test) — see the Makefile
for the full command list (make help).
Generate demo data
./manage.py generate_hotels --batch_size=10
Release files for django-hotels 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_hotels-0.1.0.tar.gz | 14.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_hotels-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.1 kB
Release files / django_hotels-0.1.0.tar.gz
| Download URL | django_hotels-0.1.0.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
74e359e49ddab33149e8ae2ecfe6e43df0749ee120b618bef678c608b5d8eef8
|
|
BLAKE2b-256 checksum How to use checksums |
061784dbc4915335a0fb2d567c83ba83f60dcfc5cf57d41709d7d9c670d17879
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency logRelease files / django_hotels-0.1.0-py3-none-any.whl
| Download URL | django_hotels-0.1.0-py3-none-any.whl |
|---|---|
| Size | 17.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1094018706f65157e6f9c88bb774219f74c0857bbbc4800aa0035e3f841727c1
|
|
BLAKE2b-256 checksum How to use checksums |
8760c7478c0160bba9ee9e8fa917b6022a4e75bda35715b4fb20bc6164b92933
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 15, 2026.
Transparency log