Skip to content

Commit 2cb299e

Browse files
committed
fix: Small fixes based on running the code.
* Be able to run on python 3.11 since we're still running that in edx-platform. * Don't trottle using AnonRateThrottle because it requires more info that we want to provide it for now.
1 parent 6d0dfb6 commit 2cb299e

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,19 @@ python manage.py lms migrate
117117
# exit the lms bash shell
118118
tutor dev restart lms
119119
```
120+
121+
# Local Development for the Backend Plugin without Tutor
122+
123+
```
124+
# In edx-platform
125+
pip install -e /path/to/sample-plugin/backend
126+
# start up lms/cms
127+
# https://github.com/openedx/edx-platform/blob/master/README.rst?plain=1#L171-L183
128+
129+
# Enabled Learner Dashboard MFE( Called learner_home in edx-platform)
130+
1. Go to http://localhost:18000/admin/waffle/flag/
131+
2. Click `Add Flag`
132+
3. Set `Name` to `learner_home_mfe.enabled`
133+
4. Set `Everyone` to `Yes`
134+
5. Click `Save`
135+
```

backend/sample_plugin/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from rest_framework import filters, permissions, viewsets
1212
from rest_framework.exceptions import PermissionDenied, ValidationError
1313
from rest_framework.pagination import PageNumberPagination
14-
from rest_framework.throttling import AnonRateThrottle, UserRateThrottle
14+
from rest_framework.throttling import UserRateThrottle
1515

1616
from sample_plugin.models import CourseArchiveStatus
1717
from sample_plugin.serializers import CourseArchiveStatusSerializer
@@ -77,7 +77,7 @@ class CourseArchiveStatusViewSet(viewsets.ModelViewSet):
7777
serializer_class = CourseArchiveStatusSerializer
7878
permission_classes = [IsOwnerOrStaffSuperuser]
7979
pagination_class = CourseArchiveStatusPagination
80-
throttle_classes = [CourseArchiveStatusThrottle, AnonRateThrottle]
80+
throttle_classes = [CourseArchiveStatusThrottle, ]
8181
filter_backends = [DjangoFilterBackend, filters.OrderingFilter]
8282
filterset_fields = ["course_id", "user", "is_archived"]
8383
ordering_fields = [

backend/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def is_requirement(line):
143143

144144
include_package_data=True,
145145
install_requires=load_requirements('requirements/base.in'),
146-
python_requires=">=3.12",
146+
python_requires=">=3.11",
147147
license="Apache Software License 2.0",
148148
zip_safe=False,
149149
keywords='Python edx',

0 commit comments

Comments
 (0)