This is a Django project for managing a library app. It demonstrates how to configure multiple databases using database routing.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Python 3.x
- Django
-
Clone the repository:
git clone https://github.com/MehediMK/django-multiple-databases.git
-
Navigate into the project directory:
cd library_project
-
Install dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Visit
http://127.0.0.1:8000/
in your browser to access the application.
- Django - The web framework used
This project is licensed under the MIT License - see the LICENSE.md file for details.
Dockerfile:
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /code
# Copy the current directory contents into the container at /code
COPY . /code/
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Run the Django development server
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]