图像未从静态显示在 Django 中

问题描述 投票:0回答:1
html django svg django-templates
1个回答
0
投票

检查所有步骤:

# Steps:
    # 1 - Create (static) folder in Root Directory of Project
    # 2 - Paste Your Static Files Folder in (static) Folder (js,css,images...etc)
    # 3 - Now Do Setting in (setting.py)
           STATIC_URL = '/static/'

        #    STATICFILES_DIRS = [
        #         os.path.join(BASE_DIR,'static') 
        #     ]
    # 4 - add {% load static %} tag on top of html page
    # 5 - Now use ({% static 'assets/image.jpg' %}) tag in HTML File for calling static files
    # 6 - Done
© www.soinside.com 2019 - 2024. All rights reserved.