Giter VIP home page Giter VIP logo

django-registration's Introduction

Description

Django-registration provides user registration functionality for Django websites.

maintainers

Macropin, DiCato, and joshblum

contributors

list of contributors

image

image

image

Documentation Status

image

If you have issues with the "django-registration-redux" package then please raise them here.

This is a fairly simple user-registration application for Django, designed to make allowing user signups as painless as possible. It requires a functional installation of Django 3.1 or newer, but has no other dependencies.

Installation

Install, upgrade and uninstall django-registration-redux with these commands:

pip install django-registration-redux
pip install --upgrade django-registration-redux
pip uninstall django-registration-redux

To install it manually, run the following command inside this source directory:

python setup.py install

Or if you'd prefer you can simply place the included registration directory somewhere on your Python path, or symlink to it from somewhere on your Python path; this is useful if you're working from a Git checkout.

Note that this application requires Python 3.5 or later, and a functional installation of Django 3.1 or newer.

If you are running on Django <=2.0, you can install a previous version of django-registration-redux, which supports older versions of Django. See the CHANGELOG for support details. Older versions will receive minor bug fixes as needed, but are no longer actively developed:

pip install django-registration-redux==1.10

Getting started with development

To get started with development, first install the required packages:

make installdeps

For convenience a Makefile is included which wraps the Python invoke library. Once you work on a patch, you can test the functionality by running:

make test

Or equivalently:

invoke test

Command line arguments can be passed to the invoke script through the Makefile via the ARGS parameter. For example:

make build ARGS=--docs

Or equivalently:

invoke build --docs

Alternatives

djangopackages.com has a comprehensive comparison of Django packages used for user registration and authentication.

For example, django-allauth is an alternative to django-registration-redux that provides user registration in addition to social authentication and email address management.

License

Django-registration-redux is licensed under BSD License.

django-registration's People

Contributors

alorence avatar ameng avatar areski avatar arpitremarkable avatar dicato avatar falcon1kr avatar felixxm avatar heavenshell avatar jamesturk avatar joshblum avatar joshchandler avatar keattang avatar laginha avatar laurentblue avatar lydiagu avatar macropin avatar martey avatar mauler avatar mnp-fuf avatar nikolas avatar noogm avatar philiptzou avatar phondanai avatar quroom avatar srenatus avatar timgraham avatar tobiasmboelz avatar ubernostrum avatar vtemian avatar wtracy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-registration's Issues

WARNINGS: registration.RegistrationProfile.user

Getting this warning
"Performing system checks...
System check identified some issues:

WARNINGS:
registration.RegistrationProfile.user: (fields.W342) Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
HINT: ForeignKey(unique=True) is usually better served by a OneToOneField.

System check identified 1 issue (0 silenced).
"
Django 1.8. python3.4 postgres 9.4

What's wrong with schema?

How to rewrite the django-registration

The django-registration is perfect, but it not flexible enough. I want to add some function or warning messages to it. Like "Your username and/or password were incorrect!".What part I should change?

Pass cleaned form data to user_registered signal handler

If we use a custom form with backends.default.RegisterView (which should be possible according to the documentation, but can't actually be done as of now), cleaned form data should be passed to the signal handler to allow processing of extra fields.

I'm trying to upgrade from 0.8.0 where custom form (specifying it and handling its extra fields) could be handled by overriding the backend class. Now this may not be the right way to do it, but there is no easy way to achieve this (the only one seems to be subclassing RegisterView and providing my own urlconf).

How do I edit a file inside the egg file? (translating urls names)

Hello!

I'm in the process of translating url names, templates, etc..and I'd like to know if it would be a good idea to modify the urls.py and auth_urls.py files residing inside the egg (I've installed django-registration-redux using 'sudo pip install...')?

/usr/local/lib/python3.2/dist-packages/django_registration_redux-1.2-py3.2.egg

Or what about unzipping the egg, modify files, then rezippit again? If so, how that works? Or what about just unziping it? If so, how do I name the folder inside ../dist-packages/?

This problem has stumped me over the last two days. I have little idea on what to do. I'm so confused. In any case, am I going in the right direction?

This is my root urls.py
url(r'^cuenta/', include('django.contrib.auth.urls')),
url(r'^cuenta/', include('registration.backends.default.urls')),

Thanks in advance!

Registered users and activation keys are not appearing in admin.

I'm new to programming and might not ask correctly about my exact issue.

When I register users they are not appearing here /admin/registration/registrationprofile/.
Because of this there is also no activation keys and no activation emails being sent. I've followed the official doc, used the Tango With Django setup for registration-redux, and checked out 2 videos from YouTube (one, and two).

Any help and/or explanation on why I have encountered this problem?

Can't specify RegistrationForm (form_class) to be used by the default backend

It seems that there is no way to set the form_class for backends.default.RegsitrationView . The documentation says something about providing a keyword argument to 'registration()' (sic), but it seems to have been left there from an earlier version. At least I can't interpret it.

Also, I have looked through the code and can't see any sign of using anything but using the wired in form_class (specified in registration.views.RegistrationView). I would make it a setting in settings. If you are OK with it, I can create a pull request.

(Note, that I'm trying to upgrade from 0.8.0 where this could be handled through providing my own backend class.)

'AuthUser' object has no attribute 'backend'

I have customize my User model as describe in this article http://buildthis.com/customizing-djangos-default-user-model/. When I register new user then it successfully added to the record but after that error arises 'AuthUser' object has no attribute 'backend'?

Feature suggestion: Extendable Registration Profiles

While writing a custom backend for django-registration, I've had the requirement to extend the provided RegistrationProfile with additional fields to request from a user. For example, maybe you require knowing the user's company or location.

After a couple days of working, I have a very custom solution that works for my django project. It required:

  • subclass registration.models.RegistrationProfile and registration.models.RegistrationManager in order to add fields to the RegistrationProfile and account for them in RegistrationManager.create_inactive_user
  • subclass registration.admin.RegistrationAdmin in order to expose the new fields on RegistrationProfile. This mostly copy-and-pasted code.
  • subclass registration.forms.RegistrationForm in order to add the additional RegistrationProfile fields and expose them during the registration process.
  • subclass registration.backends.default.views.RegistrationView in order to override the form_class specifying my custom form as well as overriding RegistrationView.register in order to be able to pass the additional RegistrationProfile fields through to create_inactive_user.
  • copy-and-paste the registration.backends.default.urls exactly, only overriding the imports for my custom views instead of the default backed views.
  • remove registration from my project's settings.py, specifying my custom django-registration "backend application" instead, since at this point it's more of a custom django application than an overriding django-registration backend.

After doing this work, I started to think it would make sense to refactor the base views in registration as well as the provided backend views in order to allow the model being used to be more "pluggable". Specifically, follow the implementation of the form_class attribute in registration.views.RegistrationView, allowing the author of the custom backend to optionally specify a custom RegistrationProfile; a custom model.

I'm still thinking through potential side effects to backwards compatibility and project settings (for example my last bullet above mentioning the changes to my project's settings.py).

Is this something the project would benefit from? Does my thought process at least make sense? I'm going to spend some time working on this, but would love any feedback or ideas.

How to use all Forms for user registration

Hi guys,

I am new to this and I kinda need to use RegistrationFormUniqueEmail and RegistrationFormNoFreeEmail at the same time. I have tried to use the form class but I can only subclass one form at a time. Is there a way to use both subclasses at the same time?

Thanks in advance

Custom user

How provide a custom user, with addition fields (age or date born, id). Previous i use this model:
class People(models.Model):
user = models.OneToOneField(User)l
born = models.DateField() # born date

class Professor(People): # Ingeritance
identification_card = models.CharField(max_length=75)
department = models.CharField(max_length=75)

def __unicode__(self):
    return "Professor" + self.user.name + ' ' + self.user.surname

def get_absolute_url(self):
    return "/professor/%i/" % self.id 

redirect if user is logged in

It would be nice if a logged in user who visits the registration views gets redirected to the site root or maybe a configurable site.

Pass request down to send_activation_email

When generating activation emails, currently template context data does not include view's request. Passing that along from the view to model should not have any negative side-effects however will allow for more flexibility such as using {{ request.get_host }} to generate site URLs vs using {{ site }}.

Let me know if I should submit PR with this.

Migration failure when upgrading from 1.1 to 1.2

When I upgraded django-registration-redux from 1.1 to 1.2, and then ran ./manage.py migrate, I get the following error:

django.db.utils.ProgrammingError: relation "registration_registrationprofile" already exists

This is because the table was already created via a syncdb command, before the migrations were added to the codebase.

The migrations can be faked manually but I wonder if there is a way of handling this in your codebase.

Thanks for all your work on this package by the way!

Not installing in pip 6.0.8 and Fedora 22

Tried to install this today (pip3 install django-registration-redux) and got this traceback:

Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/pip/basecommand.py", line 232, in main
    status = self.run(options, args)
  File "/usr/lib/python3.4/site-packages/pip/commands/install.py", line 347, in run
    requirement_set.prepare_files(finder)
  File "/usr/lib/python3.4/site-packages/pip/req/req_set.py", line 229, in prepare_files
    req_to_install.check_if_exists()
  File "/usr/lib/python3.4/site-packages/pip/req/req_install.py", line 935, in check_if_exists
    self.satisfied_by = pkg_resources.get_distribution(self.req)
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 461, in get_distribution
    dist = get_provider(dist)
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 341, in get_provider
    return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 870, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 740, in resolve
    env = Environment(self.entries)
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 927, in __init__
    self.scan(search_path)
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 957, in scan
    self.add(dist)
  File "/usr/lib/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 977, in add
    dists.sort(key=operator.attrgetter('hashcmp'), reverse=True)
TypeError: unorderable types: NoneType() < str()

After updating pip to version 7.1 it worked. It seems that that is a common bug related to pypi (e.g. https://bitbucket.org/pypa/setuptools/issues/137).

el translation trivial fix

Hello, using django-rosetta app to let users able to translate my own project,
I found this "bug" in your locale .po file for the "el" language.

~/.virtualenvs/gf-dj17/lib/python2.7/site-packages/registration/locale/el/LC_MESSAGES/django.po
LINE 68
"Η εγγραφή μέσω δωρεάν διευθύνσεων ηλεκτρονικού ταχυδρομείου απαγορεύεται. ""Παρακαλώ δώστε κάποια άλλη."

I don't know el language but I think that line should just break between the two "" so my patch :) is 👍

"Η εγγραφή μέσω δωρεάν διευθύνσεων ηλεκτρονικού ταχυδρομείου απαγορεύεται. "
"Παρακαλώ δώστε κάποια άλλη."

Upgrade guide in documentation & Releases page conflict with each other

The upgrade guide in the documentation and the information on the Releases page conflict with each other. For example:

  • The documentation claims that 1.2 changes the parameters of the register method in RegistrationView; this is not mentioned on the Releases page
  • The Releases pages claims that 1.2 requires a base.html template; the documentation claims that 1.1 requires it.
  • The documentation claims that 1.1 requires HTML email templates. The Releases page does not mention this, but claims that at least one HTML email template can be disabled by setting REGISTRATION_EMAIL_HTML to False. The documentation does not mention REGISTRATION_EMAIL_HTML at all.

I think it would be easier for people to upgrade (and for everything to be maintained) if the changelog and backwards incompatible changes were stored in one (and only one) location.

Assumption that user models have 'username' field

There's a built-in assumption that all user models have a field named username . If django-registration-redux instead looked at get_user_model().USERNAME_FIELD, it would handle custom user models better, I think.

relation "auth_user" does not exist

Given a newly created django project with the following installed apps:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'registration',
)

When I run ./manage.py migrate for the first time I get the following error:

Operations to perform:
  Synchronize unmigrated apps: staticfiles, messages, registration
  Apply all migrations: sessions, admin, auth, contenttypes
Synchronizing apps without migrations:
  Creating tables...
    Creating table registration_registrationprofile
    Running deferred SQL...
Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/base.py", line 441, in execute
    output = self.handle(*args, **options)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 179, in handle
    created_models = self.sync_apps(connection, executor.loader.unmigrated_apps)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 317, in sync_apps
    cursor.execute(statement)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/Users/tcosta/Virtualenvs/django_project/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.ProgrammingError: relation "auth_user" does not exist```

It seems Django is trying to create the registration tables before the user table.

This erros does not happen if I comment the registration app and run migrate and then uncomment the registration app and run migrate again. However, that's not the right way of doing it, right?

Test app doesn't work

In urls.py it tries to do

from registration.views import LoginView

There is no LoginView.

New Release?

I was wondering if we could get a new release (1.2)?

/accounts/register redirects to /accounts/login

I downloaded the latest version, and configured as in the instructions:

urls.py, added:
url(r'^accounts/', include('registration.backends.simple.urls')),

settings.py, added:
registration to INSTALLED_APPS
REGISTRATION_OPEN = True

However, whenever I navigate to mysite.com/accounts/register it redirects to mysite.com/accounts/login

Is anyone else seeing this? Is there something we need to change in the django-registration's urls.py to prevent this?

Thanks,
Lauren

base.html

demo form registration_base_.html extends base.html .. which does not exist .. Is that an oversight or something expected to be written by user ?

django.core.urlresolvers.NoReverseMatch: Reverse for 'password_reset_confirm'

Django: 1.8
Python: 3.4

When a user tries to reset password, it throws exception:

django.core.urlresolvers.NoReverseMatch: Reverse for 'password_reset_confirm' with
    arguments '()' and keyword arguments '{'token': '444-9887c242917d1b6b7368',
    'uidb64': b'Mg'}' not found. 0 pattern(s) tried: []

NOTE the correct fix (as mentioned below) is to move django.contrib.admin below registration in INSTALLED_APPS in settings.py. I am leaving the following text only for record.

This thread on Stackoverflow solved it for me.

The reason for this error is that the django.contrib.auth.views use different url names than the registration.auth_urls ones. To patch this problem, override the default urls until django-registration-redux gets updated for django 1.6, and use the same names as Django.

from django.contrib.auth import views as auth_views

urlpatterns = patterns('',

      #override the default urls
      url(r'^password/change/$',
                    auth_views.password_change,
                    name='password_change'),
      url(r'^password/change/done/$',
                    auth_views.password_change_done,
                    name='password_change_done'),
      url(r'^password/reset/$',
                    auth_views.password_reset,
                    name='password_reset'),
      url(r'^password/reset/done/$',
                    auth_views.password_reset_done,
                    name='password_reset_done'),
      url(r'^password/reset/complete/$',
                    auth_views.password_reset_complete,
                    name='password_reset_complete'),
      url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
                    auth_views.password_reset_confirm,
                    name='password_reset_confirm'),

      #and now add the registration urls
      url(r'^accounts/$', include('registration.backends.default.urls')),
)

Can't override email template as Django returns original as first match

After upgrading from old django-registration to redux version my email template rendering blow up.

When I use django:
loader.select_template(['registration/activation_email.txt'])
I get the django-registration original template (while my overriden template is in my_app/templates/registration/activation_email.txt). The my_app/templates is discovered by AppDirectory template loader, it's on the django.template.loaders.app_directories.app_template_dirs folders list, but after "registration" app templates folder (as it's after "registration" on the INSTALLED_APPS lists).

select_template calls get_template which returns first match. For some reason it worked before, but now (Django 1.7.7 and @master django-registration-redux) it does not. I can hack it by providing dirs value (either filtered or reversed):

    from django.template.loaders.app_directories import app_template_dirs
    dirs = sorted(app_template_dirs, reverse=True)
    template = loader.select_template(['registration/activation_email.txt'], dirs=dirs)

But it would be good to know why and what is going on. It should "just work".

document use of DEFAULT_FROM_EMAIL

This is a small thing, but it would be nice to document the use of DEFAULT_FROM_EMAIL and/or allow this to be set differently from the standard django setting. Perhaps REGISTRATION_DEFAULT_FROM_EMAIL which is set to DEFAULT_FROM_EMAIL by default (!)

Passing extra context to registration form

Hi,
I'm struggling with this for a while, , and i hope anyone can help me.

I'm trying to pass extra context (model objects) to
registration/registration_form.html

i red the docs few times and tried multiple solutions but nothing works. :(

Adding registration form on multipe pages

I want to add the registration form to my home page but also have it on the normal accounts/register. I couldn't find anything online, any help or direction appreciated.

Activation failed - email clients likely pre-fetching the activation URL?

Has anyone else run into email clients, specifically web based ones, pre-fetching the activation URL? This causes the User's email to be verified and therefore activated. When the User subsequently requests the activation URL, they are presented with a failure message, but their account has actually already been activated.

Given the design of setting the activation key to ALREADY_ACTIVATED, and passing the requested activation key back to the activation complete view upon failure, I don't see a straightforward way to distinguish between failures due to the User already being activated and every other failure scenario.

Syndb and south migration fails with Django 1.5.11: You have no migrations for the 'registration' app. You might want some.

Hi,

I'm using Django 1.5.11 and I've installed django-registration-redux 1.2, 1.2c0, and 1.3a0 and neither syncdb nor south migrations appear to be working and running the South migration command fails with:

You have no migrations for the 'registration' app. You might want some.

'register' is added to INSTALLED_APP.

Here's the output from syncdb:

$ python manage.py syncdb
Syncing...
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 10 object(s) from 1 fixture(s)

Synced:
 > grappelli
 > radmin
 > admin_timeline
 > singleton_models
 > adminactions
 > django.contrib.admindocs
 > django.contrib.admin
 > south
 > django.contrib.auth
 > django.contrib.contenttypes
 > django.contrib.sessions
 > django.contrib.sites
 > django.contrib.messages
 > django.contrib.markup
 > django.contrib.staticfiles
 > captcha
 > honeypot
 > publications
 > django.contrib.comments
 > debug_toolbar
 > djcelery_email
 > rest_framework

Not synced (use migrations):
 - reversion
 - explorer
 - sbgrid_contacts
 - sbgrid
 - custom
 - flatpages
 - django_extensions
 - registration
(use ./manage.py migrate to migrate these)

And the output from running the South migrate command:

$ python manage.py migrate

Running migrations for reversion:
- Nothing to migrate.
 - Loading initial data for reversion.
Installed 0 object(s) from 0 fixture(s)
Running migrations for explorer:
- Nothing to migrate.
 - Loading initial data for explorer.
Installed 0 object(s) from 0 fixture(s)
Running migrations for custom:
- Nothing to migrate.
 - Loading initial data for custom.
Installed 0 object(s) from 0 fixture(s)
Running migrations for flatpages:
- Nothing to migrate.
 - Loading initial data for flatpages.
Installed 0 object(s) from 0 fixture(s)
Running migrations for django_extensions:
- Nothing to migrate.
 - Loading initial data for django_extensions.
Installed 0 object(s) from 0 fixture(s)
? You have no migrations for the 'registration' app. You might want some.

This is in a virtualenv and I can see the migration files in the virtualenv:

 ls ~/.virtualenvs/sbgrid_v2/lib/python2.7/site-packages/registration/migrations/
0001_initial.py     0001_initial.pyc    __init__.py     __init__.pyc

User model loaded before models are ready in registration/users.py:7

We encountered this problem during our nightlies (log below), searching the internet it seems that we're not the only ones with the problem (see http://stackoverflow.com/a/27845576/4783965 for a probable fix). Having checked django-registration-redux code I'm confirming that the user model is still being loaded during import time which will not work during django installed app population.

Log output:

+ ./test.sh --with-coverage '--cover-package=oioioi' --cover-html '--cover-html-dir=coverage' '--html-file=test_report/new_index.html'
Traceback (most recent call last):
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/bin/django-admin.py", line 5, in <module>
    management.execute_from_command_line()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
  File "/usr/share/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django_nose/__init__.py", line 4, in <module>
    from django_nose.runner import *
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django_nose/runner.py", line 262, in <module>
    class BaseRunner(DiscoverRunner):
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django_nose/runner.py", line 264, in BaseRunner
    options = _get_options()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django_nose/runner.py", line 123, in _get_options
    config.plugins.addPlugins(list(_get_plugins_from_settings()))
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django_nose/runner.py", line 103, in _get_plugins_from_settings
    mod = import_module(p_mod)
  File "/usr/share/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/src/oioioi/base/tests/__init__.py", line 49, in <module>
    from oioioi.base.middleware import UserInfoInErrorMessage
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/src/oioioi/base/middleware.py", line 14, in <module>
    from oioioi.base.views import has_valid_username
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/src/oioioi/base/views.py", line 21, in <module>
    from oioioi.base.forms import UserForm
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/src/oioioi/base/forms.py", line 8, in <module>
    from registration.forms import RegistrationForm
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/registration/forms.py", line 19, in <module>
    User = UserModel()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/registration/users.py", line 7, in UserModel
    return get_user_model()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 137, in get_user_model
    return django_apps.get_model(settings.AUTH_USER_MODEL)
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 199, in get_model
    self.check_models_ready()
  File "/home/users/sio2devel/.hudson/jobs/oioioi-nightly-unittests/workspace/nightly-virtualenv/lib/python2.7/site-packages/django/apps/registry.py", line 131, in check_models_ready
    raise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet.

AttributeError when using Django 1.8

Hi, when I run ./manage.py runserver or ./manage.py shell with django 1.8 and python3 it raises an exception and exits (with py3 and django 1.7 it works perfect):

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/path/to/virtualenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/path/to/virtualenv/lib/python3.4/site-packages/django/core/management/__init__.py", line 312, in execute
    django.setup()
  File "/path/to/virtualenv/lib/python3.4/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/path/to/virtualenv/lib/python3.4/site-packages/django/apps/registry.py", line 108, in populate
    app_config.import_models(all_models)
  File "/path/to/virtualenv/lib/python3.4/site-packages/django/apps/config.py", line 198, in import_models
    self.models_module = import_module(models_module_name)
  File "/path/to/virtualenv/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/path/to/my/project/registration/models.py", line 31, in <module>
    class RegistrationManager(models.Manager):
  File "/path/to/my/project/registration/models.py", line 97, in RegistrationManager
    create_inactive_user = transaction.commit_on_success(create_inactive_user)
AttributeError: 'module' object has no attribute 'commit_on_success'

Unnecessary mess with class-based view prototypes

The current views.py overrides many methods from Django View to "pass the HTTP request nearly everywhere, to enable finer-grained processing". Thing is, request is already available everywhere using self.request. As a result, when subclassing RegisterView, we have to deal with these weird prototype changes and code becomes messy.

What is the rationale for this? Would that be OK if I create a PR where I remove these (unecessary, AFAICT) overrides?

Templates are not installed

I believe that we should ship and install a base set of templates that at least provide a starting point.

Currently the templates included here are not installed by default. Modification to setup.py is required.

Previously the following was given as the reason for not shipping templates.

Does |project| come with any sample templates I can use right away?
Yes, for two reasons:

1. Providing default templates with an application is generally
   hard to impossible, because different sites can have such
   wildly different design and template structure. Any attempt to
   provide templates which would work with all the possibilities
   would probably end up working with none of them.

2. A number of things in |project| depend on the
   specific :ref:`registration backend <backend-api>` you use,
   including the variables which end up in template
   contexts. Since |project| has no way of knowing in
   advance what backend you're going to be using, it also has no
   way of knowing what your templates will need to look like.

Fortunately, however, |project| has good documentation
which explains what context variables will be available to
templates, and so it should be easy for anyone who knows Django's
template system to create templates which integrate with their own
site.

Cannot include the urls with namespace

Right now, adding

url(r'^accounts/', include('registration.backends.default.urls', namespace='accounts')),

to my urls.py file will cause an error anywhere in my template where I use {% url 'accounts:auth_password_change' %}

This is probably because of the line

{'post_change_redirect': reverse_lazy('auth_password_change_done')}

which causes the template engine to go reverse 'auth_password_change_done' when it should actually reverse 'accounts:auth_password_change_done'.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.