-
Clone the repository:
git clone https://github.com/TAnd-dev/django-tree.git cd django-tree -
Create and activate a virtual environment:
python -m venv env source env/bin/activate # On Windows, use `env\Scripts\activate`
-
Install the dependencies:
pip install django
-
Apply migrations:
python manage.py migrate
-
Create a superuser:
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
- Run the following command to load the prepared data into the database:
python manage.py loaddata tree.json
- When you open
http://127.0.0.1:8000/you will see 2 trees
- Open the admin interface at
http://127.0.0.1:8000/admin/and log in with your superuser account. - Add a new
MenuandMenuItemthrough the admin interface.
To render a menu on a page, load the custom template tag and use the draw_menu tag in your template:
{% load menu_tags %}
{% draw_menu 'main_menu' %}
'''