Add django-angular dependency and configuration.

This commit is contained in:
Christopher Charbonneau Wells 2017-08-13 17:37:50 -04:00
parent b9a5450066
commit 6f0b8500fb
4 changed files with 32 additions and 3 deletions

7
.gitignore vendored
View File

@ -1,5 +1,8 @@
# database
*.sqlite3
# python # python
*.pyc *.pyc
# database # static files
*.sqlite3 babyblotter/static

View File

@ -6,3 +6,5 @@ url = "https://pypi.python.org/simple"
django = "*" django = "*"
djangorestframework = "*" djangorestframework = "*"
django-filter = "*" django-filter = "*"
django-angular = "*"
whitenoise = "*"

8
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{ {
"_meta": { "_meta": {
"hash": { "hash": {
"sha256": "a0ef885217179eed1565af7ec6a732e8b141fb42c156f152380a65feac7cb1fe" "sha256": "58ee3f51b748a5b05db80eda5a1885ac84e5645f540c5d67a00555a2b1156cc1"
}, },
"requires": {}, "requires": {},
"sources": [ "sources": [
@ -15,6 +15,9 @@
"django": { "django": {
"version": "==1.11.4" "version": "==1.11.4"
}, },
"django-angular": {
"version": "==1.0.2"
},
"django-filter": { "django-filter": {
"version": "==1.0.4" "version": "==1.0.4"
}, },
@ -23,6 +26,9 @@
}, },
"pytz": { "pytz": {
"version": "==2017.2" "version": "==2017.2"
},
"whitenoise": {
"version": "==3.3.0"
} }
}, },
"develop": {} "develop": {}

View File

@ -22,6 +22,7 @@ INSTALLED_APPS = [
'api', 'api',
'core', 'core',
'djng',
'rest_framework', 'rest_framework',
'django.contrib.admin', 'django.contrib.admin',
@ -34,6 +35,9 @@ INSTALLED_APPS = [
MIDDLEWARE = [ MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware', 'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
@ -91,8 +95,22 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.11/howto/static-files/ # https://docs.djangoproject.com/en/1.11/howto/static-files/
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_FINDERS = [
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
]
STATIC_URL = '/static/' STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'babyblotter/static')
# Form rendering
# https://docs.djangoproject.com/en/1.11/ref/settings/#form-renderer
FORM_RENDERER = 'djng.forms.renderers.DjangoAngularBootstrap3Templates'
# Django Rest Framework # Django Rest Framework
# http://www.django-rest-framework.org/# # http://www.django-rest-framework.org/#