- Download Docker Community Edition from Docker Website.
- Run
docker pull juneng/postgresto pull postgres docker image. - Run
docker run --name postgres -p 5432:5432 -d juneng/postgresto start postgres docker container. - Run
docker start postgresif the container already exists.
- Download Python 3.6 from Anaconda Website.
- Run
conda create -n entropy python=3.6 anacondato create new environment for Django. - Run
source activate entropyto switch your current Python environment. - Run
pip install -r requirements/local.txtunder Django-sample-app folder to install required packages.
- Download and install Pycharm Community Edition from JetBrains.
- Run
./reset_database.shto clean migrations and database. - Run
python manage.py makemigrationsto make migrations. - Run
python manage.py migrateto update database. - Run
python manage.py testto conduct unit test. - Run
python manage.py runserverto start server.
To run all the tests for all api:
./manage.py test api
Please refer to here.
Our final product could help companies to manage their hiring pipeline. This sample server give user ability to create/read/update/delete company information and manage the stage level information within the company's hiring pipeline.
There are two simple apps within this server: companies and stages. They are under the api folder. The companies app is an example while you need to finish the stages app according to our API document. Below is the instruction:
- The
stagemodel is already defined for you. You need to create theviews.py,serializers.pyandtests.py. - Unlike
companiesapp,stagesapp has an endpoint to change the order of different stages. This is pretty tricky so please choose any method you are comfortable with to achieve this. A challenging part is how to define thevalidatemethod in serializer beautifully. stagemodel has a field calledstage_type. It's saved in database as int but should be rendered as string. Please check API document for detailed example.- Remember to write up your unit test in
tests.py