feat: redirect to itch.io

This commit is contained in:
Gerard Gascón 2025-04-24 12:59:20 +02:00
parent 3f5f2feff8
commit ffe28e9a19
2 changed files with 6 additions and 0 deletions

View file

@ -3,6 +3,7 @@ from django.urls import path
from . import views from . import views
urlpatterns = [ urlpatterns = [
path('', views.index, name='index'),
path('add/<str:origin>/<str:name>/<str:color>/<str:shirt>/<str:hat>/<str:decor>/', views.add, name='add'), path('add/<str:origin>/<str:name>/<str:color>/<str:shirt>/<str:hat>/<str:decor>/', views.add, name='add'),
path('get/<str:origin>/', views.get, name='get'), path('get/<str:origin>/', views.get, name='get'),
] ]

View file

@ -3,6 +3,7 @@ import random
from django.db import IntegrityError from django.db import IntegrityError
from django.http import HttpResponse, Http404 from django.http import HttpResponse, Http404
from django.shortcuts import redirect
from server.filters import ProfanityFilter from server.filters import ProfanityFilter
from server.models import Dragon from server.models import Dragon
@ -46,3 +47,7 @@ def get(request, origin):
response_data = {'origin': random_item.origin, 'name': random_item.name, 'color': random_item.color, response_data = {'origin': random_item.origin, 'name': random_item.name, 'color': random_item.color,
'shirt': random_item.shirt, 'hat': random_item.hat, 'decor': random_item.decor} 'shirt': random_item.shirt, 'hat': random_item.hat, 'decor': random_item.decor}
return HttpResponse(json.dumps(response_data), content_type="application/json") return HttpResponse(json.dumps(response_data), content_type="application/json")
def index(request):
return redirect('https://geri8.itch.io/la-torreta-del-drac')