GoogleCloudPlatform / appengine-django-skeleton

A skeleton for creating App Engine applications using the Django framework.
BSD 3-Clause "New" or "Revised" License
134 stars 59 forks source link

Question / Problem : Table creation #19

Closed hepaestus closed 7 years ago

hepaestus commented 8 years ago

The commands in the Deploy section of the README don't seem to create the database tables on the google cloud. What else is required to get the installation up an running? How do I get the tables created on the app engine? Thanks, Pete.

nitrax92 commented 8 years ago

What happens when you run python manage.py migrate ?

you could also try to use python manage.py makemigrations first, and then try the migrate again.

More information about Django Migrations here

hepaestus commented 8 years ago

Those create the tables locally but not on the remote DB. :P Pete.

On Mon, Jun 20, 2016 at 11:37 AM, NitraxHub notifications@github.com wrote:

What happens when you run python manage.py migrate ?

you could also try to use python manage.py makemigrations first, and then try the migrate again.

More information about Django Migrations here https://docs.djangoproject.com/en/1.9/topics/migrations/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GoogleCloudPlatform/appengine-django-skeleton/issues/19#issuecomment-227179619, or mute the thread https://github.com/notifications/unsubscribe/AAKsSGSryjykrmZZYc1jHv_8PGX9hScVks5qNrPTgaJpZM4I5vQU .

nitrax92 commented 8 years ago

Aha.

Check out this link for how to set it up to connect to the Cloud SQL from local development https://cloud.google.com/appengine/docs/python/cloud-sql/django#running-the-development-server

Spesifically under the "Alternate development database and settings" section.

hepaestus commented 8 years ago

Still no love on my end. None of that stuff helped or was relevant. There is no clear way to get from step 4 to step 5 of the deploy section.

waprin commented 8 years ago

Sorry you haven't gotten it working yet.

The idea in the docs is that you use the remote CloudSQL database both locally and when you deploy. You may or may not want to do this but that's how the instructions are written. That means when you run the migrations, you are running them on the actual CloudSQL database.

Connecting to that database is differently locally or on App Engine. On App Engine, it's the unix socket. Locally, you open up connections from the outside and then connect via a usual host/port/database/user/password combination.

README for this repo absolutely needs improvement. Let me know if the above makes sense/where you're stuck and once we fix the issue you can give me some tips on how the doc could be more clear.