used the url from the settings for the ajax request
This commit is contained in:
parent
de67505991
commit
a2a5f8e7f8
@ -4,8 +4,8 @@
|
||||
|
||||
<script>
|
||||
|
||||
getIp = function(protocol) {
|
||||
$.getJSON('http://www.ip'+protocol+'.nsupdate.info/myip?callback=?','',function(json_data){
|
||||
getIp = function(domain,protocol) {
|
||||
$.getJSON('http://'+domain+'/myip?callback=?','',function(json_data){
|
||||
$(".ip"+protocol+"adr").val(json_data.ip);
|
||||
}).fail(function() {
|
||||
$(".ip"+protocol+"adr").val("no ip"+protocol+" address found");
|
||||
@ -13,8 +13,8 @@
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
getIp('v4');
|
||||
getIp('v6');
|
||||
getIp('{{ ipv4 }}','v4');
|
||||
getIp('{{ ipv6 }}','v6');
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from django.views.generic import TemplateView
|
||||
from django.http import HttpResponse
|
||||
from django.conf import settings
|
||||
import json
|
||||
|
||||
class HomeView(TemplateView):
|
||||
@ -17,6 +18,8 @@ class OverviewView(TemplateView):
|
||||
def get_context_data(self, *args, **kwargs):
|
||||
context = super(OverviewView, self).get_context_data(*args, **kwargs)
|
||||
context['nav_overview'] = True
|
||||
context['ipv4'] = settings.WWW_IPV4_HOST
|
||||
context['ipv6'] = settings.WWW_IPV6_HOST
|
||||
return context
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user