Display activity log
In the future, these logs are showed in the form of chart (perhaps...)
You need to setup these and to enable docker-compose
to run.
- docker
- docker-compose
- pipenv
- postgresql
*You don't have to setup these Middlewares in your OS, if you build your environment with docker and docker-compose !!
Click here to open! :D
-
Create OAuth 2.0 client
If it is necessary, please create Google client-id following this article. (Google Cloud / Creating client IDs) -
Copy
.env
$ cp .env.example .env
No Name Value Example Note 1 DEBUG True True => Display error detail on browser 2 SECRET_KEY xxxxxx... It is for Django 3 DB_USER user It is username of your postgresql 4 DB_PASSWORD password It is password of your postgresql - - - The below variables are optional
(not required)5 SOCIAL_AUTH_GOOGLE_OAUTH2_KEY 000000000000-....apps.googleusercontent.com OAuth 2.0 client ID for Google 6 SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET xxxxxx... OAuth 2.0 client secret for Google -
Execute following commands
$ docker-compose build $ docker-compose up -d $ docker attach life_recorder_web_1 $ docker-compose exec web python manage.py createsuperuser >> ** Input information of your superuser! **
-
You can run automated test by this command
$ docker-compose exec web python manage.py test --debug-mode # I recommend following options! $ docker-compose exec web python manage.py test --debug-mode -v 2 --pdb --keepdb
-
You can access to
- Django Admin
localhost:8000/admin
- App Top
localhost:8000/cms
- API Root
localhost:8000/api/v1
- Django Admin
-
You can display the sample response of API
localhost:8000/api/v1/records/?format=json
If you add any pip module,
then you have to rewrite requirements.txt
and rerun docker-compose build
,
because pip modules are installed in Docker image according to requirements.txt
.
Before commit
or push
, please run following checks, and confirm all of them are successful!
-
flake8
$ docker-compose exec web flake8
-
unittest
$ docker-compose exec web python manage.py test --debug-mode