modified url
This commit is contained in:
parent
e466466e04
commit
51986a13bd
|
@ -3,6 +3,6 @@ from django.urls import path
|
|||
from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.index, name="index"),
|
||||
path("metadata", views.metadata, name="metadata")
|
||||
path("redirect", views.redirect_view, name="redirect"),
|
||||
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
|
||||
import json
|
||||
# Create your views here.
|
||||
def index(request):
|
||||
def redirect_view(request):
|
||||
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")
|
Loading…
Reference in New Issue