How to create a inter-interactive multi-user profile system in a Flask based Web App? - flask

database used: (sqlite3) {Flask SQLAlchemy}
Files description:
homepage : html page
login_page : html form page which takes in values like username/password
dashboard_page : html page which pulls out data from the database
I created a flask based web app, but up until now it is a single user based system (I haven't added auth measures yet.)
Like it has homepage -> Login Page -> dashboard page.
Now I want separate dashboard pages for separate users.
For Example: Fatima and Sana should see separate contents given that they are two separate users.
I seek basic guidance on where to start and what tools can be used to implement the forementioned steps.

First, create the user model to store users' data
then,
create the user registration part
create the user log-in part
create the user account part
create the user log-out part
And last make every thing responsive and check that again and again

Related

Django: Track specific user actions

How can I track specific user actions with Django.
For example:
user logged in
user changes password
user visited a specific page
rest api call within a specific view took 300ms
user deleted / updated / created a specific model
Is there a nice third party app which can do this for me and display this information in an human readable admin interface or at least in django-admin?
If there is no app out there. How would you do this with Django?

How to structure django admin for multiple users

I'm still a complete newbie on Django, so now I'm a little bit lost on what I could do to structure my server to suit my needs.
The situation is like this: my Django admin could be accessed by the admin and multiple users. Each user can add multiple item to the server, and the server will only allow them to retrieve, modify and delete item added by them and not the other users. They will also have some custom option they can pick: like receiving notifications through emails or another channels. Meanwhile, admin can see all items, and have a filter to see all items added by one user and all users's custom option.
Any help would be appreciated.
take a look here. this is where i started with custom user models. https://wsvincent.com/django-custom-user-model-tutorial/
Django has builtin user models with basic fields like username email and password and authentication. The above link will help you create custom user models and it will be a good place to start

Sitecore webforms for marketers save action

For a webshop i'm using Sitecore Webforms For Marketers. There is a multiple server configuration with 2 Content Delivery Server(CDS) and 1 Content Management Server(CMS). On the CDS servers is no possibility to write data, so i have configured a webservice to forward the form data from the CDS to the CMS server.
What's the goal? There are 2 forms where a user can:
Post a review for a product at the products detail page
Post a review for a product and select the product in a dropdownlist at a global
page
The problem is that i have less experience with Sitecore Webforms For Marketers. It's important that the review's parent item the right product is. I have read the developer manual and figured out there are several save actions, but not the one i prefer. Do I need to create a custom save action or is there a simple workaroud (e.g. with workflows)?
Thanks a lot!
Jordy
Create a save action that calls your web service and submits the data to your CM instance.

Django Creating app objects

I have been following along with the django tutorial and have Polls appearing in the administration panel of the site.
Additionally, I have, using django-registration package, created a way to allow a user to login and register a new account.
How do I grant this user permission to create objects in the Polls such that appear in the admin panel of the website?
Also, these users will not be staff so they will not be able to log in to the administration portion of the website. Is there a way to create Poll objects in a form?
Also, these users will not be staff so they will not be able to log in to the administration portion of the website. Is there a way to create Poll objects in a form?
This is literally what you do on page 4 of the django tutorial. Finish the tutorial, and you will answer your own question.
https://docs.djangoproject.com/en/dev/intro/tutorial04/#write-a-simple-form

single login for multiple apex application with in same workspace

We created 5 applications based on same schema and all in one workspace now. Actually, initially they were created on different machines. now, we have to authenticate users from AD and depending on user type, have to allow or deny some modules. i have created one pager application which have 5 buttons and can control rendering of buttons according to user logged in but...the problem is, inside the applications, i have restrictions on some reports for some users...now one way was to do that is to create a log in for every application separately and thus every application would exactly know who is logged in. but that would be impractical as we need single-sign-on kind of functionality.
please let me know how to have a single log in page work for all application inside the apex workspace so that every application would know name of the user currently logged in.
for the 5 applications, i actually use No_Authentication authentication scheme. and i use following function initially for my one pager application to render the buttons to user or deny
create or replace function getUserName return varchar2
is
userName varchar2(20);
c owa_cookie.cookie;
begin
c := owa_cookie.get('LOGIN_USERNAME_COOKIE');
userName := c.vals(1);
return trim(userName);
end;
but i cannot user this function obviously in my 5 actual applications.
help is requested please.
bundle of thanks in advance.
Check my answer here on sharing sessions: apex button to call a page in another application
What you need to do further: give each application an authentication scheme. Your non-authenticated applications need authentication too, you could copy the scheme from your main app and subscribe them to the main one, so any changes on the main would be reflected on the subscribed.
Most important: same cookie name in the auth scheme, and pass on the session when you link between applications.
If you want to redirect to your main app for each login that has to be performed, you need to add an application process to the login pages of your 'sub'-apps.
Put this in an On Load - Before Header:
htp.init();
owa_util.redirect_url('f?p=main_app:101'); --redirects
apex_application.g_unrecoverable_error := true; --stops processing
This will redirect to the login page of your main application when a user would land on a login page of your sub-applications.
You can also change the logout url of the authentication scheme. You can refer to your main page app for example.
Then you can use :APP_USER in your applications and skip the cookie method, they're the same.