- Core Dependencies
- Getting Started
- DB migrations and updates to data models
- Starting the server
- Testing
The repository of the Fueled | Backend Engineer Test for services Class Written in Python/Django
Python Version 3.8
Django Version 3.0.5
MySQL Version 8.0.21
Note: explicit commands may differ depending on your OS.
- Install Python from https://www.python.org/downloads/
- Install MySQL from https://dev.mysql.com/downloads/mysql/
- NOTE: my require your own config for root access.
- Pull down the project from https://github.com/mohan488/restaurant_choices
- Setup a virtualenv in your preferred fashion e.g.:
- $ virtualenv -p python3.8 . $ source bin/activate
- pip install -r requirements.txt
- OPTIONAL: Setup autoenv (dev tool for directory management) by using following commands in project directory:
- $ touch .env $ echo "source which activate.sh" >> ~/.bashrc $ echo "source bin/activate" >> .env $ echo "export PASSWORD={YOUR_MYSQL_PASSWORD}
- Create superuser:
- $ python manage.py createsuperuser
- Setup DB using the commands:
- $ python manage.py makemigrations $ python manage.py migrate
- Run server by using:
- $ python manage.py runserver
- Browse localhost:8000/admin/ to view admin console.
- Navigate to the folder containing manage.py and run the following commands in order.
- python manage.py makemigrations
- python manage.py migrate
- python manage.py runserver
Navigate to the folder containing manage.py and run the following command. python manage.py runserver navigate to http://127.0.0.1:8000/ to go to the home page..
For initial testing with API, swagger integrated with the Django server. To check, Additional fitters use postman collection shared in the repo.
$ http://127.0.0.1:8000/services/v1/restaurant?city__icontains=Aber&latitude=57.149453&longitude=-2.172841&userId=1&postcode__iendswith=1XZ&restaurantName__istartswith=AngAbove API lists all Restaurants. Based on Geographic location (eg., country, city, postal code, restaurant name), supports all Django Search options (eg., 'in', 'isnull', 'icontains', 'istartswith','iendswith'). returns all favorite user restaurant including remaining restaurant based search and ensures that Restaurant not blacklisted by user.