In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "Django path configuration and rendering methods". In daily operation, I believe many people have doubts about Django path configuration and rendering methods. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "Django path configuration and rendering methods". Next, please follow the editor to study!
The template is the front-end page. Django writes the html source code into the template file, then renders it in a specific way and gives it to the client.
There are two ways to set the template path, namely, under the project directory and under the application directory.
Template search order: first look for templates in the directory set by DIRS, if not and 'APP_DIRS': True, continue to look for templates under the registered app file.
1). Create a new templates folder under the project directory
2). Find the template setting TEMPLATES in setting.py under the project directory, and configure "DIRS"
3). Create a teacher folder under the templates folder
4). Create a new teacher_login.html file under the templates/teacher folder and edit the web page
5). Edit views.py in the teacher application folder and render using render
6). Edit urls.py in the teacher application folder
1) create a new templates folder under the student application directory
2) find the template settings TEMPLATES and INSTALLED_APP in the setting.py of the project directory, and upload them
3). Create a new student folder under the student/templates folder
4). Create a new student_login.html file under the student/templates/student folder and edit the web page
5). Edit views.py in the student application folder and render using render
6). Edit urls.py in the student application folder
At this point, the study of "Django path configuration and rendering method" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.