Does anyone else think that this framework leads towards lasagna code?
Does anyone else think that this framework leads towards lasagna code?
Explain
whats lasagna code?
I like lasagna
just read the definition sounds good
>Lasagna code. Lasagna code is a type of program structure, characterized by several well-defined and separable layers, where each layer of code accesses services in the layers below through well-defined interfaces. The term is in comparison with spaghetti code, comparing program structure to pasta.
Sounds good for me too
Well fuckan, for example say I want to make a web form I need to create it in models.py, than in forms.py and in views.py as well. Then I need to insert it into a template as well. Then again I'm a newfag who accidentally walked into a programming job cause the boss asked me if I know how to code.
Not to mention the DB needs to be restarted each time too.
Some things about it are awful, like having to make the templates dir, HOW THE FUCK WOULD I HAVE A WEBSITE WITHOUT HTML DJANGO? Or the whole static vs static_dir thing (pythonn manage.py collectstatic), honstely thinking of switching to rails or node
starting learning Django a few days ago and I'm really starting to wonder if its ever worth my time. I like the fact that it does a lot of the heavy lifting for me, however its so unintuitive to get there.
have you heard of a web api user
you are probably not white
Probably pahjeet
its python's attempt to copy rails
of course its going to be shit
Well, it brings its own version of MVC... another one.
>Does anyone else think that this framework leads towards lasagna code?
I think quite the opposite, its one of the most straight forward frameworks. Unlike Rails its not opinionated, it doesnt hide things with DSL 'magic', its very easy to understand what it does and make it do what you want
it's before rails, and far less intuitive
>honstely thinking of switching to rails or node
Wordpress(headless if its just the service all you need)
Or even better laravel.
Straighht forward, php, e.t.c.
I just started a project this week that doesn't use nor need the templates dir
>Unironically recommending php in 2018
LMAO
I stopped using django in favor of plain aiohttp+graphql+sqlalchemy and I don't seem to be looking back, Django's organization and layering of middlewares is good and I use that whenever I can, everything frontend uses nuxt.js so I don't bother with templates or seving html.
I started a big project several years ago with it, I ended up regretting using this shit and hated by junior devs
It's good for amateurs and easy/static websites, but I'd not use this shit for enterprise/startup/microservices/apis
I don't know much about Python or Django but this just sounds like an MVC pattern, no? If that is what it is, you don't recreate your models for each web form. Models are shared and represent the business problem you're trying to solve, they hold data and interact with one another to actually provide the logical backbone of your application.
I am Garfield developer.
What do you recommend for complex sites
Try bottle framework for python it's pretty barebones. Make a webform there and compare. You can make your whole app in one file without really thinking about it.
There's a lot of shit in this thread. Here'smy point of view after 2 years of using it in production.
What you call lasagna code is actually the MVT pattern which is a good design pattern.
Then django does a lot for you and therefore has a bit of a learning curve and lacks flexibilty. But you should still learn and use it as it teaches a lot of good pratices.
Once you start feeling good with it try removing the and replacing the useless stuffs.
Last thing : a lot of the "apps" that are used to expand it's functionality are garbage. Except DRF.
complex websites are not designed is one big application, they are partitioned microservices, each one does something (authentication, api, website frontend, job runners like image processing, etc...), this is the architecture recommended for any big project
as for languages or frameworks, I'd recommend Go or Node, for Python I recommend Flask or Pyramid
This! The only reasons it might lead to lasagna code is if you don't follow the project and application hierarchy specified in the documentation or if you are a fucking newb / idiot and don't know what you are doing.
Huh, you're right.
Rails is good, until you get some pajeet coder working in it and shitting it up