This is a Book Store backend application implementing RESTful API and CRUD operations using Django Rest Framework, Python and SQLite3 as the database.
- Python=>3.10
First, you will need to clone the project onto your local machine
-
Create a new directory on your local machine.
-
Navigate into the newly created directory and open a terminal here.
-
You can now clone the repository using several ways;
#option 1 - HTTPS
git clone https://github.com/Asif-GD/a-django-book-store.git
#option 2 - Download.zip (in case you do not have git)
you will have the option to download the entire repository as an archived folder on github.com
- Navigate into the project directory; a-django-book-store-master. I will refer this as root directory
cd a-django-book-store-master
- Inside the root directory, let's setup the virtual environment for the project.
python -m venv venv
- Now, activate this virtual environment.
# windows machine
venv\Scripts\Activate
#mac/linux
source venv/bin/activate
You will know your virtual environment is active when your terminal displays the following:
(venv) <path\to\project>\a-django-book-store-master>
- Packages and requirements - This project will rely on a lot of 3rd party packages (requirements) to function. I have created a requirements.txt file. Check out /a-django-book-store-master/requirements.txt. Install them all using the command as below
pip install -r requirements.txt
This should successfully setup the project on your local machine and ready for use.
- Start the server. The command below is used to start our Django server on our local machine with default values of local host and port.
python manage.py runserver
You should now have a server running on http://127.0.0.1:8000/
- The local server - http://127.0.0.1:8000/
- Swagger UI - http://127.0.0.1:8000/api/schema/swagger-ui/
- ReDoc - http://127.0.0.1:8000/api/schema/redoc/
- Django admin interface - http://127.0.0.1:8000/admin/
- The credentials for the Django admin interface can be found in admin1_credentials.txt file; inside the meta_data folder in the project directory
\a-django-book-store\meta_data\admin1_credentials.txt
- Some sample data to be used when making API calls can be found in the sample_data folder; inside the meta_data folder in the project directory
\a-django-book-store\meta_data\sample_data