首页 > 解决方案 > 找不到页面(404)jquery django python

问题描述

jquery 不加载 - 找不到页面 (404)

base.html

{% load static %}
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS -->
    <link href="{% static 'bootstrap-5.0.0/css/bootstrap.css' %}" rel="stylesheet">
    <link href="{% static 'css/style.css' %}" rel="stylesheet">
    <!-- jQuery -->
    <script src="{% static 'jquery/jquery.js' %}"></script>
 </head>

设置.py

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'ServiceCRM3/static'),]

怎么了?

标签: pythonjquerydjangodjango-templatesdjango-static

解决方案


推荐阅读