Python Forum
Django or Flash for a would be freelancer?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django or Flash for a would be freelancer?
#1
Hey, Python community ! I used to code in C and some other languages like PHP(5 years back) then I changed career choice. Back then I just coded for fun but now I am looking for freelancing and that brings me back to development. I am learning from the edx course and so far this is how we are taught for the first web server
Quote:#Beginning
#python has its own builtin server support http.server
from http.server import BaseHTTPRequestHandler, HTTPServer
class HTTPServer_RequestHandler(BaseHTTPRequestHandler):
#GET
def do_GET(self):
#Send response code for get requests
self.send_response(200)

#send headers
self.send_header("Content-type","text/html")
self.end_headers()

#write message
self.wfile.write(bytes("<h1>howdy</h1>","utf8"))
return
port=8080
server_address=("0.0.0.0",port)
httpd=HTTPServer(server_address,HTTPServer_RequestHandler)
httpd.serve_forever()


#END
But I have realized nobody uses this approach(correct me if im wrong) and rather they rely on djangi,flask or the likes. For a freelancer which one should I go for? And from a learner's perspective, which one would be better for a beginner? Thank you
Reply
#2
(Jul-20-2017, 12:22 PM)davinci Wrote: But I have realized nobody uses this approach(correct me if im wrong) and rather they rely on djangi,flask or the likes. For a freelancer which one should I go for? And from a learner's perspective, which one would be better for a beginner? Thank you
You are right nobody use that code for web-development in Python.
Flask is very god choice for learning web-development,
there are little noise and it integrate easy with other tool for web-development(HTLM/CCS and JavaScript).

Django has more stuff build in,
this can help but also making it harder to learn how web-development work at a lower level.

I have several tutorial about Flask eg weather app.
That goes to a lot basic stuff like getting data from a API,search input and use of Jinja2(build in Template engine for Flask).
[Image: 1yDxDW.jpg]
Reply
#3
Django vs Flask is a question about scale. Django is a big platform that can do a lot of things, but it doesn't really make sense to use it for small projects. Django is a lot like our version of Ruby's Rails, or PHP's CakePHP/Laravel/[insert any of the hundreds of frameworks here].

Flask is a lot more lightweight. To try to compare it, I'd put Flask somewhere between writing individual php pages, and using a framework. It's almost just a convenience wrapper to make common things very easy to do.

Which you should use depends a bit on what it is you're trying to do, and what "freelancing" means to you in particular. If it means you're building a content management system similar to Wordpress, Django is probably the better choice. If you're building a website for a small business, such as a restaurant, that just wants somewhere to put their menus or what not, Flask would be much faster for you to get the job done.

They're both fairly similar in performance. Both can be used on almost any machine that has python installed (which is almost any non-Windows web server these days).

Django is designed more as a cohesive whole, which sometimes makes finding documentation and examples easy, at the cost of being sometimes very difficult to change some of the parts (like a different templating engine). Django also has an auto-generated admin area based off of the models you define, which could make it easy to pass off a project to a client (or very easy for them to wreck havoc on the database).

Flask is designed as a collection of utilities that work well together. If you want to try a different part for something (perhaps you don't like SQLAlchemy, and would rather write raw sql?), it's exceedingly easy, since the whole platform is designed to be modular and interchangeable.

Like most things in life, try both out, and see which "feels right" to you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  enable flash using selenium chromedriver Fre3k 1 4,285 Nov-27-2020, 12:15 PM
Last Post: JellyCreeper6
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,311 Jun-30-2019, 12:21 AM
Last Post: scidam
  Flask Flash Messages Blank Leaf 2 5,719 Oct-16-2017, 10:19 PM
Last Post: Leaf
  Selenium and Flash ATXpython 3 8,749 Oct-10-2016, 09:52 PM
Last Post: ATXpython

Forum Jump:

User Panel Messages

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