The project is a Django application designed to provide a platform for managing and displaying quotes. It includes functionalities such as storing quotes in a database, retrieving and displaying them on a webpage, and asynchronous task handling using Celery.
- Docker
- Docker Compose
Clone the repository:
git clone https://github.com/filiurskyi/django-example
Navigate to the project directory:
cd django-example
Rename file .env.dist
into .env
and specify your development environment variables. Here's an example:
DJANGO_SECRET_KEY=<your_secret_key>
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]
POSTGRES_USER=postgres
POSTGRES_PASSWORD=<pg-password>
POSTGRES_DB=postgres
REDIS_HOST=redis
REDIS_PORT=6379
Build and start the Docker containers:
docker-compose up --build
Once the setup is complete, you can access the Django development server at http://localhost:8000.
The start.sh script automates the setup process and starts the Django development server and Celery worker. Here's how to use it:
./start.sh
The docker-compose.yml file defines the services required for the project, including Redis, PostgreSQL, and Django. To start the containers defined in this file, run:
docker-compose up
Dockerfile The Dockerfile sets up the environment for running the Django application. It installs the necessary dependencies and sets the entry point to start.sh. To build the Docker image, use:
docker build -t your-image-name .
The requirements.txt file lists all Python dependencies required for the project. To install these dependencies, run:
pip install -r requirements.txt
Interested in contributing? We welcome contributions of all kinds! Check out our Contributor's Guide to get started.
This project is licensed under the MIT License.