0

I am trying to use the django-user-accounts package from pinax. I am completely new to django, and I get stuck at some point, I've been struggling for hours but I still cannot display the account/signup page.

So, I have the following line in my urls.py:

url(r"^account/", include("account.urls")),

Then, I went to check in the urls.py of the account package, and it countains this line.

url(r"^signup/$", SignupView.as_view(), name="account_signup"),

So, when I give the address: 127.0.0.1:8000/account/signup/ in my browser, I think that django should give back the SignupView. But I don't really know what the "as_view()" function does. Usually the second argument of url() should be a function that returns a HTMLResponse. So I went to see in the views.py of the account package: The class SignupView has an attribute

template_name = "account/signup.html"

I would expect the HTMLResponse returned by SignupView.as_view() to be using this template but it doesnt. Instead, I got this error:

TypeError at /

'str' object is not callable

Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 1.6.1 Exception Type: TypeError Exception Value:

'str' object is not callable

Exception Location: /usr/lib/python2.7/dist-packages/django/core/handlers/base.py in get_response, line 112 Python Executable: /usr/bin/python Python Version: 2.7.6

Note that this is just the default behaviour of django-user-accounts, I have not modified anything. So I guess that I am missing a dependency or something, but I cannot interprete the error message. By the way, the returned error is exaclty the same as when I give this address in the browser 127.0.0.1:8000/. Here I expect to receive an error because I have no home page yet, but still, why does the SignupView try to get the html of the root page ???

I am stuck here and I have no idea how I can try to debug this. Any hints would be more than welcome.

guigux
  • 113
  • 2
  • Did you try http://stackoverflow.com/questions/4668040/django-str-object-is-not-callable ? – Sylvain Biehler May 15 '15 at 10:34
  • Since it fails with `127.0.0.1:8000/`, it is probably not related to SignupView. Can you show the full `urls.py` for application and for module ? – Sylvain Biehler May 15 '15 at 11:35
  • Thanks! I added a dummy view for the index page at / , and now I got through it. I still don't really understand why django needed to access the root page of the project, but know it seems to work (well, I landed into another issue, but hopefully this is one I can manage). – guigux May 15 '15 at 19:57

1 Answers1

0

So, the problem has been solved thanks to a comment of Bilou06, the problem was actually caused by another line in the urls.py of the project, because the root of the project was pointing to an indexView that did not exist.

guigux
  • 113
  • 2