猿问

如何在手机上打开django网页

天涯尽头无女友
浏览 1201回答 1
1回答

慕莱坞森

settings.pyMIDDLEWARE_CLASSES = (    'django.middleware.common.CommonMiddleware',    'django.contrib.sessions.middleware.SessionMiddleware',    'django.middleware.csrf.CsrfViewMiddleware',    'django.contrib.auth.middleware.AuthenticationMiddleware',    'django.contrib.messages.middleware.MessageMiddleware',)INSTALLED_APPS = (    'django.contrib.auth',    'django.contrib.contenttypes',    'django.contrib.sessions',    'django.contrib.sites',    'django.contrib.messages',    'django.contrib.admin',    'django.contrib.staticfiles',)urls.pyfrom django.conf.urls.defaults import *from django.contrib import adminfrom django.conf import settingsadmin.autodiscover()urlpatterns = patterns('',    url(r'^admin/', include(admin.site.urls)),)if settings.DEBUG:    urlpatterns = patterns('',        url(r'^media/(?P<path>.*)$', 'django.views.static.serve',        {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),        url(r'', include('django.contrib.staticfiles.urls')),    ) + urlpatterns
随时随地看视频慕课网APP
我要回答