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

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 :)

Related

How do I implement single sign on Django with Azure Ad. Any clues are highly appreciated

Hi I am creating a web application in Django that integrates with Azure AD. My goal is to enable single sign on capability to my web application and I'm not sure about where to start. Please help with good references. Djangorestframework integration will be helpful
Please refer this SO thread
If you want to implement on server
Make sure to Add simple_sso.sso_server to INSTALLED_APPS, Create an instance of simple_sso.sso_server.server.Server and include valueget_urls method
If you want to implement on Client
Create a new instance of simple_sso.sso_server.models.Consumer on the Server. add SIMPLE_SSO_SECRET and SIMPLE_SSO_KEY provided by server model simple_sso.sso_server.models.Client
Add SIMPLE_SSO_SERVERwith correct url to root simple_sso.sso_server.urlswhere you include on server and add simple_sso.sso_client.urls on client.
To configure setting's in python Replace your AUTH_ADFS with this.
To do so, login to your ADFS server and click the relying party trust created with the Django app and check all the details regarding the federation properties like data XML link, claims and attributes passing rules, etc ..
For more information in detail, please refer below links:
GitHub - divio/django-simple-sso
Implementing Single Sign On (SSO) using Django
python - How to implement single sign-on django auth in azure ad? - Stack Overflow

Authenticate a Django/Appengine project using Firebase

I currently have google and facebook authentication for my application. I would like to add firebase-auth as the backend for my Django/appengine backend. The tutorial i followed (https://cloud.google.com/appengine/docs/standard/python/authenticating-users-firebase-appengine) only show how to use it for a python Flask backend.
Does anyone know how to set up firebase in a Django backend that uses appengine?
You should follow the same logic mentioned in the tutorial that you indicated here. As per the documentation informs:
The sample app uses Flask because of its simplicity and ease of use, but the concepts and technologies explored are applicable regardless of which framework you use.
So, the concepts are the same for any framework, which should work for you using Django. Since there isn't a specific tutorial for the use of Django, I recommend you take a look at the below article, to better understand the integration of Firebase and Django, so you can implement it on your
Python Django with Google Firebase : Getting Started, Intro, Basic Configuration & Firebase Authentication #Part1
Let me know if the information helped you!

Is it possible to make a mobile app in Django?

I was wondering if it is possible for me to use Django code I have for my website and somehow use that in a mobile app, in a framework such as, for example, Flutter.
So is it possible to use the Django backend I have right now and use it in a mobile app?
So like the models, views etc...
Yes. There are a couple ways you could do it
Use the Django Rest Framework to serve as the backend for something like React Native.
Build a traditional website for mobile and then run it through a tool like PhoneGap.
Use the standard Android app tools and use Django to serve and process data through API requests.
Update for 2022: This article from AppPresser provides alternatives to PhoneGap which was mentioned in the other answer. These alternatives can be used to package web native sites as mobile apps.
The alternatives listed are:
Bitrise
Ionic
The honorable mentions were:
Appcircle
Appcenter
CodeMagic
Codeship

Django, Angular, & DRF: Authentication to Django backend vs. API

I'm building an app with a Django backend, Angular frontend, and a REST API using Django REST Framework for Angular to consume. When I was still working out backend stuff with a vanilla frontend, I used the provided Django authentication to handle user auth- but now that I'm creating a REST based app, I'm not sure how to approach authentication.
Since all user data will be either retrieved or submitted via the API, should API authentication be enough? If so, do I need to remove the existing Django authentication middleware?
Right now, when I try to hit API endpoints on an early version of the app, I'm directed to what looks like the normal Django login form. If I enter a valid username and password, it doesn't work- just prompts to login again. Would removing the basic Django authentication prevent this? I want to be prompted to login, however I'm not sure how to handle that with these technologies.
The package django-rest-auth seems useful, and the same group makes an Angular module- but the docs don't go much past installation and the provided endpoints. Ultimately, I think the core of this question is: how do I entirely switch authentication away from what's provided by Django to something like django-rest-auth or one of the other 3rd party packages recommended by DRF?
edit: I made this comment below, but I realized that I need to figure out how combined auth will work. I'm not building a single page app, so individual basic pages will be served from Django, but each page will hit various API endpoints to retrieve the data it needs. Is there a way to have something like django-rest-auth handle all authentication?
To anyone that stumbles onto this question, I couldn't figure out how to make the hybrid approach work. Having Django serve pages that each contained API calls seemed OK, but I never saw any requests made to the API- I believe due to some other security issues. I'm sure it's possible, but I decided to go for the single page app implementation after all to make things simpler.

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.

Categories