Update lots of things

This commit is contained in:
Livvy Mackintosh
2017-06-16 18:06:22 +02:00
parent 90b508e3b0
commit 0811936382
23 changed files with 557 additions and 106 deletions

View File

@ -45,6 +45,7 @@ INSTALLED_APPS = [
'django.contrib.gis',
'bootstrap3',
'cas_server',
'compressor',
'crispy_forms',
'django_extensions',
'leaflet',
@ -158,6 +159,13 @@ LOCALE_PATHS = [
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
STATIC_URL = os.getenv("STATIC_URL", '/static/')
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
'compressor.finders.CompressorFinder',
]
# Cache
# https://docs.djangoproject.com/en/1.11/topics/cache/
@ -191,3 +199,21 @@ REST_FRAMEWORK = {
'rest_framework.parsers.JSONParser',
)
}
# Django Crispy Forms
# http://django-crispy-forms.readthedocs.io/en/latest/
CRISPY_TEMPLATE_PACK = 'bootstrap3'
# Django-Leaflet
# https://django-leaflet.readthedocs.io/en/latest/
LEAFLET_CONFIG = {
'MIN_ZOOM': 3,
'MAX_ZOOM': 16,
'PLUGINS': {
'forms': {
'auto-include': True
}
},
}

View File

@ -17,7 +17,6 @@ from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth.models import User
from apps.map.models import CaseStudy
from django.views.generic.base import RedirectView
from rest_framework import routers, serializers, viewsets
from rest_framework_gis import serializers as gis_serializers
@ -48,9 +47,8 @@ apirouter.register(r'users', UserViewSet)
apirouter.register(r'case-studies', CaseStudyViewSet)
urlpatterns = [
url(r'^$', RedirectView.as_view(url="/beta/")),
url(r'', include('apps.map.urls'), name="map"),
url(r'api/', include(apirouter.urls)),
url(r'^beta/', include('apps.map.urls'), name="beta"),
url(r'^admin/', admin.site.urls),
url(r'^cas/', include('cas_server.urls', namespace='cas_server')),
]