From 5c98d3f3191ba20156c69fd9eac858bb034bff8c Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Mon, 22 Apr 2024 18:42:10 +0330 Subject: [PATCH 1/2] fix: set JSONRenderer as the DEFAULT_RENDERER_CLASSES --- notesserver/settings/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/notesserver/settings/common.py b/notesserver/settings/common.py index 4c597f0e..857804a4 100644 --- a/notesserver/settings/common.py +++ b/notesserver/settings/common.py @@ -83,6 +83,7 @@ 'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.SessionAuthentication'], 'DEFAULT_PERMISSION_CLASSES': ['notesapi.v1.permissions.HasAccessToken'], 'DEFAULT_PAGINATION_CLASS': 'notesapi.v1.paginators.NotesPaginator', + 'DEFAULT_RENDERER_CLASSES': ('rest_framework.renderers.JSONRenderer',), } # CORS is configured to allow all origins because requests to the From 9c6d096cbc18a7601e947c195f22ed0c2f61f4d0 Mon Sep 17 00:00:00 2001 From: Emad Rad Date: Mon, 22 Apr 2024 18:47:21 +0330 Subject: [PATCH 2/2] docs: clean up - RST header definition - code-block for better readability - removed $ from commands for simpler copying --- README.rst | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/README.rst b/README.rst index a5583152..98634436 100644 --- a/README.rst +++ b/README.rst @@ -1,42 +1,38 @@ -Part of `edX code`__. - -__ http://code.edx.org/ - edX Student Notes API |build-status| -==================================== +#################################### This is a backend store for edX Student Notes. Overview --------- +******** The edX Notes API is designed to be compatible with the `Annotator `__. Getting Started ---------------- +*************** 1. Install `ElasticSearch 7.8.0 `__. 2. Install the requirements: - :: + .. code-block:: bash - $ make develop + make develop 3. Create index and put mapping: - :: + .. code-block:: bash - $ make create-index + make create-index 4. Run the server: - :: + .. code-block:: bash - $ make run + make run -Configuration: --------------- +Configuration +************* ``CLIENT_ID`` - OAuth2 Client ID, which is to be found in ``aud`` field of IDTokens which authorize users @@ -49,20 +45,21 @@ Configuration: ``ELASTICSEARCH_DSL['default']['hosts']`` - Your ElasticSearch host Running Tests -------------- +************* Run ``make validate`` install the requirements, run the tests, and run lint. How To Resync The Index ------------------------ +*********************** + edX Notes Store uses `Django elasticsearch DSL `_ which comes with several management commands. Please read more about ``search_index`` management commands `here `_. License -------- +******* The code in this repository is licensed under version 3 of the AGPL unless otherwise noted. @@ -70,19 +67,19 @@ otherwise noted. Please see ``LICENSE.txt`` for details. How To Contribute ------------------ +***************** Contributions are very welcome. Please read `How To Contribute `_ for details. Reporting Security Issues -------------------------- +************************* Please do not report security issues in public. Please email security@openedx.org Mailing List and IRC Channel ----------------------------- +**************************** You can discuss this code on the `edx-code Google Group`__ or in the ``edx-code`` IRC channel on Freenode.