This README would normally document whatever steps are necessary to get your application up and running.
- Quick summary
- Version
- Learn Markdown
- Summary of set up
MAC-OS
- install python3.6 official release
- install django by pip for coding
- create a project with django (Already done)
- create virtual environment
- start venv
- install django in evnv
- install mysqlclient
- creating database fxinterview
- migrate db
- start server
- Configuration
-
install python3.6 official release.
-
install django by pip for coding:
$ pip3.6 install Django
doc at https://docs.djangoproject.com/en/1.11/intro/ -
create your own app with django (Already done):
$ python3.6 -m django startproject fxinterview
$ python3.6 manage.py startapp main -
create your local_settings.py based on local_settings_template.py
-
create virtual environment:
$ python3.6 -m venv /path/to/fxinterview/venv -
start venv:
$ source venv/bin/activate -
install requirement libs
$ pip3.6 install -r ./requirements.txt
- Dependencies
-
install django in evnv:
$ pip3.6 install django -
install mysqlclient
($ brew unlink mysql)
$ brew install mysql-connector-c
($ brew unlink mysql-connector-c)
($ brew link mysql)
$ pip3.6 install mysqlclient
- Database configuration
-
create database fxinterview in your mysql
-
update settings.py DATABASES to configure your mysql (do not commit)
-
migrate db
$ python3.6 manage.py migrate
$ python3.6 manage.py makemigrations main
$ python3.6 manage.py sqlmigrate main 0001
$ python3.6 manage.py migrate (check states) -
insert default data
1). Create your own admin user, and test staff user
2). Load test fake data:
$ python3.6 manage.py loaddata main/default_insert_data.json
- How to run tests
-
Run testing with command:
$ coverage run manage.py test project_name
e.g. $ coverage run manage.py test main
or running full test:
$ coverage run manage.py test -
Build your test report
$ coverage html -
View your test report
$ open ./htmlcov/index.html
- Deployment instructions
- Start server $ python3.6 manage.py runserver
- Writing tests
Every new functionality should has a related test.
-
Add your test case class into project_name/tests/test_xxx.py
-
Every test case should contain description for showing what are you testing
-
Test case class name should be ClassNameTestCase, and test case name should be test_function_name
e.g. CompanyModelTestCase
- Code review
- Other guidelines
- Repo owner or admin
- Other community or team contact