Skip to main content

Utilities to run Django on Google Cloud Platform

Project description

PyPI version codecov Documentation pre-commit black

DjangoGCP

Helps you to run Django on Google Cloud Platform:

  • Storage (including direct uploads)
  • Events (PubSub)
  • Tasks (ad-hoc and scheduled)
  • Logging (pretty colours and labels) and
  • Error Reporting.

Read the documentation here.

This app is maintained by Octue - we're on a mission to help climate scientists and energy engineers be more efficient. Find out more. If you need some help implementing django-gcp, or wish to sponsor a feature or any of the issues on the board, we can help! Raise an issue or contact us.

Are you from GCP??

If so, get in touch for a chat. We're doing fun things with Google Cloud. Way funner than boring old django... :)

All the :heart:

This app is based heavily on django-storages, django-google-cloud-tasks and uses the django-rabid-armadillo template. Big love.

Contributing

It's pretty straightforward to get going, but it's good to get in touch first, especially if you're planning a big feature.

Set up

Open the project in codespaces, a vscode .devcontainer (which is configured out of the box for you) or your favourite IDE or editor (if the latter you'll need to set up docker compose yourself).

Create a file .devcontainer/docker-compose.developer.yml. This allows you to customise extra services and volumes you make available to the container. For example, you can map your own gcloud config folder into the container to use your own credentials. This example will get you going, but you can just leave the services key empty.

version: "3.8"

services:
  web:
    volumes:
      - ..:/workspace:cached
      - $HOME/.config/gcloud:/gcp/config

    environment:
      - CLOUDSDK_CONFIG=/gcp/config
      - GOOGLE_APPLICATION_CREDENTIALS=/gcp/config/your-credentials-file.json

Initialise gcloud CLI

To sign in (enabling use of the gcloud CLI tool), do:

gcloud config set project octue-django-gcp
gcloud auth login

Run the tests

Run the tests:

pytest .

We use pre-commit to ensure code quality standards (and to help us automate releases using conventional-commits). If you can get on board with this that's really helpful - if not, don't fret, we can help.

Use the example app

You can start the example app (which is useful for seeing how django-gcp looks in the admin.

Initially, do:

python manage.py migrate
python manage.py createsuperuser
# make yourself a user account at the prompt

Then to run the app, do:

python manage.py runserver

...and visit http://localhost:8000/admin/ to sign in.

Update the docs

We're pretty good on keeping the docs helpful, friendly and up to date. Any contributions should be fully documented.

To help develop the docs quickly, we set up a watcher that rebuilds the docs on save. Start it with:

python docs/watch.py

Once docs are building, the the vscode live server extension (or whatever the equivalent is in your IDE) to live-reload docs/html/index.html in your browser, then get started!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_gcp-0.25.0.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_gcp-0.25.0-py3-none-any.whl (73.9 kB view details)

Uploaded Python 3

File details

Details for the file django_gcp-0.25.0.tar.gz.

File metadata

  • Download URL: django_gcp-0.25.0.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_gcp-0.25.0.tar.gz
Algorithm Hash digest
SHA256 e5914b41b49e7f15aaed4aaaa47b6593979b35a2a69a57f355cab0b5937390ab
MD5 709e807f6164c3940be24d33c8f66eab
BLAKE2b-256 7bc8fca68e6c1cbb64ccba4b954cd52e10a069ec57813c09ca3114a199bbc7b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_gcp-0.25.0.tar.gz:

Publisher: cd.yml on octue/django-gcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_gcp-0.25.0-py3-none-any.whl.

File metadata

  • Download URL: django_gcp-0.25.0-py3-none-any.whl
  • Upload date:
  • Size: 73.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_gcp-0.25.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a67d685924b18d8f954e397ef4d33e1e19cdace6a8ecaf6117e07527d0aaa35
MD5 372c3b1d2ebac337d5aa0c666cb8fa44
BLAKE2b-256 f76fd4efdca5987f4c067223181b38862df31ff228ed59ff30b33e6bb3d0f2c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_gcp-0.25.0-py3-none-any.whl:

Publisher: cd.yml on octue/django-gcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page