Skip to content

Commit 6714a67

Browse files
authored
feat: create support/cms-4.1.x branch for quick install of django CMS 4.1 (#39)
* Repalce djangocms-bootstrap4 by djangocms-frontend * Add: Parler to INSTALLED_APPs for djangocms_alias * feat: use 4.1.0rc1 * Update tests * Update python version to 3.10
1 parent c35accd commit 6714a67

15 files changed

+164
-140
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: [3.8, 3.9, pypy3]
11+
python-version: [3.9, "3.10", "3.11", pypy3]
1212
os: [
1313
ubuntu-20.04,
14-
ubuntu-18.04,
1514
]
1615

1716
services:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.9
1+
FROM python:3.10
22
WORKDIR /app
33
COPY . /app
44
RUN pip install -r requirements.txt

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
A Dockerised django CMS project, ready to deploy on [Divio](https://www.divio.com/) or another Docker-based cloud platform, and run locally in Docker on your own machine.
66

7-
This version uses Python 3.8 running and the most up-to-date versions of Django 3.1 and django CMS 3.8.
7+
This version uses Python 3.10 running and the most up-to-date versions of Django 3.2, and django CMS 4.1.0rc1
88

99
This project is endorsed by the [django CMS Association](https://www.django-cms.org/en/about-us/). That means that it is officially accepted by the dCA as being in line with our roadmap vision and development/plugin policy. Join us on [Slack](https://www.django-cms.org/slack/) for more information or questions.
1010

11+
The documentation for version 4.1 is still work in progress and - for the time being - can be found here: https://django-cms-docs.readthedocs.io/en/latest/
12+
1113
## Installation
1214

1315
You need to have docker installed on your system to run this project.

backend/settings.py

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,30 @@
5555

5656
# the default alias content - optional, but used in most projects
5757
'djangocms_alias',
58+
'parler',
5859

5960
# the default CKEditor - optional, but used in most projects
6061
'djangocms_text_ckeditor',
6162

62-
'djangocms_url_manager',
63-
6463
'djangocms_picture',
6564

6665
# optional django CMS Bootstrap 4 modules
67-
'djangocms_bootstrap4',
68-
'djangocms_bootstrap4.contrib.bootstrap4_alerts',
69-
'djangocms_bootstrap4.contrib.bootstrap4_badge',
70-
'djangocms_bootstrap4.contrib.bootstrap4_card',
71-
# 'djangocms_bootstrap4.contrib.bootstrap4_carousel', # TODO: remove hard-coded dependance on djangocms_link
72-
'djangocms_bootstrap4.contrib.bootstrap4_collapse',
73-
'djangocms_bootstrap4.contrib.bootstrap4_content',
74-
'djangocms_bootstrap4.contrib.bootstrap4_grid',
75-
'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
76-
# 'djangocms_bootstrap4.contrib.bootstrap4_link', # TODO: remove hard-coded dependance on djangocms_link
77-
'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
78-
'djangocms_bootstrap4.contrib.bootstrap4_media',
79-
'djangocms_bootstrap4.contrib.bootstrap4_picture',
80-
'djangocms_bootstrap4.contrib.bootstrap4_tabs',
81-
'djangocms_bootstrap4.contrib.bootstrap4_utilities',
66+
'djangocms_frontend',
67+
'djangocms_frontend.contrib.accordion',
68+
'djangocms_frontend.contrib.alert',
69+
'djangocms_frontend.contrib.badge',
70+
'djangocms_frontend.contrib.card',
71+
'djangocms_frontend.contrib.carousel',
72+
'djangocms_frontend.contrib.collapse',
73+
'djangocms_frontend.contrib.content',
74+
'djangocms_frontend.contrib.grid',
75+
'djangocms_frontend.contrib.jumbotron',
76+
'djangocms_frontend.contrib.link',
77+
'djangocms_frontend.contrib.listgroup',
78+
'djangocms_frontend.contrib.media',
79+
'djangocms_frontend.contrib.image',
80+
'djangocms_frontend.contrib.tabs',
81+
'djangocms_frontend.contrib.utilities',
8282
]
8383

8484
MIDDLEWARE = [
@@ -124,14 +124,22 @@
124124
},
125125
]
126126

127+
THUMBNAIL_PROCESSORS = (
128+
'easy_thumbnails.processors.colorspace',
129+
'easy_thumbnails.processors.autocrop',
130+
#'easy_thumbnails.processors.scale_and_crop',
131+
'filer.thumbnail_processors.scale_and_crop_with_subject_location',
132+
'easy_thumbnails.processors.filters',
133+
)
134+
127135
CMS_TEMPLATES = [
128136
# a minimal template to get started with
129137
('minimal.html', 'Minimal template'),
130-
('whitenoise-static-files-demo.html', 'Static File Demo'),
131138

132139
# optional templates that extend base.html, to be used with Bootstrap 5
133-
('page.html', 'Bootstrap 4 Demo'),
134-
('feature.html', 'Bootstrap 4 Demo with two placeholders')
140+
('bootstrap5.html', 'Bootstrap 5 Demo'),
141+
142+
('whitenoise-static-files-demo.html', 'Static File Demo'),
135143
]
136144

137145
WSGI_APPLICATION = 'backend.wsgi.application'
@@ -211,3 +219,5 @@
211219
SITE_ID = 1
212220

213221
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
222+
223+
CMS_CONFIRM_VERSION4 = True

backend/templates/base.html

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,34 @@
1-
{% load cms_tags static sekizai_tags menu_tags %}
2-
<!doctype html>
3-
<html>
4-
<head>
5-
<meta charset="utf-8">
6-
<title>{% block title %}This is my new project home page{% endblock title %}</title>
7-
<meta name="viewport" content="width=device-width,initial-scale=1">
8-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
9-
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> -->
10-
{% render_block "css" %}
1+
<!DOCTYPE html>{% load cms_tags menu_tags sekizai_tags static i18n %}{% spaceless %}
2+
<html lang="{{ LANGUAGE_CODE }}">
3+
<head>
4+
<meta charset="utf-8"/>
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
7+
{% block meta %}
8+
<meta name="description" content="{% page_attribute meta_description %}"/>
9+
<meta property="og:type" content="website"/>
10+
<meta property="og:title" content="{% page_attribute "page_title" %}"/>
11+
<meta property="og:description" content="{% page_attribute meta_description %}"/>
12+
{% endblock meta %}
13+
{% block canonical_url %}
14+
<link rel="canonical" href="{{ request.build_absolute_uri }}"/>
15+
<meta property="og:url" content="{{ request.build_absolute_uri }}"/>
16+
{% endblock canonical_url %}
17+
{% block fb_meta %}{% endblock fb_meta %}
18+
<title>{% block title %}{% page_attribute "page_title" %}{% endblock %}</title>
19+
{% block base_css %}{% endblock %}
20+
{% endspaceless %}{% render_block 'css' %}{% spaceless %}
21+
{% block page_head %}{% endblock %}
1122
</head>
12-
<body>
13-
{% cms_toolbar %}
14-
<div class="container-fluid">
15-
<div class="navbar navbar-light bg-light" role="navigation">
16-
<div class="navbar-header">
17-
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
18-
<span class="navbar-toggler-icon"></span>
19-
</button>
20-
<a class="navbar-brand" href="/">Project name</a>
21-
</div>
22-
<div class="collapse navbar-collapse" id="navbarSupportedContent">
23-
<ul class="navbar-nav mr-auto">
24-
{% show_menu 0 1 100 100 "menu.html" %}
25-
</ul>
26-
</div>
27-
</div>
28-
{% block content %}{% endblock content %}
29-
</div>
30-
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
31-
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
32-
33-
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
34-
<!-- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> -->
35-
{% render_block "js" %}
23+
<body {% block body_attrs %}{% endblock %}>
24+
{% endspaceless %}{% cms_toolbar %}{% spaceless %}
25+
{% block navbar %}{% endblock %}
26+
{% block content %}
27+
{% placeholder "Content" %}
28+
{% endblock content %}
29+
{% block base_js %}{% endblock %}
30+
{% endspaceless %}{% render_block 'js' %}{% spaceless %}
31+
{% block end_js %}{% endblock %}
32+
{% block bottom_css %}{% endblock %}
3633
</body>
37-
</html>
34+
</html>{% endspaceless %}

backend/templates/bootstrap5.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% extends "base.html" %}{% load cms_tags menu_tags %}
2+
{% block base_css %}
3+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous"/>
4+
{% endblock %}
5+
{% block base_js %}
6+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-u1OknCvxWvY5kfmNBILK2hRnQC3Pr17a+RTT6rIHI7NnikvbZlHgTPOOmMi466C8" crossorigin="anonymous"></script>
7+
{% endblock %}
8+
{% block navbar %}
9+
<nav class="navbar {% block navbar_options %}navbar-expand-lg navbar-dark bg-dark{% endblock %}">
10+
<div class="container">
11+
<a class="navbar-brand" href="/">{% block brand %}{% endblock %}</a>
12+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
13+
<span class="navbar-toggler-icon"></span>
14+
</button>
15+
<div class="collapse navbar-collapse" id="navbarSupportedContent">
16+
<ul class="navbar-nav me-auto mb-2 mb-lg-0">{% block menubar %}{% show_menu 0 100 0 100 'menu/menu.html' %}{% endblock %}</ul>
17+
{% block searchbar %}{% endblock %}
18+
</div>
19+
</div>
20+
</nav>
21+
{% endblock %}

backend/templates/feature.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

backend/templates/menu.html

Lines changed: 0 additions & 19 deletions
This file was deleted.

backend/templates/menu/dropdown.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% load i18n menu_tags cache %}
2+
{% for child in children %}
3+
{% if child.get_menu_title|first == ' ' %}
4+
<div class="dropdown-divider"></div>
5+
{% endif %}
6+
<a class="dropdown-item" href="{{ child.get_absolute_url }}"><span>{{ child.get_menu_title }}</span></a>
7+
{% endfor %}

backend/templates/menu/menu.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% load i18n menu_tags cache %}{% spaceless %}
2+
{% for child in children %}
3+
<li class="nav-item text-center {% if child.ancestor %}ancestor{% endif %}{% if child.children %} dropdown{% endif %}">
4+
{% if child.children %}<a class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" href="{{ child.get_absolute_url }}" id="menu-{{ child.id|safe }}">{{ child.get_menu_title }}</a>
5+
<div class="dropdown-menu" aria-labelledby="menu-{{ child.ancestor.id|safe }}">
6+
{% show_menu from_level to_level extra_inactive extra_active "menu/dropdown.html" "" "" child %}
7+
</div>
8+
{% else %}
9+
<a class="nav-link{% if child.selected %} active{% endif %}" href="{{ child.get_absolute_url }}"><span>{{ child.get_menu_title }}</span></a>
10+
{% endif %}
11+
</li>
12+
{% endfor %}
13+
{% endspaceless %}

0 commit comments

Comments
 (0)