|
| 1 | +# Ostmodern Python Code Test |
| 2 | + |
| 3 | +The goal of this exercise is to test that you know your way around Django and |
| 4 | +REST APIs. Approach it the way you would an actual long-term project. |
| 5 | + |
| 6 | +The idea is to build a platform on which your users can buy and sell Starships. |
| 7 | +To make this process more transparent, it has been decided to source some |
| 8 | +technical information about the Starships on sale from the [Starship |
| 9 | +API](https://swapi.co/documentation#starships). |
| 10 | + |
| 11 | +A Django project some initial data models have been created already. You may need |
| 12 | +to do some additional data modelling to satify the requirements. |
| 13 | + |
| 14 | +## Getting started |
| 15 | + |
| 16 | +* This test works with either |
| 17 | + [Docker](https://docs.docker.com/compose/install/#install-compose) or |
| 18 | + [Vagrant](https://www.vagrantup.com/downloads.html) |
| 19 | +* Get the code from `https://github.com/ostmodern/python-code-test` |
| 20 | +* Do all your work in your own `develop` branch |
| 21 | +* Once you have downloaded the code the following commands will get the site up |
| 22 | + and running |
| 23 | + |
| 24 | +```shell |
| 25 | +# For Docker |
| 26 | +docker-compose up |
| 27 | +# You can run `manage.py` commands using the `./manapy` wrapper |
| 28 | + |
| 29 | +# For Vagrant |
| 30 | +vagrant up |
| 31 | +vagrant ssh |
| 32 | +# Inside the box |
| 33 | +./manage.py runserver 0.0.0.0:8008 |
| 34 | +``` |
| 35 | +* The default Django "It worked!" page should now be available at |
| 36 | + http://localhost:8008/ |
| 37 | + |
| 38 | +## Tasks |
| 39 | + |
| 40 | +Your task is to build a JSON-based REST API for your frontend developers to |
| 41 | +consume. You have built a list of user stories with your colleagues, but you get |
| 42 | +to decide how to design the API. Remember that the frontend developers will need |
| 43 | +some documentation of your API to understand how to use it. |
| 44 | + |
| 45 | +We do not need you to implement users or authentication, to reduce the amount of |
| 46 | +time this exercise will take to complete. You may use any external libraries you |
| 47 | +require. |
| 48 | + |
| 49 | +* We need to be able to import all existing |
| 50 | + [Starships](https://swapi.co/documentation#starships) to the provided Starship |
| 51 | + Model |
| 52 | +* A potential buyer can browse all Starships |
| 53 | +* A potential buyer can browse all the listings for a given `starship_class` |
| 54 | +* A potential buyer can sort listings by price or time of listing |
| 55 | +* To list a Starship as for sale, the user should supply the Starship name and |
| 56 | + list price |
| 57 | +* A seller can deactivate and reactivate their listing |
| 58 | + |
| 59 | +After you are done, create a release branch in your repo and send us the link. |
0 commit comments