Skip to content

Instantly share code, notes, and snippets.

@hassanabidpk
Last active December 17, 2016 18:05
Show Gist options
  • Select an option

  • Save hassanabidpk/2b2aad13062b62039dbd3ebf9cfc4342 to your computer and use it in GitHub Desktop.

Select an option

Save hassanabidpk/2b2aad13062b62039dbd3ebf9cfc4342 to your computer and use it in GitHub Desktop.
For djangocupcakeshop project
if DEBUG:
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': 'cupcakeshop_db_local',
'USER': 'admincupcake',
'PASSWORD': '*****',
'HOST': 'cupcakeshop.database.windows.net',
'PORT': '1433',
'OPTIONS': {
'driver': 'FreeTDS',
'host_is_server': True,
},
}
}
else :
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': os.getenv("DATABASE_NAME"),
'USER': os.getenv("DATABASE_USER"),
'PASSWORD': os.getenv("DATABASE_PASSWORD"),
'HOST': 'os.getenv("DATABASE_HOST"),
'PORT': os.getenv("DATABASE_PORT"),
'OPTIONS' : {
'driver': 'ODBC Driver 13 for SQL Server',
'MARS_Connection': 'True',
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment