需求:访问xx.com 跳转到xx.com/index

修改setting 同级别的urls.py 文件

from django.conf.urls import include, url
from django.contrib import admin
from django.conf import settings
from testTask import views
from django.views.static import serve

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^at/', include('testTask.urls')),
    url(r'^static/(?P<path>.*)$', serve, {'document_root':'/Users/conan/vir_env/AutoTest/static/'}),
    url(r'^',views.index), #域名直接跳转到首页
]

标签: nginx, django, import, rewrite, admin, url, urls, views

相关文章推荐

添加新评论,含*的栏目为必填