Well, this solution doesn't work for me.
Setting urls to:
____________________________________________________________________________________________
from django.conf.urls.defaults import *
from django.contrib.auth.views import login, logout
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
(r'^djmsb/accounts/login/$', 'django.contrib.auth.views.login',
{'template_name': 'login.html'}),
(r'^djmsb/accounts/logout/$', logout),
(r'^$', 'djmsb.views.indice'),
(r'^biblioteca/', include('djmsb.biblioteca.urls')),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/(.*)', admin.site.root),
)
____________________________________________________________________________________________
[Beware the "r'^$'", "r'^admin/(.*)'" and "r'^biblioteca/' urls work
correctly because of the "PythonOption django.root /djmsb" line in the
apache.conf (see my first message)]
Generates two errors:
In production the apache2 url "http://localhost/djmsb/" is redirected to
the incorrect url "http://localhost/accounts/login/?next=/djmsb/" as
before (no /djmsb/ in the url)
In development the "http://localhost:8000/" gives the error:
________________________________________________________________________________________________
Page not found (404)
Request Method: GET
Request URL: http://localhost:8000/accounts/login/
Using the URLconf defined in djmsb.urls, Django tried these URL
patterns, in this order:
1. ^djmsb/accounts/login/$
2. ^djmsb/accounts/logout/$
3. ^$
4. ^biblioteca/
5. ^admin/doc/
6. ^admin/(.*)
The current URL, accounts/login/, didn't match any of these.
________________________________________________________________________________________________
It seems that erroneous url is generated by the
"@login_required(redirect_field_name='next')" statement in views.py
I'm very confused.
What can I try?
There is any documentation about an entire site under access control?
Thanks
Mirto
R. Gorman ha scritto:
> Ah, I see. I didn't see that on the first read through - I think I
> need a nap. Your URLs are lacking the /djmsb/ because that's how you
> currently have your url.py patterns setup. You just need to add
> 'djmsb/' to the front of your urls:
>
> from django.conf.urls.defaults import *
> from django.contrib.auth.views import login, logout
> from django.contrib import admin
> admin.autodiscover()
>
> urlpatterns = patterns('',
> (r'^djmsb/accounts/login/$', 'django.contrib.auth.views.login',
> {'template_name': 'login.html'}),
> (r'^djmsb/accounts/logout/$', logout),
> (r'^djmsb/$', 'djmsb.views.indice'),
> (r'^djmsb/biblioteca/', include('djmsb.biblioteca.urls')),
> (r'^djmsb/admin/doc/', include('django.contrib.admindocs.urls')),
> (r'^djmsb/admin/(.*)', admin.site.root),
> )
>
> R.
> >
>
>
--
_________________________________________________________________________
Busico Mirto Silvio
Consulente ICT
cell. 333 4562651
email [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---