All fix for production

This commit is contained in:
Fundor333
2020-09-22 22:12:44 +02:00
parent 55bfe48e49
commit 64c4c24269
5 changed files with 27 additions and 26 deletions

6
.env Normal file
View File

@@ -0,0 +1,6 @@
DEBUG=on
SECRET_KEY=your-secret-key
DATABASE_URL=psql://urser:un-githubbedpassword@127.0.0.1:8458/database
SQLITE_URL=sqlite:///my-local-sqlite.db
CACHE_URL=memcache://127.0.0.1:11211,127.0.0.1:11212,127.0.0.1:11213
REDIS_URL=rediscache://127.0.0.1:6379/1?client_class=django_redis.client.DefaultClient&password=ungithubbed-secret

View File

@@ -1,25 +1,12 @@
fail_fast: true fail_fast: true
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks - repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0 rev: v3.2.0
hooks: hooks:
- id: trailing-whitespace - id: trailing-whitespace
- repo: https://github.com/psf/black language: python
rev: 19.3b0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs - repo: https://github.com/asottile/blacken-docs
rev: v1.7.0 rev: v1.8.0
hooks: hooks:
- id: blacken-docs - id: blacken-docs
additional_dependencies: [black==19.3b0] additional_dependencies: [black==19.3b0]
- repo: local
hooks:
- id: markdownlint
name: markdownlint
description: "Lint Markdown files"
entry:
markdownlint '**/*.md' --fix --ignore node_modules --config
"./.markdownlint.json"
language: node
types: [markdown]

13
Pipfile
View File

@@ -5,20 +5,19 @@ verify_ssl = true
[dev-packages] [dev-packages]
pylint = "*" pylint = "*"
pylint-django = "*"
autopep8 = "*" autopep8 = "*"
rope = "*" rope = "*"
safety = "*" safety = "*"
pylint-django = "*"
flake8 = "*" flake8 = "*"
black ="*"
pre-commit= "*" pre-commit= "*"
[packages] [packages]
django = "==3.1.*" django = ">=3.1.0"
gunicorn = "==20.0.*" gunicorn = ">=20.0.0"
psycopg2 = "==2.8.*" psycopg2 = ">=2.8.0"
django-filter = "==2.3.*" django-filter = ">=2.3.0"
django-guardian = "==2.3.*" django-guardian = ">=2.3.0"
[requires] [requires]
python_version = "3.8" python_version = "3.8"

View File

@@ -1,2 +1,4 @@
# django-template # django-template
My personal Django template project My personal Django template project.
This a blank django template for my project. Build around [this post](https://victoria.dev/blog/my-django-project-best-practices-for-happy-developers/) and other find online.

View File

@@ -6,9 +6,16 @@ include .env
help: ## Show this help help: ## Show this help
@egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' @egrep -h '\s##\s' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
.PHONY: env
env: ## Install pipenv
pip3 install pipenv
pipenv shell --python 3.8
.PHONY: install .PHONY: install
install: ## Make venv and install requirements install: env ## Make venv and install requirements
$(BIN) pipenv install; pipenv run pre-commit install pipenv install --development
pipenv run pre-commit install
pre-commit autoupdate
migrate: ## Make and run migrations migrate: ## Make and run migrations
$(PYTHON) manage.py makemigrations $(PYTHON) manage.py makemigrations