Skip to content

Commit

Permalink
added google storage support and updated manage.py for dynamic manage…
Browse files Browse the repository at this point in the history
….py location
  • Loading branch information
littleq0903 committed May 2, 2013
1 parent dd1c0c2 commit 0e9130d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ pip-log.txt
.mr.developer.cfg

# Sphinx build
docs/_build/
docs/_build/
/.project
8 changes: 6 additions & 2 deletions django_deployer/paas_templates/appengine/manage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PROJECT_NAME="{{ project_name }}"
CLOUDSQL_DATABASENAME="{{ databasename }}"
CLOUDSQL_INSTANCENAME="{{ instancename }}"
APPENGINE_SDK_LOCATION={{ sdk_location }}
MANAGE_SCRIPT_LOCATION="{{ managepy }}"
APPLICATION_ID="{{ application_id }}"
PATH="$APPENGINE_SDK_LOCATION:$PATH"

Expand All @@ -12,7 +13,7 @@ export APPLICATION_ID
args=$@

manage_script () {
env/bin/python $PROJECT_NAME/manage.py $@ --settings=$DJANGO_SETTINGS_MODULE
env/bin/python $MANAGE_SCRIPT_LOCATION $@ --settings=$DJANGO_SETTINGS_MODULE
}


Expand All @@ -23,11 +24,14 @@ case "$1" in
cloudsyncdb)
export SETTINGS_MODE=prod && manage_script syncdb
;;
clouddbshell)
export SETTINGS_MODE=prod && manage_script dbshell
;;
deploy)
# packaging site-packages
cp -r env/lib/python2.7/site-packages ./
cd site-packages
rm -rf *.egg-info *.egg *.so *.pth django PIL
rm -rf *.so django PIL
cd -
# deploy
appcfg.py update --oauth2 .
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
django_rocket_engine
django-google-storage
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@
#4. Log out, and check for the validation email.

# use Blob datastore for default file storage
DEFAULT_FILE_STORAGE = 'rocket_engine.storage.BlobStorage'
DEFAULT_FILE_STORAGE = 'django-google-storage.storage.GoogleStorage'
GS_ACCESS_KEY_ID = '<fill-your-own>'
GS_SECRET_ACCESS_KEY = '<fill-your-own>'
GS_STORAGE_BUCKET_NAME = '<fill-your-own>'

if not (GS_ACCESS_KEY_ID and GS_SECRET_ACCESS_KEY and GS_STORAGE_BUCKET_NAME):
print 'Warning: no correct settings for Google Storage, please provide it in settings_appengine.py'

# static_url
STATIC_URL = '/static/'
Expand Down

0 comments on commit 0e9130d

Please sign in to comment.