Jump to content

Is Django good?

Horohoro123

Hello everybody!

I would like to know if django is good for web development? And if you could share some tips to get started with django.

 

Link to comment
Share on other sites

Link to post
Share on other sites

w4j7j.jpg

DISPLAYS: LG 27UL500 IPS 4k60hz + HDR and LG 27GL650F IPS 1080p 144hz + HDR

 

LAPTOP: Lenovo Legion 5 CPU: AMD Ryzen 7 5800H GPU: RTX 3070 8GB RAM: 16GB 3200MHz (2x8GB DDR4) STORAGE: 1TB Crucial P5 NVMe SSD + 2TB Samsung 970 evo plus NVMe SSD DISPLAY: 1080p 165hz IPS OS: Windows 10 Pro x64

Link to comment
Share on other sites

Link to post
Share on other sites

Personally, I prefer Flask. It's lighter weight and much more simplistic to use.

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
Share on other sites

Link to post
Share on other sites

Personally, I prefer Flask. It's lighter weight and much more simplistic to use.

 

I've never really used flask, what's it like?

A lot of the time, I just make little websites that only demand Jinja2 and small json files for data storage at the most. So, I don't get to use the big frameworks much. I had some experience with Django at my last job and really liked it.

Link to comment
Share on other sites

Link to post
Share on other sites

"Good" is too broad. I've been using Django for a good few years now, and I've built and helped build websites, services, APIs, and a bunch of other stuff with it. So in that aspect, I think we can say that Django is good. It might help you better though if I list some pros of Django which might help you decide:

 

- Django is an all-in-one package. Whereas other frameworks like Flash/Pylons are basically just barebones HTTP servers, Django comes with its own ORM (Object Relational Manager to convert raw SQL data into usable Python objects), templating engine (based on Jinja), and has a ton of utility functions and shortcuts that would help you prototype rapidly

- Django has a huge community and therefore not only is it easier to get support, but there are also loads of packages out there written to add functionality to Django

- It also has its own scaffolding system which lets you generate HTML forms based on your Models (part of the ORM), so basic CRUD is fast to implement if you're pressed on time

- Apart from the scaffolding, it also has its own Admin module which lets you interact with your data directly without having to dive into SQL

 

What other frameworks have you used before? If you've used Rails, then Django is pretty close.

 

And oh, here's a pro-tip. If you're starting Django, check out the free Tango with Django resource. It helped me really dive into Django without having to swallow stuff that I really don't understand.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

I've never really used flask, what's it like?

A lot of the time, I just make little websites that only demand Jinja2 and small json files for data storage at the most. So, I don't get to use the big frameworks much. I had some experience with Django at my last job and really liked it.

I only have experience making smaller websites and APIs and that's exactly why I use it. All of the routes and logic can be built into a single file. In that respect, it's very barebones and puts the dependence on you to implement the extra stuff you might need. I think it might also be lighter and easier to run but I'm not 100% sure. Miguel Grinberg has a pretty wonderful "hello world" series that covers a lot of Flask's strengths: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

 

This is an example of a fully functioning website with a JSON API.

from flask import Flaskfrom flask import jsonifyapp = Flask(__name__)@app.route('/')def index():    return 'Hello World!' @app.route('/api')def api():   return jsonify(response='Hello world!')if __name__ == '__main__':    app.run()

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
Share on other sites

Link to post
Share on other sites

I only have experience making smaller websites and APIs and that's exactly why I use it. All of the routes and logic can be built into a single file. In that respect, it's very barebones and puts the dependence on you to implement the extra stuff you might need. I think it might also be lighter and easier to run but I'm not 100% sure. Miguel Grinberg has a pretty wonderful "hello world" series that covers a lot of Flask's strengths: http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-i-hello-world

 

This is an example of a fully functioning website with a JSON API.

from flask import Flaskfrom flask import jsonifyapp = Flask(__name__)@app.route('/')def index():    return 'Hello World!' @app.route('/api')def api():   return jsonify(response='Hello world!')if __name__ == '__main__':    app.run()

Nice. Routes look a lot simpler than Django. I found Django's routing system a bit hard to get my head around at first.

Does Flask include an ORM and HTML templating engine too?

Link to comment
Share on other sites

Link to post
Share on other sites

Nice. Routes look a lot simpler than Django. I found Django's routing system a bit hard to get my head around at first.

Does Flask include an ORM and HTML templating engine too?

It doesn't have a first-class, built-in ORM like Django does but it does have really great support for SQLite and SQLAlchemy. For templating, it defaults to Jinja2 but you can use Django, Mako, and Chameleon as well.

"Unix was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." - Doug Gwyn

Link to comment
Share on other sites

Link to post
Share on other sites

It doesn't have a first-class, built-in ORM like Django does but it does have really great support for SQLite and SQLAlchemy. For templating, it defaults to Jinja2 but you can use Django, Mako, and Chameleon as well.

I usually use Jinja2 anyway. I might give Flask a look. Heard good things about SQLAlchemy.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×