Skip to content

Commit bc9b9cb

Browse files
Merge pull request #41 from tomvothecoder/feature/40-cookiecutter-django
Feature/40 cookiecutter django
2 parents 2b2fa1e + 03d919a commit bc9b9cb

File tree

111 files changed

+3293
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+3293
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Update Github actions in workflows
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "daily"

.github/workflows/backend-ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
# Enable Buildkit and let compose use it to speed up image building
4+
env:
5+
DOCKER_BUILDKIT: 1
6+
COMPOSE_DOCKER_CLI_BUILD: 1
7+
DATABASE_URL: pgsql://XDwVOJDPZWeKGECmAgdQMlsrrHgJFiir:EfhBcfu9MS0MNUboMvw7AOOvabRvO2jwDJEACSxXUslei0Me5WmJQE9JXV8oavo3@postgres:5432/personal_website
8+
9+
on:
10+
pull_request:
11+
branches: ["master"]
12+
paths-ignore: ["docs/**"]
13+
14+
push:
15+
branches: ["master"]
16+
paths-ignore: ["docs/**"]
17+
18+
defaults:
19+
run:
20+
working-directory: backend
21+
22+
jobs:
23+
flake8:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code Repository
27+
uses: actions/checkout@v2
28+
29+
- name: Set up Python 3.8
30+
uses: actions/setup-python@v2
31+
with:
32+
python-version: 3.8
33+
34+
- name: Install flake8
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install flake8
38+
39+
- name: Lint with flake8
40+
run: flake8
41+
42+
# With no caching at all the entire ci process takes 4m 30s to complete!
43+
pytest:
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout Code Repository
47+
uses: actions/checkout@v2
48+
- name: Build the Stack
49+
run: docker-compose -f docker-compose.yml build
50+
51+
- name: Make DB Migrations
52+
run: docker-compose -f docker-compose.yml run --rm django python manage.py migrate
53+
54+
- name: Run the Stack
55+
run: docker-compose -f docker-compose.yml up -d
56+
57+
- name: Run Django Tests
58+
run: docker-compose -f docker-compose.yml exec -e DATABASE_URL=${DATABASE_URL} -T django pytest
59+
60+
- name: Tear down the Stack
61+
run: docker-compose down

backend/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.*
2+
!.coveragerc
3+
!.env
4+
!.pylintrc

backend/.editorconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.{py,rst,ini}]
12+
indent_style = space
13+
indent_size = 4
14+
15+
[*.py]
16+
line_length = 88
17+
known_first_party = personal_website,config
18+
multi_line_output = 3
19+
default_section = THIRDPARTY
20+
recursive = true
21+
skip = venv/
22+
skip_glob = **/migrations/*.py
23+
include_trailing_comma = true
24+
force_grid_wrap = 0
25+
use_parentheses = true
26+
27+
[*.{html,css,scss,json,yml}]
28+
indent_style = space
29+
indent_size = 2
30+
31+
[*.md]
32+
trim_trailing_whitespace = false
33+
34+
[Makefile]
35+
indent_style = tab
36+
37+
[nginx.conf]
38+
indent_style = space
39+
indent_size = 2

backend/.envs/.local/.django

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# General
2+
# ------------------------------------------------------------------------------
3+
USE_DOCKER=yes
4+
IPYTHONDIR=/app/.ipython

backend/.envs/.local/.postgres

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# PostgreSQL
2+
# ------------------------------------------------------------------------------
3+
POSTGRES_HOST=postgres
4+
POSTGRES_PORT=5432
5+
POSTGRES_DB=personal_website
6+
POSTGRES_USER=XDwVOJDPZWeKGECmAgdQMlsrrHgJFiir
7+
POSTGRES_PASSWORD=EfhBcfu9MS0MNUboMvw7AOOvabRvO2jwDJEACSxXUslei0Me5WmJQE9JXV8oavo3

backend/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

0 commit comments

Comments
 (0)