Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ecommerce
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
edx
ecommerce
Commits
4ed4b74d
Commit
4ed4b74d
authored
May 09, 2018
by
Douglas Hall
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use django-rest-swagger for API doc generation.
parent
701c1f0c
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
70 deletions
+5
-70
ecommerce/settings/base.py
+1
-0
ecommerce/static/sass/base/edx-swagger.scss
+0
-19
ecommerce/templates/rest_framework_swagger/index.html
+0
-44
ecommerce/tests/test_urls.py
+1
-1
ecommerce/theming/compressor.py
+0
-4
ecommerce/urls.py
+2
-2
requirements/base.txt
+1
-0
No files found.
ecommerce/settings/base.py
View file @
4ed4b74d
...
@@ -281,6 +281,7 @@ DJANGO_APPS = [
...
@@ -281,6 +281,7 @@ DJANGO_APPS = [
'crispy_forms'
,
'crispy_forms'
,
'solo'
,
'solo'
,
'social_django'
,
'social_django'
,
'rest_framework_swagger'
,
]
]
# Apps specific to this project go here.
# Apps specific to this project go here.
...
...
ecommerce/static/sass/base/edx-swagger.scss
deleted
100644 → 0
View file @
701c1f0c
body
{
background-color
:
white
;
}
#django-rest-swagger
{
background-color
:
white
;
color
:
#999999
;
a
{
color
:
inherit
;
}
}
.swagger-ui-wrap
{
.container
{
// Undo Bootstrap's container width
width
:
initial
;
}
}
ecommerce/templates/rest_framework_swagger/index.html
deleted
100644 → 0
View file @
701c1f0c
{% extends 'rest_framework_swagger/base.html' %}
{% load compress %}
{% load core_extras %}
{% load static %}
{% block title %}edX E-Commerce API {{ swagger_settings.api_version }}{% endblock %}
{% block style %}
{{ block.super }}
{% compress css %}
{% if main_css %}
<link
rel=
"stylesheet"
href=
"{{ main_css }}"
type=
"text/x-scss"
>
{% else %}
<link
rel=
"stylesheet"
href=
"{% static 'css/base/main.css' %}"
type=
"text/x-scss"
>
{% endif %}
{% if swagger_css %}
<link
rel=
"stylesheet"
href=
"{{ swagger_css }}"
type=
"text/x-scss"
>
{% else %}
<link
rel=
"stylesheet"
href=
"{% static 'css/base/edx-swagger.css' %}"
type=
"text/x-scss"
>
{% endif %}
{% endcompress %}
{% endblock %}
{% block branding %}
{% endblock %}
{% block header %}
{% include 'edx/partials/_staff_navbar.html' %}
{% endblock %}
{% block body %}
{# NOTE: Loading RequireJS, config.js, and common.js conflicts with Swagger's JS dependencies. Load our updated version of jQuery first, so that bootstrap.js loads properly. #}
{% compress js %}
<script
src=
"{% static 'bower_components/jquery/dist/jquery.js' %}"
></script>
<script
src=
"{% static 'bower_components/bootstrap-sass/assets/javascripts/bootstrap.js' %}"
></script>
{% endcompress %}
{{ block.super }}
{% endblock %}
ecommerce/tests/test_urls.py
View file @
4ed4b74d
...
@@ -22,7 +22,7 @@ class TestUrls(TestCase):
...
@@ -22,7 +22,7 @@ class TestUrls(TestCase):
"""
"""
Verify that the API docs render.
Verify that the API docs render.
"""
"""
path
=
reverse
(
'api
-docs:docs-index
'
)
path
=
reverse
(
'api
_docs
'
)
response
=
self
.
client
.
get
(
path
)
response
=
self
.
client
.
get
(
path
)
assert
response
.
status_code
==
200
assert
response
.
status_code
==
200
ecommerce/theming/compressor.py
View file @
4ed4b74d
...
@@ -11,18 +11,14 @@ def offline_context():
...
@@ -11,18 +11,14 @@ def offline_context():
through all applied themes and returns a separate context for each theme.
through all applied themes and returns a separate context for each theme.
"""
"""
main_css_path
=
"css/base/main.css"
main_css_path
=
"css/base/main.css"
swagger_css_path
=
"css/base/edx-swagger.css"
for
theme
in
get_themes
():
for
theme
in
get_themes
():
main_css
=
ThemeStorage
(
prefix
=
theme
.
theme_dir_name
)
.
url
(
main_css_path
)
main_css
=
ThemeStorage
(
prefix
=
theme
.
theme_dir_name
)
.
url
(
main_css_path
)
swagger_css
=
ThemeStorage
(
prefix
=
theme
.
theme_dir_name
)
.
url
(
swagger_css_path
)
yield
{
yield
{
'main_css'
:
main_css
,
'main_css'
:
main_css
,
'swagger_css'
:
swagger_css
,
}
}
yield
{
yield
{
'main_css'
:
ThemeStorage
()
.
url
(
main_css_path
),
'main_css'
:
ThemeStorage
()
.
url
(
main_css_path
),
'swagger_css'
:
ThemeStorage
()
.
url
(
swagger_css_path
),
}
}
ecommerce/urls.py
View file @
4ed4b74d
...
@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -10,7 +10,7 @@ from django.utils.translation import ugettext_lazy as _
from
django.views.defaults
import
page_not_found
,
server_error
from
django.views.defaults
import
page_not_found
,
server_error
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
from
django.views.i18n
import
JavaScriptCatalog
from
django.views.i18n
import
JavaScriptCatalog
from
rest_framework
.documentation
import
include_docs_urls
from
rest_framework
_swagger.views
import
get_swagger_view
from
ecommerce.core
import
views
as
core_views
from
ecommerce.core
import
views
as
core_views
from
ecommerce.core.url_utils
import
get_lms_dashboard_url
from
ecommerce.core.url_utils
import
get_lms_dashboard_url
...
@@ -54,7 +54,7 @@ urlpatterns = AUTH_URLS + WELL_KNOWN_URLS + [
...
@@ -54,7 +54,7 @@ urlpatterns = AUTH_URLS + WELL_KNOWN_URLS + [
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r'^auto_auth/$'
,
core_views
.
AutoAuth
.
as_view
(),
name
=
'auto_auth'
),
url
(
r'^auto_auth/$'
,
core_views
.
AutoAuth
.
as_view
(),
name
=
'auto_auth'
),
url
(
r'^api-auth/'
,
include
(
AUTH_URLS
,
namespace
=
'rest_framework'
)),
url
(
r'^api-auth/'
,
include
(
AUTH_URLS
,
namespace
=
'rest_framework'
)),
url
(
r'^api-docs/'
,
include_docs_urls
(
title
=
'Ecommerce API'
)
),
url
(
r'^api-docs/'
,
get_swagger_view
(
title
=
'Ecommerce API'
),
name
=
'api_docs'
),
url
(
r'^courses/'
,
include
(
'ecommerce.courses.urls'
,
namespace
=
'courses'
)),
url
(
r'^courses/'
,
include
(
'ecommerce.courses.urls'
,
namespace
=
'courses'
)),
url
(
r'^credit/'
,
include
(
'ecommerce.credit.urls'
,
namespace
=
'credit'
)),
url
(
r'^credit/'
,
include
(
'ecommerce.credit.urls'
,
namespace
=
'credit'
)),
url
(
r'^coupons/'
,
include
(
'ecommerce.coupons.urls'
,
namespace
=
'coupons'
)),
url
(
r'^coupons/'
,
include
(
'ecommerce.coupons.urls'
,
namespace
=
'coupons'
)),
...
...
requirements/base.txt
View file @
4ed4b74d
...
@@ -13,6 +13,7 @@ django_extensions==1.9.9
...
@@ -13,6 +13,7 @@ django_extensions==1.9.9
django-filter==1.0.4
django-filter==1.0.4
django-libsass==0.5
django-libsass==0.5
django-oscar==1.5.1
django-oscar==1.5.1
django-rest-swagger==2.2.0
django-solo==1.1.2
django-solo==1.1.2
django-threadlocals==0.8
django-threadlocals==0.8
django-waffle==0.12.0
django-waffle==0.12.0
...
...
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