django.contrib.auth.views.password_change how to

2007-10-31 Thread Gigs_

can anyoune give me simple example how to use:
django.contrib.auth.views.password_change?


thanks!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



login page?

2007-10-31 Thread Gigs_

hi

im trying to use generic password_change. i log in and i go to change
password. when i click on pass change link im redirected to login
page, but im already loged in. so i think that something is not good
with my login page.

here is views.py login funct

def login_page(request):
if request.POST:
form = LoginForm(request.POST)
if form.is_valid():
data = form.clean_data
user = authenticate(username=data['username'],
password=data['password'])
if user is not None:
if user.is_active:
return render_to_response('base.html',
{'user':user})
else:
return render_to_response('login.html',
{'form':form, 'message':'Your account is disabled!'})
else:
return render_to_response('login.html', {'form':form,
'message': 'Your user name or password is incorect!'})
form = LoginForm()
return render_to_response('login.html', {'form':form})


tanks in advance!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



why is this happening?

2007-10-30 Thread Gigs_

error:
IntegrityError at /accounts/register/
accounts_playersprofile.first_name may not be NULL
Request Method: POST
Request URL:http://localhost:8000/accounts/register/
Exception Type: IntegrityError
Exception Value:accounts_playersprofile.first_name may not be NULL
Exception Location: C:\Python25\lib\site-packages\django\db\backends
\sqlite3\base.py in execute, line 93

views.py
def register_page(request):
"""Register page"""
if request.user.is_authenticated():
return render_to_response('register.html',
{'has_account':True})

if request.POST:
form = RegistrationForm(request.POST)
if form.is_valid():
# save the user
new_user = form.save(form.clean_data)

# build activation key for their account
activation_key = new_user.username + str(random.random())
key_expires = datetime.datetime.today() +
datetime.timedelta(2)

# Create and save their profile
new_profile = PlayersProfile(user=new_user,
  activation_key=activation_key,
  key_expires=key_expires)
new_profile.save()

return render_to_response('register.html', {'created':
True})
else:
return render_to_response('register.html', {'form':form})
else:
form = RegistrationForm()
return render_to_response('register.html', {'form':form})

models.py

class PlayersProfile(models.Model):
user = models.ForeignKey(User, unique=True)
activation_key = models.CharField(maxlength=40)
key_expires = models.DateTimeField()

forms.py

class RegistrationForm(forms.Form):
"""Player registration form"""
username = forms.CharField(max_length=20)
password = forms.CharField(min_length=4, max_length=20,
widget=forms.PasswordInput())
first_name = forms.CharField(max_length=20)
last_name = forms.CharField(max_length=20)
email = forms.EmailField(max_length=40)

def save(self, data):
u = User.objects.create_user(data['username'], data['email'],
data['password'])
u.is_active = False
u.first_name = data['first_name']
u.last_name = data['last_name']
u.save()
return u


thanks in advance


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: user registration problem

2007-10-30 Thread Gigs_

thanks

On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
> On 30.10.2007, at 13:38, Gigs_ wrote:
>
>
>
> > im getting this error all the time.
>
> > IntegrityError at /accounts/register/
> > column username is not unique
> > Request Method:POST
> > Request URL:  http://localhost:8000/accounts/register/
> > Exception Type:IntegrityError
> > Exception Value:   column username is not unique
>
> Are you trying to register with a username that is already taken? ...
>
> You did not give us much details what you are doing when this
> error occurs.
>
> --http://spinlock.ch/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: user registration problem

2007-10-30 Thread Gigs_

its working now.

On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
> On 30.10.2007, at 13:38, Gigs_ wrote:
>
>
>
> > im getting this error all the time.
>
> > IntegrityError at /accounts/register/
> > column username is not unique
> > Request Method:POST
> > Request URL:  http://localhost:8000/accounts/register/
> > Exception Type:IntegrityError
> > Exception Value:   column username is not unique
>
> Are you trying to register with a username that is already taken? ...
>
> You did not give us much details what you are doing when this
> error occurs.
>
> --http://spinlock.ch/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: user registration problem

2007-10-30 Thread Gigs_

that username is not taken.

On Oct 30, 1:59 pm, Matthias Kestenholz <[EMAIL PROTECTED]> wrote:
> On 30.10.2007, at 13:38, Gigs_ wrote:
>
>
>
> > im getting this error all the time.
>
> > IntegrityError at /accounts/register/
> > column username is not unique
> > Request Method:POST
> > Request URL:  http://localhost:8000/accounts/register/
> > Exception Type:IntegrityError
> > Exception Value:   column username is not unique
>
> Are you trying to register with a username that is already taken? ...
>
> You did not give us much details what you are doing when this
> error occurs.
>
> --http://spinlock.ch/blog/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



user registration problem

2007-10-30 Thread Gigs_

im getting this error all the time.

IntegrityError at /accounts/register/
column username is not unique
Request Method: POST
Request URL:http://localhost:8000/accounts/register/
Exception Type: IntegrityError
Exception Value:column username is not unique
Exception Location: C:\Python25\lib\site-packages\django\db\backends
\sqlite3\base.py in execute, line 93

forms.py

class RegistrationForm(forms.Form):
"""Player registration form"""
username = forms.CharField(max_length=20)
password = forms.CharField(min_length=4, max_length=20,
widget=forms.PasswordInput())
first_name = forms.CharField(max_length=20)
last_name = forms.CharField(max_length=20)
email = forms.EmailField(max_length=40)

def save(self, data):
u = User.objects.create_user(data['username'], data['email'],
data['password'])
u.is_active = False
u.first_name = data['first_name']
u.last_name = data['last_name']
u.save()

views.py

def register_page(request):
"""Register page"""
if request.user.is_authenticated():
return render_to_response('register.html',
{'has_account':True})

if request.POST:
form = RegistrationForm(request.POST)
if form.is_valid():
form.save(form.clean_data)
form = LoginForm()
return render_to_response('login.html', {'form':form})
else:
return render_to_response('register.html', {'form':form})
else:
form = RegistrationForm()
return render_to_response('register.html', {'form':form})


can someone please help?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: newbie: user proile in models

2007-10-29 Thread Gigs_

is username and password and email stored under user or i need to make
models.CharField for them?


On Oct 26, 7:03 pm, dunia <[EMAIL PROTECTED]> wrote:
> Gigs_ wrote:
> > how do you people createuserprofile in models?
> > i want to createduserprofile for users to register
> > i have don it like this, but i have feeling that it could be better
>
> > class PlayersProfile(models.Model):
> >user= models.ForeignKey(User)
> > first_name = models.CharField(maxlength=20)
> > last_name = models.CharField(maxlength=20)
> > email = models.EmailField()
> > # some more models field
>
> > def __unicde__(self):
> > return self.first_name
>
> > class Admin:
> > pass
>
> take a look at 
> this:http://www.b-list.org/weblog/2006/jun/06/django-tips-extending-user-m...http://www.stonemind.net/blog/2007/04/13/django-registration-for-newb...


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



newbie: user proile in models

2007-10-26 Thread Gigs_

how do you people create user profile in models?
i want to created user profile for users to register
i have don it like this, but i have feeling that it could be better

class PlayersProfile(models.Model):
user = models.ForeignKey(User)
first_name = models.CharField(maxlength=20)
last_name = models.CharField(maxlength=20)
email = models.EmailField()
# some more models field

def __unicde__(self):
return self.first_name

class Admin:
pass


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



first website with django

2007-10-17 Thread Gigs_

hI!

I'm going to start my first website (with django).

 I need some guidelines what to do first, where to start etc.?

Website will be for some tennis game tournament, so it will have
database with registered users. Registered users could register for
upcoming tournaments (after they login) in specified date for
registration. After that time pass that tournament will go under
current tournaments.

It will have interface for making tournament, there will be 4
different tournament type. Each tournament will have his amount of
points. Registered players will automatically got points for what they
have done on some tournament. That points will generate scoreboard.

that will be harder part.


sorry for bad english
thanks in advance


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django.views.generic.create_update.update_object

2007-10-12 Thread Gigs_

i found solution in djangobook chapter9 at the end

On Oct 12, 6:37 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
> if i wanna update object in django generic
> (django.views.generic.create_update.update_object) im using object_id
> and all work fine if i passwww.myurl.com/books/edit/object_id/.
>
> but what if i want to access my object with object name like book
> title?
> can i do that too?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django.views.generic.create_update.update_object

2007-10-12 Thread Gigs_

if i wanna update object in django generic
(django.views.generic.create_update.update_object) im using object_id
and all work fine if i pass www.myurl.com/books/edit/object_id/.

but what if i want to access my object with object name like book
title?
can i do that too?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic views

2007-10-11 Thread Gigs_

yes i figure out that after marty replay

On Oct 11, 10:01 pm, jake elliott <[EMAIL PROTECTED]> wrote:
> Marty Alchin wrote:
> > You'd replace "what goes here" with what you put in
> > "template_object_name": "author" (only without the quotes). Of course,
> > it'd be a little more readable if you use the plural "authors", since
> > you're getting a list of more than one author.
>
> actually you'll use "author_list" here - list_detail.object_list appends
> "_list" to the value set for "template_object_name"
>
> best
> jake


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic views

2007-10-11 Thread Gigs_

yes i know. this is just for learning.

thanks

On Oct 11, 8:06 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> You'd replace "what goes here" with what you put in
> "template_object_name": "author" (only without the quotes). Of course,
> it'd be a little more readable if you use the plural "authors", since
> you're getting a list of more than one author.
>
> -Gul


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic views

2007-10-11 Thread Gigs_

and here is urls from myapp

from django.conf.urls.defaults import *
from django.views.generic import list_detail, date_based,
create_update
from books.models import Publisher, Author, Book

author_list_info = {
'queryset':Author.objects.all(),
"template_object_name" : "author",
"extra_context":{'name':'john', 'lname':'doe'}
}


urlpatterns = patterns('',
# we'll add URL patterns here
    (r'author_list.html$', list_detail.object_list, author_list_info),
)




On Oct 11, 7:49 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
> so if this is my template for that list
> 
> 
>
> my template
>
> 
> 
> my books app
> 
> {% for name in "what goes here" %}
> {{ name }}
> {% endfor %}
> 
>
> On Oct 11, 7:47 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
>
> > so i cant get list from models?
> > from Author.objects.all()
>
> > On Oct 11, 4:03 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > > the list you want to use in template must be in template context. use
> > > "extra_context" value
>
> > > On 11 окт, 17:31, Gigs_ <[EMAIL PROTECTED]> wrote:
>
> > > > hi all
>
> > > > im learning django with djangobook.com
> > > > im stuck in chapter 9 at Lists of objects.
> > > > i just cant get any list of objects in my template.
>
> > > > what should i put in template to make this work?
>
> > > > thanks!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic views

2007-10-11 Thread Gigs_

so if this is my template for that list



my template



my books app

{% for name in "what goes here" %}
{{ name }}
{% endfor %}



On Oct 11, 7:47 pm, Gigs_ <[EMAIL PROTECTED]> wrote:
> so i cant get list from models?
> from Author.objects.all()
>
> On Oct 11, 4:03 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
> > the list you want to use in template must be in template context. use
> > "extra_context" value
>
> > On 11 окт, 17:31, Gigs_ <[EMAIL PROTECTED]> wrote:
>
> > > hi all
>
> > > im learning django with djangobook.com
> > > im stuck in chapter 9 at Lists of objects.
> > > i just cant get any list of objects in my template.
>
> > > what should i put in template to make this work?
>
> > > thanks!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: generic views

2007-10-11 Thread Gigs_

so i cant get list from models?
from Author.objects.all()

On Oct 11, 4:03 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> the list you want to use in template must be in template context. use
> "extra_context" value
>
> On 11 окт, 17:31, Gigs_ <[EMAIL PROTECTED]> wrote:
>
> > hi all
>
> > im learning django with djangobook.com
> > im stuck in chapter 9 at Lists of objects.
> > i just cant get any list of objects in my template.
>
> > what should i put in template to make this work?
>
> > thanks!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



generic views

2007-10-11 Thread Gigs_

hi all

im learning django with djangobook.com
im stuck in chapter 9 at Lists of objects.
i just cant get any list of objects in my template.

what should i put in template to make this work?

thanks!


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



need to know to start learn django

2007-05-23 Thread Gigs_

What i need to know, except python before i start learn django?


thank you


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



need to know to learn django

2007-05-23 Thread Gigs_

What I need to know to learn django, except python(HTML, javascript,
sql, etc)?

thanks


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---