Django没有加载admin css - '静态'设置

时间:2013-11-05 19:15:18

标签: python css django

我是Django的新手,只是学习docs.djangoproject教程。我的管理页面没有显示CSS样式,所以我想我没有正确设置“静态”路径。在家用PC上作为Windows操作系统使用。

以下是文件中的一些代码:

settings.py:

DEBUG = True
MEDIA_ROOT = ''
MEDIA_URL = ''
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (
)
STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
)
INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # Uncomment the next line to enable the admin:
    'django.contrib.admin',
    #Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

urls.py

urlpatterns = patterns('',
    # Examples:
    #url(r'^$', 'polysite.views.home', name='home'),
    #url(r'^polysite/', include('polysite.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    #url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

0 个答案:

没有答案