https://github.com/mehedimk/django-multiple-databases
Multiple Databases in Django for a Library Project
https://github.com/mehedimk/django-multiple-databases
Last synced: 3 months ago
JSON representation
Multiple Databases in Django for a Library Project
- Host: GitHub
- URL: https://github.com/mehedimk/django-multiple-databases
- Owner: MehediMK
- License: mit
- Created: 2024-03-02T16:58:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-02T19:28:33.000Z (over 1 year ago)
- Last Synced: 2024-03-02T20:33:16.969Z (over 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Library Project
This is a Django project for managing a library app. It demonstrates how to configure multiple databases using database routing.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
- Python 3.x
- Django### Installing
1. Clone the repository:
```bash
git clone https://github.com/MehediMK/django-multiple-databases.git
```2. Navigate into the project directory:
```bash
cd library_project
```3. Install dependencies:
```bash
pip install -r requirements.txt
```4. Apply migrations:
```bash
python manage.py migrate
```5. Run the development server:
```bash
python manage.py runserver
```6. Visit `http://127.0.0.1:8000/` in your browser to access the application.
## Built With
- [Django](https://www.djangoproject.com/) - The web framework used
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.
**Dockerfile:**
```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"]
```