- Download Docker Community Edition from Docker Website.
- Run
docker pull juneng/postgres
to pull postgres docker image. - Run
docker run --name postgres -p 5432:5432 -d juneng/postgres
to start postgres docker container. - Run
docker start postgres
if the container already exists.
- Download Python 3.6 from Anaconda Website.
- Run
conda create -n entropy python=3.6 anaconda
to create new environment for Django. - Run
source activate entropy
to switch your current Python environment. - Run
pip install -r requirements/local.txt
under Django-sample-app folder to install required packages.
- Download and install Pycharm Community Edition from JetBrains.
- Run
./reset_database.sh
to clean migrations and database. - Run
python manage.py makemigrations
to make migrations. - Run
python manage.py migrate
to update database. - Run
python manage.py test
to conduct unit test. - Run
python manage.py runserver
to 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
stage
model is already defined for you. You need to create theviews.py
,serializers.py
andtests.py
. - Unlike
companies
app,stages
app 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 thevalidate
method in serializer beautifully. stage
model 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