This is a simple to-do list application built with Django, following Test-Driven Development principles.
- Create and manage personal to-do lists.
- Add items to lists.
- View lists.
-
Clone the repository:
git clone https://github.com/jryusuf/To-Do-Django
-
Create a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate # On Linux/macOS venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
Running Tests:
To run tests:
python src/manage.py test lists #unit tests python src/manage.py test functional_tests #functional/e2e tests
-
Run migrations:
python src/manage.py migrate
-
Run the development server:
python src/manage.py runserver
The application will be accessible at
http://localhost:8000/
.
The production environment is set up using Docker and Ansible.
-
Build the Docker image:
docker build -t django-todo-app .
-
Deploy with Ansible:
- Ensure you have Ansible installed and configured.
- Modify the
infra/deploy-playbook.yaml
andinfra/env.j2
files with your server details and environment variables. - Run the Ansible playbook:
Replace
ansible-playbook infra/deploy-playbook.yaml -i <inventory_file> -e env=<environment_name>
<inventory_file>
with your Ansible inventory file and<environment_name>
with your environment name (e.g., production, staging).
Note: Refer to the
infra/deploy-playbook.yaml
for detailed deployment steps and configuration.
Example deployment at: http://ec2-18-133-232-224.eu-west-2.compute.amazonaws.com/
For local deployment using Docker, you can use the following steps:
-
Build the Docker image:
docker build -t django-todo-app .
-
Run the Docker container:
docker run -p 8000:8000 django-todo-app
The application will be accessible at
http://localhost:8000/
.Alternatively, you can use Docker Compose if you have a
docker-compose.yml
file:docker-compose up --build