aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/resources/urls.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-08-02 14:38:47 +0200
committerGravatar Johannes Christ <[email protected]>2024-08-02 15:05:57 +0200
commitc63ab0be5add5f37a11c3e8a7de33bb75a3eccae (patch)
tree696955abf194b2fb6d8797a4f33787bf79d84323 /pydis_site/apps/resources/urls.py
parentMerge pull request #1372 from python-discord/dependabot/pip/sentry-sdk-2.12.0 (diff)
Add endpoint to fetch filters in JSON format
While this is an API endpoint consumed by the bot, keep it in the `resources` app instead of the `api` app, as all the logic and data for resources is contained within the `resources` app and we don't want to start messing around with that. The response format from the endpoint is as follows: { "topics": [ "algorithms-and-data-structures", "data-science", "databases", "discord-bots", "game-development", "general", "microcontrollers", "security", "software-design", "testing", "tooling", "user-interface", "web-development", "other" ], "payment_tiers": [ "free", "paid", "subscription" ], "type": [ "book", "community", "course", "interactive", "podcast", "project-ideas", "tool", "tutorial", "video" ], "difficulty": [ "beginner", "intermediate" ] } Closes #710.
Diffstat (limited to 'pydis_site/apps/resources/urls.py')
-rw-r--r--pydis_site/apps/resources/urls.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pydis_site/apps/resources/urls.py b/pydis_site/apps/resources/urls.py
index cb33a9d7..3a10d108 100644
--- a/pydis_site/apps/resources/urls.py
+++ b/pydis_site/apps/resources/urls.py
@@ -1,11 +1,12 @@
from django_distill import distill_path
-from pydis_site.apps.resources.views import ResourceView
+from pydis_site.apps.resources.views import ResourceView, ResourceFilterView
app_name = "resources"
urlpatterns = [
# Using `distill_path` instead of `path` allows this to be available
# in static preview builds.
distill_path("", ResourceView.as_view(), name="index"),
+ distill_path("filters", ResourceFilterView.as_view(), name="filters"),
distill_path("<resource_type>/", ResourceView.as_view(), name="index"),
]