{"id":9686,"library":"django-snowflake","title":"Django Snowflake Backend","description":"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.","status":"active","version":"6.0","language":"python","source_language":"en","source_url":"https://github.com/Snowflake-Labs/django-snowflake","tags":["django","database","snowflake","backend"],"install":[{"cmd":"pip install django-snowflake","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"This is a database backend for Django applications. Version 6.0 requires Django 5.x.","package":"Django","optional":false},{"reason":"Underlying Python connector for Snowflake.","package":"snowflake-connector-python","optional":false}],"imports":[{"note":"The correct engine path is simply 'django_snowflake', not a deeper internal module path.","wrong":"DATABASES = {'default': {'ENGINE': 'django_snowflake.base', ...}}","symbol":"ENGINE setting","correct":"DATABASES = {'default': {'ENGINE': 'django_snowflake', ...}}"}],"quickstart":{"code":"import os\n\nDATABASES = {\n    \"default\": {\n        \"ENGINE\": \"django_snowflake\",\n        \"NAME\": os.environ.get(\"SNOWFLAKE_DATABASE\", \"mydb\"),\n        \"USER\": os.environ.get(\"SNOWFLAKE_USER\", \"my_user\"),\n        \"OPTIONS\": {\n            \"ACCOUNT\": os.environ.get(\"SNOWFLAKE_ACCOUNT\", \"myaccount\"),\n            \"PASSWORD\": os.environ.get(\"SNOWFLAKE_PASSWORD\", \"\"),\n            \"WAREHOUSE\": os.environ.get(\"SNOWFLAKE_WAREHOUSE\", \"my_warehouse\"),\n            \"ROLE\": os.environ.get(\"SNOWFLAKE_ROLE\", \"my_role\"),\n            # Optional: Specify the schema if not using a DSN that includes it\n            \"SCHEMA\": os.environ.get(\"SNOWFLAKE_SCHEMA\", \"public\")\n            # For key-pair authentication, provide PRIVATE_KEY instead of PASSWORD:\n            # \"PRIVATE_KEY\": os.environ.get(\"SNOWFLAKE_PRIVATE_KEY\", \"\"),\n            # \"PRIVATE_KEY_PASSPHRASE\": os.environ.get(\"SNOWFLAKE_PRIVATE_KEY_PASSPHRASE\", \"\")\n        },\n    }\n}\n\n# Example of using a DSN (Data Source Name) instead of separate options:\n# DATABASES = {\n#     \"default\": {\n#         \"ENGINE\": \"django_snowflake\",\n#         \"NAME\": os.environ.get(\"SNOWFLAKE_DATABASE\", \"mydb\"),\n#         \"OPTIONS\": {\n#             \"DSN\": os.environ.get(\n#                 \"SNOWFLAKE_DSN\",\n#                 \"snowflake://{user}:{password}@{account}.snowflakecomputing.com/{database}/{schema}?warehouse={warehouse}&role={role}\"\n#             ).format(\n#                 user=os.environ.get(\"SNOWFLAKE_USER\", \"my_user\"),\n#                 password=os.environ.get(\"SNOWFLAKE_PASSWORD\", \"\"),\n#                 account=os.environ.get(\"SNOWFLAKE_ACCOUNT\", \"myaccount\"),\n#                 database=os.environ.get(\"SNOWFLAKE_DATABASE\", \"mydb\"),\n#                 schema=os.environ.get(\"SNOWFLAKE_SCHEMA\", \"public\"),\n#                 warehouse=os.environ.get(\"SNOWFLAKE_WAREHOUSE\", \"my_warehouse\"),\n#                 role=os.environ.get(\"SNOWFLAKE_ROLE\", \"my_role\")\n#             )\n#         },\n#     }\n# }","lang":"python","description":"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."},"warnings":[{"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).","message":"django-snowflake v6.0 requires Django 5.x. Previous versions of django-snowflake supported older Django versions.","severity":"breaking","affected_versions":">=6.0"},{"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.","message":"The `TYPE: 'SNOWFLAKE'` option is no longer required in `DATABASES` settings for django-snowflake versions >= 5.0. Including it is harmless but unnecessary.","severity":"gotcha","affected_versions":">=5.0"},{"fix":"Prefer either a complete DSN string OR individual `OPTIONS` parameters. Avoid using both for the same connection unless explicitly documented for specific overrides.","message":"When 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.","severity":"gotcha","affected_versions":"all"},{"fix":"Set `\"SCHEMA\": \"your_schema_name\"` in the `OPTIONS` dictionary of your `DATABASES` configuration to ensure Django queries target the correct schema.","message":"Snowflake'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.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'6.0':29 'activ':32 'address':45 'applic':15 'backend':3,11,55 'connect':17 'current':26 'data':22 'databas':10,53 'django':1,5,9,14,42,52 'django-snowflak':4 'enabl':13 'featur':49 'issu':51 'latest':41 'maintain':33 'new':36 'primarili':34 'releas':35,43 'snowflak':2,6,21,47,54 'snowflake-specif':46 'specif':48 'support':39 'use':20 'version':28,37 'warehous':23","created_at":"2026-04-17T01:20:12.144816+00:00","updated_at":"2026-04-17T01:20:12.144816+00:00","problems":{"verify_error":"no import statement found"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"6.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/Snowflake-Labs/django-snowflake","docs":null,"changelog":null,"pypi":"https://pypi.org/project/django-snowflake/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-05","install_tag":null}}