Skip to content

Commit cfd482a

Browse files
committed
add support for django CMS 4.1
1 parent b9d7419 commit cfd482a

14 files changed

+213
-266
lines changed

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
11
# Code of Conduct
22

3-
In this open-source project, our aim is to foster a welcoming and inclusive environment. We expect all contributors
4-
and participants interact with each other with courtesy, respect and kindness.
3+
## Welcome to Our Open-Source Community
54

6-
We will not tolerate abuse or harassment of any kind.
5+
This collaborative project strives to create an inclusive and welcoming environment. We value all contributors' and participants' interactions that reflect courtesy, respect, and kindness.
76

8-
In the event of a concern about behaviour, please contact the maintainers of the project:
7+
We have a zero-tolerance policy for any form of abuse or harassment.
98

10-
* Dennis Schwertel <dennis.swchwertel@divio.com>
9+
If you have concerns about behaviour, please reach out to Divio at info@divio.com.
1110

12-
Reports will be taken seriously and treated in confidence. If necessary, the maintainers will act to exclude
13-
individuals from participating in this and other projects.
11+
Reports will be treated confidentially and taken seriously. The project maintainers may take appropriate action, including exclusion from participation in this and other projects, if necessary.
1412

13+
## Guidelines for Code Review
1514

16-
## Code review
15+
Code review is a crucial but sometimes challenging process for contributors and reviewers. It involves constructive critique, and improvements are often needed before accepting contributions.
1716

18-
Code review can be a frustrating process for both contributors and reviewers, with many opportunities for mutual
19-
misunderstanding.
17+
We expect contributors to recognize that all aspects of their submissions, including code and underlying ideas, will be carefully reviewed.
2018

21-
We expect participants who submit contributions for review to understand and accept that all contributions to the
22-
project, including code and the ideas behind it, will be reviewed carefully. Often review will include critique and
23-
criticism, and will almost always require improvements or other changes before contributions can be accepted.
24-
25-
We also expect reviewers to communicate sensitively and respectfully.
26-
27-
This is in line with a shared aim for the success of the project.
19+
Reviewers are encouraged to provide feedback sensitively and respectfully, aligning with our shared goal for the project's success.

CONTRIBUTING.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
1-
# How to contribute to the project
1+
# Contributing to the Project
22

3-
Thanks for contributing, welcome aboard.
3+
Thank you for contributing! We appreciate your involvement in making this project better. Before you start, please familiarize yourself with our [Code of Conduct](./CODE_OF_CONDUCT.md).
44

5-
Please see our [CODE OF CONDUCT](./CODE_OF_CONDUCT.md) for our code of conduct.
5+
## Submitting Proposals
66

7+
Proposals can be submitted through:
78

8-
## Submitting proposals
9+
- [Pull Requests](https://github.com/divio/getting-started-with-django-cms/pulls)
10+
- [Issues](https://github.com/divio/getting-started-with-django-cms/issues)
911

10-
Please provide proposals as
11-
[pull requests](https://github.com/divio/getting-started-with-django-cms/pulls)
12-
or
13-
[issues](https://github.com/divio/getting-started-with-django-cms/issues) as appropriate.
12+
## Pull Requests and Branches
1413

14+
When making pull requests, adhere to the following:
1515

16-
## Pull requests and branches
16+
- Submit from a properly named new branch.
17+
- Target the `main` branch.
1718

18-
Please make pull requests:
19-
20-
* from an appropriately-named new branch
21-
* to the ``main`` branch
22-
23-
See:
24-
25-
* [how to make pull requests](https://help.github.com/articles/using-pull-requests/)
26-
* [how to manage branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
19+
Learn more:
2720

21+
- [How to make pull requests](https://help.github.com/articles/using-pull-requests/)
22+
- [Managing branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
2823

2924
### Whitespace
3025

31-
Do not use trailing whitespace (spaces or tabs at the end of a line). They are often not visible, and can cause silent
32-
problems and misleading unexpected changes. For example, some editors quietly delete them by default.
26+
Avoid trailing whitespace (spaces or tabs at the end of a line). They might be invisible and lead to silent issues or unexpected changes. Some editors may silently delete them by default.

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
FROM python:3.12
22

33
# Set environment variables for Python
4-
ENV PYTHONDONTWRITEBYTECODE 1
5-
ENV PYTHONUNBUFFERED 1
4+
ENV PYTHONUNBUFFERED=1 \
5+
PYTHONDONTWRITEBYTECODE=1
66

77
# Set the working directory to /app
88
WORKDIR /app
@@ -24,10 +24,12 @@ RUN pip-compile requirements.in && \
2424

2525
# Copy the rest of the project files into the container
2626
COPY . /app/
27-
RUN chmod +x manage.py
2827

29-
# Make port 8000 available to the world outside this container
30-
EXPOSE 8000
28+
# Run collectstatic to gather static files
29+
RUN python manage.py collectstatic --noinput
30+
31+
# Make port 80 available to the world outside this container
32+
EXPOSE 80
3133

3234
# Define the command to run your application
33-
CMD ["gunicorn", "backend.wsgi:application", "--bind", "0.0.0.0:8000"]
35+
CMD ["gunicorn", "backend.wsgi:application", "--bind", "0.0.0.0:80"]

LICENSE

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
MIT License
1+
Copyright (c) 2024, Divio AG
2+
All rights reserved.
23

3-
Copyright (c) 2021 Divio
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of Divio AG nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
414

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL DIVIO AG BE LIABLE FOR ANY DIRECT, INDIRECT,
19+
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23+
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 18 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,28 @@
1-
# Getting started with Django CMS
1+
# Getting Started with django CMS
22

3-
[![Deploy at Divio
4-
badge](https://img.shields.io/badge/deploy%20at%20divio-DFFF67)](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-django-cms/archive/refs/heads/main.zip)
3+
[![Deploy to Divio](https://img.shields.io/badge/DEPLOY-TO%20DIVIO-DFFF67?logo=docker&logoColor=white&labelColor=333333)](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-django-cms/archive/refs/heads/main.zip)
54

5+
Welcome to our QuickStart template – your portal to swift application development and seamless local testing. Whether you're delving into django CMS for the first time or optimizing your workflow, our template, based on the [django CMS quickstart](https://github.com/django-cms/django-cms-quickstart/) guide, has got you covered.
66

7-
This is a template project to bootstrap a Django CMS application.
7+
## Cloud Setup
88

9+
Use the app creation wizard with a free [Divio Account](https://control.divio.com/) and choose **django CMS** from the template selection. Alternatively, click the `Deploy to Divio` button above and follow the app creation wizard. Finally, deploy your app to the `test` or `live` environment.
910

10-
## Quick Start with Divio Cloud
11+
Beware that the **admin** user is not created automatically.
12+
You can do so by connecting via SSH and manually run `python manage.py createsuperuser`.
1113

12-
### Create a free Divio account
13-
Create a free [Divio account](https://control.divio.com/).
14+
For in-depth details about Divio Cloud, refer to the [Divio documentation](https://docs.divio.com/introduction/).
1415

15-
### Deploy your app in Divio Cloud
16-
- Click the `Deploy at Divio` button above and provide the information requested by the app creation wizard (eg. app name and app settings)
16+
## Local Setup
1717

18-
- In Divio Control Panel dashboard, Add `PostgreSQL` database under Services section.
18+
Install the [Divio CLI](https://github.com/divio/divio-cli) to set up your app locally.
1919

20-
- Under settings, add the `Release Command` for database migration:
21-
- `python manage.py migrate`
22-
(`Release Commands` are the commands executed at the start of app container).
20+
Alternatively, build this app locally using Docker:
2321

24-
25-
- Deploy an environment; test or live. Open the Env URL in your browser.
26-
27-
For more details about Divio system, read [Divio documentation](https://docs.divio.com/introduction/)
28-
29-
30-
## Setup your local development environment with Divio CLI
31-
32-
Please follow our simple guidelines for [Divio CLI installation](https://docs.divio.com/introduction/01-installation/) and [setup local development](https://docs.divio.com/introduction/01-installation/#tutorial-installation&gsc.tab=0)
33-
34-
35-
## Setup your local development environment without Divio CLI
36-
37-
### Install Docker
38-
39-
This project uses Docker and docker-compose which you can install from the [offical Docker website](https://docs.docker.com/get-docker/).
40-
41-
### Clone the repository
42-
43-
```
44-
git clone https://github.com/divio/getting-started-with-django-cms.git
45-
```
46-
47-
### Build the project
48-
49-
Let's build the docker image of the project.
50-
```
51-
cd getting-started-with-django-cms
52-
docker-compose build
53-
```
54-
55-
### Run the project
56-
57-
```
58-
docker-compose up
59-
```
60-
61-
This command will start the `web` and `database_default` services. You can reach the web application at [http://localhost:8000]() and Admin panel at [http://localhost:8000/admin]()
62-
63-
64-
To access admin, create a super user.
65-
```
66-
docker-compose run web python manage.py createsuperuser
67-
```
68-
69-
## How to develop
70-
71-
Follow the official [Django CMS development guides](https://docs.django-cms.org/en/latest/introduction/01-install.html)
72-
73-
74-
## Contribute to the project
75-
76-
See the [contribution guide](./CONTRIBUTING.md).
22+
1. Ensure [Docker](https://docs.docker.com/get-docker/) is installed and running.
23+
2. Clone this repository locally.
24+
3. Build the app with `docker compose build`.
25+
4. Run the migrations with `docker compose run --rm web python manage.py migrate`
26+
5. Create a superuser with `docker compose run --rm web python manage.py createsuperuser`
27+
6. Run the app using `docker compose up`.
28+
7. Open [http://localhost:8000]() to view your app.

0 commit comments

Comments
 (0)