On Tue, 2008-12-16 at 20:15 -0800, Chuck22 wrote:
> 1. I want to create Global Unique ID (GUID) as the primary key of my
> database table. Is there GUID available in Django or Python?

The uuid module is part of Python's standard library. Lots of options
there for generating various forms of uuid values.

> 
> 2. Also, I need to create a Authorization Code (random char/number
> string) to verify user's email when people sign up on my site. Is
> there generic method in Django or Python to create such code?

The random module is your friend here:

        ''.join([random.choice('abcdefghijklmnopqrstuvwxyz0123456789') for i in 
range(20)])

is one possibility. For more advanced stuff, have a look at
django/contrib/auth/tokens.py, although that will require reading and
comprehending some code.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to