Git Product home page Git Product logo

challengesuggestic's Introduction

Suggestic Code Challenge

Create a web service using any framework that flattens a nested sequence into a single list of values.

Input:

{
"items": [1, 2, [3, 4, [5, 6], 7], 8]
}

Output:

{
"result": [1, 2, 3, 4, 5, 6, 7, 8]
}

You code should be pushed to a public github/gitlab repository.

Extra points:

  • Optionally save the result
  • Containerize

Installation

Step 1: Create a virtual environment you can use pyenv or venv or workon in my case used pyenv

pyenv virtualenv 3.8.2 test

Step 2: Now you may activate de virtual enviroment

pyenv activate test 

Step 3: We must move to the django project folder where we place it

cd ChallengeAPIProject/

Step 4: Well now we are going to install in the virtual environment the necessary libraries with which this project was built

pip3 install -r requirements.txt

Step 5: Then we are going to carry out a makemigrations using the django framework

python3 manage.py makemigrations 

Step 6: execute the following command

python3 manage.py migrate

Step 7: Then we are going to create superuser

python3 manage.py createsuperuser 

We put a username and password

Step 8: run server django

python3 manage.py runserver

Then, we enter the following link of API: http://localhost:8000/api/challenge/

Then, we enter the following link of administrator: http://localhost:8000/admin

The only thing I could not do about the challange is to containerize the application

Challenge Solution by

  • José Nicolielly - - jcnil

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.