A RESTful password locker with Django and backbone.js part 4

Django + rest framework + backbone.js = awesome..

London Python developer/AWS devop engineer

So far we’ve got a single-user password storing application. That’s not very secure or useful 🙂 So now we’re going to support multiple users and lock down the app so users must be authenticated. We’ll also lock down the REST API.

There’s now sufficient code that I’ll point you in the direction of certain files in the repository for some of the more standard Django code for things such as user registration.

Supporting multiple users

I created a registration form in `apps/users/forms.py` and updated `urls.py` so the django registration app would use it. The registration form asks for users first and last names, email address, a user name and their password (twice). This is pretty standard stuff.

Now users can register, we need to update the Password model in `apps/passwords/models.py` so passwords are associated with the user that created them. Add a new foreign key to django.contrib.auth.models.User:

We’ll use…

View original post 789 more words


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s