开启代码之旅 Launch With Code


1109 浏览 5 years, 4 months

4 Settings Setup Django Main Configuration

版权声明: 转载请注明出处 http://www.codingsoho.com/

Django的主要配置

  • 模板
  • 调试开关

模板

创建 lwc/templates & lwc/templates/home.html

配置settings.py

TEMPLATE_DIRS = (
    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASE_DIR,"templates")

调试开关

DEBUG
TEMPLATE_DEBUG
…..