Skip to main content

Posts

Showing posts with the label authentication

Setting up user logins

I've been meaning to experiment with user authentication in Django for awhile now, but I kept putting it off. I finally created a new pet project and decided that user authentication was the first thing I wanted to set up for my project. Django has a built-in User model but the Django documentation highly encourages us to set up a custom user model. Just in case you need to customise it at some point. Even if you have no need for it right now. Looking at the Django documentation was really overwhelming(surprise!) so I looked around for a tutorial I could follow. I've already started a project, so I had to fit whatever tutorial into what I had already set up. The learndjango tutorial(link below) seemed easy enough to follow. Step 1 : Create a 'User' app   Done. Step 2: Create the initial custom user model First, I had to add 'users.apps,UsersConfig' to the INSTALLED_APPS. mainapp/settings.py Next, I had to tell Django to use my custom user model. mainapp/settings...