Django-Todolist is a todolist web application with the most basic features of most web apps, i.e. accounts/login, API and (somewhat) interactive UI.
Try it out by installing the requirements. (Works only with python >= 3.8, due to Django 4)
pip install -r requirements.txt
Create a database schema:
python manage.py migrate
And then start the server (default: http://localhost:8000)
python manage.py runserver
Now you can browse the API or start on the landing page
-
Fork this repository
-
Open requirements.txt
-
Add mysql-connector-python==8.2.0
-
Open file todolist/settings.py
-
Go to line DATABASES on line 64
-
Update it with this code:
DATABASES = { 'default': { 'ENGINE': 'mysql.connector.django', 'NAME': 'app_db', 'USER': 'app_user', 'PASSWORD': '1234', 'HOST': 'localhost', # You can use a different host in your MySQL server is on a remote machine. 'PORT': '', # Leave this empty to use the default MySQL port (3306). } }
- Prepare a Dockerfile to run a MySQL database, based on official MySQL Image
- Dockerfile should contain ENV variables to initialize app_db database
- Dockerfile should contain ENV variables to initialize app_user with password 1234
- Build mysql image with a name and tag mysql-local:1.0.0
- You should be able successfully run a container with MySQL with a Volumes Attached
- Push mysql-local:1.0.0 to your personal docker hub into mysql-local repository
- Run mysql-local:1.0.0 onn your machine
- Update the python app db config with an IP of a running MySQL server container (without it, the app container won’t build)
- Build and run your updated app
- Take a screenshot of a terminal with successfully started application
- Push Image with a name and tag: todoapp:2.0.0 to yout Docker Hub repository
- Update README.md with instructions on how to run MySQL container with a volume attached
- Update README.md with instructions on how to run an App container which will connect to a MySQL db container.
- README.md should contain a link to your personal docker hub repository win an app image
- README.md should contain instructions on how to access the application via a browser.
- Create PR with your changes and attach it for validation on a platform