The purpose of this coding test is to evaluate your skills using Python and the Django web framework.
Luizalabs' team is growing every month and now we need to have some application to manage employees' information, such as name, e-mail and department. As any application written at Luizalabs, it must have an API to allow integrations.
"Luizalabs Employee Manager" app must have:
- A Django Admin panel to manage employees' data
- An API to list, add and remove employees
Request
curl -H "Content-Type: application/javascript" http://localhost:8000/employee/
Response
[
{
"name": "Arnaldo Pereira",
"email": "arnaldo@luizalabs.com",
"departament": "Architecture"
},
{
"name": "Renato Pedigoni",
"email": "renato@luizalabs.com",
"departament": "E-commerce"
},
{
"name": "Thiago Catoto",
"email": "catoto@luizalabs.com",
"departament": "Mobile"
}
]
Clone the repository and create a virtualenv
$ git clone https://github.com/rodolphopivetta/luizalabs.git
$ cd luizalabs
$ virtualenv .venv
Active virtualenv and install all dependencies
$ source .venv/bin/activate
$ pip install -r requirements.txt
Migrate and create a superuser to access admin pages
$ python manage.py migrate
$ python manage.py createsuperuser
Perform tests
$ python manage.py test
Start the server
$ python manage.py runserver
$ curl -H "Content-Type: application/json" -X POST -d '{"name":"Arnaldo Pereira", "email":"arnaldo@luizalabs.com", "departament": "Architecture"}' http://localhost:8000/employee/
URL format: http://localhost:8000/employee/id/
$ curl -H "Content-Type: application/json" -X PUT -d '{"name":"Arnaldo Pereira", "email":"arnaldo@luizalabs.com", "departament": "Mobile"}' http://localhost:8000/employee/1/
URL format: http://localhost:8000/employee/id/
$ curl -H "Content-Type: application/json" http://localhost:8000/employee/1/
This endpoint is paginated with 10 elements per page, so ?page=2
can be used.
$ curl -H "Content-Type: application/json" http://localhost:8000/employee/
$ curl -H "Content-Type: application/json" http://localhost:8000/employee/?page=2
URL format: http://localhost:8000/employee/id/
$ curl -X DELETE http://localhost:8000/employee/1/
Admin page to manage employees: http://localhost:8000/admin/employee/employee/