Api Host -> https://agile-headland-13957.herokuapp.com
- Python3.5 + [https://www.python.org/]
- VirtualEnv
- Python PIP
- PostgreSQL [https://www.postgresql.org/]
- Clone this repository
- Create virtualenv using python 3.5 + e.g. virtualenv -p python3.5 envname
- Install python dependencies: pip install -r requirements-local.txt
- Create database.
- Edit local.env file with your configurations.
- Export env variables e.g. export $(cat local.env | xargs)
- Run migration for create database tables e.g. python3.6 work-at-olist/manage.py migrate
- Import Channel and Categories using test.csv file e.g. python3.6 work-at-olist/manage.py importcategories walmart test.csv
- Start Api: python work-at-olist/manage.py runserver
python3.6 work-at-olist/manage.py test api
python3.6 work-at-olist/manage.py importcategories {channel_name} {csv_file_path}
python3.6 work-at-olist/manage.py importcategories "Magazine Luiza" test.csv
GET /api/channels/
[
{
"name": "Magazine Luiza",
"slug": "magazine-luiza"
}
]
GET /api/channel-categories/{channel-slug}/
GET /api/channel-categories/magazine-luiza/
[
{
"name": "Auto",
"slug": "auto",
"children": [
{
"name": "Cars",
"slug": "cars",
"children": [
{
"name": "Motor",
"slug": "motor",
"children": []
}
]
}
]
},
{
"name": "Books",
"slug": "books",
"children": [
{
"name": "Computers",
"slug": "computers",
"children": [
{
"name": "Applications",
"slug": "applications",
"children": []
},
{
"name": "Database",
"slug": "database",
"children": []
},
{
"name": "Programming",
"slug": "programming",
"children": []
}
]
},
{
"name": "Foreign Literature",
"slug": "foreign-literature",
"children": []
},
{
"name": "National Literature",
"slug": "national-literature",
"children": [
{
"name": "Fiction Fantastic",
"slug": "fiction-fantastic",
"children": []
},
{
"name": "Science Fiction",
"slug": "science-fiction",
"children": []
}
]
}
]
},
{
"name": "Computers",
"slug": "computers",
"children": [
{
"name": "Desktop",
"slug": "desktop",
"children": []
},
{
"name": "Notebooks",
"slug": "notebooks",
"children": []
},
{
"name": "Tablets",
"slug": "tablets",
"children": []
}
]
},
{
"name": "Games",
"slug": "games",
"children": [
{
"name": "Playstation 4",
"slug": "playstation-4",
"children": []
},
{
"name": "XBOX 360",
"slug": "xbox-360",
"children": [
{
"name": "Accessories",
"slug": "accessories",
"children": [
{
"name": "Controller",
"slug": "controller",
"children": []
}
]
},
{
"name": "Console",
"slug": "console",
"children": []
},
{
"name": "Games",
"slug": "games",
"children": []
}
]
},
{
"name": "XBOX One",
"slug": "xbox-one",
"children": [
{
"name": "Accessories",
"slug": "accessories",
"children": []
},
{
"name": "Console",
"slug": "console",
"children": []
},
{
"name": "Games",
"slug": "games",
"children": []
}
]
}
]
}
]
GET /api/category/{category-slug}/
GET /api/category/cars/
[
{
"name": "Auto",
"slug": "auto",
"children": [
{
"name": "Cars",
"slug": "cars",
"children": [
{
"name": "Motor",
"slug": "motor",
"children": []
}
]
}
]
}
]