Skip to content

Commit eb66d14

Browse files
Upgrade django-ws-include to 0.2.0
1 parent 7b83d5f commit eb66d14

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

django_async_include_example/settings.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
from pathlib import Path
23

34
# Build paths inside the project like this: BASE_DIR / 'subdir'.
@@ -114,6 +115,11 @@
114115

115116
STATIC_URL = '/static/'
116117

118+
STATICFILES_DIRS = (
119+
os.path.join(BASE_DIR, "static"),
120+
)
121+
122+
117123
# Default primary key field type
118124
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
119125

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Django>=3.2.6
22
django-async-include==0.6.7
3-
django-ws-include==0.1.2
3+
django-ws-include==0.2.0
44
django-stubs>=1.9.0

shop_list/templates/shop_list/index_with_ws.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{% load ws_include %}
2+
{% load static %}
23

34
<h1>Shop lists with ws</h1>
45
<div>
@@ -23,4 +24,6 @@ <h1>Shop lists with ws</h1>
2324
{% ws_include "shop_list/partials/item_list.html" shop_list=shop_list items=shop_list.item_set.all %}
2425
</li>
2526
{% endfor %}
26-
</ul>
27+
</ul>
28+
29+
<script type="text/javascript" src="{% static 'ws_include/ws_include.js' %}"></script>

shop_list/urls.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from django.urls import path
2-
2+
from django.conf import settings
3+
from django.conf.urls.static import static
34
from shop_list import views
45

56
app_name = 'shop_list'
@@ -8,4 +9,4 @@
89
path('', views.index, name='index'),
910
# /shop_list/5/
1011
path('<int:shop_list_id>/', views.view_shop_list, name='view_shop_list'),
11-
]
12+
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

0 commit comments

Comments
 (0)