Working with Django CMS.
I am hoping you can verify the sanity of attempting to fulfill this requirement using Django CMS, and if you determine I am not insane over this, tell me which files in Django CMS are the right files for forming a list and displaying it on a web page.
In Other Words
- Which file is the right file for making the list in Django CMS?
- How does a list get turned into a template tag, enabling the list to be displayed on a web page?
The List I Need to Display
I need to display through Django CMS a list of files and directories within a certain directory on the web server. This image shows what I mean
To accomplish this, I envision something like this:
In a .py file to be determined, run this:
# import OS module
import os
# Get the list of all files and directories
path = "/var/www/mondoBusterBoss/www.legacy-systems.biz/htdocs/longview2500/topics/0_code_samples/systems/python"
dir_list = os.listdir(path)
# make a template tag
directory_contents_template_tag = STRING_MADE_BY_LOOPING THROUGH dir_list, DECORATING IT WITH HTML TAGS, SAY <BR> AFTER EACH ITEM IN dirlist
In a template, put something like this:
{% directory_contents_template_tag %}
Any information you can provide will be appreciated immensely. Thank you.