How to define permission sets in web application in python flask? - python

I am making a web applicaion in python with flask framework in which different types of users are there like admin, editior, normal user etc. So the application access is different for each. How to implement this?. After login application need to redirect to user related views . Please help to make this in a better way

There is a Flask extension Flask-RBAC which does exactly what you need:
Flask-RBAC provides a Role-based Access Control module in Flask
applications. It can help you to control different role of users to
access your website.

Related

How to make flutter mobile app associated to a django webapp?

I have a django webapp, which is a repository for alumni. Users can sign up using the extended user model and fill-in multiple fields. Then there is a detail page for each user that shows their respective data. All this is built using function based views. This bit is fine. But I also want to make its corresponding mobile apps for android and ios hopefully in flutter otherwise react native. My question is, should I host this as it is, or there are some basic things that I already need in the code so I can make a REST API and connect mobile apps later? I don't really have any knowledge about mobile apps and connecting django's REST API? So please guide me in this regard.
Thanks :)
There two ways to do it based in my knowldge :
1- using flutter web view in packages website only pick the best pkg for you .
2-or using HTTPS req by http pkg and make sure you have get and post in your backend like flask in paython or laraval php .
I hope I answred your question :)

Using Google/G-Suite as a user backend for django?

I'm looking at building a django app specifically designed for G-Suite domains. It requires users to be logged in to G-Suite, and would get permissions from groups in G-Suite. I know I could achieve this using django-allauth or similar, but that would involve the django app duplicating the user information in it's own database. In the interests of preventing unnecessary replication, is it feasible to have django directly use Google APIs to handle user logins, but still program the rest of the app in a django kind of a way? Are there any libraries that implement this? If not in django, are there other (python) frameworks that can do this?

Django Auth: Use external service (without Django-social-app)

How could I do to allow users to link their Gmail or Facebook account in my Django App ?
I'd like to avoid my clients to register in my site if they have an account in any of the common sites (Gmail, Facebook etc...)
I know the app Django Social Auth can be used for this purposes but I'd like to know how to do this auth by my own.
Can anyone point me to some documentation or small example ?
I'd like to do this kind of authentication by my own, without external app, I'm looking for information not anybody to solve my code
Thanks
Actually, you can try to find an example how to use OAuth2 technology in Django from different django app. I use django-allauth and you can try to copy some techniques from them.

user system with social authentication in django

I've read about a lot of different apps for django for integrating social authentication to django projects. But, I'm having some trouble understanding how this integration works
Does it extends the default USER models? Where do I find those kind of information in the applications?
I basically need a user system that has groups (for permission purposes). The user would be able to register using a common registration proccess or facebook. Will I be able to achieve that with any kind of application?
Thanks in advance.
There is an app called django-allauth. If you read their official documentation, it is pretty easy to follow. As per their instructions, you install the core app, and any other authentication you need (like facebook, oauth which google uses). Then, you have to go to facebook, get developers key, and add it to your django admin.
Basically, when somebody tries to login using facebook, the signin process sends the keys to facebook, and check if the user exists. If it does, then the authentication app creates user on the backend, just like a normal signin process. You can get javascript from facebook to make a login window.

Using OpenId with Bottle

So i'm creating a blog engine in python with bottle. I would like to be able to have it create and run it's own login system and use OpenId.
Can I use OpenId with bottle? If so how?
Bonus brownie points if you can tell me how to request information from the user profile through this.
Are there any other alternatives that works with Google?
Do you have any Tips or guides for making a secure login system?
BTW: I use python 3
Edit: I have decided to just move to Flask it has openid and heaps more.
I couldn't find any turnkey solution for this, but you might want to check out this simple auth class for bottle: https://github.com/bbrodriges/bottlepy-user-auth, which shows an example how to bind together your bottle webapp and your user database.
So by using this as a base and a implementing a wrapper class on the top of the python-openid library, and use it as the 'db' class in the linked auth class. You can also extend this class to handle further profile infos you need.

Categories