为什么我会得到404?

时间:2018-05-22 13:57:34

标签: python jquery django http-status-code-404 feed

我正在尝试按照本教程https://simpleisbetterthancomplex.com/tutorial/2017/03/13/how-to-create-infinite-scroll-with-django.html,但出于某种原因,当我尝试加载页面时,我得到了

generate_series() select g.dte, count(*) from (select g.dte, v.user_id, count(distinct v.time::date) as cnt from generate_series('2018-05-01'::date, '2018-05-22'::date, interval '1 day') g(dte) left join visit v on v.time::date <= g.dte and v.time::date > '2018-05-22'::date - interval '30 days' group by g.dte, v.user_id having count(distinct v.time::date) >= 10 ) vd group by g.dte order by g.dte;

SELECT
  *
FROM
(
  SELECT
    *,
    ROW_NUMBER() OVER (PARTITION BY email
                           ORDER BY created_timestamp
                      )
                        AS SequenceID
  FROM
    yourTable
)
  sorted
WHERE
  SequenceID = 1

base.html文件

django.template.exceptions.TemplateSyntaxError: Invalid block tag on line 1: 'static'.

home.html的

Did you forget to register or load this tag?

views.py

 "GET / HTTP/1.1" 500 141448``
 "GET / HTTP/1.1" 200 167
 "GET /static/js/jquery-3.1.1.min.js HTTP/1.1" 404 1690
 "GET /static/js/jquery.waypoints.min.js HTTP/1.1" 404 1702
 "GET /static/js/infinite.min.js HTTP/1.1" 404 1678
 "GET /static/js/jquery.waypoints.min.js HTTP/1.1" 404 1702
 "GET /static/js/infinite.min.js HTTP/1.1" 404 1678

settings.py

{% load static from staticfiles %}

<script src="{% static 'js/jquery-3.1.1.min.js' %}"></script>
<script src="{% static 'js/jquery.waypoints.min.js' %}"></script>
<script src="{% static 'js/infinite.min.js' %}"></script>

我还通过“pip install django-jquery”安装了jQuery,并通过“npm install waypoints”安装了Waypoints

1 个答案:

答案 0 :(得分:0)

在静态/ js目录中添加jquery文件。