Skip to content

Commit c5fa0b1

Browse files
chore: add view stub (#14)
* Add view stub * Update readme
1 parent 6533f11 commit c5fa0b1

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

python-django/apps/flags/urls.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
urlpatterns = []
1+
from django.urls import path
2+
3+
from apps.flags.views import get_flags
4+
5+
urlpatterns = [
6+
path("", get_flags),
7+
]

python-django/apps/flags/views.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from rest_framework.decorators import api_view
2+
from rest_framework.request import Request
3+
from rest_framework.response import Response
4+
5+
6+
@api_view(["GET"])
7+
def get_flags(request: Request) -> Response:
8+
# TODO: Implement this view as per requirements in Readme.md
9+
return Response()

python-django/readme.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ relationship with the Feature and Environment, as well as a boolean value to des
99
disabled in a given environment. The API endpoint should return the enabled / disabled state of the feature and the name
1010
(+ metadata) for the feature. You need not return any information about the environment.
1111

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

1516
Some notes / clarifications:
1617

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

0 commit comments

Comments
 (0)