Live data from Hacker News

Learn web development: Django Web Framework

developer.mozilla.org

21–30 of 54 posts

Re: Learn web development: Django Web Framework

#21
post #16

If you're curious about how to set up a modern JS frontend on top of Django, I wrote up a tutorial recently. It might be helpful if you're debating between trying a Single Page App approach or some other design: https://medium.com/@theSquashSH/reconciling-djangos-mvc-temp...

And if you're going down the React + Redux + REST framework path and need a boilerplate to start off on, I'd highly recommend Seedstars': https://github.com/Seedstars/django-react-redux-base

Looking only at the JS part of this boilerplate and the amount of dependencies I think to myself: "this cannot be right". It reminds me of my early Java days with bad system frameworks which needs a tremendous amount of boilerplate to get running. Maybe it's the right way to go for big production systems, nevertheless... don't like it much. But on the other hand it looks pretty complete regarding tests and there is not much to add.

Re: Learn web development: Django Web Framework

#22
post #11

I had used Django back in version 1.3 and was just thinking today of how I need to brush up, as it has been a few years. The timing of this article couldn't have been better. Now I've got my weekend cut out :)

Everything about Django 1.8 and above blows everything below away. Its all the same, but so much better. The admin app keeps getting better, migrations are a first class citizen and make ongoing change management and deployment a snap.

If you want to make a solid, stable web-app Django is a perfect backend.

Re: Learn web development: Django Web Framework

#23
post #20

Earlier quoted context omitted.

Care to share why? My apologies if you have street cred in the field, but I don't know you, so have no reason to trust your recommendation. Please tell me what makes this particular project better than any alternatives.

No street card to offer --- just a developer passing on some knowledge. I've been using Django for the past two years and React + Redux for the past year. I've scoured around for boilerplates and that's the one that worked for me the best. YMMV

Thanks.

Re: Learn web development: Django Web Framework

#24

If you're curious about how to set up a modern JS frontend on top of Django, I wrote up a tutorial recently. It might be helpful if you're debating between trying a Single Page App approach or some other design: https://medium.com/@theSquashSH/reconciling-djangos-mvc-temp...

I think one important lesson here is that by abandoning the traditional SPA approach, you're also opening up your site to be indexed by search engine crawlers much more easily.

Re: Learn web development: Django Web Framework

#27
post #25

It has been years since I have used Django - do they still expect everything in the model to go in a single file or can you put each model in it's own file now?

Create a models.py and import there your models from wherever they are. This should do the trick.

Re: Learn web development: Django Web Framework

#28
Django is such an important building block of the web, it completely deserves this tutorial on MDN.

As someone who came to Django quite late, I cannot stress enough how coding in Django is refreshing. Yes it's not about microservices nor it bring all the trendy technologies that we all hear about.

And that's just fine, you get things done with it and at the end of the day this is what matters.

Re: Learn web development: Django Web Framework

#29
post #5
post #2

Great to see Mozilla supporting Django. But isn't the official Django tutorial cover all of this, Why not just link to it?

Django's basic tutorial is great to get started, but once you get into the nitty gritty I find myself often going to stacks rather than the docs to get the information I need because the docs get kinda sparse. One example is if you want to forgo modelforms and pass the information from the forms to the model manually through your view (for example because you want to manipulate the information before passing it to th…

How did you solve the problem of bypassing modelforms? Same roadblock here...

Re: Learn web development: Django Web Framework

#30

If you're curious about how to set up a modern JS frontend on top of Django, I wrote up a tutorial recently. It might be helpful if you're debating between trying a Single Page App approach or some other design: https://medium.com/@theSquashSH/reconciling-djangos-mvc-temp...

I've been using react for various components inside a somewhat standard django application through https://github.com/owais/django-webpack-loader . It works by having your webpack pipeline spit a webpack-stats.json that a django's template tag reads and uses to output things in your template.

The setup is not really straight forward, and generally I have problems mixing django static files in my .scss url() , so this is far from perfect. I'm using it with a main .ts file that requires various components based on the class of body tag, so I can use this in simple reload request use case. Also I've complicated things a little so my webpack bundles are collected as other static files and my static template tag also works.

But yeah, using react in typescript and sass in this way for the frontend has accelerated my development a lot.

Post reply on HN