Background Image
Table of Contents Table of Contents
Previous Page  276 / 478 Next Page
Information
Show Menu
Previous Page 276 / 478 Next Page
Page Background

Almost there. We switch on the auth backend and our new accounts app in

settings.py

:

superlists/settings.py.

INSTALLED_APPS

=

(

#'django.contrib.admin',

'django.contrib.auth'

,

'django.contrib.contenttypes'

,

'django.contrib.sessions'

,

'django.contrib.messages'

,

'django.contrib.staticfiles'

,

'lists'

,

'accounts'

,

)

AUTH_USER_MODEL

=

'accounts.ListUser'

AUTHENTICATION_BACKENDS

=

(

'accounts.authentication.PersonaAuthenticationBackend'

,

)

MIDDLEWARE_CLASSES

=

(

[

...

]

And a quick

makemigrations

to make the new user model real:

$

python3 manage.py makemigrations

Migrations for 'accounts':

0001_initial.py:

- Create model ListUser

And a

migrate

to build the database:

$

python3 manage.py migrate

[...]

Running migrations:

Applying accounts.0001_initial... OK

And we should be all done! Why not spin up a dev server with

runserver

and see how

it all looks

( Figure 15-1 )

?

248

|

Chapter 15: User Authentication, Integrating Third-Party Plugins, and Mocking with JavaScript