Skip to content

Commit 51d31ef

Browse files
author
Mario Colombo
committed
updated to latest main branch changes
1 parent 336f374 commit 51d31ef

File tree

7 files changed

+272
-66
lines changed

7 files changed

+272
-66
lines changed

Dockerfile

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

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ see sections that can be removed - in each case, the section is noted with a com
3939

4040
Options are also available for using Postgres/MySQL, uWSGI/Gunicorn/Guvicorn, etc.
4141

42+
#### Updating requirements
43+
44+
The project uses a 2 step approach, freezing all dependencies with pip-tools. Read more about how to handle it here: https://blog.typodrive.com/2020/02/04/always-freeze-requirements-with-pip-compile-to-avoid-unpleasant-surprises/
45+
4246
## Features
4347

4448
### Static Files with Whitenoise

backend/settings.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,22 @@
6969
'djangocms_googlemap',
7070
'djangocms_video',
7171

72-
# optional django CMS Bootstrap 5 modules
73-
'djangocms_bootstrap5',
74-
'djangocms_bootstrap5.contrib.bootstrap5_alerts',
75-
'djangocms_bootstrap5.contrib.bootstrap5_badge',
76-
'djangocms_bootstrap5.contrib.bootstrap5_card',
77-
'djangocms_bootstrap5.contrib.bootstrap5_carousel',
78-
'djangocms_bootstrap5.contrib.bootstrap5_collapse',
79-
'djangocms_bootstrap5.contrib.bootstrap5_content',
80-
'djangocms_bootstrap5.contrib.bootstrap5_grid',
81-
'djangocms_bootstrap5.contrib.bootstrap5_jumbotron',
82-
'djangocms_bootstrap5.contrib.bootstrap5_link',
83-
'djangocms_bootstrap5.contrib.bootstrap5_listgroup',
84-
'djangocms_bootstrap5.contrib.bootstrap5_media',
85-
'djangocms_bootstrap5.contrib.bootstrap5_picture',
86-
'djangocms_bootstrap5.contrib.bootstrap5_tabs',
87-
'djangocms_bootstrap5.contrib.bootstrap5_utilities',
72+
# optional django CMS Bootstrap 4 modules
73+
'djangocms_bootstrap4',
74+
'djangocms_bootstrap4.contrib.bootstrap4_alerts',
75+
'djangocms_bootstrap4.contrib.bootstrap4_badge',
76+
'djangocms_bootstrap4.contrib.bootstrap4_card',
77+
'djangocms_bootstrap4.contrib.bootstrap4_carousel',
78+
'djangocms_bootstrap4.contrib.bootstrap4_collapse',
79+
'djangocms_bootstrap4.contrib.bootstrap4_content',
80+
'djangocms_bootstrap4.contrib.bootstrap4_grid',
81+
'djangocms_bootstrap4.contrib.bootstrap4_jumbotron',
82+
'djangocms_bootstrap4.contrib.bootstrap4_link',
83+
'djangocms_bootstrap4.contrib.bootstrap4_listgroup',
84+
'djangocms_bootstrap4.contrib.bootstrap4_media',
85+
'djangocms_bootstrap4.contrib.bootstrap4_picture',
86+
'djangocms_bootstrap4.contrib.bootstrap4_tabs',
87+
'djangocms_bootstrap4.contrib.bootstrap4_utilities',
8888
]
8989

9090
MIDDLEWARE = [
@@ -136,8 +136,8 @@
136136
('whitenoise-static-files-demo.html', 'Static File Demo'),
137137

138138
# optional templates that extend base.html, to be used with Bootstrap 5
139-
('page.html', 'Bootstrap5 Demo'),
140-
('feature.html', 'Bootstrap5 Demo with two placeholders')
139+
('page.html', 'Bootstrap 4 Demo'),
140+
('feature.html', 'Bootstrap 4 Demo with two placeholders')
141141
]
142142

143143
WSGI_APPLICATION = 'backend.wsgi.application'

backend/templates/base.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<meta charset="utf-8">
66
<title>{% block title %}This is my new project home page{% endblock title %}</title>
77
<meta name="viewport" content="width=device-width,initial-scale=1">
8-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
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"> -->
910
{% render_block "css" %}
1011
</head>
1112
<body>
@@ -26,8 +27,11 @@
2627
</div>
2728
{% block content %}{% endblock content %}
2829
</div>
30+
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
2931
<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>
30-
<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>
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> -->
3135
{% render_block "js" %}
3236
</body>
3337
</html>

docker-compose.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: "2.4"
1+
version: "3"
2+
23
services:
34
web:
45
# the application's web service (container) will use an image based on our Dockerfile
5-
build: "."
6+
build: .
67
# map the internal port 80 to port 8000 on the host
78
ports:
89
- "8000:80"
@@ -13,19 +14,27 @@ services:
1314
# the default command to run whenever the container is launched
1415
command: python manage.py runserver 0.0.0.0:80
1516
# the URL 'postgres' or 'mysql' will point to the application's db service
16-
links:
17-
- "database_default"
17+
networks:
18+
- djangocmsnet
19+
1820
env_file: .env-local
1921

2022
database_default:
2123
# Select one of the following db configurations for the database
2224
image: postgres:9.6-alpine
2325
ports:
24-
- "5432:5432" # allow your local dev env to connect to the db
26+
- "5432:5432/tcp" # allow your local dev env to connect to the db
2527
environment:
2628
POSTGRES_DB: "db"
2729
POSTGRES_PASSWORD: "password"
2830
POSTGRES_HOST_AUTH_METHOD: "trust"
2931
SERVICE_MANAGER: "fsm-postgres"
32+
33+
networks:
34+
- djangocmsnet
35+
3036
volumes:
3137
- ".:/app:rw"
38+
39+
networks:
40+
djangocmsnet:

requirements.in

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Compile this file for changes to take effect:
2+
# pip-compile requirements.in >> requirements.txt
3+
4+
5+
django<3.2 # 3.2 has dark admin theme which looks bad in custom django CMS admin views
6+
dj-database-url==0.5.0
7+
django-storage-url==0.5.0
8+
whitenoise==5.2.0
9+
boto3==1.14.49
10+
11+
psycopg2==2.8.5
12+
13+
uwsgi==2.0.19.1
14+
15+
# key requirements for django CMS
16+
http://github.com/django-cms/django-cms/tarball/release/4.0.x#egg=django-cms
17+
https://github.com/divio/djangocms-versioning/tarball/master#egg=djangocms-versioning # FIXME: Requires an "official" V1 release
18+
https://github.com/divio/djangocms-alias/tarball/master#egg=djangocms-alias # FIXME: Requires an "official" V1 release
19+
django-treebeard>=4.0,<5.0
20+
django-classy-tags>=2.0
21+
django-sekizai>=2.0
22+
six
23+
pytz
24+
25+
# optional, but used in most projects
26+
djangocms-admin-style>=2.0,<3.0
27+
28+
# the default CKEditor - optional, but used in most projects
29+
https://github.com/django-cms/djangocms-text-ckeditor/tarball/support/4.0.x#egg=djangocms-text-ckeditor
30+
31+
# some content plugins - optional, but used in most projects
32+
33+
# some content plugins - optional, but used in most projects
34+
djangocms-link>=3.0,<4.0
35+
# FIXME: Replaces djangocms-link, some packages are still sadly dependant ....
36+
https://github.com/divio/djangocms-url-manager/tarball/master#egg=djangocms-url-manager
37+
38+
djangocms-icon>=2.0,<3.0
39+
djangocms-style>=3.0,<4.0
40+
djangocms-googlemap>=2.0,<3.0
41+
djangocms-video>=3.0,<4.0
42+
djangocms-file>=3.0,<4.0
43+
44+
45+
# optional django CMS Bootstrap 4 modules
46+
djangocms-bootstrap4>=2.0,<3.0
47+
# optional django CMS Bootstrap 5 modules (alpha) - requires BS5 frontend setup in the templates
48+
# as of Q4 2021 there are still basic issues with djangocms-bootstrap5
49+
# https://github.com/gl-agnx/djangocms-bootstrap5/archive/refs/heads/master.zip#egg=djangocms_bootstrap5
50+
51+
# Django Filer - optional, but used in most projects (alpha)
52+
https://github.com/django-cms/django-filer/archive/refs/tags/2.1rc4.zip#egg=django-filer
53+
54+
pip-tools # needed for compilation of this file into requirements.txt, see start of file

0 commit comments

Comments
 (0)