Commit 4324ccfe authored by Matías Alarcón's avatar Matías Alarcón

add google maps token

parent 36078084
Pipeline #7175 passed with stages
in 14 minutes and 2 seconds
......@@ -81,6 +81,7 @@ To deploy this project, you need to configure settings in your environment
* EMAIL_USE_TLS: if 'True', uses TLS when sending emails
* GOOGLE_ANALYTICS_CODE: The code for google analytics
* GOOGLE_MAPS_TOKEN: Api key for access to service from google maps
* RECAPTCHA_PUBLIC_KEY: public Key for recaptcha service
* RECAPTCHA_PRIVATE_KEY: private key for recaptcha service
......
......@@ -7,3 +7,10 @@ def google_analytics_code(request):
'google_analytics_code': settings.GOOGLE_ANALYTICS_CODE,
'site': Site.objects.get_current(),
}
def google_maps_token(request):
return {
'google_maps_token': settings.GOOGLE_MAPS_TOKEN,
'site': Site.objects.get_current(),
}
......@@ -42,8 +42,8 @@ def get_local_value(key, default_value=None):
except AttributeError:
return default_value
GOOGLE_ANALYTICS_CODE = get_local_value('GOOGLE_ANALYTICS_CODE', None)
GOOGLE_MAPS_TOKEN = get_local_value('GOOGLE_MAPS_TOKEN')
# default keys, replace with somethign your own
RECAPTCHA_PUBLIC_KEY = get_local_value('RECAPTCHA_PUBLIC_KEY', None)
......@@ -262,6 +262,7 @@ TEMPLATES = [
'cms.context_processors.cms_settings',
'sekizai.context_processors.sekizai',
'project.context_processors.google_analytics_code',
'project.context_processors.google_maps_token',
],
'loaders': [
('pypugjs.ext.django.Loader', (
......
......@@ -6,7 +6,7 @@ extends base.pug
block javascripts
script(src="{% static 'js/projects/map.js' %}")
script(src="https://maps.googleapis.com/maps/api/js?key=AIzaSyABauQ4s_k8LFbx_2KtPiNGeyPWA7rujsY&libraries=drawing,geometry&callback=initMap")
script(src="https://maps.googleapis.com/maps/api/js?key={{google_maps_token}}&libraries=drawing,geometry&callback=initMap")
block javascript_data
script(type="text/javascript").
......
......@@ -7,7 +7,7 @@ block javascripts
script(src="{% static 'js/formset.js' %}")
script(src="{% static 'js/projects/create.js' %}")
script(src="{% static 'js/projects/map.js' %}")
script(src="https://maps.googleapis.com/maps/api/js?key=AIzaSyABauQ4s_k8LFbx_2KtPiNGeyPWA7rujsY&libraries=drawing&callback=initMap")
script(src="https://maps.googleapis.com/maps/api/js?key={{google_maps_token}}&libraries=drawing&callback=initMap")
block javascript_data
script(type="text/javascript").
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment