Registry / database / django-snowflake

django-snowflake

JSON →
library6.0pypypiunverified

django-snowflake is a Django database backend that enables Django applications to connect to and use Snowflake data warehouses. It's currently at version 6.0 and is actively maintained, primarily releasing new versions to support the latest Django releases and address Snowflake-specific features or issues.

pip install django-snowflake
INSTALL
IMPORT
SIG · DJANGO-SNOWFLAKE
D
django-snowflake
databasepythonv6.0
Install
8.2s avg
Import
Disk
130MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v5.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 8.2s · import 0.000s · 138MB
130MB installed
● package 130MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ENGINE setting
DATABASES = {'default': {'ENGINE': 'django_snowflake', ...}}
DATABASES = {'default': {'ENGINE': 'django_snowflake.base', ...}}
The correct engine path is simply 'django_snowflake', not a deeper internal module path.

Configure your `settings.py` `DATABASES` entry. It's recommended to use environment variables for sensitive credentials and connection details. The `NAME` parameter typically refers to the database in Snowflake. You can provide connection details via individual `OPTIONS` or a full `DSN` string.

import os DATABASES = { "default": { "ENGINE": "django_snowflake", "NAME": os.environ.get("SNOWFLAKE_DATABASE", "mydb"), "USER": os.environ.get("SNOWFLAKE_USER", "my_user"), "OPTIONS": { "ACCOUNT": os.environ.get("SNOWFLAKE_ACCOUNT", "myaccount"), "PASSWORD": os.environ.get("SNOWFLAKE_PASSWORD", ""), "WAREHOUSE": os.environ.get("SNOWFLAKE_WAREHOUSE", "my_warehouse"), "ROLE": os.environ.get("SNOWFLAKE_ROLE", "my_role"), # Optional: Specify the schema if not using a DSN that includes it "SCHEMA": os.environ.get("SNOWFLAKE_SCHEMA", "public") # For key-pair authentication, provide PRIVATE_KEY instead of PASSWORD: # "PRIVATE_KEY": os.environ.get("SNOWFLAKE_PRIVATE_KEY", ""), # "PRIVATE_KEY_PASSPHRASE": os.environ.get("SNOWFLAKE_PRIVATE_KEY_PASSPHRASE", "") }, } } # Example of using a DSN (Data Source Name) instead of separate options: # DATABASES = { # "default": { # "ENGINE": "django_snowflake", # "NAME": os.environ.get("SNOWFLAKE_DATABASE", "mydb"), # "OPTIONS": { # "DSN": os.environ.get( # "SNOWFLAKE_DSN", # "snowflake://{user}:{password}@{account}.snowflakecomputing.com/{database}/{schema}?warehouse={warehouse}&role={role}" # ).format( # user=os.environ.get("SNOWFLAKE_USER", "my_user"), # password=os.environ.get("SNOWFLAKE_PASSWORD", ""), # account=os.environ.get("SNOWFLAKE_ACCOUNT", "myaccount"), # database=os.environ.get("SNOWFLAKE_DATABASE", "mydb"), # schema=os.environ.get("SNOWFLAKE_SCHEMA", "public"), # warehouse=os.environ.get("SNOWFLAKE_WAREHOUSE", "my_warehouse"), # role=os.environ.get("SNOWFLAKE_ROLE", "my_role") # ) # }, # } # }
Debug
Known issues
breakingdjango-snowflake v6.0 requires Django 5.x. Previous versions of django-snowflake supported older Django versions.
fix
Ensure your Django project is running Django 5.x. If not, upgrade Django or use an older compatible version of django-snowflake (e.g., v5.x for Django 4.x).
affects: >=6.0
gotchaThe `TYPE: 'SNOWFLAKE'` option is no longer required in `DATABASES` settings for django-snowflake versions >= 5.0. Including it is harmless but unnecessary.
fix
You can safely remove `"TYPE": "SNOWFLAKE"` from your `DATABASES` configuration if you are on django-snowflake 5.0 or newer. It will not cause errors if left in.
affects: >=5.0
gotchaWhen using a DSN (Data Source Name) in `OPTIONS`, ensure all required parameters (user, password, account, database, schema, warehouse, role) are correctly embedded or provided. Mixing DSN with individual options can lead to unexpected behavior.
fix
Prefer either a complete DSN string OR individual `OPTIONS` parameters. Avoid using both for the same connection unless explicitly documented for specific overrides.
affects: all
gotchaSnowflake's default session schema might not be 'public'. If your Django models expect a specific schema, you must define it explicitly in the `SCHEMA` option or within the DSN.
fix
Set `"SCHEMA": "your_schema_name"` in the `OPTIONS` dictionary of your `DATABASES` configuration to ensure Django queries target the correct schema.
affects: all
Upgrade
Version history
6.0latest on PyPI · released Dec 6, 2025
Audit
Dependencies
DjangorequiredThis is a database backend for Django applications. Version 6.0 requires Django 5.x.
snowflake-connector-pythonrequiredUnderlying Python connector for Snowflake.
Agent activity
4 hits · last 30 days
node
4
Resources
django-snowflake — pip install django-snowflake · libregistry