Skip to main content

Posts

Showing posts with the label authentication

mongodb authentication setting

The administrator of the database is the right person for the task of granting, or denying, permissions to users for doing operations with database resources. By using roles, we can specify what action can be done with a resource. Therefore, a role is a privilege granted to a user to do specific tasks with specific resources. Before you enable access control, you should create a user that can then create users and assign roles to them once access control is enabled.This user-admin will then be used to create and maintain other users and roles, so needs to be assigned a suitable role to enable it to do so. I assume you already have admin user set up within you system if not refer hare before proceeding. The role userAdminAnyDatabase in MongoDB gives ability to create users and assign roles to them, but by itself it doesn’t allow the user to do anything else. The superuser role in MongoDB is the root . In the this post i will show how to create, show and delete a user in...

django user authentication how to login, logout and Register

This post will demonstrate the necessary step's that you will need to follow when you want to build  authentication system with you Django framework using the built-in user authentication system . You can get the code of this project on github Start with clean work space where Django app is going to live  mkdir news-wire cd news-wire Time to setup virtual eviroment, install django and kickoff the project python3 -m venv venv source venv/bin/activate pip3 install Django django-admin startproject news_art House keeping mv news_art/manage.py ./ mv news_art/news_art/* news_art/ rm -r news_art/news_art/ nano news_art/settings.py ALLOWED_HOSTS = [ '*' ] ---------- We want to acsses our app from anywhere Django automatically installs the auth app when a new project is created. This can be reveled in the settings.py under INSTALLED_APPS and you can see auth is one of several built-in apps Django has installed. INSTALLED_APPS = [   ...