2018-11-08 19:45:21 +00:00
|
|
|
from django.conf.urls import include, url
|
2020-03-06 16:26:37 +00:00
|
|
|
from django.views.generic import TemplateView
|
2018-11-08 19:45:21 +00:00
|
|
|
from django.conf import settings
|
|
|
|
|
|
|
|
import peeringdb_server.rest
|
|
|
|
|
2019-12-05 16:57:52 +00:00
|
|
|
from peeringdb_server.models import InternetExchange, Network, Facility, Organization
|
2018-11-08 19:45:21 +00:00
|
|
|
|
|
|
|
from peeringdb_server.autocomplete_views import (
|
2019-12-05 16:57:52 +00:00
|
|
|
FacilityAutocompleteForNetwork,
|
|
|
|
FacilityAutocompleteForExchange,
|
|
|
|
OrganizationAutocomplete,
|
|
|
|
ExchangeAutocomplete,
|
|
|
|
ExchangeAutocompleteJSON,
|
|
|
|
IXLanAutocomplete,
|
|
|
|
FacilityAutocomplete,
|
|
|
|
FacilityAutocompleteJSON,
|
|
|
|
DeletedVersionAutocomplete,
|
|
|
|
clt_history,
|
|
|
|
)
|
2018-11-08 19:45:21 +00:00
|
|
|
|
|
|
|
from peeringdb_server.export_views import (
|
|
|
|
view_export_ixf_ix_members,
|
|
|
|
view_export_ixf_ixlan_members,
|
|
|
|
AdvancedSearchExportView,
|
|
|
|
)
|
|
|
|
|
2019-02-15 17:46:40 +00:00
|
|
|
from peeringdb_server.import_views import (
|
|
|
|
view_import_ixlan_ixf_preview,
|
2019-09-07 01:08:37 -05:00
|
|
|
view_import_net_ixf_postmortem,
|
|
|
|
view_import_net_ixf_preview,
|
2019-02-15 17:46:40 +00:00
|
|
|
)
|
|
|
|
|
2018-11-08 19:45:21 +00:00
|
|
|
from django.views.i18n import JavaScriptCatalog
|
|
|
|
|
|
|
|
# o
|
|
|
|
# SITE
|
|
|
|
|
|
|
|
from peeringdb_server.views import (
|
|
|
|
view_index,
|
|
|
|
view_login,
|
|
|
|
view_registration,
|
|
|
|
view_password_reset,
|
|
|
|
view_password_change,
|
|
|
|
view_set_user_locale,
|
|
|
|
view_network,
|
|
|
|
view_network_by_asn,
|
|
|
|
view_network_by_query,
|
|
|
|
view_suggest,
|
|
|
|
view_exchange,
|
|
|
|
view_facility,
|
|
|
|
view_organization,
|
|
|
|
view_affiliate_to_org,
|
|
|
|
view_request_ownership,
|
|
|
|
view_verify,
|
|
|
|
view_profile,
|
|
|
|
view_profile_v1,
|
|
|
|
view_advanced_search,
|
|
|
|
view_sponsorships,
|
|
|
|
view_partnerships,
|
|
|
|
view_aup,
|
2019-02-19 22:08:29 +00:00
|
|
|
view_about,
|
2018-11-08 19:45:21 +00:00
|
|
|
view_username_retrieve,
|
|
|
|
view_username_retrieve_initiate,
|
|
|
|
view_username_retrieve_complete,
|
2019-01-04 10:02:28 +00:00
|
|
|
view_maintenance,
|
2018-11-08 19:45:21 +00:00
|
|
|
resend_confirmation_mail,
|
|
|
|
request_login,
|
|
|
|
request_logout,
|
|
|
|
request_api_search,
|
|
|
|
request_search,
|
|
|
|
request_translation,
|
2020-04-01 11:08:12 +00:00
|
|
|
cancel_affiliation_request,
|
2018-11-08 19:45:21 +00:00
|
|
|
)
|
|
|
|
import peeringdb_server.org_admin_views
|
|
|
|
import peeringdb_server.data_views
|
|
|
|
|
|
|
|
urlpatterns = [
|
2019-12-05 16:57:52 +00:00
|
|
|
url(r"^api_search$", request_api_search),
|
|
|
|
url(r"^search$", request_search),
|
|
|
|
url(r"^advanced_search", view_advanced_search),
|
|
|
|
url(r"^auth$", request_login),
|
|
|
|
url(r"^logout$", request_logout),
|
|
|
|
url(r"^login$", view_login),
|
|
|
|
url(r"^register$", view_registration),
|
|
|
|
url(r"^reset-password$", view_password_reset),
|
|
|
|
url(r"^change-password$", view_password_change),
|
|
|
|
url(r"^set-user-locale$", view_set_user_locale),
|
|
|
|
url(r"^username-retrieve/initiate$", view_username_retrieve_initiate),
|
|
|
|
url(r"^username-retrieve/complete$", view_username_retrieve_complete),
|
|
|
|
url(r"^username-retrieve$", view_username_retrieve),
|
|
|
|
url(r"^verify$", view_verify),
|
2020-04-01 11:08:12 +00:00
|
|
|
url(r"^profile$", view_profile, name="user-profile"),
|
2019-12-05 16:57:52 +00:00
|
|
|
url(r"^profile/v1$", view_profile_v1),
|
|
|
|
url(r"^resend_email_confirmation$", resend_confirmation_mail),
|
|
|
|
url(r"^sponsors$", view_sponsorships),
|
|
|
|
# url(r'^partners$', view_partnerships),
|
|
|
|
url(r"^aup$", view_aup),
|
|
|
|
url(r"^about$", view_about),
|
|
|
|
url(r"^affiliate-to-org$", view_affiliate_to_org),
|
2020-04-01 11:08:12 +00:00
|
|
|
url(r"^cancel-affiliation-request/(?P<uoar_id>\d+)/$", cancel_affiliation_request, name="cancel-affiliation-request"),
|
2019-12-05 16:57:52 +00:00
|
|
|
url(r"^request-ownership$", view_request_ownership),
|
|
|
|
url(r"^%s/(?P<id>\d+)/?$" % Network.handleref.tag, view_network),
|
|
|
|
url(r"^%s/(?P<id>\d+)/?$" % InternetExchange.handleref.tag, view_exchange),
|
|
|
|
url(r"^%s/(?P<id>\d+)/?$" % Facility.handleref.tag, view_facility),
|
|
|
|
url(r"^%s/(?P<id>\d+)/?$" % Organization.handleref.tag, view_organization),
|
|
|
|
url(r"^%s$" % Network.handleref.tag, view_network_by_query),
|
|
|
|
url(r"^asn/(?P<asn>\d+)/?$", view_network_by_asn),
|
|
|
|
url(r"^org_admin/users$", peeringdb_server.org_admin_views.users),
|
|
|
|
url(
|
|
|
|
r"^org_admin/user_permissions$",
|
|
|
|
peeringdb_server.org_admin_views.user_permissions,
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^org_admin/user_permissions/update$",
|
|
|
|
peeringdb_server.org_admin_views.user_permission_update,
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^org_admin/user_permissions/remove$",
|
|
|
|
peeringdb_server.org_admin_views.user_permission_remove,
|
|
|
|
),
|
|
|
|
url(r"^org_admin/permissions$", peeringdb_server.org_admin_views.permissions),
|
|
|
|
url(r"^org_admin/uoar/approve$", peeringdb_server.org_admin_views.uoar_approve),
|
|
|
|
url(r"^org_admin/uoar/deny$", peeringdb_server.org_admin_views.uoar_deny),
|
|
|
|
url(
|
|
|
|
r"^org_admin/manage_user/update$",
|
|
|
|
peeringdb_server.org_admin_views.manage_user_update,
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^org_admin/manage_user/delete$",
|
|
|
|
peeringdb_server.org_admin_views.manage_user_delete,
|
|
|
|
),
|
|
|
|
url(r"^data/countries$", peeringdb_server.data_views.countries),
|
|
|
|
url(r"^data/sponsors$", peeringdb_server.data_views.sponsorships),
|
|
|
|
url(r"^data/countries_b$", peeringdb_server.data_views.countries_w_blank),
|
|
|
|
url(r"^data/facilities$", peeringdb_server.data_views.facilities),
|
|
|
|
url(r"^data/enum/(?P<name>[\w_]+)$", peeringdb_server.data_views.enum),
|
|
|
|
url(r"^data/asns$", peeringdb_server.data_views.asns),
|
|
|
|
url(r"^data/organizations$", peeringdb_server.data_views.organizations),
|
|
|
|
url(r"^data/locales$", peeringdb_server.data_views.languages),
|
|
|
|
url(r"^export/ix/(?P<ix_id>\d+)/ixp-member-list$", view_export_ixf_ix_members),
|
|
|
|
url(
|
|
|
|
r"^export/ixlan/(?P<ixlan_id>\d+)/ixp-member-list$",
|
|
|
|
view_export_ixf_ixlan_members,
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^export/advanced-search/(?P<tag>[\w_]+)/(?P<fmt>[\w_-]+)$",
|
|
|
|
AdvancedSearchExportView.as_view(),
|
|
|
|
),
|
|
|
|
url(r"^import/ixlan/(?P<ixlan_id>\d+)/ixf/preview$", view_import_ixlan_ixf_preview),
|
|
|
|
url(r"^import/net/(?P<net_id>\d+)/ixf/postmortem$", view_import_net_ixf_postmortem),
|
|
|
|
url(r"^import/net/(?P<net_id>\d+)/ixf/preview$", view_import_net_ixf_preview),
|
|
|
|
url(r"^$", view_index),
|
|
|
|
url(r"^i18n/", include("django.conf.urls.i18n")),
|
|
|
|
url("jsi18n/", JavaScriptCatalog.as_view(), name="javascript-catalog"),
|
|
|
|
url(r"^(net|ix|fac|org|asn)/translate$", request_translation),
|
|
|
|
url(r"^suggest/(?P<reftag>fac)$", view_suggest),
|
|
|
|
url(r"^maintenance$", view_maintenance, name="maintenance"),
|
2018-11-08 19:45:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# o
|
|
|
|
# REST API
|
|
|
|
|
|
|
|
urlpatterns += [
|
2019-12-05 16:57:52 +00:00
|
|
|
url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")),
|
2020-03-06 16:26:37 +00:00
|
|
|
url(
|
|
|
|
r"^apidocs/",
|
|
|
|
TemplateView.as_view(
|
|
|
|
template_name="apidocs/redoc.html",
|
|
|
|
extra_context={"schema_url": "openapi-schema"},
|
|
|
|
),
|
|
|
|
name="redoc-ui",
|
|
|
|
),
|
|
|
|
url(r"^api/", include(peeringdb_server.rest.urls)),
|
2018-11-08 19:45:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# AUTOCOMPLETE
|
|
|
|
|
|
|
|
urlpatterns += [
|
2019-12-05 16:57:52 +00:00
|
|
|
url(
|
|
|
|
r"^autocomplete/fac/net/(?P<net_id>\d+)/$",
|
|
|
|
FacilityAutocompleteForNetwork.as_view(),
|
|
|
|
name="autocomplete-fac-net",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/fac/ix/(?P<ix_id>\d+)/$",
|
|
|
|
FacilityAutocompleteForExchange.as_view(),
|
|
|
|
name="autocomplete-fac-ix",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/org/$",
|
|
|
|
OrganizationAutocomplete.as_view(),
|
|
|
|
name="autocomplete-org",
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/ix/json$",
|
|
|
|
ExchangeAutocompleteJSON.as_view(),
|
|
|
|
name="autocomplete-ix-json",
|
|
|
|
),
|
|
|
|
url(r"^autocomplete/ix$", ExchangeAutocomplete.as_view(), name="autocomplete-ix"),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/fac/json$",
|
|
|
|
FacilityAutocompleteJSON.as_view(),
|
|
|
|
name="autocomplete-fac-json",
|
|
|
|
),
|
|
|
|
url(r"^autocomplete/fac$", FacilityAutocomplete.as_view(), name="autocomplete-fac"),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/ixlan/$", IXLanAutocomplete.as_view(), name="autocomplete-ixlan"
|
|
|
|
),
|
|
|
|
url(
|
|
|
|
r"^autocomplete/admin/deletedversions$",
|
|
|
|
DeletedVersionAutocomplete.as_view(),
|
|
|
|
name="autocomplete-admin-deleted-versions",
|
|
|
|
),
|
2018-11-08 19:45:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# Admin autocomplete for commandlinetool history
|
|
|
|
|
|
|
|
urlpatterns += [
|
2019-12-05 16:57:52 +00:00
|
|
|
url(
|
|
|
|
r"^autocomplete/admin/clt-history/{}/$".format(tool_id),
|
2018-11-08 19:45:21 +00:00
|
|
|
ToolHistory.as_view(),
|
2019-12-05 16:57:52 +00:00
|
|
|
name="autocomplete-admin-clt-history-{}".format(tool_id),
|
|
|
|
)
|
2020-01-08 13:29:58 -06:00
|
|
|
for tool_id, ToolHistory in list(clt_history.items())
|
2018-11-08 19:45:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# Oauth2
|
|
|
|
|
|
|
|
urlpatterns += [
|
2019-12-05 16:57:52 +00:00
|
|
|
url(r"^oauth2/", include("oauth2_provider.urls", namespace="oauth2_provider")),
|
2018-11-08 19:45:21 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
# DEBUG
|
|
|
|
if settings.DEBUG:
|
|
|
|
import debug_toolbar
|
2019-12-05 16:57:52 +00:00
|
|
|
|
|
|
|
urlpatterns = [url(r"^__debug__/", include(debug_toolbar.urls)),] + urlpatterns
|