【django】【基础】django设置

django设置

国际化

  • 中文:LANGUAGE_CODE='zh-hans'
  • 时区:Shanghai/Asia
  • 应用列表中加入:INSTALLED_APPS=[应用名(supporter)]
  • 复制总路由文件到应用根目录下:urls.py
  • 修改总路由文件:
    from django.conf.urls import url, include
    from django.contrib import admin
    
    urlpatterns = [
        url(r'^admin/', admin.site.urls),
        url(r'^supporter/', include('supporter.urls'))
    ]
    
  • 修改应用路由文件:
    from django.conf.urls import url
    from . import views
    
    urlpatterns = [
        url(r'^$', views.index)
    ]
    
  • 访问:http://127.0.0.1/supporter

你可能感兴趣的:(【django】【基础】django设置)