Encrypting PK in URL

70 views
Skip to first unread message

nate

unread,
Mar 6, 2012, 3:55:42 PM3/6/12
to django...@googlegroups.com
I saw a thread on this previously but it does not seem to have a solution.  I used this thread http://stackoverflow.com/questions/2291176/django-python-and-link-encryption as a base and created encrypt and decrypt functions for the pk.  I encrypt and quote and use smart_unicode to create my url.  They come out looking something like this:  %FA8%01%5B%9D%93_%B6%F5%3D%3A%23ij%01%8B.  it does not work.  I changed the core as mentioned on this ticket https://code.djangoproject.com/attachment/ticket/5738/unicode_url_bug.patch and I was able to get the error it was throwing.  The encrypted URL does not seem to be going thru all the way as the URL in the error statements looks something like this: _ij .  Is there another approach I can take? or Am I missing something here?  Also the url is set to something like this: /path/(.+)

shiji bijo

unread,
Mar 6, 2012, 4:09:19 PM3/6/12
to django...@googlegroups.com
today i asked my teacher to help me.she told it is possible to return as httpresponse(context) from the view then show the response body in the html page. I tried a lot but I didnt yet find a solution.I will try the one which you sent now  the url I used now is
( r'^auctions/(\d+)/$',AuctionView())





On Tue, Mar 6, 2012 at 10:55 PM, nate <nares...@gmail.com> wrote:
I saw a thread on this previously but it does not seem to have a solution.  I used this thread http://stackoverflow.com/questions/2291176/django-python-and-link-encryption as a base and created encrypt and decrypt functions for the pk.  I encrypt and quote and use smart_unicode to create my url.  They come out looking something like this:  %FA8%01%5B%9D%93_%B6%F5%3D%3A%23ij%01%8B.  it does not work.  I changed the core as mentioned on this ticket https://code.djangoproject.com/attachment/ticket/5738/unicode_url_bug.patch and I was able to get the error it was throwing.  The encrypted URL does not seem to be going thru all the way as the URL in the error statements looks something like this: _ij .  Is there another approach I can take? or Am I missing something here?  Also the url is set to something like this: /path/(.+)

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/hfIb0PLTs2YJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
0 new messages