打开settings.py,在底部添加: import os STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(os.path.dirname(__file__), '../static/').replace('\\','/'), ) 打开urls.py,添加:(注意,如果你在blog目录下也建立了urls.py,那么就得在blog/urls.py中做修改.别忘了import settings) import settings u…