Python Forum

Full Version: Python for web apps - where to start?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I have some basic programming knowledge (can read syntax, and understand functions and statements) I have never programmed in Python so I'm looking for the right start.
My goal is to make web apps with forms that enter data in a database (Mysql), manipulate said data in reports, and similar.
For example employee work hours management/calculation app, with employee info, worked hours, overtime, etc.
I have a Linux web server hosted online and I have installed Visual studio code (with python extension and ssh extension, I read it supports web apps)
When I programmed in VB a long time ago I used to make a form first and then connect everything in the back end, that's what I'm accustomed to so I'm looking for a similar setup.

I looked online and got some bits but not a complete picture: framework, IDE, ssh access

My question is what are the steps to have a good starting setup so I can play around with form design and back-end python?
I just want to make sure I begin my journey the right way.

If someone could point me in the right direction and just list the steps in terms of software or just a list of things I need to do, I would greatly appreciate it.
Thank you in advance.
There are several web development Frameworks available:

here's a list with links:
Flask
Django
Pyramid
Web2Py
Turbogears

I admit that I am biased, and use Flask I beleive that Django and Flask are considered the top two.
Both are good, so others will say Django is their favorite.
I think you should try as many as you have the patience for and then make your selection.
Should you decide on flask, there's a great tutorial here: The Flask Mega Tutorial
I'm sure you will find equally well written tutorials for each framework.

This will get you started.
Hi,

(Feb-18-2023, 05:02 AM)Larz60+ Wrote: [ -> ]I admit that I am biased, and use Flask I beleive that Django and Flask are considered the top two.
I would even say that Flask and Django are far ahead of the others with regards to popularity.

Upfront it is hard to say which one is better. I personally prefer Django due to the higher integration of components (ORM, Form management, template engine, security modules etc.). However, Django has certainly the steeper learning curve, at least for the start. While Flask allows a very simple "hello world" web-based application with < 10 lines of code, you need to edit at least three to four files to get things running.

To unterstand how Python-based web applications work (which is basically binding a function to an URL), Flask (or the bit dusted Bottle) may be the better starting point. Which doesn't necessarily mean that Flask is the better choice for you, ultimatetly.

If like to dive into Django, there are two excellent tutorials: the one on the Django project site as well as the "Django for girls" tutorial. The latter can also be read by boys, no worries.

No matter which one you choose: Django and Flask are widely used and have active communities, so getting help will be no problem.

Regards, noisefloor
In my opinion, if you want to learn and build from the ground up, then Flask is the way to go. If you want already built modules, then Django is the way to go. Really depends on where you want to start and what you want to learn. Both are very similar. Pre-built modules or start from scratch.

Here is a simple example of something I did to help someone in another forum using flask.

django is django (well, almost everything is included) the rest is wsgi or asgi...it is difficult to list them..
I would agree with menator01 on Flask.
Larz60+ Post 2 Wrote:I admit that I am biased, and use Flask I beleive that Django and Flask are considered the top two.
(Feb-18-2023, 04:22 PM)noisefloor Wrote: [ -> ]Hi,

(Feb-18-2023, 05:02 AM)Larz60+ Wrote: [ -> ]I admit that I am biased, and use Flask I beleive that Django and Flask are considered the top two.
I would even say that Flask and Django are far ahead of the others with regards to popularity.

Upfront it is hard to say which one is better. I personally prefer Django due to the higher integration of components (ORM, Form management, template engine, security modules etc.). However, Django has certainly the steeper learning curve, at least for the start. While Flask allows a very simple "hello world" web-based application with < 10 lines of code, you need to edit at least three to four files to get things running.

To unterstand how Python-based web applications work (which is basically binding a function to an URL), Flask (or the bit dusted Bottle) may be the better starting point. Which doesn't necessarily mean that Flask is the better choice for you, ultimatetly.

If like to dive into Django, there are two excellent tutorials: the one on the Django project site as well as the "Django for girls" tutorial. The latter can also be read by boys, no worries.

No matter which one you choose: Django and Flask are widely used and have active communities, so getting help will be no problem.
Also I advice https://claspo.io/blog/120-impactful-sum...pired-now/
Regards, noisefloor

Hey, I've worked with both Django and Flask before, and I can share my thoughts on this. Django is indeed powerful with its integrated components, making it suitable for complex web applications. However, it can be a bit overwhelming for beginners.

Flask, on the other hand, is lightweight and great for starting simple projects, allowing you to grasp the basics of Python-based web development quickly. It's a fantastic choice for getting hands-on experience.