Skip to content

chore: add view stub #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion python-django/apps/flags/urls.py
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
urlpatterns = []
from django.urls import path

from apps.flags.views import get_flags

urlpatterns = [
path("", get_flags),
]
9 changes: 9 additions & 0 deletions python-django/apps/flags/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from rest_framework.decorators import api_view
from rest_framework.request import Request
from rest_framework.response import Response


@api_view(["GET"])
def get_flags(request: Request) -> Response:
# TODO: Implement this view as per requirements in Readme.md
return Response()
9 changes: 5 additions & 4 deletions python-django/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ relationship with the Feature and Environment, as well as a boolean value to des
disabled in a given environment. The API endpoint should return the enabled / disabled state of the feature and the name
(+ metadata) for the feature. You need not return any information about the environment.

We have created the django application and some boilerplate code for you. You should complete the `flags` app in the
`apps` directory.
We have created the django application, `flags`, in the `apps` directory and added some boilerplate code for you,
including a stub of the function based view we expect you to complete. If you would rather use a class-based view, you
may, but you should justify in your response why you chose to do so.

Some notes / clarifications:

- To determine the environment, you may use either a query parameter or an authentication class. It must not be
possible, however, to request flags without an environment.
- To determine the environment, you may use a header or a query parameter. You may use an authentication class, but are
not required to. It must not be possible, however, to request flags without an environment.
- You need not worry about API endpoints to manage these objects, you can use the django admin as necessary.
- You may use the default sqlite database.
- You should not implement any pagination on the list flags endpoint.
Expand Down