Welcome to the LittleLemon project! This project is a full-stack restaurant reservation system built using Django and RESTful principles. Below are the API paths you can use to test the functionality of the project.
-
Menu Items
- GET/POST:
/restaurant/menu/ - GET/PUT/DELETE:
/restaurant/menu/<int:pk>/
- GET/POST:
-
Booking Tables
- GET/POST/PUT/DELETE:
/restaurant/booking/tables/
- GET/POST/PUT/DELETE:
-
Authentication
- Obtain Token:
/restaurant/api-token-auth/ - User Registration:
/auth/users/ - Login:
/auth/token/login/ - Logout:
/auth/token/logout/
- Obtain Token:
-
Static HTML Page
- Access the homepage:
/
- Access the homepage:
To set up and run the project locally, follow these steps:
-
Navigate to the Project Directory
Open your terminal and navigate to thelittlelemonfolder:cd /Users/ashishsharma/codes/LittleLemon/littlelemon -
Install Dependencies
Ensure you havepipenvinstalled. If not, install it using:pip install pipenv
Then, install the required dependencies:
pipenv install
-
Activate the Virtual Environment
Activate the virtual environment created bypipenv:pipenv shell
-
Run Database Migrations
Apply the database migrations:python manage.py migrate
-
Run the Development Server
Start the Django development server:python manage.py runserver
-
Access the Application
Open your browser and navigate tohttp://127.0.0.1:8000/to access the application.
Once the development server is running, you can access the static HTML homepage by navigating to:
http://127.0.0.1:8000/
You can use tools like Postman or curl to test the APIs. Ensure you have the necessary authentication tokens for endpoints that require authentication.
- The project uses MySQL as the database. Ensure you have MySQL installed and configured with the credentials provided in
settings.py. - Static files are served using Django's static file handling. Ensure you have run
collectstaticif deploying to production.
Happy testing!