This app is set up to create webhooks and receive requests, however the 
routing has broken and the requests are getting a 404.

The path looks like this:

http://127.0.0.1:8000/integrations/dc3509ac-1aa8-4c9a-a439-904342d885cd/order

The Stack Track/Routing:

Using the URLconf defined in fulfill.urls, Django tried these URL patterns, 
in this order:

   1. baton/
   2. [name='index']
   3. etc...
   4. integrations/request/
   5. reports/clientreport/
   6. 
^(?P<app_label>auth|sites|account|socialaccount|users|core|integrations|reports)/$
 
   [name='app_list']
   7. (?P<url>.*)$

The current path, integrations/dc3509ac-1aa8-4c9a-a439-904342d885cd/order, 
matched the last one.

My URL setup is like this:
urlpatterns = [
    path("baton/", include("baton.urls")),
    # Be sure "baton/" is at the beginning of the list, before "".
    path("", admin.site.urls),
    path('accounts/', include('allauth.urls')),
    path("integrations/", include("integrations.urls")),
    path("queryfilter/", include("core.urls")),
    path("docs/", include("docs.urls")),
    path(
        "favicon.ico", 
RedirectView.as_view(url=staticfiles_storage.url("favicon.ico"))
    ),
]

With integrations.urls like this:

urlpatterns = [
  path(
    "<uuid:integration_uuid>/order",
      incoming_order,
      name="incoming-order",
    ),
]


The incoming_order method looks like this:

@csrf_exempt
@require_http_methods(["POST"])
def incoming_order(request, integration_uuid):
    headers = request.headers
    request_body = request.body.decode("utf-8")
    log = Request.objects.create(
        url=request.build_absolute_uri(), body=request_body, 
headers=dict(headers)
    )

    log.process(integration_uuid)

    return JsonResponse({"status": "ok"})

Any suggestions?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/98d3971b-41da-4b33-8bbe-3b9a59332b9bn%40googlegroups.com.

Reply via email to