Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
edx-platform
Commits
d78b9bde
Commit
d78b9bde
authored
Oct 07, 2017
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Added API documentation
parent
b85b793c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
15 deletions
+17
-15
cms/djangoapps/contentstore/api/views.py
+7
-13
cms/envs/common.py
+1
-0
cms/urls.py
+2
-0
lms/djangoapps/support/views/enrollments.py
+2
-2
lms/urls.py
+2
-0
openedx/core/djangoapps/theming/urls.py
+2
-0
requirements/edx/base.txt
+1
-0
No files found.
cms/djangoapps/contentstore/api/views.py
View file @
d78b9bde
""" API v0 views. """
""" API v0 views. """
import
base64
import
base64
import
logging
import
logging
import
os
from
path
import
Path
as
path
from
six
import
text_type
import
os
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth
import
get_user_model
from
django.views.decorators.csrf
import
csrf_exempt
from
django.core.files
import
File
from
django.core.files
import
File
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
from
path
import
Path
as
path
from
rest_framework
import
status
from
rest_framework
import
status
from
rest_framework.exceptions
import
AuthenticationFailed
from
rest_framework.exceptions
import
AuthenticationFailed
from
rest_framework.generics
import
GenericAPIView
from
rest_framework.response
import
Response
from
rest_framework.response
import
Response
from
user_tasks.models
import
UserTaskArtifact
,
UserTaskStatus
from
rest_framework.views
import
APIView
from
six
import
text_type
from
student.auth
import
has_course_author_acces
s
from
user_tasks.models
import
UserTaskStatu
s
from
contentstore.storage
import
course_import_export_storage
from
contentstore.storage
import
course_import_export_storage
from
contentstore.tasks
import
CourseImportTask
,
import_olx
from
contentstore.tasks
import
CourseImportTask
,
import_olx
from
openedx.core.lib.api.view_utils
import
DeveloperErrorViewMixin
,
view_auth_classes
from
openedx.core.lib.api.view_utils
import
DeveloperErrorViewMixin
,
view_auth_classes
from
student.auth
import
has_course_author_access
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
...
@@ -42,7 +36,7 @@ class CourseImportExportViewMixin(DeveloperErrorViewMixin):
...
@@ -42,7 +36,7 @@ class CourseImportExportViewMixin(DeveloperErrorViewMixin):
raise
AuthenticationFailed
raise
AuthenticationFailed
class
CourseImportView
(
CourseImportExportViewMixin
,
Generic
APIView
):
class
CourseImportView
(
CourseImportExportViewMixin
,
APIView
):
"""
"""
**Use Case**
**Use Case**
...
...
cms/envs/common.py
View file @
d78b9bde
...
@@ -910,6 +910,7 @@ INSTALLED_APPS = [
...
@@ -910,6 +910,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'djcelery'
,
'djcelery'
,
'method_override'
,
'method_override'
,
'rest_framework'
,
# Common views
# Common views
'openedx.core.djangoapps.common_views'
,
'openedx.core.djangoapps.common_views'
,
...
...
cms/urls.py
View file @
d78b9bde
...
@@ -4,6 +4,7 @@ from django.conf.urls.static import static
...
@@ -4,6 +4,7 @@ from django.conf.urls.static import static
from
django.contrib.admin
import
autodiscover
as
django_autodiscover
from
django.contrib.admin
import
autodiscover
as
django_autodiscover
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
ratelimitbackend
import
admin
from
ratelimitbackend
import
admin
from
rest_framework.documentation
import
include_docs_urls
from
cms.djangoapps.contentstore.views.organization
import
OrganizationListView
from
cms.djangoapps.contentstore.views.organization
import
OrganizationListView
...
@@ -75,6 +76,7 @@ urlpatterns = patterns(
...
@@ -75,6 +76,7 @@ urlpatterns = patterns(
# For redirecting to help pages.
# For redirecting to help pages.
url
(
r'^help_token/'
,
include
(
'help_tokens.urls'
)),
url
(
r'^help_token/'
,
include
(
'help_tokens.urls'
)),
url
(
r'^api/'
,
include
(
'cms.djangoapps.api.urls'
,
namespace
=
'api'
)),
url
(
r'^api/'
,
include
(
'cms.djangoapps.api.urls'
,
namespace
=
'api'
)),
url
(
r'^api-docs/'
,
include_docs_urls
(
title
=
'Studio API'
,
public
=
True
)),
)
)
# restful api
# restful api
...
...
lms/djangoapps/support/views/enrollments.py
View file @
d78b9bde
...
@@ -10,7 +10,7 @@ from django.utils.decorators import method_decorator
...
@@ -10,7 +10,7 @@ from django.utils.decorators import method_decorator
from
django.views.generic
import
View
from
django.views.generic
import
View
from
opaque_keys
import
InvalidKeyError
from
opaque_keys
import
InvalidKeyError
from
opaque_keys.edx.keys
import
CourseKey
from
opaque_keys.edx.keys
import
CourseKey
from
rest_framework.
generics
import
Generic
APIView
from
rest_framework.
views
import
APIView
from
course_modes.models
import
CourseMode
from
course_modes.models
import
CourseMode
from
edxmako.shortcuts
import
render_to_response
from
edxmako.shortcuts
import
render_to_response
...
@@ -40,7 +40,7 @@ class EnrollmentSupportView(View):
...
@@ -40,7 +40,7 @@ class EnrollmentSupportView(View):
})
})
class
EnrollmentSupportListView
(
Generic
APIView
):
class
EnrollmentSupportListView
(
APIView
):
"""
"""
Allows viewing and changing learner enrollments by support
Allows viewing and changing learner enrollments by support
staff.
staff.
...
...
lms/urls.py
View file @
d78b9bde
...
@@ -10,6 +10,7 @@ from django.contrib.admin import autodiscover as django_autodiscover
...
@@ -10,6 +10,7 @@ from django.contrib.admin import autodiscover as django_autodiscover
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.views.generic.base
import
RedirectView
from
django.views.generic.base
import
RedirectView
from
ratelimitbackend
import
admin
from
ratelimitbackend
import
admin
from
rest_framework.documentation
import
include_docs_urls
from
courseware.views.index
import
CoursewareIndex
from
courseware.views.index
import
CoursewareIndex
from
courseware.views.views
import
CourseTabView
,
EnrollStaffView
,
StaticCourseTabView
from
courseware.views.views
import
CourseTabView
,
EnrollStaffView
,
StaticCourseTabView
...
@@ -119,6 +120,7 @@ urlpatterns = (
...
@@ -119,6 +120,7 @@ urlpatterns = (
url
(
r'^dashboard/'
,
include
(
'learner_dashboard.urls'
)),
url
(
r'^dashboard/'
,
include
(
'learner_dashboard.urls'
)),
url
(
r'^api/experiments/'
,
include
(
'experiments.urls'
,
namespace
=
'api_experiments'
)),
url
(
r'^api/experiments/'
,
include
(
'experiments.urls'
,
namespace
=
'api_experiments'
)),
url
(
r'^api-docs/'
,
include_docs_urls
(
title
=
'LMS API'
,
public
=
False
)),
)
)
# TODO: This needs to move to a separate urls.py once the student_account and
# TODO: This needs to move to a separate urls.py once the student_account and
...
...
openedx/core/djangoapps/theming/urls.py
View file @
d78b9bde
...
@@ -8,6 +8,8 @@ from .helpers import is_comprehensive_theming_enabled
...
@@ -8,6 +8,8 @@ from .helpers import is_comprehensive_theming_enabled
from
.views
import
ThemingAdministrationFragmentView
from
.views
import
ThemingAdministrationFragmentView
urlpatterns
=
[]
if
is_comprehensive_theming_enabled
():
if
is_comprehensive_theming_enabled
():
urlpatterns
=
[
urlpatterns
=
[
url
(
url
(
...
...
requirements/edx/base.txt
View file @
d78b9bde
...
@@ -11,6 +11,7 @@ bleach==1.4
...
@@ -11,6 +11,7 @@ bleach==1.4
html5lib==0.999
html5lib==0.999
boto==2.39.0
boto==2.39.0
celery==3.1.18
celery==3.1.18
coreapi==2.3.3
cryptography==1.5.3
cryptography==1.5.3
cssselect==0.9.1
cssselect==0.9.1
dealer==2.0.4
dealer==2.0.4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment