-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
105200c
commit 9206543
Showing
24 changed files
with
152 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
# Code of Conduct | ||
|
||
In this open-source project, our aim is to foster a welcoming and inclusive environment. We expect all contributors | ||
and participants interact with each other with courtesy, respect and kindness. | ||
## Welcome to Our Open-Source Community | ||
|
||
We will not tolerate abuse or harassment of any kind. | ||
This collaborative project strives to create an inclusive and welcoming environment. We value all contributors' and participants' interactions that reflect courtesy, respect, and kindness. | ||
|
||
In the event of a concern about behaviour, please contact the maintainers of the project: | ||
We have a zero-tolerance policy for any form of abuse or harassment. | ||
|
||
* Dennis Schwertel <dennis.swchwertel@divio.com> | ||
If you have concerns about behaviour, please reach out to Divio at info@divio.com. | ||
|
||
Reports will be taken seriously and treated in confidence. If necessary, the maintainers will act to exclude | ||
individuals from participating in this and other projects. | ||
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. | ||
|
||
## Guidelines for Code Review | ||
|
||
## Code review | ||
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. | ||
|
||
Code review can be a frustrating process for both contributors and reviewers, with many opportunities for mutual | ||
misunderstanding. | ||
We expect contributors to recognize that all aspects of their submissions, including code and underlying ideas, will be carefully reviewed. | ||
|
||
We expect participants who submit contributions for review to understand and accept that all contributions to the | ||
project, including code and the ideas behind it, will be reviewed carefully. Often review will include critique and | ||
criticism, and will almost always require improvements or other changes before contributions can be accepted. | ||
|
||
We also expect reviewers to communicate sensitively and respectfully. | ||
|
||
This is in line with a shared aim for the success of the project. | ||
Reviewers are encouraged to provide feedback sensitively and respectfully, aligning with our shared goal for the project's success. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
# How to contribute to the project | ||
# Contributing to the Project | ||
|
||
Thanks for contributing, welcome aboard. | ||
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). | ||
|
||
Please see our [CODE OF CONDUCT](./CODE_OF_CONDUCT.md) for our code of conduct. | ||
## Submitting Proposals | ||
|
||
Proposals can be submitted through: | ||
|
||
## Submitting proposals | ||
- [Pull Requests](https://github.com/divio/getting-started-with-django/pulls) | ||
- [Issues](https://github.com/divio/getting-started-with-django/issues) | ||
|
||
Please provide proposals as | ||
[pull requests](https://github.com/divio/getting-started-with-django/pulls) | ||
or | ||
[issues](https://github.com/divio/getting-started-with-django/issues) as appropriate. | ||
## Pull Requests and Branches | ||
|
||
When making pull requests, adhere to the following: | ||
|
||
## Pull requests and branches | ||
- Submit from a properly named new branch. | ||
- Target the `main` branch. | ||
|
||
Please make pull requests: | ||
|
||
* from an appropriately-named new branch | ||
* to the ``main`` branch | ||
|
||
See: | ||
|
||
* [how to make pull requests](https://help.github.com/articles/using-pull-requests/) | ||
* [how to manage branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) | ||
Learn more: | ||
|
||
- [How to make pull requests](https://help.github.com/articles/using-pull-requests/) | ||
- [Managing branches](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) | ||
|
||
### Whitespace | ||
|
||
Do not use trailing whitespace (spaces or tabs at the end of a line). They are often not visible, and can cause silent | ||
problems and misleading unexpected changes. For example, some editors quietly delete them by default. | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Copyright (c) 2024, Divio AG | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright | ||
notice, this list of conditions and the following disclaimer in the | ||
documentation and/or other materials provided with the distribution. | ||
* Neither the name of Divio AG nor the | ||
names of its contributors may be used to endorse or promote products | ||
derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL DIVIO AG BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE | ||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,28 @@ | ||
# Getting started with Django | ||
# Getting Started with Django | ||
|
||
[](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-django/archive/refs/heads/main.zip) | ||
[](https://control.divio.com/app/new/?template_url=https://github.com/divio/getting-started-with-django/archive/refs/heads/main.zip) | ||
|
||
Welcome to our QuickStart template – your portal to swift application development and seamless local testing. Whether you're delving into Django for the first time or optimizing your workflow, our template, based on Djangos' [Getting started](https://docs.djangoproject.com/en/5.0/intro/) guide, has got you covered. | ||
|
||
This is a template project to bootstrap a Django application. | ||
## Cloud Setup | ||
|
||
Use the app creation wizard with a free [Divio Account](https://control.divio.com/) and choose **Django** 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. | ||
|
||
## Quick Start with Divio Cloud | ||
Beware that the **admin** user is not created automatically. | ||
You can do so by connecting via SSH and manually run `python manage.py createsuperuser`. | ||
|
||
### Create a free Divio account | ||
Create a free [Divio account](https://control.divio.com/). | ||
For in-depth details about Divio Cloud, refer to the [Divio documentation](https://docs.divio.com/introduction/). | ||
|
||
### Deploy your app in Divio Cloud | ||
- Click the `Deploy at Divio` button above and provide the information requested by the app creation wizard (eg. app name and app settings) | ||
## Local Setup | ||
|
||
- In Divio Control Panel dashboard, Add `PostgreSQL` database under Services section. | ||
Install the [Divio CLI](https://github.com/divio/divio-cli) to set up your app locally. | ||
|
||
- Under settings, add the `Release Command` for database migration: | ||
- `python manage.py migrate` | ||
(`Release Commands` are the commands executed at the start of app container). | ||
Alternatively, build this app locally using Docker: | ||
|
||
|
||
- Deploy an environment; test or live. Open the Env URL in your browser. | ||
|
||
For more details about Divio system, read [Divio documentation](https://docs.divio.com/introduction/) | ||
|
||
|
||
## Setup your local development environment with Divio CLI | ||
|
||
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) | ||
|
||
|
||
## Setup your local development environment without Divio CLI | ||
|
||
### Install Docker | ||
|
||
This project uses Docker and docker-compose which you can install from the [offical Docker website](https://docs.docker.com/get-docker/). | ||
|
||
### Clone the repository | ||
|
||
``` | ||
git clone https://github.com/divio/getting-started-with-django.git | ||
``` | ||
|
||
### Build the project | ||
|
||
Let's build the docker image of the project. | ||
``` | ||
cd getting-started-with-django | ||
docker-compose build | ||
``` | ||
|
||
### Run the project | ||
|
||
``` | ||
docker-compose up | ||
``` | ||
|
||
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]() | ||
|
||
|
||
To access admin, create a super user. | ||
``` | ||
docker-compose run web python manage.py createsuperuser | ||
``` | ||
|
||
## How to develop | ||
|
||
Follow the official [Django development guides](https://docs.djangoproject.com/en/4.2/intro/tutorial01/) | ||
|
||
|
||
## Contribute to the project | ||
|
||
See the [contribution guide](./CONTRIBUTING.md). | ||
1. Ensure [Docker](https://docs.docker.com/get-docker/) is installed and running. | ||
2. Clone this repository locally. | ||
3. Build the app with `docker compose build`. | ||
4. Run the migrations with `docker compose run --rm web python manage.py migrate` | ||
5. Create a superuser with `docker compose run --rm web python manage.py createsuperuser` | ||
6. Run the app using `docker compose up`. | ||
7. Open [http://localhost:8000]() to view your app. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
""" | ||
ASGI config for project. | ||
ASGI config. | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/ | ||
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings') | ||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') | ||
|
||
application = get_asgi_application() |
Oops, something went wrong.