Alpha release
With this release tagged as Alpha, you can install django-spanner by following these 3 steps below:
1. Installing it
Please see installing it
Create a Cloud Spanner database
If you haven't already created a Cloud Spanner database, please do so by following this guide: https://cloud.google.com/spanner/docs/quickstart-console
Afterwards, please take note of the project-id, instance name, database name and application default credentials (ADCs).
2. Edit your settings.py file
DATABASES = {
'default': {
'ENGINE': 'django_spanner',
'PROJECT': '<project_id>',
'INSTANCE': '<instance_id>',
'NAME': '<database_name>',
},
}
Example
For example:
DATABASES = {
'default': {
'ENGINE': 'django_spanner',
'PROJECT': 'appdev-soda-spanner-staging', # Or the GCP project-id
'INSTANCE': 'django-dev1', # Or the Cloud Spanner instance
'DATABASE': 'db1', # Or the Cloud Spanner database to use
}
}
Run your application/migrations
Run your application and migrations as you normally would.
Fully fledged example
We've got some examples in https://github.com/googleapis/python-spanner-django/tree/master/examples and at the end of say running healthchecks.io, the migration should produce the following when viewed on the Cloud Spanner UI
Next steps
Please try it out, file/report bugs, provide feedback, share your shares, let us know what you think.
We are on the journey towards a Beta and then finally to General Availability someday. For now we'll keep working on improving it, ironing out bugs and fixing them as we go on.
Thank you.
Kind regards,
Django-Spanner team