[Django] #34726: Backslash replaced by forwardslash in queries

3 views
Skip to first unread message

Django

unread,
Jul 20, 2023, 10:03:23 AM7/20/23
to django-...@googlegroups.com
#34726: Backslash replaced by forwardslash in queries
-------------------------------------+-------------------------------------
Reporter: Peskind | Owner: nobody
Type: | Status: new
Uncategorized |
Component: | Version: 3.2
Uncategorized | Keywords: Backslash
Severity: Normal | urlpatterns
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
We use Django 3.2.3 with djangorestframework 3.14.0 (Windows 10)

In urls.py I've defined **urlpatterns**:
urlpatterns = [
path('items/<path:pk>', views.itemsPK, name='itemDetailsPK'),
...
]

and in** views.py** function:
@csrf_exempt
@api_view(['GET', 'POST', 'PUT', 'DELETE'])
@authentication_classes([BasicAuthentication, SessionAuthentication])
def itemsPK(request, pk): #(request, pk
"""
Retrieve, update or delete a code snippet.
"""
permission_classes = [permissions.IsAuthenticated]

logger = logging.getLogger('django')
logger.info( " :: foldimport:views:items :: "+ request.method+ "
request, pk="+str(pk))
...

If I send a query like ''http://127.0.0.1:8000/importvault/items/(STD-/
\000&87)'', backslash in pk will be replaced with forwardslash.
I've tried to use query parameters (pk = request.GET.get('itemNum', '')),
but it doesn't help.

Sending backslashes in the json body doesn't work as well.

How I can send parameters including backslashes? Forwardslash works
perfectly with <path:pk>.

--
Ticket URL: <https://code.djangoproject.com/ticket/34726>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 20, 2023, 10:29:25 AM7/20/23
to django-...@googlegroups.com
#34726: Backslash replaced by forwardslash in queries
-------------------------------------+-------------------------------------
Reporter: Dmitry Peskin | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 3.2
Severity: Normal | Resolution: invalid
Keywords: Backslash | Triage Stage:
urlpatterns | Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* status: new => closed
* resolution: => invalid


Comment:

Hello,

This ticket seems to be a support request. The best place to get answers
to your issue is using any of the user support channels from
[https://docs.djangoproject.com/en/dev/faq/help/#how-do-i-do-x-why-
doesn-t-y-work-where-can-i-go-to-get-help this link].

Since the goal of this issue tracker is to track issues about Django
itself, and not to track support requests, I'll be closing this ticket as
invalid.

--
Ticket URL: <https://code.djangoproject.com/ticket/34726#comment:1>

Reply all
Reply to author
Forward
0 new messages