Ejemplo n.º 1
0
        # terms_of_service="https://www.google.com/policies/terms/",
        # contact=openapi.Contact(email="*****@*****.**"),
        # license=openapi.License(name="BSD License"), # FIXME: needs to be changed
    ),
    public=False,
    url=settings.GENUI_SETTINGS['HOST_URL'] if 'HOST_URL' in settings.GENUI_SETTINGS else None
)

base_urls = discover_apps_urls(BASE_APPS)
api_urls = discover_apps_urls(API_APPS, prefix='api', app_names_as_root=True)
api_urls += [
    re_path(r'^api/schema/swagger(?P<format>\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'),
    re_path(r'^api/redoc/$', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'),
    re_path(r'^api/(swagger/)?$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]
extensions_urls = discover_extensions_urlpatterns('genui')

media_patterns = []
if settings.DEBUG:
    media_patterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

# redirect from root to the app if the path is available
# TODO: create some simple introduction page at the root (link to repo, docs, etc.)
gui_patterns = []
if 'FRONTEND_APP_PATH' in settings.GENUI_SETTINGS and settings.GENUI_SETTINGS['FRONTEND_APP_PATH'] is not None:
    gui_patterns.append(path('', RedirectView.as_view(
        url=urllib.parse.urljoin(settings.GENUI_SETTINGS['HOST_URL'], settings.GENUI_SETTINGS['FRONTEND_APP_PATH']) if 'HOST_URL' in settings.GENUI_SETTINGS else settings.GENUI_SETTINGS['FRONTEND_APP_PATH']
    )))
else:
    gui_patterns.append(path('', RedirectView.as_view(
        url=urllib.parse.urljoin(settings.GENUI_SETTINGS['HOST_URL'], 'api/') if 'HOST_URL' in settings.GENUI_SETTINGS else 'api/'
Ejemplo n.º 2
0
from genui.utils.extensions.tasks.views import ModelTasksView
from genui.utils.inspection import discover_extensions_urlpatterns
from . import views
from .models import MolSet
from .apps import CompoundsConfig

# Routers provide an easy way of automatically determining the URL conf.

router = routers.DefaultRouter()
router.register(r'sets/all', views.MolSetViewSet, basename='molset')
router.register(r'activity/sets',
                views.ActivitySetViewSet,
                basename='activitySet')
router.register(r'', views.MoleculeViewSet, basename='compound')

routes = [
    path('sets/<int:pk>/tasks/all/',
         ModelTasksView.as_view(model_class=MolSet)),
    path('sets/<int:pk>/tasks/started/',
         ModelTasksView.as_view(started_only=True, model_class=MolSet)),
    path('sets/<int:pk>/molecules/',
         views.MolSetMoleculesView.as_view(),
         name='moleculesInSet')
]

urlpatterns = [
    path('', include(routes)),
    path('', include(router.urls)),
] + discover_extensions_urlpatterns(CompoundsConfig.name)
Ejemplo n.º 3
0
"""
urls

Created by: Martin Sicho
On: 5/3/20, 6:13 PM
"""
from genui.models.apps import ModelsConfig
from genui.utils.inspection import discover_extensions_urlpatterns

urlpatterns = discover_extensions_urlpatterns(ModelsConfig.name)

Ejemplo n.º 4
0
"""
urls.py

Created by: Martin Sicho
On: 04-12-19, 15:06
"""

from django.urls import path, include
from rest_framework import routers

from . import views

# Routers provide an easy way of automatically determining the URL conf.
from genui.utils.inspection import discover_extensions_urlpatterns
from .apps import ProjectsConfig

router = routers.DefaultRouter()
router.register(r'', views.GenUIProjectViewSet, basename='project')

urlpatterns = [
    # path('', views.index, name='projects-index'),
    path('', include(router.urls)),
] + discover_extensions_urlpatterns(ProjectsConfig.name)
Ejemplo n.º 5
0
"""
urls

Created by: Martin Sicho
On: 02-12-19, 17:18
"""

from django.urls import path, include
from rest_framework import routers

from . import views
from genui.utils.inspection import discover_extensions_urlpatterns
from .apps import GeneratorsConfig

router = routers.DefaultRouter()
router.register(r'all', views.GeneratorViewSet, basename='generator')
router.register(r'algorithms',
                views.GeneratorAlgorithmViewSet,
                basename='generator_algorithm')
router.register(r'metrics',
                views.GeneratorMetricsViewSet,
                basename='generator_metric')

urlpatterns = [
    path('', include(router.urls)),
] + discover_extensions_urlpatterns(GeneratorsConfig.name)
Ejemplo n.º 6
0
On: 25-02-20, 16:29
"""
from django.urls import path, include
from rest_framework import routers

from .models import Map
from . import views
from genui.utils.extensions.tasks.views import ModelTasksView
from genui.models.views import ModelFileView
from genui.qsar.views import DescriptorGroupsViewSet
from .apps import MapsConfig
from genui.utils.inspection import discover_extensions_urlpatterns

router = routers.DefaultRouter()
router.register(r'algorithms',views.MappingAlgViewSet, basename='mapping-algorithm')
router.register(r'descriptors', DescriptorGroupsViewSet, basename='descriptor')
router.register(r'', views.MapViewSet, basename='map')


routes = [
    path('<int:pk>/tasks/all/', ModelTasksView.as_view(model_class=Map))
    , path('<int:pk>/tasks/started/', ModelTasksView.as_view(started_only=True, model_class=Map))
    , path('<int:pk>/files/', ModelFileView.as_view(model_class=Map), name="map-files-list")
    , path('<int:pk>/points/', views.PointsView.as_view(model_class=Map), name="map-points-list")
]

urlpatterns = [
    path('', include(routes)),
    path('', include(router.urls)),
] + discover_extensions_urlpatterns(MapsConfig.name)