Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

I've edited the database.py with the database creation. It will add a default user of admin, password admin, and role of admin After the app.secret_key in app.py I added db = Database() db.create() d...
menator01 Web Scraping & Web Development 13 465 May-04-2024, 07:08 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

Yes, that is correct.
menator01 Web Scraping & Web Development 13 465 May-04-2024, 07:02 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

It's one of the fields in the database. It is retrieved when getting a valid user. I then set it as a session variable.
menator01 Web Scraping & Web Development 13 465 May-04-2024, 06:47 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

(May-04-2024, 06:38 PM)erdemath Wrote: OK, it also finally worked for me. Thank you so much. Now, the next question. How would you define users with their activities? Some dictionary, or and html ...
menator01 Web Scraping & Web Development 13 465 May-04-2024, 06:42 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

(May-04-2024, 06:18 PM)erdemath Wrote: (May-03-2024, 07:08 PM)menator01 Wrote: Although I do not have a role system setup, here is a basic example that I was playing around with a while back. Hope...
menator01 Web Scraping & Web Development 13 465 May-04-2024, 06:26 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

It works for me. I've edited app.py a little [Video: https://youtu.be/pVH1B3rBkko]
menator01 Web Scraping & Web Development 13 465 May-04-2024, 06:19 PM
    Thread: Flask role-based authorization
Post: RE: Flask role-based authorization

Although I do not have a role system setup, here is a basic example that I was playing around with a while back. Hope it helps. I installed gunicorn in the venv and it ran fine. On a side note you can...
menator01 Web Scraping & Web Development 13 465 May-03-2024, 07:08 PM
    Thread: [SOLVED] Loop through directories and files one level down?
Post: RE: Loop through directories and files one level d...

Did you check out os.walk? https://www.w3schools.com/python/ref_os_walk.asp
menator01 General Coding Help 3 271 Apr-28-2024, 01:51 PM
    Thread: How to edit Tkinter Minimize, Maximize, and Close Buttons
Post: RE: How to edit Tkinter Minimize, Maximize, and Cl...

From the link I provided, I don't think you can directly edit the titlebar as it's managed by the systems window manager. Probably best option is to use root.resizable(False, False) A way to detect ...
menator01 General Coding Help 7 352 Apr-26-2024, 10:44 AM
    Thread: How to edit Tkinter Minimize, Maximize, and Close Buttons
Post: RE: How to edit Tkinter Minimize, Maximize, and Cl...

This will remove the titlebar import tkinter as tk root = tk.Tk() root.overrideredirect(True) # This removes the title bar. root.mainloop()More can be found here https://blog.finxter.com/5-best-ways-...
menator01 General Coding Help 7 352 Apr-26-2024, 10:11 AM
    Thread: How To Make A PyQt5 Progress Bar Run While Executing A Function
Post: RE: How To Make A PyQt5 Progress Bar Run While Exe...

Maybe this link will help. Seems to be what you are trying to do. https://realpython.com/python-pyqt-qthread/
menator01 GUI 1 296 Apr-26-2024, 02:18 AM
    Thread: Good way to ignore case when searching elements?
Post: RE: Good way to ignore case when searching element...

You might could try something like this from bs4 import BeautifulSoup html_doc = """ <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" charset="UTF-8...
menator01 General Coding Help 1 226 Apr-25-2024, 12:39 PM
    Thread: how to edited Tkinter Toplevel from main form?
Post: RE: how to edited Tkinter Toplevel from main form?

I'm not sure. I do it that way so root is not the parent window. It is its own parent.
menator01 General Coding Help 7 383 Apr-24-2024, 12:28 PM
    Thread: how to edited Tkinter Toplevel from main form?
Post: RE: how to edited Tkinter Toplevel from main form?

Are you trying to do something like this? from tkinter import Button, Label, Toplevel, Tk def edit(window): window.title('Edited Top Window Title') def openwindow(): window = Toplevel(None) ...
menator01 General Coding Help 7 383 Apr-24-2024, 12:07 PM
    Thread: Using Lists as Dictionary Values
Post: RE: Using Lists as Dictionary Values

Can you post the code you are using?
menator01 General Coding Help 8 412 Apr-19-2024, 08:57 PM
    Thread: How do I parse the string?
Post: RE: How do I parse the string?

Another way astring = 'FTP://21.105.28.15/abc/test1.txt' astring2 = 'FTP://21.105.28.15/abc/def/test1.txt' def remover(astring): astring = astring.split('/') for index, item in enumerate(astr...
menator01 General Coding Help 4 381 Apr-10-2024, 10:23 AM
    Thread: tkinter - Random Quote from internet
Post: tkinter - Random Quote from internet

Gets random quote from internet import requests import json import tkinter as tk root = tk.Tk() root.title('Random quote of the day') def get_quote(): frame = tk.Frame(root) frame.grid(co...
menator01 Code sharing 0 262 Apr-02-2024, 07:44 PM
    Thread: How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu
Post: RE: How to Randomly Print a Quote From a Text File...

These are the same and either is fine to use. from random import choice import random alist = [1,2,3,4,5,6,7,8,9] atuple = ['a','b','c','d','e'] print(f'import random module as whole -> {random.c...
menator01 General Coding Help 13 1,079 Apr-02-2024, 12:33 AM
    Thread: How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu
Post: RE: How to Randomly Print a Quote From a Text File...

The first part -- "from random import choice" -- is actually another import, so I should probably put it right below "import random", right? - This is just part of the random module you can import ran...
menator01 General Coding Help 13 1,079 Apr-01-2024, 11:29 PM
    Thread: How to Randomly Print a Quote From a Text File When User Types a Command on Main Menu
Post: RE: How to Randomly Print a Quote From a Text File...

A basic random quote example using a text file from random import choice with open('quote.txt', 'r') as quotes: quotes = quotes.readlines() def get_quote(): return choice(quotes) w...
menator01 General Coding Help 13 1,079 Apr-01-2024, 10:28 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020