integrate vue cateditor with django
This commit is contained in:
@ -16,6 +16,8 @@ from django.urls import reverse_lazy
|
||||
# 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, 'cateditor')
|
||||
|
||||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/
|
||||
@ -73,6 +75,7 @@ INSTALLED_APPS = [
|
||||
'django_extensions',
|
||||
'account',
|
||||
'lazysignup',
|
||||
'webpack_loader',
|
||||
'procat2',
|
||||
'dashboard',
|
||||
]
|
||||
@ -148,8 +151,10 @@ USE_TZ = True
|
||||
# Static files (CSS, JavaScript, Images)
|
||||
# https://docs.djangoproject.com/en/2.1/howto/static-files/
|
||||
STATIC_URL = '/static/'
|
||||
# (STATIC_ROOT set in settings_ansible.py)
|
||||
STATICFILES_DIRS = [
|
||||
os.path.join(BASE_DIR, "static"),
|
||||
os.path.join(FRONTEND_DIR, "dist"),
|
||||
]
|
||||
|
||||
LOGIN_REDIRECT_URL = reverse_lazy('home')
|
||||
@ -171,10 +176,24 @@ if DJDT:
|
||||
)
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
|
||||
# bring in ansible-defined settings
|
||||
from .settings_ansible import *
|
||||
|
||||
# what settings to expose in templates
|
||||
SETTINGS_EXPORT = [
|
||||
'CUSTOMER_NAME',
|
||||
]
|
||||
|
||||
# can have multiple if we have multiple vue pages.
|
||||
# https://github.com/owais/django-webpack-loader
|
||||
WEBPACK_LOADER = {
|
||||
'DEFAULT': {
|
||||
'CACHE': not DEBUG,
|
||||
#'BUNDLE_DIR_NAME': '/bundles/', # must end with slash
|
||||
'BUNDLE_DIR_NAME': '',
|
||||
# 'POLL_INTERVAL': 0.1,
|
||||
# 'TIMEOUT': None,
|
||||
'STATS_FILE': os.path.join(FRONTEND_DIR, 'webpack-stats.json'),
|
||||
'IGNORE': [r'.+\.hot-update.js', r'.+\.map']
|
||||
}
|
||||
}
|
||||
|
||||
# bring in ansible-defined settings
|
||||
from .settings_ansible import *
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
backcall==0.1.0
|
||||
decorator==4.4.0
|
||||
Django==2.1.7
|
||||
django-appconf==1.0.3
|
||||
django-debug-toolbar==1.11
|
||||
@ -5,8 +7,21 @@ django-extensions==2.1.6
|
||||
django-lazysignup==2.0.0
|
||||
django-settings-export==1.2.1
|
||||
django-user-accounts==2.1.0
|
||||
django-webpack-loader==0.6.0
|
||||
ipdb==0.11
|
||||
ipython==7.3.0
|
||||
ipython-genutils==0.2.0
|
||||
jedi==0.13.3
|
||||
parso==0.3.4
|
||||
pexpect==4.6.0
|
||||
pickleshare==0.7.5
|
||||
prompt-toolkit==2.0.9
|
||||
psycopg2-binary==2.7.7
|
||||
ptyprocess==0.6.0
|
||||
Pygments==2.3.1
|
||||
pytz==2018.9
|
||||
six==1.12.0
|
||||
sqlparse==0.3.0
|
||||
traitlets==4.3.2
|
||||
wcwidth==0.1.7
|
||||
Werkzeug==0.14.1
|
||||
|
||||
@ -1,8 +1,29 @@
|
||||
{% extends 'base.html' %}
|
||||
{% load staticfiles i18n %}
|
||||
{% load staticfiles %}
|
||||
{% load render_bundle from webpack_loader %}
|
||||
|
||||
{% block title %}{% trans "Editor"%}{% endblock %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link href="{% static 'img/favicon.ico' %}" rel="shortcut icon" />
|
||||
<title>Django Vue Integration</title>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons">
|
||||
</head>
|
||||
<body>
|
||||
<noscript>
|
||||
<strong>We're sorry but frontend doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
||||
</noscript>
|
||||
|
||||
{% block content %}
|
||||
<div id="app">
|
||||
<app></app>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
{% render_bundle 'app' %}
|
||||
|
||||
<!-- built files will be auto injected -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user