Live data from Hacker News

Django Newbie Mistakes

code.djangoproject.com

21–30 of 225 posts

Re: Django Newbie Mistakes

#21
post #2

If you're writing a REST api, invest the time to learn Django Rest Framework. It is well worth it.

DRF is nice enough 90% of the way, but when you need to do something that its authors haven't really thought of, you need to dig in very deep to fix things, I've found. :/

Re: Django Newbie Mistakes

#22
post #13

I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.

It is current year and Django is still very relevant in web development.

Re: Django Newbie Mistakes

#23
post #21
post #2

If you're writing a REST api, invest the time to learn Django Rest Framework. It is well worth it.

DRF is nice enough 90% of the way, but when you need to do something that its authors haven't really thought of, you need to dig in very deep to fix things, I've found. :/

Agreed, for this reason I stopped using it, the investment in those digs were not worth the time to not copy/paste some CRUD api views. Which is what I do now, and modify as needed.

If the number of models and views grows too much and gets brittle, maybe it will be worth trying again.

Re: Django Newbie Mistakes

#24
post #13

I feel like I just got into a time machine - this is the top post on hacker news? People are learning Django in 2018? I guess its fine if you have a small project and aren't going to see much traffic, but Python is so slow and difficult to maintian compared to (e.g.) Go. I say this as someone who worked in Python for a long time, and on several large Django projects.

Oh man! I feel where you are coming from but who clicked on this link except Django fans?

That's like walking into a Django club and telling everyone their framework sucks. Even as a member that only gets you so far.

I can't believe you also called it difficult to maintain! Because when you say slow, the response its easy to maintain, and you went ahead and called it difficult to maintain?

At least give us a reason.

Re: Django Newbie Mistakes

#26
post #25
post #2

If you're writing a REST api, invest the time to learn Django Rest Framework. It is well worth it.

Isn't Flask simpler for REST stuff?

Sort of, but you'll have to assemble several different libraries to make it good. It doesn't handle request validation, JSON serialization/deserialization, or databases well out of the box.

If you use Flask with Flask-SQLAlchemy be sure to use apply_driver_hacks to enable the pool_pre_ping option or you'll end up in production wondering why 1/3 of your requests are getting a bad DB connection from the pool.

Honestly, it seems like many somewhat essential libraries for Flask APIs are being maintained by one person on GitHub. I wouldn't want to put my faith in that for a core part of my business. Django has a lot more resources going into it even if it's not as powerful as SQLAlchemy or as simple as Flask.

Re: Django Newbie Mistakes

#27
post #3

Django’s documentation is still the best I have worked with so far of any software project I came across to date. It not only explains, it educates.

I find it some of the hardest documentation (close to AWS) to understand the best way to do something. I think it's great if you know what you're doing or you have a rough idea of what to do but need more information, but for someone new to the framework it makes me want to paper cut the webs of my fingers and bath my hands in vinegar because it would be less painful.

Re: Django Newbie Mistakes

#28
post #2

If you're writing a REST api, invest the time to learn Django Rest Framework. It is well worth it.

Agreed, but with the caveat that there are a lot of bad parts of DRF. It's probably the best tool to build a REST API, but only if you're using some minimal subset of the tools available.

What are the bad bits? Why are they bad?

Re: Django Newbie Mistakes

#30
post #27
post #3

Django’s documentation is still the best I have worked with so far of any software project I came across to date. It not only explains, it educates.

I find it some of the hardest documentation (close to AWS) to understand the best way to do something. I think it's great if you know what you're doing or you have a rough idea of what to do but need more information, but for someone new to the framework it makes me want to paper cut the webs of my fingers and bath my hands in vinegar because it would be less painful.

I agree. The tutorial is incredibly simplistic with a "go play" ending. Then the actual documentation assumes you have a pretty good knowledge of how everything works. There is no middle step without utilizing 3rd party docs.
Post reply on HN