def init_all_applications(): """ Forces import of all applications to ensure code is registered. """ from django.db.models import get_apps, get_models for app in get_apps(): try: get_models(app) except Exception: continue init_all_applications() # Only create one instance of the ReactPageView since it's duplicated errywhere generic_react_page_view = GenericReactPageView.as_view() react_page_view = ReactPageView.as_view() urlpatterns = patterns('') if getattr(settings, 'DEBUG_VIEWS', settings.DEBUG): from sentry.web.debug_urls import urlpatterns as debug_urls urlpatterns += debug_urls urlpatterns += patterns( '', # Store endpoints first since they are the most active url(r'^api/store/$', api.StoreView.as_view(), name='sentry-api-store'), url(r'^api/(?P<project_id>[\w_-]+)/store/$', api.StoreView.as_view(), name='sentry-api-store'),
from sentry.web.frontend.unsubscribe_issue_notifications import UnsubscribeIssueNotificationsView from sentry.web.frontend.unsubscribe_incident_notifications import ( UnsubscribeIncidentNotificationsView, ) from sentry.web.frontend.user_avatar import UserAvatarPhotoView from sentry.web.frontend.setup_wizard import SetupWizardView from sentry.web.frontend.vsts_extension_configuration import VstsExtensionConfigurationView from sentry.web.frontend.js_sdk_loader import JavaScriptSdkLoader from sentry.web.frontend.project_event import ProjectEventRedirect __all__ = ("urlpatterns",) # Only create one instance of the ReactPageView since it's duplicated everywhere generic_react_page_view = GenericReactPageView.as_view() react_page_view = ReactPageView.as_view() urlpatterns = [] if getattr(settings, "DEBUG_VIEWS", settings.DEBUG): from sentry.web.debug_urls import urlpatterns as debug_urls urlpatterns += debug_urls # Special favicon in debug mode if settings.DEBUG: urlpatterns += [ url( r"^_static/[^/]+/[^/]+/images/favicon\.(ico|png)$", generic.dev_favicon,
name='sentry-api-groups-trends'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<team_slug>[\w_-]+)/groups/newest/$', api.get_new_groups, name='sentry-api-groups-new'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<team_slug>[\w_-]+)/groups/resolved/$', api.get_resolved_groups, name='sentry-api-groups-resolved'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<team_slug>[\w_-]+)/stats/$', api.get_stats, name='sentry-api-stats'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/tags/search/$', api.search_tags, name='sentry-api-search-tags'), url(r'^api/(?P<organization_slug>[\w_-]+)/users/search/$', api.search_users, name='sentry-api-search-users'), url(r'^api/(?P<organization_slug>[\w_-]+)/projects/search/$', api.search_projects, name='sentry-api-search-projects'), url(r'^share/group/(?P<share_id>[\w_-]+)/$', GenericReactPageView.as_view(auth_required=False), name='sentry-group-shared'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/$', ReactPageView.as_view(), name='sentry-group'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/activity/$', ReactPageView.as_view(), name='sentry-group-activity'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/events/$', ReactPageView.as_view(), name='sentry-group-events'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/events/(?P<event_id>\d+)/$', ReactPageView.as_view(), name='sentry-group-event'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/events/(?P<event_id>\d+)/replay/$', events.replay_event, name='sentry-replay'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/events/(?P<event_id_or_latest>(\d+|latest))/json/$', groups.group_event_details_json, name='sentry-group-event-json'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/actions/(?P<slug>[\w_-]+)/', groups.group_plugin_action,
api.get_resolved_groups, name='sentry-api-groups-resolved'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<team_slug>[\w_-]+)/stats/$', api.get_stats, name='sentry-api-stats'), url(r'^api/(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/tags/search/$', api.search_tags, name='sentry-api-search-tags'), url(r'^api/(?P<organization_slug>[\w_-]+)/users/search/$', api.search_users, name='sentry-api-search-users'), url(r'^api/(?P<organization_slug>[\w_-]+)/projects/search/$', api.search_projects, name='sentry-api-search-projects'), url(r'^share/group/(?P<share_id>[\w_-]+)/$', GenericReactPageView.as_view(auth_required=False), name='sentry-group-shared'), # TV dashboard url(r'^(?P<organization_slug>[\w_-]+)/teams/(?P<team_slug>[\w_-]+)/wall/$', groups.wall_display, name='sentry-wall'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/$', ReactPageView.as_view(), name='sentry-group'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/activity/$', ReactPageView.as_view(), name='sentry-group-activity'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/group/(?P<group_id>\d+)/events/$', ReactPageView.as_view(), name='sentry-group-events'),
""" Forces import of all applications to ensure code is registered. """ from django.db.models import get_apps, get_models for app in get_apps(): try: get_models(app) except Exception: continue init_all_applications() # Only create one instance of the ReactPageView since it's duplicated errywhere generic_react_page_view = GenericReactPageView.as_view() react_page_view = ReactPageView.as_view() urlpatterns = patterns('') if getattr(settings, 'DEBUG_VIEWS', settings.DEBUG): from sentry.web.debug_urls import urlpatterns as debug_urls urlpatterns += debug_urls # Special favicon in debug mode if settings.DEBUG: urlpatterns += patterns('', url( r'^_static/[^/]+/[^/]+/images/favicon\.ico$', generic.dev_favicon, name='sentry-dev-favicon' ))
# A side effect of this is it may cause a bad redirect when logging in # since this gets stored in session as the last viewed page. # See: https://github.com/getsentry/sentry/issues/2195 url(r'favicon\.ico$', lambda r: HttpResponse(status=404)), # crossdomain.xml url(r'^crossdomain\.xml$', api.crossdomain_xml_index, name='sentry-api-crossdomain-xml-index'), url(r'^api/(?P<project_id>[\w_-]+)/crossdomain\.xml$', api.crossdomain_xml, name='sentry-api-crossdomain-xml'), # plugins url(r'^plugins/', include('sentry.plugins.base.urls')), # Generic API url(r'^share/(?:group|issue)/(?P<share_id>[\w_-]+)/$', GenericReactPageView.as_view(auth_required=False), name='sentry-group-shared'), # Keep named URL for for things using reverse url(r'^(?P<organization_slug>[\w_-]+)/issues/(?P<short_id>[\w_-]+)/$', react_page_view, name='sentry-short-id'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/issues/(?P<group_id>\d+)/$', react_page_view, name='sentry-group'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/$', react_page_view, name='sentry-stream'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_slug>[\w_-]+)/(?:group|issues)/(?P<group_id>\d+)/events/(?P<event_id_or_latest>(\d+|latest))/json/$', GroupEventJsonView.as_view(), name='sentry-group-event-json'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_slug>[\w_-]+)/issues/(?P<group_id>\d+)/tags/(?P<key>[^\/]+)/export/$', GroupTagExportView.as_view(), name='sentry-group-tag-export'), url(r'^(?P<organization_slug>[\w_-]+)/(?P<project_slug>[\w_-]+)/issues/(?P<group_id>\d+)/actions/(?P<slug>[\w_-]+)/', GroupPluginActionView.as_view(),
# Force a 404 of favicon.ico. # This url is commonly requested by browsers, and without # blocking this, it was treated as a 200 OK for a react page view. # A side effect of this is it may cause a bad redirect when logging in # since this gets stored in session as the last viewed page. # See: https://github.com/getsentry/sentry/issues/2195 url(r"favicon\.ico$", lambda r: HttpResponse(status=404)), # crossdomain.xml url(r"^crossdomain\.xml$", api.crossdomain_xml_index, name="sentry-api-crossdomain-xml-index"), url(r"^api/(?P<project_id>[\w_-]+)/crossdomain\.xml$", api.crossdomain_xml, name="sentry-api-crossdomain-xml"), # plugins url(r"^plugins/", include("sentry.plugins.base.urls")), # Generic API url( r"^share/(?:group|issue)/(?P<share_id>[\w_-]+)/$", GenericReactPageView.as_view(auth_required=False), name="sentry-group-shared", ), # Keep named URL for for things using reverse url(r"^(?P<organization_slug>[\w_-]+)/issues/(?P<short_id>[\w_-]+)/$", react_page_view, name="sentry-short-id"), url( r"^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/issues/(?P<group_id>\d+)/$", react_page_view, name="sentry-group", ), url(r"^(?P<organization_slug>[\w_-]+)/(?P<project_id>[\w_-]+)/$", react_page_view, name="sentry-stream"), url( r"^(?P<organization_slug>[\w_-]+)/(?P<project_slug>[\w_-]+)/(?:group|issues)/(?P<group_id>\d+)/events/(?P<event_id>\d+)/replay/$", ReplayEventView.as_view(), name="sentry-replay", ),