15

So I've installed django-registration through easy_install. I'm following a quick start guide and I'm trying to setup my urlConf, however it says module named backends.defauls.urls is not found. What might be the problem ?

import registration
(r'^accounts/', include('registration.backends.default.urls')),
Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
Marijus
  • 813
  • 2
  • 8
  • 13
  • 6
    I think this is happening because you are following the documentation for a later version than you have. registration.backends.default.urls is going to be deprecated in version 0.9 and then removed. Could you have a version in which registration.urls is still correct? – hughdbrown Nov 23 '10 at 20:11

4 Answers4

27

(not my solution, but since it was hidden in a comment)

You need to use use include('registration.urls'),

instead of include('registration.backends.default.urls')

markijbema
  • 3,985
  • 20
  • 32
4

Is the registration module in your PYTHONPATH?

mipadi
  • 398,885
  • 90
  • 523
  • 479
  • 14
    It is. Problem solved, I had to use include('registration.urls'), why does the docs say I should use include('registration.backends.default.urls') when it doesn't work.. – Marijus Nov 23 '10 at 20:13
2

I'd suggest always getting django-registration from Bitbucket: https://bitbucket.org/ubernostrum/django-registration/overview.

I had a similar problem where I installed django-registration using pip install and it wasn't giving me up-to-date code.

niceguydave
  • 401
  • 2
  • 12
  • Agreed, grab from bitbucket to get latest, but the docs are still incorrect - @Marijius has the correct include statement that fixes the problem. – Han May 09 '11 at 16:41
1

I had the same problem. Apparently the server where I'm trying to upload the urls.py script has an older version, 0.7 I think.

My initial workaround was to put django-registration as an app (from the source) and include it in INSTALLED_APPS, with the registration folder right alongside my other apps.

Then the new problem was that the installed version is being looked up before the 'custom' app, especially on imports. For example, in views.py, we have an

from registration.backends import get_backend

which seems to be missing from the 0.7 version. So this raises an exception, but checking on the registration app the function is there in registration/backend/init.py.

This causes clashes between the custom registration app (0.8) and the one installed server-wide (0.7) that I can't seem to get around to.

Arbie Samong
  • 1,195
  • 1
  • 15
  • 17