Reputation: 1731
I am trying to set up my Django site using Azure Websites (not an Azure VM). I got a site with some static pages up and running, and I created an Azure SQL Database, but how do I connect the Django site to use the Azure db?
Upvotes: 2
Views: 626
Reputation: 1
I understand you can use something like the following in your settings.py
file
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.environ['DBNAME'],
'HOST': hostname + ".postgres.database.azure.com",
'USER': os.environ['DBUSER'] + "@" + hostname,
'PASSWORD': os.environ['DBPASS']
}
}
Upvotes: 0
Reputation: 22561
django-pyodbc-azure is a refined fork of django-pyodbc, a Django MS SQL Server external DB backend that uses ODBC by employing the pyodbc library. It supports MS SQL Server and Windows Azure SQL Database.
Features
Upvotes: 3