Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-03-02 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+-
 Reporter:  anonymous|Owner:  neaf
 Type:  Bug  |   Status:  closed
Component:  Documentation|  Version:
 Severity:  Normal   |  1.4-alpha-1
 Keywords:   |   Resolution:  fixed
Has patch:  1| Triage Stage:  Ready for
  Needs tests:  0|  checkin
Easy pickings:  0|  Needs documentation:  0
 |  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by jezdez):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [17626]:
 {{{
 #!CommitTicketReference repository="" revision="17626"
 Fixed #17568 -- Mentioned ``reverse_lazy`` in the ``LOGIN_REDIRECT_URL``
 settings docs. Thanks, zsiciarz.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-02-16 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+-
 Reporter:  anonymous|Owner:  neaf
 Type:  Bug  |   Status:  assigned
Component:  Documentation|  Version:
 Severity:  Normal   |  1.4-alpha-1
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Ready for
  Needs tests:  0|  checkin
Easy pickings:  0|  Needs documentation:  0
 |  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by jezdez):

 * type:  Uncategorized => Bug


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-02-05 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+-
 Reporter:  anonymous|Owner:  neaf
 Type:  Uncategorized|   Status:  assigned
Component:  Documentation|  Version:
 Severity:  Normal   |  1.4-alpha-1
 Keywords:   |   Resolution:
Has patch:  1| Triage Stage:  Ready for
  Needs tests:  0|  checkin
Easy pickings:  0|  Needs documentation:  0
 |  Patch needs improvement:  0
 |UI/UX:  0
-+-
Changes (by neaf):

 * status:  new => assigned
 * type:  Bug => Uncategorized
 * has_patch:  0 => 1
 * component:  Core (URLs) => Documentation
 * stage:  Accepted => Ready for checkin


Comment:

 I tested it with reverse_lazy and it works fine.
 {{{#!python
 from django.conf.urls import url
 from django.utils.translation import ugettext as _
 from django.conf.urls.i18n import i18n_patterns

 urlpatterns = i18n_patterns('',
 url(_(r'^home/$'), 'languages.views.home', name='home'),
 url(_(r'^login_success/$'), 'languages.views.login_success',
 name='login_success'),
 )
 urlpatterns += i18n_patterns('django.contrib.auth.views',
 url(_(r'^login/$'), 'login', name='login'),
 )
 }}}

 My pl locale:
 {{{
 #: urls.py:6
 msgid "^home/$"
 msgstr "^dom/$"

 #: urls.py:7
 msgid "^login_success/$"
 msgstr "^logowanie_udane/$"

 #: urls.py:10
 msgid "^login/$"
 msgstr "^loguj/$"
 }}}

 My settings:
 {{{#!python
 LOGIN_URL = reverse_lazy('login')
 LOGIN_REDIRECT_URL = reverse_lazy('login_success')
 }}}

 Login required redirects to /pl/loguj/

 After login redirects to /pl/logowanie_udane/

 This is expected behavior. Patch with hint in documentation added (had
 problems with linking reverse_lazy - if someone knows more about rst
 please fix).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-02-05 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+---
 Reporter:  anonymous|Owner:  neaf
 Type:  Bug  |   Status:  new
Component:  Core (URLs)  |  Version:  1.4-alpha-1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---
Changes (by neaf):

 * stage:  Unreviewed => Accepted


Comment:

 Ok, I tested it to be sure: reverse_lazy does what you need it to do.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-02-05 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+---
 Reporter:  anonymous|Owner:  neaf
 Type:  Bug  |   Status:  new
Component:  Core (URLs)  |  Version:  1.4-alpha-1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---
Changes (by neaf):

 * owner:  nobody => neaf
 * status:  reopened => new


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-01-24 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+---
 Reporter:  anonymous|Owner:  nobody
 Type:  Bug  |   Status:  reopened
Component:  Core (URLs)  |  Version:  1.4-alpha-1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---

Comment (by julien):

 It's unfortunate that the default values for those settings are hardcoded
 URLs, but changing that would be backwards-incompatible.

 Have you tried redefining those settings using `reverse_lazy` in your
 project?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-01-24 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+---
 Reporter:  anonymous|Owner:  nobody
 Type:  Bug  |   Status:  reopened
Component:  Core (URLs)  |  Version:  1.4-alpha-1
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---
Changes (by anonymous):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 It does not work. Django uses settings.LOGIN_URL, settings.LOGOUT_URL,
 settings.LOGIN_REDIRECT_URL in django.contrib.auth.views and puts them
 into the HttpResponseRedirect, so I nothing can do. If Django could use
 `redirect` function in place of HttpResponseRedirect this will allow to
 use url patterns in settings (like: LOGIN_URL = "auth:login") but it does
 not.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



Re: [Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-01-23 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+---
 Reporter:  anonymous|Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Core (URLs)  |  Version:  1.4-alpha-1
 Severity:  Normal   |   Resolution:  invalid
 Keywords:   | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+---
Changes (by julien):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => invalid
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I think your issue comes from the fact that you're using a noop function,
 so your url constants will never get translated. I suggest using
 [https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse-lazy
 reverse_lazy] instead. Please feel free to re-open if you disagree, but in
 that case please also provide an actual test case so it's easier to assess
 your problem.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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



[Django] #17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL

2012-01-20 Thread Django
#17568: i18n_patterns and LOGIN_URL, LOGOUT_URL, LOGIN_REDIRECT_URL
-+-
 Reporter:  anonymous|  Owner:  nobody
 Type:  Bug  | Status:  new
Component:  Core (URLs)  |Version:  1.4-alpha-1
 Severity:  Normal   |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0|  UI/UX:  0
-+-
 Hi,

 There is some bug with i18n_patterns and redirection after login/logout
 action. Sample code:

 {{{

 #urls.py

 urlpatterns = i18n_patterns('',
 ...
 (_(r'^auth/'), include('apps.my_auth.urls', namespace='auth')),
 )

 #settings.py

 ...
 gettext_noop = lambda s: s

 LOGIN_URL = gettext_noop('/auth/login/')

 LOGOUT_URL = gettext_noop('/auth/logout/')

 LOGIN_REDIRECT_URL = gettext_noop('/accounts/profile/')

 }}}

 The urls are translated (for "en" and "nl" language). Now login at
 http://server.com/en/auth/login/ redirect to /en/accounts/profile/ and
 also http://server.com/nl/nl_auth/nl_login/ redirect to
 /nl/accounts/profile/ but should to /nl/nl_accounts/nl_profile/

 I think there is a bug.

 Thanks.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

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