This folder contains project code for the Real Python step-by-step project for building a to-do app with Django.
These instructions have been tested in Ubuntu Linux and macOS. They should also work in Windows, but note that you'll need to use a different command to activate your virtual environment as described in Step 3. Please consult the venv
documentation for greater detail on the use of virtual environments.
- Navigate into the project directory (
source_code/
). - Create a virtual environment in a
venv/
folder by typingpython -m venv venv
in your console. - Activate the venv using
source venv/bin/activate
(Linux, MacOS) orvenv\Scripts\activate.bat
(Windows). - Install the dependencies with
python -m pip install -r requirements.txt
- Generate the empty SQLite database and tables using
python manage.py migrate
- Run the app with
python manage.py runserver
- Browse to the app home page to see the list of todo lists, which will initially be empty.
You can now start using the UI to add your to-do lists and to-do items to the database. The data will be stored in a new db.sqlite3
file in the root of your project directory.
You can also use Django's auto-generated admin interface at http://localhost:8000/admin/
to view, add, and edit the data.