straight55b / app-engine-patch

Automatically exported from code.google.com/p/app-engine-patch
0 stars 0 forks source link

GoogleAuthentication {% url %} error when no sample apps installed #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Download AEP 1.0beta6
2. In settings.py enable GoogleAuthenticationMiddleware + AUTH_USER_MODULE
+ AUTH_ADMIN_MODULE
3. In settings comment out myapp and registration
4. Remove from base.html {% url %} for commented apps

What is the expected output? What do you see instead?
Static page with login link, but I see:

NoReverseMatch: Reverse for 'settings.myapp.views.list_people' with
arguments '()' and keyword arguments '{}' not found.

What version of the product are you using? On what operating system?
AppEnginePatch 1.0beta6, Linux, SDK 1.1.9

Please provide any additional information below.
Enabling both sample apps in settings removes the problem. Adding
"settings." to name of url in regadija too ;) I've no time today to look
for a fix, but for me seems related to urlsauto magic: enabling both apps
but also adding them to IGNORE_APP_* makes the problem reappear.

Original issue reported on code.google.com by jonca.rafal on 17 Feb 2009 at 8:09

GoogleCodeExporter commented 9 years ago
In templates/base.html I link to a few views in myapp, so you have to change the
template, too.

Original comment by wkornew...@gmail.com on 17 Feb 2009 at 9:47

GoogleCodeExporter commented 9 years ago
Sorry Waldemar, I have copy pasted error that i had previously that have you 
pointed
to that conclusion. The problem was the *settings* part in reverse link.

Now I have both apps disabled and I'm showing home page main.html using below 
content:

{% if user.is_authenticated %}
    Welcome, {{ user.username }}!
    <a href="{% url django.contrib.auth.views.logout %}">Logout</a>
{% else %}
    <a href="{% url django.contrib.auth.views.login %}">Login</a>

No usage of base and other views url. I'm getting the below error:

NoReverseMatch: Reverse for 'settings.django.contrib.auth.views.logout' with
arguments '()' and keyword arguments '{}' not found.

I've also tested simpler change: just enable Google Auth Middleware and remove
registration app to get the error with above main.html file content.

Original comment by jonca.rafal on 18 Feb 2009 at 5:48

GoogleCodeExporter commented 9 years ago
Do you integrate ragendja.auth.urlsauto.urlpatterns (like in the latest sample
project, see auth_patterns)? If not, then "registration" is the only app that 
defines
urls for those views and if you remove it there indeed is no reverse match.

Original comment by wkornew...@gmail.com on 18 Feb 2009 at 7:39

GoogleCodeExporter commented 9 years ago
I think the problem is different:

The reverse is looking for: 'settings.django.contrib.auth.views.logout' not
'django.contrib.auth.views.logout'. If i simulate the
'settings.django.contrib.auth.views.logout' in ragendja.auth by adding 
settings. to
name, everything works. But in general the reverse shouldn't be looking for
settings.*something. I'm try to test it further in the evening.

Regadija is in installed paths and I have checked: ragendja.auth.urlsauto is
executed. Django adds reverse for 'django.contrib.auth.views.logout', just then 
the
above main.html strangely is looking for 
'settings.django.contrib.auth.views.logout'...

Original comment by jonca.rafal on 18 Feb 2009 at 8:48

GoogleCodeExporter commented 9 years ago
I'm sorry. I've found your issue. It looks like naming a pattern by some 
existing
function's import path breaks Django's reverse() function.

BTW, I've often seen Django say that it can't find the reverse for 
"settings.xxx",
but it actually tried to find "xxx". I don't know why this is happening.

Original comment by wkornew...@gmail.com on 18 Feb 2009 at 9:29

GoogleCodeExporter commented 9 years ago
why the status if fixed and I am still bothered by this

Original comment by xiaona...@gmail.com on 28 Mar 2009 at 4:05

GoogleCodeExporter commented 9 years ago
Please post a complete traceback.

Original comment by wkornew...@gmail.com on 29 Mar 2009 at 10:42