Exos code task

This repo was created for hosting the code task for the upwork jobpost

Features:

  • Set up a basic django 1.9 installation using a sqlite database in the same folder as the source
  • Add two fields to the User model using a migration:
    • birthday field of type date
    • random number field of type integer that is assigned a value from 1-100 on creation
  • Create views for listing all users, viewing, adding, editing and deleting a single user
  • Create two template tags:
    • A tag that will display "allowed" if the user is > 13 years old otherwise display "blocked"
    • A tag that will display the BizzFuzz result of the random number that was generated for the user. The BizzFuzz specification is that for multiples of three print "Bizz" instead of the number and for the multiples of five print "Fuzz". For numbers which are multiples of both three and five print "BizzFuzz"
    • Add a column to the list view after the birthday column that uses the allowed/blocked tag
    • Add a column to the list view after the random number column that uses the BizzFuzz tag
  • Unit test what you feel is appropriate to test.
  • Time permitting, create a download link on the list view that would allow the list to be exported to excel.

Screenshots

List users

List users

User detail

User detail

Edit user

Edit user

Delete user

Delete user

Create user

Create user

List users csv file

List user csv

System Requirements

  • Python 3.6+
  • sqlite 3.13
  • pip 9.0.1

Dependencies

See requirements.txt for more information.

Build Instructions

Application

For Linux and OSX users, run these commands:

  1. First clone the project locally and then go into the directory
$ git clone https://github.com/juliankmazo/exos_code_task.git
$ cd exos_code_task
  1. Setup our virtual environment
$ python3 -m venv env
  1. Now lets activate virtual environment
$ source env/bin/activate
  1. Now lets install the libraries this project depends on.
$ pip install -r requirements.txt

Application + Database

Run the following commands to make the database migrations

$ python manage.py makemigrations
$ python manage.py migrate

Usage

To run the web-app, you’ll need to run the server instance and access the page from your browser.

Start up the web-server:

$ cd exos_code_task
$ python manage.py runserver

In your web-browser, load up the following url

http://127.0.0.1:8000/

Tests

To run the tests, you need to run the following command.

Start up the web-server:

$ cd exos_code_task
$ python manage.py test

You should get something like: Tests