DEV Community

Cover image for Python For Web Development

Python For Web Development

Max Ong Zong Bao on March 18, 2020

Introduction When it comes to Python for web development. I feel that it is really not talked about much. Since the upward trend & p...
Collapse
 
mburszley profile image
Maximilian Burszley

Out of curiosity, why recommend Django over Flask?

Collapse
 
janmpeterka profile image
Jan Peterka

(disclamer: I work in Flask, never wrote anything in Django, but have some idea about how it works - also work with Rails, which I guess is a similar beast)

I would guess it's because of simplicity of making basic app. If you main goal is to provide web interface for data manipulation (dashboards, APIs), there's little need to understand how it works and write everything yourself (as you will probably do when starting in Flask until you find all the right plugins and/or write abstractions you need).

Collapse
 
steelwolf180 profile image
Max Ong Zong Bao

Yup it's actually a replica of Ruby for Django. Which is why data scientists will work with Flask more than Django.

Due to its huge learning curve that follows to just to understand it and use it fully because you are really going past the microservice and API aspects of it.

Thread Thread
 
mburszley profile image
Maximilian Burszley

Are you saying flask has a huge learning curve while also advocating Django? Or am I misunderstanding? I've done professional work in both; flask was significantly easier to get people productive in fastest but I did lay solid foundations following good patterns and recommended extensions like flask-talisman and co.

Thread Thread
 
steelwolf180 profile image
Max Ong Zong Bao

Ahh.. its my bad I wrote wrongly. I was referring to Django for steep learning curve.

To me it is more like of a overkill to use Django. Which Data Scientists just prefer to get it done with a quick & dirty solution.

Depending on who you talk to they might not even know of the concept of clean code or TDD.

When they are building a data product as it is not part of their job to do it.

Collapse
 
minchulkim87 profile image
Min

Just a quick thought on learning web dev vs actual web dev:

Maybe Bottle is the best to start off with as it is the easiest. It inspired Flask and similar enough that learning Bottle will transfer very easily to learning Flask.

Then, perhaps, FastAPI is the python framework to learn next. Again, very Flask-esque, but just a more modern implementation.

Collapse
 
sobolevn profile image
Nikita Sobolev

I love Python for web apps! I also recommend to use Django for most of the cases.

By the way, check out this awesome Django project template: it allows to start new Django projects filled with best-practices and good tools in just a few clicks.

Features:

  • Supports latest python3.7+
  • poetry for managing dependencies
  • mypy and django-stubs for static typing
  • pytest and hypothesis for unit tests
  • flake8 and wemake-python-styleguide for linting
  • docker for development, testing, and production
  • sphinx for documentation
  • Gitlab CI with full build, test, and deploy pipeline configured by default
  • Caddy with https and http/2 turned on by default

GitHub logo wemake-services / wemake-django-template

Bleeding edge django template focused on code quality and security.

wemake-django-template

wemake.services Awesome Build Status Documentation Status Dependencies Status wemake-python-styleguide

Bleeding edge django2.2 template focused on code quality and security.


Purpose

This project is used to scaffold a django project structure Just like django-admin.py startproject but better.

Features

Installation

Firstly, you will need to install dependencies:

pip install cookiecutter jinja2-git

Then, create a project itself:

cookiecutter gh:wemake-services/wemake-django-template

Who are using this template?

If you use our template, please add yourself or your company in the list.

We offer free email support for anyone who is using this If you have any problems or questions,…