modified url
This commit is contained in:
parent
e466466e04
commit
51986a13bd
|
@ -3,6 +3,6 @@ from django.urls import path
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
path("", views.index, name="index"),
|
path("redirect", views.redirect_view, name="redirect"),
|
||||||
path("metadata", views.metadata, name="metadata")
|
path("metadata", views.metadata_view, name="metadata")
|
||||||
]
|
]
|
|
@ -3,7 +3,7 @@ from django.http import HttpResponse
|
||||||
from .random_picture import get_random_picture_url, get_random_picture_meta
|
from .random_picture import get_random_picture_url, get_random_picture_meta
|
||||||
import json
|
import json
|
||||||
# Create your views here.
|
# Create your views here.
|
||||||
def index(request):
|
def redirect_view(request):
|
||||||
return redirect(get_random_picture_url())
|
return redirect(get_random_picture_url())
|
||||||
def metadata(request):
|
def metadata_view(request):
|
||||||
return HttpResponse(json.dumps(get_random_picture_meta()), content_type="application/json")
|
return HttpResponse(json.dumps(get_random_picture_meta()), content_type="application/json")
|
Loading…
Reference in New Issue