So I have two questions:

1.  Changing LOGIN_REDIRECT to a named url.

Example:

settings.py:
LOGIN_REDIRECT = ??   // what do i set it to,  'tracklist:profile' gives me 
an unsafe redirect error

urls.py: // which one?  your root urls.py or your application urls.py
from django.conf.urls import include, patterns, url

urlpatterns = patterns('tracklist.views',
    url(r'^accounts/profile/$', 'profile', name='profile'),
)

etc...


2.  Accessing user profile data from a session.

Example:

models.py

from django.contrib.auth.models import User

class UserProfile(models.Model):
    
    user = models.ForeignKey(User, unique=True)
    timestamp = models.DateTimeField(auto_now_add=True)


So in the above example if I get the User object from a session how do I 
get the session data.
Per the documentation it looks like it should be:

user = request.user

timestamp = user.userprofile.timestamp


I get that user does not have userprofile attribute.

Hopefully someone can help...


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


Reply via email to