Python Forum
Build a simple Webapp with Python Flask and mariaDB
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Build a simple Webapp with Python Flask and mariaDB
#1
Hi,
I've done a little PHP and Python Programming in the past. Now as a newbie in this field (Thread subject) I want to build a simple webapp for a private purpose and I was wondering how to move forward.
It would be a website listing my family members and when clicking on a family ... we have the details (Family's name, address, phone ...).
I'm working on Ubuntu 20 and I've already installed mariadb and flask(and ran a simple route to see "hello world". Big Grin ).

My concerns are:
- How can I populate my database from my csv file and get the result in the template home.html?
- How to make the result look something like this?

(photo) Family 1
(photo) Family 2
(photo) Family 3
...

and when clicking on a Family, I get

(photo) Family 1
        Name: Family 1
        Address: abc
        Phone: 12345
(photo) Family 2
(photo) Family 3
.
.
.
Any tips/hints/steps and help will really be appreciated
Newbie
Reply
#2
What have you tried? Do you know how to read from a CSV file? Do you know how to insert into the database? Have you already installed the MySQL Connector library (see this)? As for templates, have you looked at the docs for Jinja 2 to see how they work?
Reply
#3
(May-25-2020, 03:57 AM)ndc85430 Wrote: What have you tried? Do you know how to read from a CSV file? Do you know how to insert into the database? Have you already installed the MySQL Connector library (see this)? As for templates, have you looked at the docs for Jinja 2 to see how they work?
Hi,
thank for replying. I will post a new question with code.
Reply
#4
After 44 years in IT and just retiring, I can offer my 2 cents. Always start with a data model and work back from that. Design your tables and normalize as best you can. One table for Family, one for Photos with a foreign key on family_id or something. In my most recent project at home, I wrote a web app to manage our LP, CD, and DVD collection. It wasn't drill-down like yours but it does allow editing a record by clicking on a grid. Used Flask for the REST api (with MySQL) a,d Svelte for the GUI. All hosted by Ubuntu 20.x. Developed on Win10.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Webapp for creating sheet music philipbergwerf 2 1,401 Aug-17-2023, 12:38 PM
Last Post: Gaurav_Kumar
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,400 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
Question Securing State Constitutions (USA) from University of Maryland > MariaDB .sql BrandonKastning 1 1,496 Jan-21-2022, 06:34 PM
Last Post: BrandonKastning
Exclamation Debian 10 Buster Environment - Python 3.x (MariaDB 10.4.21) | Working Connector? BrandonKastning 9 4,122 Jan-04-2022, 08:27 PM
Last Post: BrandonKastning
Lightbulb Python Obstacles | Kung-Fu | Full File HTML Document Scrape and Store it in MariaDB BrandonKastning 5 2,821 Dec-29-2021, 02:26 AM
Last Post: BrandonKastning
  Python Obstacles | American Kenpo | Wiki Scrape URL/Table and Store it in MariaDB BrandonKastning 6 2,785 Dec-29-2021, 12:38 AM
Last Post: BrandonKastning
  Python Obstacles | Karate | HTML/Scrape Specific Tag and Store it in MariaDB BrandonKastning 8 3,093 Nov-22-2021, 01:38 AM
Last Post: BrandonKastning
  Python to build website Methew324 1 2,195 Dec-15-2020, 05:57 AM
Last Post: buran
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 3,945 Aug-12-2020, 07:24 PM
Last Post: Alpy
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to write 3 Columns to MariaDB? BrandonKastning 21 6,720 Mar-23-2020, 05:51 PM
Last Post: ndc85430

Forum Jump:

User Panel Messages

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