0

I have a Django URL I can't seem to get to work. I'm thinking it's something Django related rather than the regex itself since the regex is working at pythex.org.

Here's the URL string:

http://127.0.0.1:8000/invitation.html?S2XEvent=ConfirmInvitation&Type=Participant&ValidationKey=ab8a8f1fc1927044feb89245dd88a55e&InvitationId=14708

And here's the line in my urls.py:

url(r'^invitation\.html\?S2XEvent=ConfirmInvitation&Type=(?P<invitation_type>\w+)&ValidationKey=(?P<validation_key>\w+)&InvitationId=(?P<invitation_id>\d+)$', 'events.views.accept'),

Before anyone yells at me about the ugly URL, this is just for legacy purposes as this code is replacing an existing application.

Any idea what I'm doing wrong?

1
  • Not sure if you're supposed to write out query params in url configuration. Prolly messing it up. Commented Apr 1, 2016 at 19:30

1 Answer 1

3

That's not how Django urls work. Query parameters - those after the ? - are not part of the urlpattern but are captured in request.GET.

Your pattern should just be r'^invitation\.html$'.

Sign up to request clarification or add additional context in comments.

1 Comment

Alright that makes sense. So I just need to send all invitation.html requests to whatever view, then get them from request.GET?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.