在写前端项目的时候,会遇到需要应用js和css的时候,通常我们是设置一个static,去调用static中的静态文件

这里需要在setting里面设置static的位置,设置如下

# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.2/howto/static-files/

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, 'static'),
]

 

相关文章:

  • 2022-12-23
  • 2021-10-30
  • 2022-12-23
  • 2022-02-10
  • 2021-04-13
  • 2021-07-10
  • 2022-12-23
  • 2022-02-10
猜你喜欢
  • 2022-12-23
  • 2021-08-13
  • 2022-02-10
  • 2021-06-18
  • 2022-12-23
  • 2021-11-19
  • 2022-02-10
相关资源
相似解决方案