Init Vue + Webpack
This commit is contained in:
@@ -14,6 +14,8 @@ import os
|
||||
|
||||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
|
||||
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates')
|
||||
FRONTEND_DIR = os.path.join(BASE_DIR, 'frontend')
|
||||
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
@@ -37,6 +39,7 @@ INSTALLED_APPS = [
|
||||
'django.contrib.sessions',
|
||||
'django.contrib.messages',
|
||||
'django.contrib.staticfiles',
|
||||
'webpack_loader',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
@@ -54,7 +57,7 @@ ROOT_URLCONF = 'cookAssistant.urls'
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
'DIRS': [],
|
||||
'DIRS': [TEMPLATES_DIR, ],
|
||||
'APP_DIRS': True,
|
||||
'OPTIONS': {
|
||||
'context_processors': [
|
||||
@@ -118,3 +121,11 @@ USE_TZ = True
|
||||
# https://docs.djangoproject.com/en/2.2/howto/static-files/
|
||||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
WEBPACK_LOADER = {
|
||||
'DEFAULT': {
|
||||
'CACHE': not DEBUG,
|
||||
'BUNDLE_DIR_NAME': '/bundles/', # must end with slash
|
||||
'STATS_FILE': os.path.join(FRONTEND_DIR, 'webpack-stats.json'),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user