Cloud Spanner is the world's first fully managed relational database service to offer both strong consistency and horizontal scalability for mission-critical online transaction processing (OLTP) applications. With Cloud Spanner you enjoy all the traditional benefits of a relational database; but unlike any other relational database service, Cloud Spanner scales horizontally to hundreds or thousands of servers to handle the biggest transactional workloads.
In order to use this library, you first need to go through the following steps:
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the Google Cloud Spanner API.
- Setup Authentication.
This package provides a 3rd-party database backend for using Cloud Spanner with the Django ORM. It uses the Cloud Spanner Python client library under the hood.
Install this library in a virtualenv using pip. virtualenv is a tool to create isolated Python and Django environments. The basic problem it addresses is one of dependencies and versions, and indirectly permissions.
With virtualenv, it's possible to install this library without needing system install permissions, and without clashing with the installed system dependencies.
The library supports Django 2.2, and Django 3.2. Both versions are long-term support (LTS) releases for the Django project<https://www.djangoproject.com/download/#supported-versions>_. The minimum required Python version is 3.6.
pip3 install django==3.2
To install from PyPI:
pip3 install django-google-spanner
To install from source:
< CEE0 div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="git clone git@github.com:googleapis/python-spanner-django.git cd python-spanner-django pip3 install -e .">git clone git@github.com:googleapis/python-spanner-django.git cd python-spanner-django pip3 install -e .