Skip to content

Commit

Permalink
passes tests against testsite
Browse files Browse the repository at this point in the history
  • Loading branch information
smirolo committed Jun 18, 2024
1 parent 83e2fa4 commit d9262d1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 11 deletions.
5 changes: 1 addition & 4 deletions pages/urls/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@
path('attendance/', include('pages.urls.api.sequences')),
path('content/', include('pages.urls.api.readers')),
path('content/', include('pages.urls.api.noauth')),
path('<path:path>', PageElementAPIView.as_view(),
name="api_content"),
path('content', PageElementIndexAPIView.as_view(),
name="api_content_index"),
path('', include('pages.urls.api.noauth2')), # 'api/content' index
path('progress/', include('pages.urls.api.progress')),
path('', include('pages.urls.api.assets'))
]
37 changes: 37 additions & 0 deletions pages/urls/api/noauth2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright (c) 2024, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""
API URLs for readers who could be unauthenticated
"""
from ...compat import path
from ...api.elements import PageElementAPIView, PageElementIndexAPIView


urlpatterns = [
path('content/<path:path>', PageElementAPIView.as_view(),
name="api_content"),
path('content', PageElementIndexAPIView.as_view(),
name="api_content_index"),
]
6 changes: 1 addition & 5 deletions testsite/urls/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

from pages.compat import include, path
from pages.api.elements import PageElementIndexAPIView
from pages.api.sequences import SequencesIndexAPIView

from ..views.app import IndexView

Expand All @@ -47,10 +46,7 @@
path('api/progress/', include('pages.urls.api.progress')),
path('api/content/', include('pages.urls.api.readers')),
path('api/content/', include('pages.urls.api.noauth')),
path('api/content', PageElementIndexAPIView.as_view(),
name="api_content_index"),
path('api/sequences', SequencesIndexAPIView.as_view(),
name='api_sequences_index'),
path('api/', include('pages.urls.api.noauth2')),
path('api/', include('pages.urls.api.assets')),
path('', IndexView.as_view()),
path('', include('pages.urls.views')),
Expand Down
4 changes: 2 additions & 2 deletions testsite/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"""
import os, signal

#pylint: disable=invalid-name
from django.core.wsgi import get_wsgi_application


def save_coverage():
sys.stderr.write("saving coverage\n")
Expand All @@ -35,6 +36,5 @@ def save_coverage():
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
from django.core.wsgi import get_wsgi_application
#pylint: disable=invalid-name
application = get_wsgi_application()

0 comments on commit d9262d1

Please sign in to comment.