Skip to content

Update Django Flex Example to CloudSQL v2 #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 25, 2016
Merged

Update Django Flex Example to CloudSQL v2 #616

merged 2 commits into from
Oct 25, 2016

Conversation

waprin
Copy link
Contributor

@waprin waprin commented Oct 25, 2016

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 25, 2016
# Locally, you can use the CloudSQL proxy to proxy a localhost connection
# to the instance
if os.getenv('APPENGINE_FLEXIBLE'):
DATABASES['default']['HOST'] = '/cloudsql/<your-cloudsql-connection-string>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you have to separate database configs local and live and tell django to switch between them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If by different database configs you mean not have them both on default, you could, but then all your code and management commands have to specify the database, which I don't think is what you want for local vs production, because all the code would probably just point to some settings flag and it's a lot of code that accomplishes nothing. I think the feature is more for cases where in production there's multiple databases. If by different database configs you mean just totally separate dict objects that we pick here, it's just a readability preference. Since the configs are the same except for a single line, I thought this was easiest, you don't have to type in the password in two places, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, then this is fine.

@waprin
Copy link
Contributor Author

waprin commented Oct 25, 2016

@dpebot squash merge on travis green

@dpebot
Copy link
Collaborator

dpebot commented Oct 25, 2016

Okay! I'll merge when all statuses are green.

@dpebot dpebot added the automerge Merge the pull request once unit tests and other checks pass. label Oct 25, 2016
@waprin waprin merged commit d14074a into master Oct 25, 2016
@theacodes theacodes deleted the django_cloudsql branch November 15, 2016 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge the pull request once unit tests and other checks pass. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants