1

I have been reading on their respective website (Django and Flask) about what do they do and what they offer .

I realized the following:

  1. Both are web application frameworks: They help and speed up the application dev time.

  2. They provide rendering to html from python/html templates (please correct me if I'm wrong)

  3. I was able to see that with a minimalist Flask hello world application, the user was able to select the local host port and view the html from browser.

Point 3 led me to believe that Flask comes with its integrated webserver that renders html. Is this capability available in Django? Or does Django require a separate server (Apache for instance) running?

Please help me clarify this confusion. I am trying to understand the difference in the word "web framework"

davidism
  • 121,510
  • 29
  • 395
  • 339
Kam
  • 5,878
  • 10
  • 53
  • 97

1 Answers1

6

Both Django and Flask use a Python-based server when running in development (Django bundles its own, Flask relies on the third-party Werkzeug library). However, neither of these are suitable for running in production: they will need a proper server - suitable candidates include Apache/mod_wsgi, or nginx proxied to gunicorn or uWSGI.

Daniel Roseman
  • 588,541
  • 66
  • 880
  • 895
  • 3
    "neither of these are suitable for running in production" why so? – Kam Dec 11 '14 at 16:29
  • 4
    Because they're not meant for that. They're not tested for load, stability, or security. – Daniel Roseman Dec 11 '14 at 16:31
  • Ah I see, and is Point 2 correct? Or am I missing something? basically is the intent to use these frameworks is to write webapps and website pages in python? – Kam Dec 11 '14 at 16:32
  • I'm not really sure what you're asking. Yes, of course the point of Python web frameworks is to create web sites. – Daniel Roseman Dec 11 '14 at 16:53
  • 1
    my main question was related to python language, is the main purpose to create websites in python? (instead of html, php, js, etc...) – Kam Dec 11 '14 at 17:09
  • 2
    Python is a general-purpose programming language, you can use it for pretty much anything. Django and Flask exist entirely to make building web applications using Python easy. – Giles Thomas Dec 12 '14 at 12:36