django-google-cloud-sql
django-google-cloud-sql copied to clipboard
Django Google Cloud SQL
h1. djangoappengine_rbdms
This is a toolkit to run native django code with admin in the Google AppEngine. This project is inspired (forked) in the very google djangoappengine project. I based many code and modules in that project.
h2. WARNINGS
It is working with some limitations, it is not tested and I'm NOT using it. The remote command is not working at all. DO NOT USE IT IN PRODUCTION.
h2. PREREQUISITES
GAE Instance created
Google SQL Cloud instance created
GAE SDK 1.6 instaled and working
h2. INSTALATION:
This instalation does not include the django instalation, or GAE SDK instalation. Basicaly setup a basic django project,
pre. django-admin.py starproject example
and copy or synlink the djangoappengine_rdbms to the root of your project. You should not install or put these files in the path beacuse they need to deployed to appengine. You can also checkout the example project
h2. SETUP:
add the following line to your settings
pre. from djangoappengine_rdbms.settings_base import *
and configure you database.
pre. DATABASES = { 'default': { 'ENGINE': 'djangoappengine_rdbms.db.backend', 'INSTANCE': 'djangosqlcloudmysql:example', 'NAME': 'example', # Or path to database file if using sqlite3. 'USER': 'root', # Not used with sqlite3. 'PASSWORD': 'root', } }
h2. RUNNING:
Just run the default runserver django command
pre. ./manage.py runserver
h2. DEPLOY:
pre. ./manage.py deploy
As long as the remote command is not working I used the command line tool provide by Google to setup up the DB.
h2. TODO:
Make remote commands work - Google Cloud SQL does not use the stub services. Strategy: Access the directely the instance like the command line tool provided by Google
Write better instalations intructions.
Test, test, test
h2. GAMBIARRA (a portugues word that means something like a "quick fix"):
It is not possible yet (I hope) to access the Google Cloud SQL via stub infra-structures, só a I plan adpat the http://shell.appspot.com/ to django shell insted of a python shell.
h2. GAMBIARRA 2 - webaccess to django manage.py commands
add the following line to your urls in urls.py to access the manage.py commands.
pre. (r'^appengine/admin/', include('djangoappengine_rdbms.urls')),