Skip to content

Commit

Permalink
added logo
Browse files Browse the repository at this point in the history
  • Loading branch information
leoBitto committed Mar 26, 2024
1 parent 4df937f commit effcc76
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 0 deletions.
128 changes: 128 additions & 0 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
158 changes: 158 additions & 0 deletions docs/README copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# DjangoForge: User Manual

## Introduction

DjangoForge is a project ready for deployment, based on Django. This manual provides detailed instructions on how to use the project and automate the deployment process using GitHub Actions.

## Project Setup

### 1. Create a Repository from Template

1. Click on the "Use this template" button on the GitHub repository page.
2. Create a new repository based on the template.

### 2. Clone the New Repository Locally

```bash
git clone --recursive https://github.com/your-username/your-new-repo.git
cd your-new-repo
```

## Project Development

1. Mount or develop new apps for the project: clone all necessary apps inside the project (the `src` directory) as submodules.
```bash
git submodule add <URL to submodule> src/<name of app>
```
Then `git add`, `git commit`, and push.

2. Update the setting file with all the Django apps we intend to use and add the new set of URLs the application uses in the `urls.py` file. In `settings.py` update the `INSTALLED_APPS` list with the apps we use.

## Module `website`

The `website` module allows you to load images, gather them in galleries, add contacts, and opening hours. To use the module:

1. Modify the landing page.
2. Modify the navbar and footer with the links of all the pages you want to be accessible.
3. Modify the view called "base", it will call the page `landing.html`. Add the info in the context you use in the landing. It will be the first page seen by the user.
4. Modify the favicon and title in the template `base.html`.

### Dashboard

The `website` application has a dashboard part that allows you to perform CRUD operations on graphical objects such as images and galleries...
The dashboard can be the place where all such operations for the other apps should be done.
It can be expanded by creating a dashboard directory inside the templates directory of the new app.

```
app folder
│ ├── ...
├── templates/
│ ├── dashboard
└── ...
```
This allows you to keep the dashboard components inside of the new app separated from the rest.
Inside this directory, there should be a file called `dashboard.html` that expands using include `dashboard.html` inside the website app.
This file should be expanded using the expand statement with templates that show the objects needed.
## Dockerfile: Step-by-Step Guide
**Important Commands**
To start:
`sudo docker-compose -f docker-compose.yml up -d --build`
`sudo docker-compose -f docker-compose.yml exec web python manage.py migrate --noinput`
`sudo docker-compose -f docker-compose.yml exec web python manage.py collectstatic --no-input --clear`
To stop:
`sudo docker-compose down -v`
1. **Introduction:**
This Dockerfile defines a multi-stage build process for a production Django application. It creates an optimized and deployment-ready Docker image.
2. **Builder Stage:**
- **Base Image:** `python:3.11.4-slim-buster` provides a minimal Python environment.
- **Working Directory:** `/usr/src/app` is set as the working directory.
- **Environment Variables:**
- `PYTHONDONTWRITEBYTECODE=1`: Disables bytecode generation for better performance.
- `PYTHONUNBUFFERED=1`: Enables unbuffered output for real-time logging.
- **System Dependencies:** `gcc` is installed for potential compiled dependencies.
- **Pip Installation:** `pip` is updated and used to install Python dependencies.
- **Copying Source Code:** The entire project is copied to the builder's working directory.
- **Wheel Creation:** `pip wheel` is used to create wheel files from dependencies in the build stage, improving efficiency in the final stage.
3. **Final Stage:**
- **Base Image:** The `python:3.11.4-slim-buster` image is used again.
- **App User:** A dedicated user `app` is created to run the application.
- **Application Directory:** Directories are created for the `app` user, static files, media files, and the working directory is set.
- **Copying Artifacts from Builder:**
- Pre-built wheel files are copied from the build stage using `COPY --from=builder`.
- `requirements.txt` is copied for reference.
- **Installing Dependencies:** `pip install` is used to install dependencies using the pre-built wheel files and `requirements.txt`.
- **Copying Project:** The entire project source code is copied to the application directory.
- **Permissions:** Ownership of all files and directories is changed to `app:app`.
- **Run User:** The user is set to `app` to run the application.
- **Command:** `gunicorn` is run with specific options.
4. **Notes:**
- This Dockerfile uses a multi-stage approach to improve efficiency and reduce the size of the final image.
- The `app` user is used for security purposes and to separate application privileges.
- The `gunicorn` command is configured with specific options for worker management and timeout.
5. **Usage:**
To use this Dockerfile:
1. Build the image: `docker build -t my-django-app .`
2. Run the container: `docker run -p 8000:8000 my-django-app` (replace `8000` with the desired port number)
6. **Further Resources:**
- Docker documentation: https://docs.docker.com/
- Django documentation: https://docs.djangoproject.com/
- Gunicorn documentation: https://gunicorn.org/
7. **Conclusion:**
This Dockerfile provides a robust and efficient way to build and deploy a Django application.
## Automated Deployment with Script
### Overview
This script streamlines the deployment process, automating several manual steps, and can be triggered automatically on every push to the main branch of the GitHub repository.
### Deployment Workflow
1. **Checkout Repository:**
Clones the repository GitHub into the GitHub Actions runner.
2. **Define REPO_NAME:**
Extracts the repository name and saves it in the `REPO_NAME` variable within GitHub Actions Environment Variables (`$GITHUB_ENV`).
3. **Configure Server:**
Connects to the server configured in secret variables and performs setup tasks.
4. **Clone Repository:**
Clones the GitHub repository inside the server using the GitHub username and repository name.
5. **Activate Virtual Environment and install dependencies:**
Creates a Python virtual environment, activates it, and installs project dependencies.
6. **Create .env file:**
Creates the `.env` file with necessary configurations.
7. **Run Django Commands:**
Executes Django commands for setup and configuration.
8. **Configure Gunicorn:**
Configures Gunicorn for serving the Django application.
9. **Configure Nginx:**
Configures Nginx as a reverse proxy.
10. **Fix Firewall:**
Adjusts firewall rules to allow traffic.
11. **Final Checks:**
Restarts services and performs checks to ensure successful deployment.
---
8 changes: 8 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
theme: jekyll-theme-minimal
remote_theme: pages-themes/[email protected]
plugins:
- jekyll-remote-theme # add this line to the plugins list if you already have one
title: DjangoForge - docs
description: A ready to deploy Django project
logo: "./assets/img/DjangoForge.png"
favicon: "./assets/img/djangoforgeico.svg"
Binary file added docs/assets/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit effcc76

Please sign in to comment.