0

Hello and thank you in advance,

When I installed django-profiles and django-registration. I believe I followed a tutorial correctly on how to configure them:

http://agiliq.com/books/djenofdjango/chapter5.html#reusable-apps

Now when I try to access website.com/accounts I get a 404 page:

Using the URLconf defined in acme_p.urls, Django tried these URL patterns, in this order:

^$
^accounts/
^admin/doc/
^admin/

The current URL, accounts, didn't match any of these.

My urls files look like this:

#acme_p urls - Django Project

from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',

    url(r'^$', include('user_prof.urls')),

    # Examples:
    # url(r'^$', 'acme_p.views.home', name='home'),
    # url(r'^acme_p/', include('acme_p.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

user_prof urls.py - Django App one level below project mentioned above

from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^login/$', 'auth.views.login_user'),
    (r'^accounts/', include('registration.urls')),
#    (r'^accounts/', include('registration.backends.default.urls')),

)

Thank you for you help.

dp

Lycha
  • 9,937
  • 3
  • 38
  • 43
dpbklyn
  • 781
  • 3
  • 10
  • 19

2 Answers2

2

(r'^accounts/', include('registration.urls')), should be in the root urls.py not the app urls.py

platinummonkey
  • 808
  • 8
  • 19
  • Thank you. yes. I thought that would make more sense, I tried it there before posting here as a test and got a similar 404. I just tried again at your suggestion at still got the 404. – dpbklyn Feb 27 '12 at 18:51
  • and did you add `registration` in your `INSTALLED_APPS` in the root config, followed by `syncdb`? – platinummonkey Feb 27 '12 at 19:05
  • I did. I added it to my settings.py. In fact, I have registration_registrationprofile as a table in my db. I didn't create any views for this module, as it seemed from the tutorial that it would use generic views to display the information... – dpbklyn Feb 27 '12 at 19:25
1

There is no website.com/account in the configuration, there is only website.com/account/(more) where (more) has the rest of the url that is given to the django-registration module. You could try website.com/account/login/ for example to check if the django-registration module is working.

Also you should just put those on the root urls.py file.

Lycha
  • 9,937
  • 3
  • 38
  • 43
  • THANK YOU! I actually JUST figured this out when I get your comment. Can you point me toward a good tutorial or documentation on django-registration? Thank you, dp – dpbklyn Feb 27 '12 at 21:12
  • @dpbklyn Sorry, nothing comes to mind, but it's always useful to inspect the sourcecode yourself. [Link to urls.py](http://code.google.com/p/django-registration/source/browse/trunk/registration/urls.py). – Lycha Feb 27 '12 at 21:18