Skip to content

Commit a52a13c

Browse files
Merge pull request #70 from delsim/improve_demo
Added site lookup for curl url in demo
2 parents da8c36c + ecf56d7 commit a52a13c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

demo/demo/templates/demo_four.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ <h1>Live Updating</h1>
6363
</p>
6464
<div class="card bg-light border-dark">
6565
<div class="card-body">
66-
curl http://localhost:8000/dpd/views/poke/ -d'{"channel_name":"live_button_counter","label":"named_counts","value":{"click_colour":"red"}}'
66+
curl http://{%site_root_url%}/dpd/views/poke/ -d'{"channel_name":"live_button_counter","label":"named_counts","value":{"click_colour":"red"}}'
6767
</div>
6868
</div>
6969
<p></p>

django_plotly_dash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
SOFTWARE.
2727
'''
2828

29-
__version__ = "0.9.2"
29+
__version__ = "0.9.3"
3030

3131
from .dash_wrapper import DjangoDash

django_plotly_dash/templatetags/plotly_dash.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
from django import template
3030
from django.core.cache import cache
3131

32+
from django.contrib.sites.shortcuts import get_current_site
33+
3234
from django_plotly_dash.models import DashApp
3335
from django_plotly_dash.util import pipe_ws_endpoint_name, cache_timeout_initial_arguments
3436

@@ -139,3 +141,8 @@ def plotly_class(name=None, slug=None, da=None, prefix=None, postfix=None, templ
139141
return app.extra_html_properties(prefix=prefix,
140142
postfix=postfix,
141143
template_type=template_type)
144+
145+
@register.simple_tag(takes_context=True)
146+
def site_root_url(context):
147+
current_site_url = get_current_site(context.request)
148+
return current_site_url.domain

0 commit comments

Comments
 (0)