From 16c78485ea7e9f58a05350fadb980210bd8639c4 Mon Sep 17 00:00:00 2001 From: Raymond Yee Date: Wed, 16 Nov 2016 17:21:22 -0800 Subject: [PATCH] try to build just and please with a setting coming from secrets.yml --- deploy/just.wsgi | 9 --------- settings/please.py | 3 ++- vagrant/Vagrantfile | 6 +++--- vagrant/dev.yml | 6 ++++++ vagrant/templates/just.wsgi.j2 | 2 +- deploy/please.wsgi => vagrant/templates/please.wsgi.j2 | 2 ++ 6 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 deploy/just.wsgi rename deploy/please.wsgi => vagrant/templates/please.wsgi.j2 (66%) diff --git a/deploy/just.wsgi b/deploy/just.wsgi deleted file mode 100644 index e12da4d1..00000000 --- a/deploy/just.wsgi +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python - -import os - -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.just") -os.environ['CELERY_LOADER'] = 'django' - -from django.core.wsgi import get_wsgi_application -application = get_wsgi_application() diff --git a/settings/please.py b/settings/please.py index 14af0157..9c4d9eb7 100644 --- a/settings/please.py +++ b/settings/please.py @@ -40,7 +40,8 @@ EMAIL_PORT = 587 DEFAULT_FROM_EMAIL = 'accounts@gluejar.com' # googlebooks -GOOGLE_BOOKS_API_KEY = 'AIzaSyBE36z7o6NUafIWcLEB8yk2I47-8_5y1_0' +# GOOGLE_BOOKS_API_KEY = 'AIzaSyBE36z7o6NUafIWcLEB8yk2I47-8_5y1_0' +GOOGLE_BOOKS_API_KEY = os.environ.get('GOOGLE_BOOKS_API_KEY', '') # twitter auth SOCIAL_AUTH_TWITTER_KEY = 'sd9StEg1N1qB8gGb2GRX4A' diff --git a/vagrant/Vagrantfile b/vagrant/Vagrantfile index 965ea19e..6c08bc45 100644 --- a/vagrant/Vagrantfile +++ b/vagrant/Vagrantfile @@ -30,7 +30,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "-e class=please", "-e hostname=please.unglue.it", "-e setdns=true", - "-e branch=dj18postdj18" + "-e branch=open_source" ] end @@ -94,7 +94,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "-e class=just", "-e hostname=just.unglue.it", "-e setdns=false", - "-e branch=master", + "-e branch=open_source", "-e do_migrate=false" ] @@ -152,7 +152,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| "-e class=just", "-e hostname=just2.unglue.it", "-e setdns=false", - "-e branch=master", + "-e branch=open_source", "-e do_migrate=false" ] diff --git a/vagrant/dev.yml b/vagrant/dev.yml index 10761e47..bdbb847d 100644 --- a/vagrant/dev.yml +++ b/vagrant/dev.yml @@ -242,6 +242,12 @@ - name: make /var/log/regluit file: path=/var/log/regluit state=directory owner={{user}} group=www-data mode=2775 + + # create the wsgi script from the appropriate template + - name: create the wsgi script from the appropriate template + template: src=templates/{{class}}.wsgi.j2 dest=/opt/regluit/deploy/{{class}}.wsgi owner={{user}} group={{user}} mode=0664 + when: class in ['please', 'just'] + #Run syncdb on the application # TO DO: syncdb might be deprecated # http://stackoverflow.com/a/29683785 diff --git a/vagrant/templates/just.wsgi.j2 b/vagrant/templates/just.wsgi.j2 index 2ef11827..ede04aa7 100644 --- a/vagrant/templates/just.wsgi.j2 +++ b/vagrant/templates/just.wsgi.j2 @@ -5,7 +5,7 @@ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.just") os.environ['CELERY_LOADER'] = 'django' -os.environ['GOOGLE_BOOKS_API_KEY'] = {{GOOGLE_BOOKS_API_KEY}} +os.environ['GOOGLE_BOOKS_API_KEY'] = '{{GOOGLE_BOOKS_API_KEY}}' from django.core.wsgi import get_wsgi_application application = get_wsgi_application() diff --git a/deploy/please.wsgi b/vagrant/templates/please.wsgi.j2 similarity index 66% rename from deploy/please.wsgi rename to vagrant/templates/please.wsgi.j2 index 3fe5a14c..dd43a66a 100644 --- a/deploy/please.wsgi +++ b/vagrant/templates/please.wsgi.j2 @@ -5,5 +5,7 @@ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "regluit.settings.please") os.environ['CELERY_LOADER'] = 'django' +os.environ['GOOGLE_BOOKS_API_KEY'] = '{{GOOGLE_BOOKS_API_KEY}}' + from django.core.wsgi import get_wsgi_application application = get_wsgi_application() \ No newline at end of file