dave
dave

Reputation: 683

Django: email user a one-time link to a view

I want to email people invitations to sign up on my site.

Which is a better signup link and a better django practice?:

mysite.com/accounts/create?verylongrandomstring (And handle it as a GET request)

OR

mysite.com/accounts/create/verylongrandomstring (And handle it as part of the URL)

OR

Does it matter? I've already written the code as a GET request but I wanted to check to see if this is a good practice.

Upvotes: 1

Views: 467

Answers (2)

Lie Ryan
Lie Ryan

Reputation: 64913

It doesn't really matter, it really depends on whether you're thinking of it as a "one-time page" or a "one-time code for a fixed page", but ultimately either way is fine. FYI, Pinax's signup_code reusable app uses GET parameter in its default urls.py config.

Upvotes: 3

TimD
TimD

Reputation: 1381

There isn't a difference unless you ever want to have any other pages below /create/ in the future. I'd do it with a GET parameter personally, but it's really up to you.

Upvotes: 2

Related Questions