Skip to content

Commit

Permalink
chore: 🎉 Move project to open source
Browse files Browse the repository at this point in the history
  • Loading branch information
hotenov committed Dec 7, 2023
0 parents commit 80b1bd5
Show file tree
Hide file tree
Showing 605 changed files with 25,593 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Ignore every file in the entire build context
*

# Re-include the file or directory after wild (*) ignore
!pyproject.toml
!poetry.lock
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,S,W
ignore = E203,E501,RST201,RST203,RST301,W503,B950
max-line-length = 80
max-complexity = 10
docstring-convention = google
per-file-ignores = tests/*:S101
rst-roles = class,const,func,meth,mod,ref
rst-directives = deprecated
# darglint settings
strictness = long
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* text=auto
*Dockerfile* text eol=lf
*.yml text eol=lf
*.sh text eol=lf
156 changes: 156 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
# *.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
*.env

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# VS Code
.vscode

# Hyper Modern template
.pytype/
src/*.egg-info



# Frontend stuff
node_modules
.DS_Store
# Commom static (can be rebuiled from src_front)
src/static
# Media and static root folders for DEV container and local debug server
src/mediafiles
src/staticfiles

# Ignore all non-public Docker related files
_DockerStuff/*
!_DockerStuff/.env.boilerplate
!_DockerStuff/.env.dev.local
!_DockerStuff/docker-compose.yml
!_DockerStuff/Dockerfile
!_DockerStuff/entrypoint.sh
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright © 2023 Artem Hotenov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

**The software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the software or the use or other dealings in the
software.**
73 changes: 73 additions & 0 deletions _DockerStuff/.env.boilerplate
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Dev (Docker) settings. Shared Example.
DJ_PROJECT_NAME=hotenov_com


# # # Variables for 'docker-compose.yml' scope # # #


# Path to .env file for Docker services (container scope)
# including health check in 'db' service of compose file (below)
# It's mandatory to run 'web' (Django app) service
DOCKER_ENV_PATH=./.env.boilerplate
# Do not forget to change it if you use absolute path for '--env-file' docker's commands.
# It should be the same file (for simplicity)


# DATABASE SERVICE ('db')

# DB credentials for db creation
POSTGRES_USER=db_user
POSTGRES_DB=hotenov_com_dev
POSTGRES_PASSWORD=db_password


# WEB APP SERVICE ('web')

# You should extract version from 'pyproject.toml' or changed it manually
# to have versioned app images on your Docker host.
APP_VERSION=latest
# Port for Django's debug server
WEB_PORT=8833

# IMAGE BUILD ARGUMENTS
POETRY_VER=1.7.1
POETRY_DEPS_TO_INSTALL=--only main


# # # Variables for container scope # # #


# WEB / DJANGO APPLICATION CONTAINER

# DB credentials (connection to 'db' host)
SQL_ENGINE=django.db.backends.postgresql
SQL_USER=${POSTGRES_USER}
SQL_DATABASE=${POSTGRES_DB}
SQL_PASSWORD=${POSTGRES_PASSWORD}
SQL_HOST=db
SQL_PORT=5432

# COMMON APP SETTINGS FOR ANY ENVIRONMENT
DJANGO_ROOT_URLCONF=${DJ_PROJECT_NAME}.urls
DJANGO_WSGI_APPLICATION=${DJ_PROJECT_NAME}.wsgi.application
DJANGO_LANGUAGE_CODE=en
DJANGO_TIME_ZONE=Europe/Moscow

# ENVIRONMENT SPECIFIC SETTINGS
DEBUG=1
SECRET_KEY=django-insecure-lkjgk)ee1(ryfneh%!7yd^6cx!fo6748)l^a+yj3h2ev&9ibxr
ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
CSRF_TRUSTED_ORIGINS=http://localhost:3000 http://127.0.0.1:3000
# For this project MEDIA_ROOT default location is 'mediafiles' folder inside the Django project directory..
# Uncomment the following line and specify absolute path to your local disc.
# DJANGO_MEDIA_ROOT="/usr/src/app/mediafiles/"
DJANGO_MEDIA_URL="upl/"
# Usually STATIC_ROOT is not so needed for Dev environment,
# because Django debug server serves the static files for you.
# For this project STATIC_ROOT default location is 'staticfiles' folder inside the Django project directory.
# But you can change it at any time if you want (uncomment the following line)
# DJANGO_STATIC_ROOT="/usr/src/app/staticfiles/"

# CUSTOM APP SETTINGS
SITE_NAME=docker.hotenov.com
SITE_DOMAIN=docker.hotenov.com
70 changes: 70 additions & 0 deletions _DockerStuff/.env.dev.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Dev (Local) settings. Shared Example.

# This file is intended to run Django app locally (without Docker)
# For now, its mandatory to run local Django and unit tests.

# It must be located whether by its default path '<repo_root>/_DockerStuff/.env.dev.local'
# OR by path configured in LOCAL_ENV_FILE_PATH environment variable.
# Path can be relative to <repo_root> OR absolute.

# While you are running the Django debug server locally,
# you always can use database inside a Docker container (or any DB server you have access).
# Just change SQL_* and SQL_TEST_* variables below.
# Duplicated database credentials let you run your unit tests on any DB server you specify.
# Sometimes it's convenient to ensure that new DB version is OK with your app.


# COMMON APP SETTINGS FOR ANY ENVIRONMENT
DJANGO_ROOT_URLCONF=hotenov_com.urls
DJANGO_WSGI_APPLICATION=hotenov_com.wsgi.application
DJANGO_LANGUAGE_CODE=en
DJANGO_TIME_ZONE=Europe/Moscow


# ENVIRONMENT SPECIFIC SETTINGS
DEBUG=1
SECRET_KEY=django-insecure-X3ltLIwfkqGD6rfIJ06F4XqwYZ6p9Xt9X4ZawfQ-Pa6QIX3qJ-hJ6RLy99SoNTsAOW2vIIeFt8ZMZxdtprlmTA
ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
CSRF_TRUSTED_ORIGINS=http://localhost:3000 http://*.127.0.0.1:3000
# For this project MEDIA_ROOT default location is 'mediafiles' folder inside django project directory.
# Uncomment the following line and specify absolute path to your local disc.
# DJANGO_MEDIA_ROOT=/home/path/to/your/media/
DJANGO_MEDIA_URL="upl/"
# Usually STATIC_ROOT is not so needed for Dev environment,
# because Django debug server serves the static files for you.
# For this project STATIC_ROOT default location is 'staticfiles' folder inside django project directory.
# But you can change it at any time if you want (uncomment the following line)
# DJANGO_STATIC_ROOT=/home/path/to/your/staticfiles/

# CUSTOM APP SETTINGS
SITE_NAME="My DEV Django Website"
SITE_DOMAIN=localdev.hotenov.com

# DB credentials (connection to database server)
SQL_ENGINE=django.db.backends.postgresql
SQL_DATABASE=hotenov_com_dev
SQL_USER=db_user
SQL_PASSWORD=db_password
SQL_HOST=127.0.0.1
SQL_PORT=5432

# # DB credentials for running unit test
SQL_TEST_ENGINE=django.db.backends.postgresql
SQL_TEST_DATABASE=hotenov_com_dev
SQL_TEST_USER=db_user
SQL_TEST_PASSWORD=db_password
SQL_TEST_HOST=127.0.0.1
SQL_TEST_PORT=5432


# # DB credentials for running unit test (quick switch)
# SQL_TEST_ENGINE=django.db.backends.postgresql
# SQL_TEST_DATABASE=hotenov_com_docker
# SQL_TEST_USER=hdb_user_docker
# SQL_TEST_PASSWORD=db_password
# SQL_TEST_HOST=localhost
# SQL_TEST_PORT=55432


# # SQLite 3 database (for running test without PostgreSQL)
# SQL_TEST_ENGINE=django.db.backends.sqlite3
Loading

0 comments on commit 80b1bd5

Please sign in to comment.