15 ms·
This is probably your best bet if you're just going to build a nice CRUD frontend for a business app, possibly with an API (via DRF). I am doing this right now
by sgt 9y ago
This is probably your best bet if you're just going to build a nice CRUD frontend for a business app, possibly with an API (via DRF). I am doing this right now on a project as it's the shortest path to a win. The API however is written in Java 8 / vertx.
- Kpourdeilami 9y agoJust out of curiosity, if the API is already being built in Java, why not just build a single-page-app to utilize the API instead of Django? I'd assume the deployment and overhead of maintaining a single-page-app would be way lower than Django. (i.e. uploading to s3 and setting up CDN vs. setting up a VM for Django with nginx, uwsgi, etc.)
- Scarbutt 9y agoDepending on the app, writing a SPA could be a lot of work vs just writing your UI as a frontend server. About NGINX, is still needed in both cases IMO, for the API or the frontend server.
- richardknop 9y agoOne reason would be because you don’t know react or angular or whatever the latest js framework is. You have known Django for a decade and it still works so why waste time learning some js framework which might be out of fashion in 2 years. Generate dynamic HTML on the server, that still works just fine. And codebase will be way simpler as you just generate HTML on page refresh. No need to fiddle with event listeners and DOM and AJAX or whatever. Single page web apps are often wrong choice if you just need some UI other than some fancy dashboard. Let’s say you need an admin panel where you can do CRUD operations, that’s perfect for Django/Rails and would be much much more work as SPA.
- mythrwy 9y agoStatic pages and full refreshes really limit what a page can do though. My personal preference (for most use cases) is a combination. Some things are easier done in static templates but JS is needed to really bring a page to life IMOP. Lately there is too much SP-appage around where there are simpler alternatives though, with that I'll agree. I guess it keeps people employed screwing around with webpack so there's that.
- richardknop 9y ago> Static pages and full refreshes really limit what a page can do though. Yes. But for 90% of business UI cases, you have some sort of collection of pages (i.e. website = collection of pages not a single page with everything crammed into it) with navigation menu. You use the menu to navigate to different pages with HTML forms that submit POST data and do GET redirects. Trying to cram an entire business logic into a single page is often detrimental, split it into multiple pages. Highly interactive apps that fit into a single page model is maybe 10% of use cases or less I have seen in my career last few years. This is all just my opinion obviously but I just think SPAs are a fad that will hopefully go away.
- boundlessdreamz 9y agoI have never written an SPA but after writing a fairly complex ecommerce admin backend (handling orders, shipping etc), I wish I had. There are a lot of complex UI state and some of it would have been easier in React/Vue
- sgt 9y agoAs someone already suggested, writing an SPA comes with a lot of work to get going. This is a side project I need to write, and then hand off to an external development team at some point. Then it helps to simplify the equation as much as possible.
- whalesalad 9y agoI’d posit that a simple crud app would take an order of magnitude less time with Rails. I’ve been a Django developer since 0.96 and have built dozens of apps with it. After transitioning to Rails, it’s hard to justify the use unless you’re in an evironment that absolutely must use Python.
- _arvin 9y agoPython - Django Ruby - Rails PHP - Laravel all nice choices
- baby 9y agoAgree, note that Laravel was heavily influenced by RoR. I personally find that Laravel is less heavy than Django which is way less heavy than RoR. I would never use RoR for small projects.
- blunte 9y agoAnd if you don't mind the learning curve (which will make you a better thinker!), I would add Elixir - Phoenix I wish there was a complete Clojure - ???
- enraged_camel 9y agoElixir with Phoenix is phenomenal. An absolute joy to use. Elixir itself is an excellent language that leveraged the strengths of the Erlang VM, and Phoenix is like a massively improved, blazing fast and reliable version of Rails.
- KingMob 9y agoClosest is probably Luminus, but it's really just a Leiningen build tool that can pull in your choice of libs to stitch together. It's good, and speeds up Clojure web dev, but is in no ways a framework by itself.
- guftagu 9y agoI'd wait for the ecosystem to mature before building a business app with Phoenix. You never know what taken for granted library is missing in Elixir, and it's going to be damn hard to hire a developer experienced with Phoenix. Everyone on your team will be slow and will be making a steady stream of mistakes as they learn the framework
- Rotareti 9y ago> This is probably your best bet if you're just going to build a nice CRUD frontend for a business app, possibly with an API (via DRF). If I had to choose a framework for a web API these days, I would go with something that is async from the ground up.
- yedpodtrzitko 9y agoDjango Channels [1] + ASGI is exactly that. However making that the default would be a hit to the very good backward/forward compatibility Django keep having. [1] https://channels.readthedocs.io/en/latest/ https://channels.readthedocs.io/en/latest/
- blowski 9y agoWhy? Async isn’t cost free - it’s more complicated and that complexity comes at a cost. If your company has only basic needs, you have to question whether you’re providing the best value for your company by doing anything more.
- jrs95 9y agoEspecially when a platform doesn't have libraries that support it fully. Node and ASP.NET are the only fully async platforms I'm really aware of where this isn't a huge problem. Of course there are others with great but not async concurrency models as well. Regardless, it's definitely a minority of use cases where the concurrency model should even be a priority.
- Rotareti 9y ago> Why? Because we are getting more and more CPU cores to utilize. I don't think this trend will stop soon. The software stack will have to adjust to this and it already does. The next generation of mainstream (highlevel)languages/frameworks will be those that are designed to easily utilize CPU cores. It may be more expensive for now, but it might pay out later and I think it's much more exciting. ;)
- konschubert 9y ago
- baby 9y agoI would rather use Flask for that.
- edshiro 9y agoI am learning Python right now and want to build a website using this programming language. Django and Flask seem to be the best frameworks for this purpose. I understand that Django has steeper learning curve and comes with "everything", whereas Flask is more modular and compositional. If I were to use Flask, is there anything that I could not do but that Django could?
- brianwawok 9y agoI would miss the django ORM. Depends if you like the ORM.
- orf 9y agoThe advantage of Django is it comes bundled with everything you could need. Flask is simple, but then you need user authentication. Which library do you use? Is it updated and maintained? What about an ORM, forms, templating, localzation. Do they all work together? Suddenly it's not so simple. That being said, if your app really is simple (single file, under 100 lines) flask is excellent.
- int_19h 9y agoIf your app is that simple, Bottle is probably a better fit than Flask (even more minimalist and non-opinionated).
- jrs95 9y agoFlask is a great fit with smaller APIs but not tiny like this in my experience. Great support for SQLAlchemy and database migrations. Better than Django ORM in my opinion.
- dizzystar 9y agoOh, come on. There are plenty of large websites written in flask. It's not that hard to use at all, and all those things you list are definitely a part of it. Hell, I have a 20 KLOC website written in bottle, and no one ever said it was poorly done, insecure, and so on. The problem is that a lot of people writing Python web stacks don't know how to write Python at all, and no framework will save that shortcoming.
- paulie_a 9y agoAlso APIStar from the creator of DRF is something to keep an eye on. It has Django integrations and I believe is async.
- jrs95 9y agoIt's not inherently async, but it supports async. Although database support for that isnt great, so I'd recommend just sticking to synchronous stuff for now unless you don't mind using raw SQL. If it were me, I'd probably use something else before I tried to squeeze that much performance out of Python at this point to though. I hope library support catches up and it becomes more convenient, but I don't think a predominantly synchronous ecosystem has really successfully transitioned to async before.
- mattgreenrocks 9y agoAFAIK, C# navigated the sync-async transition well. Admittedly, this is a function of time, as it has had async/await for quite awhile.
- jrs95 9y agoTotally forgot about that one. Having nearly everyone on one the same framework probably helped a lot with that. I don't think anyone else really has that advantage. Except maybe Ruby and Rails... Perhaps some good concurrency stuff will come of Ruby 3.
- goodoldboys 9y ago+1 for APIStar. I love Django but if all you want to build is an API, it can be a bit much. APIStar has been great so far in the one production API I've helped build even if there are a few pain points that come with using such a new framework.
- sebazzz 9y agoOne disadvantage of Django is that database providers need to know a lot about the internals of the framework. This shows once you rely on a 3rd party developed database provider, which can break even on minor upgrades.
- konschubert 9y agoWhat do you mean with a database provider?
- drdaeman 9y agoPossibly, database backends? Like those: https://docs.djangoproject.com/en/2.0/ref/databases/#using-a-3rd-party-database-backend https://docs.djangoproject.com/en/2.0/ref/databases/#using-a... They are, indeed, quite complex.
- whatyoucantsay 9y ago> as it's the shortest path to a win. Rails is the "shortest path to a win". Django is well made, but it just hasn't had the same level of focus on RAD or the same level of intensity of community support. Edit: My goodness there are some insecure, vindictive Django advocates here! What I wrote above is the truth and no level of tribalism can change it.
- lima 9y agoBut the trade-off isn't usually worth it. The time you save initially you'll later spend fighting the framework or debugging its internals. Python's "explicit over implicit" scales a lot better, especially with large teams. (personal opionion of someone maintaining production-critical Django and Rails applications)
- jrs95 9y agoFWIW I've never had these issues with Rails, though it does make sense that this would be more common with Rails than most things.
- whatyoucantsay 9y agoIt was worth it in the case of Airbnb, Twitter, Teespring, Coinbase and many, many others. Once you find product market fit, you can afford to rewrite your entire backend if needed. If you don't win round one, then it doesn't matter how well your stack could have scaled.
- jlgaddis 9y agoFYI, I just downvoted you but for your edit, not your original comment. Perfectly legit, valid comments get downvoted here for bullshit reasons sometimes, I just ignore it and move on. (FWIW, I've never used Django. I'm not a developer.)
- whatyoucantsay 9y agoMy only concern for karma is as a way to gain insight regarding the opinions of the community and how broken it is. The parent comment being flagged to death is enlightening on both counts. I also appreciate your telling me you'd comment and vote on a thread about a Django release even though you've never used it and aren't a developer. That's simply fascinating!
- systems 9y agoi vote turbogears for crud apps
- Scarblac 9y agoWe use Django for large single page GIS web apps that still always need some CRUD somewhere (e.g. configuration is done through the Django admin). Parts that Django doesn't do can still be done in Python.
- methodover 9y agoWhat does GIS mean?
- collinmanderson 9y agoGeographic information system. Dealing with maps, etc. https://docs.djangoproject.com/en/2.0/ref/contrib/gis/tutorial/ https://docs.djangoproject.com/en/2.0/ref/contrib/gis/tutori...