sw00d / doug-practice

0 stars 0 forks source link
CKC

 

skeletor CKC

This is the official CKC base project, we use this for most of our new clients. It gives us:

   ❯  One command dev install: make
   ❯  Heroku deploys for frontend and backend
   ❯  Email templates + helpers
   ❯  Fast tests w/coverage (pytest)
   ❯  Hot reloading for local dev

 
 
 
 

Start a project..

Use django-admin startproject to clone skeletor

$ django-admin.py startproject new_project \
    --template=https://github.com/ckc-org/skeletor/archive/master.zip \
    --name index.md,setup,app.json,README.md
$ cd new_project

Finally, remove this section from the README and continue below!


new_project

installation

$ make

# (or make init)

development

default login is "admin@admin.com" password "admin"

For local development (hot reloading, etc.): http://localhost:3000

To get to the django admin: http://localhost:8000/admin

reset local database

$ make reset

run tests

$ make test

# ..or with coverage:
# docker-compose exec django py.test --cov-report html:artifacts/coverag

# run frontend tests
# docker-compose exec builder yarn test

configuration

if you are only doing local development you shouldn't have to do any extra configuration.

for a deployment you'll want to edit .env with your secrets.

generating ERD

You can use django-extensions to generate a nice diagram of the current model structure.

# make sure graphviz installed
#     mac: brew install graphviz
#     linux: apt-get install graphviz-dev

# install requisite graph visualizer libs
docker-compose exec django pip install pygraphviz

# take the screenshot
docker-compose exec django ./manage.py graph_models -a -g -o my_project_visualized.png

deploy

when we deploy we'll do the following..

$ make deploy

testing emails locally

eg sending a welcome email....

$ docker-compose exec django ./manage.py email welcome hello@ckcollab.com