# In Django application file folder, often will find two folders: static, media; static called static folder to hold the same file CSS, JavaScript, and other Web site logo; In contrast, the media say media folder to store the user to upload pictures.
1、static
= STATIC_URL ' / static / ' # static file alias (relative path) and the absolute path STATICFILES_DIRS = ( the os.path.join (base_dir, ' app01 / static ' ), )
2、media
# The settings.py configuration item: of MEDIA_ROOT it the os.path.join = (base_dir, ' Media ' ) # configure route from django.views.static Import serve from django.conf Import Settings URL (R & lt ' ^ Media / (P <? . path> *) ' , serve, { ' DOCUMENT_ROOT ' : settings.MEDIA_ROOT})