Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1st poetry #465

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 45 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Environment variables

#SECRET_KEY="asnc34c29823v23v3v23"

DEBUG=True
DOMAIN_NAME="example.com"
TIME_ZONE="Europe/London"

ALLOWED_HOSTS=127.0.0.1,localhost,.example.com

# AWS
#AWS_BUCKET_NAME
#
#AWS_ACCESS_KEY_ID
#AWS_SECRET_ACCESS_KEY
#AWS_SES_REGION_NAME
#AWS_SES_REGION_ENDPOINT


# DB
#DBNAME=ktcrm
#DBUSER=postgres
#DBPASSWORD=oracol0
#DBHOST=172.0.0.1
#DBPORT=5432
DATABASE_URL="postgres://postgres:[email protected]:5432/ktcrm"

# Sentry
SENTRY_DSN=http://[email protected]:9000/5

# Celery
#CELERY_BROKER_URL="redis://172.17.0.1:6379/9"
#CELERY_RESULT_BACKEND="redis://172.17.0.1:6379/10"

# Swagger
SWAGGER_ROOT_URL="http://swagger.ktcrm.example.com"

#CACHES
MEMCACHELOCATION="172.17.0.1:11211"

# Email
DEFAULT_FROM_EMAIL="[email protected]"
MARKETING_REPLY_EMAIL="[email protected]"
PASSWORD_RESET_MAIL_FROM_USER="[email protected]"
ADMIN_EMAIL="[email protected]"
21 changes: 21 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
dotenv

layout_poetry() {
if [[ ! -f pyproject.toml ]]; then
log_error 'No pyproject.toml found. Use `poetry new` or `poetry init` to create one first.'
exit 2
fi

# local VENV=$(poetry env list --full-path | cut -d' ' -f1)
local VENV='.venv'
if [[ -z $VENV || ! -d $VENV/bin ]]; then
log_error 'No created poetry virtual environment found. Use `poetry install` to create one first.'
exit 2
fi
VENV=$VENV/bin
export VIRTUAL_ENV=$(echo "$VENV" | rev | cut -d'/' -f2- | rev)
export POETRY_ACTIVE=1
PATH_add "$VENV"
}

layout poetry
15 changes: 15 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[flake8]
max-complexity = 12
max-line-length = 120
exclude =
.*/
__pycache__
docs
src/aws
~build
dist
*.md
datahub_notebooks/*

per-file-ignores =
src/**/migrations/*.py:E501
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@ ref.css.map
crm/dev_settings\.py
env
.env
.envrc
.direnv
.history
dist
docs/build
celerybeat-schedule
local_settings.py
media
.sass-cache
server.log
.vscode
static
static
15 changes: 15 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[settings]
combine_as_imports = true
default_section = THIRDPARTY
include_trailing_comma = true
;forced_separate = django.contrib,django.utils
line_length = 80
known_future_library = future,pies,__future__
;known_standard_library =
known_third_party = rest_framework,django,constance
known_first_party = cbtconsole
multi_line_output = 0
balanced_wrapping = true
;not_skip = __init__.py
sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
skip = .venv src/cbtconsole/cli/__init__.py
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.5
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ virtualenv venv
source venv/bin/activate
```

* Install the project's dependencie
* Install the project's dependencies

```
pip install -r requirements.txt
# pip install -r requirements.txt
poetry install
```

#### env variables
Expand All @@ -63,7 +64,7 @@ pip install -r requirements.txt
python manage.py migrate
python manage.py runserver
```
Then open http://localhost:8000 in your borwser and create a new account with test as company name. We mapped `test.localhost` to `127.0.0.1`. So, it should work properly.
Then open http://localhost:8000 in your browser and create a new account with test as company name. We mapped `test.localhost` to `127.0.0.1`. So, it should work properly.



Expand Down
47 changes: 0 additions & 47 deletions crm/server_settings.py

This file was deleted.

File renamed without changes.
Loading