Jubilar Django: borrar el portal antiguo, la web ya la sirve Next
El cutover se hizo hoy: Caddy manda www.nightspire.gg a :3001 (Next), así que Django se quedó sin dominio y sin uso. Se comprobó antes de borrar que nada dependía de él: ninguna referencia a :8001 en Caddy, el timer de reconciliación llama a Next, DJANGO_API_BASE no lo leía ni una línea del código (se quita también de la unidad de systemd), web-next/public es autónomo (736 ficheros reales, 0 symlinks) y no hay ni una referencia a /static/. Con Django parado la web siguió dando 200 en todas las rutas. Se va: home/, novawow/, forum/, wotlk_db/, frontend/ (las islas React que Next sustituyó), static/, staticfiles/, manage.py, requirements.txt, db.sqlite3 y el Docker de Django. Se quedan docs/ y sql/: no son código Django sino documentación y esquemas, y sql/forum_schema.sql describe la BD acore_web que Next usa hoy. La BASE DE DATOS no se toca. django_wow y sus 41 tablas home_* son ahora de Next, que las consulta con SQL directo. El nombre se queda por historia. README reescrito: describía cómo montar un Django que ya no existe (venv, manage.py migrate, gunicorn, Docker). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,187 +0,0 @@
|
||||
import ClassicEditor from './src/ckeditor';
|
||||
import './src/override-django.css';
|
||||
|
||||
window.ClassicEditor = ClassicEditor;
|
||||
window.ckeditorRegisterCallback = registerCallback;
|
||||
window.ckeditorUnregisterCallback = unregisterCallback;
|
||||
window.editors = {};
|
||||
let editors = {};
|
||||
let callbacks = {};
|
||||
|
||||
function getCookie(name) {
|
||||
let cookieValue = null;
|
||||
if (document.cookie && document.cookie !== '') {
|
||||
let cookies = document.cookie.split(';');
|
||||
for (let i = 0; i < cookies.length; i++) {
|
||||
let cookie = cookies[i].trim();
|
||||
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
||||
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return cookieValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the element or its children match the query and returns
|
||||
* an array with the matches.
|
||||
*
|
||||
* @param {!HTMLElement} element
|
||||
* @param {!string} query
|
||||
*
|
||||
* @returns {array.<HTMLElement>}
|
||||
*/
|
||||
function resolveElementArray(element, query) {
|
||||
return element.matches(query) ? [element] : [...element.querySelectorAll(query)];
|
||||
}
|
||||
|
||||
/**
|
||||
* This function initializes the CKEditor inputs within an optional element and
|
||||
* assigns properties necessary for the correct operation
|
||||
*
|
||||
* @param {HTMLElement} [element=document.body] - The element to search for elements
|
||||
*
|
||||
* @returns {void}
|
||||
*/
|
||||
function createEditors(element = document.body) {
|
||||
const allEditors = resolveElementArray(element, '.django_ckeditor_5');
|
||||
|
||||
allEditors.forEach(editorEl => {
|
||||
if (
|
||||
editorEl.id.indexOf('__prefix__') !== -1 ||
|
||||
editorEl.getAttribute('data-processed') === '1'
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const script_id = `${editorEl.id}_script`;
|
||||
// remove next sibling if it is an empty text node
|
||||
if (editorEl.nextSibling.nodeType == Node.TEXT_NODE && editorEl.nextSibling.textContent.trim() === '') {
|
||||
editorEl.nextSibling.remove();
|
||||
}
|
||||
const upload_url = element.querySelector(
|
||||
`#${script_id}-ck-editor-5-upload-url`
|
||||
).getAttribute('data-upload-url');
|
||||
const upload_file_types = JSON.parse(element.querySelector(
|
||||
`#${script_id}-ck-editor-5-upload-url`
|
||||
).getAttribute('data-upload-file-types'));
|
||||
const csrf_cookie_name = element.querySelector(
|
||||
`#${script_id}-ck-editor-5-upload-url`
|
||||
).getAttribute('data-csrf_cookie_name');
|
||||
const labelElement = element.querySelector(`[for$="${editorEl.id}"]`);
|
||||
if (labelElement) {
|
||||
labelElement.style.float = 'none';
|
||||
}
|
||||
|
||||
const config = JSON.parse(
|
||||
element.querySelector(`#${script_id}-span`).textContent,
|
||||
(key, value) => {
|
||||
var match = value.toString().match(new RegExp('^/(.*?)/([gimy]*)$'));
|
||||
if (match) {
|
||||
var regex = new RegExp(match[1], match[2]);
|
||||
return regex;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
);
|
||||
config.simpleUpload = {
|
||||
'uploadUrl': upload_url,
|
||||
'headers': {
|
||||
'X-CSRFToken': getCookie(csrf_cookie_name),
|
||||
},
|
||||
};
|
||||
|
||||
config.fileUploader = {
|
||||
'fileTypes': upload_file_types
|
||||
};
|
||||
config.licenseKey = 'GPL';
|
||||
ClassicEditor.create(
|
||||
editorEl,
|
||||
config
|
||||
).then(editor => {
|
||||
|
||||
const textarea = document.querySelector(`#${editorEl.id}`);
|
||||
editor.model.document.on('change:data', () => {
|
||||
textarea.value = editor.getData();
|
||||
});
|
||||
if (editor.plugins.has('WordCount')) {
|
||||
const wordCountPlugin = editor.plugins.get('WordCount');
|
||||
const wordCountWrapper = element.querySelector(`#${script_id}-word-count`);
|
||||
wordCountWrapper.innerHTML = '';
|
||||
wordCountWrapper.appendChild(wordCountPlugin.wordCountContainer);
|
||||
}
|
||||
editors[editorEl.id] = editor;
|
||||
if (callbacks[editorEl.id]) {
|
||||
callbacks[editorEl.id](editor);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error((error));
|
||||
});
|
||||
editorEl.setAttribute('data-processed', '1');
|
||||
});
|
||||
window.editors = editors;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function filters the list of mutations only by added elements, thus
|
||||
* eliminates the occurrence of text nodes and tags where it does not make sense
|
||||
* to try to use with `QuerySelectorAll()` and `matches()` functions.
|
||||
*
|
||||
* @param {MutationRecord} recordList - It is the object inside the array
|
||||
* passed to the callback of a MutationObserver.
|
||||
*
|
||||
* @returns {Array} Array containing filtered nodes.
|
||||
*/
|
||||
function getAddedNodes(recordList) {
|
||||
return recordList
|
||||
.flatMap(({ addedNodes }) => Array.from(addedNodes))
|
||||
.filter(node => node.nodeType === 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a callback for when an editor with `id` is created.
|
||||
*
|
||||
* @param {!string} id - the id of the ckeditor element.
|
||||
* @callback callback - the callback function to be invoked.
|
||||
*/
|
||||
function registerCallback(id, callback) {
|
||||
callbacks[id] = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregister a previously registered callback.
|
||||
*
|
||||
* @param {!string} id - the id of the ckeditor element.
|
||||
*/
|
||||
function unregisterCallback(id) {
|
||||
callbacks[id] = null;
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
createEditors();
|
||||
|
||||
if (typeof django === "object" && django.jQuery) {
|
||||
django.jQuery(document).on("formset:added", () => {createEditors();});
|
||||
}
|
||||
|
||||
const observer = new MutationObserver((mutations) => {
|
||||
let addedNodes = getAddedNodes(mutations);
|
||||
|
||||
addedNodes.forEach(node => {
|
||||
// Initializes editors
|
||||
createEditors(node);
|
||||
});
|
||||
});
|
||||
|
||||
// Configure MutationObserver options
|
||||
const observerOptions = {
|
||||
childList: true,
|
||||
subtree: true,
|
||||
};
|
||||
|
||||
// Selects the parent element where the events occur
|
||||
const mainContent = document.body;
|
||||
|
||||
// Starts to observe the selected father element with the configured options
|
||||
observer.observe(mainContent, observerOptions);
|
||||
});
|
||||
-3
File diff suppressed because one or more lines are too long
@@ -1,25 +0,0 @@
|
||||
/* istanbul ignore else -- @preserve */
|
||||
|
||||
/* istanbul ignore else: This is always true because otherwise it would not register a reducer callback. -- @preserve */
|
||||
|
||||
/* istanbul ignore file -- @preserve */
|
||||
|
||||
/* istanbul ignore if -- @preserve */
|
||||
|
||||
/* istanbul ignore if: paranoid check -- @preserve */
|
||||
|
||||
/* istanbul ignore next -- @preserve */
|
||||
|
||||
/* istanbul ignore next: paranoid check -- @preserve */
|
||||
|
||||
/* istanbul ignore next: static function definition -- @preserve */
|
||||
|
||||
/**
|
||||
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
||||
*/
|
||||
|
||||
/**
|
||||
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
||||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
||||
*/
|
||||
-1
File diff suppressed because one or more lines are too long
-114
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-114
@@ -1,114 +0,0 @@
|
||||
import ClassicEditorBase from '@ckeditor/ckeditor5-editor-classic/src/classiceditor';
|
||||
import Essentials from '@ckeditor/ckeditor5-essentials/src/essentials';
|
||||
import UploadAdapter from '@ckeditor/ckeditor5-adapter-ckfinder/src/uploadadapter';
|
||||
import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
|
||||
import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
|
||||
import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
|
||||
import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
|
||||
import Strikethrough from '@ckeditor/ckeditor5-basic-styles/src/strikethrough';
|
||||
import Code from '@ckeditor/ckeditor5-basic-styles/src/code';
|
||||
import Subscript from '@ckeditor/ckeditor5-basic-styles/src/subscript';
|
||||
import Superscript from '@ckeditor/ckeditor5-basic-styles/src/superscript';
|
||||
import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
|
||||
import Heading from '@ckeditor/ckeditor5-heading/src/heading';
|
||||
import Image from '@ckeditor/ckeditor5-image/src/image';
|
||||
import ImageCaption from '@ckeditor/ckeditor5-image/src/imagecaption';
|
||||
import ImageStyle from '@ckeditor/ckeditor5-image/src/imagestyle';
|
||||
import ImageToolbar from '@ckeditor/ckeditor5-image/src/imagetoolbar';
|
||||
import Link from '@ckeditor/ckeditor5-link/src/link';
|
||||
import List from '@ckeditor/ckeditor5-list/src/list';
|
||||
import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
|
||||
import ImageResize from '@ckeditor/ckeditor5-image/src/imageresize';
|
||||
import SimpleUploadAdapter from '@ckeditor/ckeditor5-upload/src/adapters/simpleuploadadapter';
|
||||
import Alignment from '@ckeditor/ckeditor5-alignment/src/alignment';
|
||||
import PasteFromOffice from '@ckeditor/ckeditor5-paste-from-office/src/pastefromoffice';
|
||||
import Font from '@ckeditor/ckeditor5-font/src/font';
|
||||
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';
|
||||
import RemoveFormat from '@ckeditor/ckeditor5-remove-format/src/removeformat';
|
||||
import Table from '@ckeditor/ckeditor5-table/src/table';
|
||||
import TableToolbar from '@ckeditor/ckeditor5-table/src/tabletoolbar';
|
||||
import TableProperties from '@ckeditor/ckeditor5-table/src/tableproperties';
|
||||
import TableCellProperties from '@ckeditor/ckeditor5-table/src/tablecellproperties';
|
||||
import Indent from '@ckeditor/ckeditor5-indent/src/indent';
|
||||
import IndentBlock from '@ckeditor/ckeditor5-indent/src/indentblock';
|
||||
import Highlight from '@ckeditor/ckeditor5-highlight/src/highlight';
|
||||
import TodoList from '@ckeditor/ckeditor5-list/src/todolist';
|
||||
import CodeBlock from '@ckeditor/ckeditor5-code-block/src/codeblock';
|
||||
import ListProperties from '@ckeditor/ckeditor5-list/src/listproperties';
|
||||
import SourceEditing from '@ckeditor/ckeditor5-source-editing/src/sourceediting';
|
||||
import GeneralHtmlSupport from '@ckeditor/ckeditor5-html-support/src/generalhtmlsupport';
|
||||
import ImageInsert from '@ckeditor/ckeditor5-image/src/imageinsert';
|
||||
import { TableCaption } from '@ckeditor/ckeditor5-table';
|
||||
import WordCount from '@ckeditor/ckeditor5-word-count/src/wordcount';
|
||||
import Mention from '@ckeditor/ckeditor5-mention/src/mention';
|
||||
import { Style } from '@ckeditor/ckeditor5-style';
|
||||
import { HorizontalLine } from '@ckeditor/ckeditor5-horizontal-line';
|
||||
import {LinkImage} from "@ckeditor/ckeditor5-link";
|
||||
import {HtmlEmbed} from "@ckeditor/ckeditor5-html-embed";
|
||||
import { FullPage } from '@ckeditor/ckeditor5-html-support';
|
||||
import { SpecialCharacters } from '@ckeditor/ckeditor5-special-characters';
|
||||
import { SpecialCharactersEssentials } from '@ckeditor/ckeditor5-special-characters';
|
||||
import { FileUploader } from '@liqd/ckeditor5-file-uploader';
|
||||
import { ShowBlocks } from '@ckeditor/ckeditor5-show-blocks';
|
||||
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
|
||||
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
|
||||
import FullScreen from '@pikulinpw/ckeditor5-fullscreen';
|
||||
|
||||
export default class ClassicEditor extends ClassicEditorBase {
|
||||
}
|
||||
|
||||
ClassicEditor.builtinPlugins = [
|
||||
Essentials,
|
||||
UploadAdapter,
|
||||
CodeBlock,
|
||||
Autoformat,
|
||||
Bold,
|
||||
Italic,
|
||||
Underline,
|
||||
Strikethrough,
|
||||
Code,
|
||||
Subscript,
|
||||
Superscript,
|
||||
BlockQuote,
|
||||
Heading,
|
||||
Image,
|
||||
ImageCaption,
|
||||
ImageStyle,
|
||||
ImageToolbar,
|
||||
ImageResize,
|
||||
Link,
|
||||
List,
|
||||
Paragraph,
|
||||
Alignment,
|
||||
Font,
|
||||
PasteFromOffice,
|
||||
SimpleUploadAdapter,
|
||||
MediaEmbed,
|
||||
RemoveFormat,
|
||||
Table, TableToolbar,
|
||||
TableCaption,
|
||||
TableProperties,
|
||||
TableCellProperties,
|
||||
Indent,
|
||||
IndentBlock,
|
||||
Highlight,
|
||||
TodoList,
|
||||
ListProperties,
|
||||
SourceEditing,
|
||||
GeneralHtmlSupport,
|
||||
ImageInsert,
|
||||
WordCount,
|
||||
Mention,
|
||||
Style,
|
||||
HorizontalLine,
|
||||
LinkImage,
|
||||
HtmlEmbed,
|
||||
FullPage,
|
||||
SpecialCharacters,
|
||||
SpecialCharactersEssentials,
|
||||
FileUploader,
|
||||
ShowBlocks,
|
||||
SelectAll,
|
||||
FindAndReplace,
|
||||
FullScreen
|
||||
];
|
||||
@@ -1,47 +0,0 @@
|
||||
/** Todo list **/
|
||||
|
||||
.ck .todo-list input {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ck .todo-list__checkmark:after {
|
||||
height: 6px !important;
|
||||
}
|
||||
|
||||
.ck .todo-list__checkmark {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ck.ck-content.ck-editor__editable {
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.ck h2 {
|
||||
color: inherit;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
form .aligned .ck ul li {
|
||||
list-style: inherit;
|
||||
}
|
||||
|
||||
form .aligned .ck ul {
|
||||
margin-left: 1.5em;
|
||||
padding-left: inherit;
|
||||
}
|
||||
.ck-word-count{
|
||||
display: flex;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.ck-word-count__words{
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.ck.ck-editor {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
.ck-editor-container{
|
||||
width: 100%;
|
||||
}
|
||||
Reference in New Issue
Block a user