new
parent
497faf45a1
commit
4d5b5de4af
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,9 @@
|
|||||||
|
from django.urls import path, include
|
||||||
|
from . import views
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns = [
|
||||||
|
# DETAILS
|
||||||
|
path('get-client-ip/', views.get_client_ip, name='get-client-ip'),
|
||||||
|
|
||||||
|
]
|
@ -1,3 +1,7 @@
|
|||||||
from django.shortcuts import render
|
from django.shortcuts import render
|
||||||
|
from django.http import JsonResponse
|
||||||
|
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
|
def get_client_ip(request):
|
||||||
|
client_ip = request.META.get('REMOTE_ADDR', '')
|
||||||
|
return JsonResponse({'ip': client_ip})
|
Binary file not shown.
Loading…
Reference in New Issue