Django REST framework

Django REST framework

Application and Data / Languages & Frameworks / Microframeworks (Backend)

My Situation: I am both

  1. Working on a startup/side hustle app, an interactive fitness journal that tracks and recommends exercise as well as makes creating meal plans trivial, in Flutter where the back-end will tentatively be written using Django REST framework as a REST API. For what it's worth Microsoft Azure will be my cloud of choice.

  2. I'm also trying to transition away from an on-prem senior engineer to a Cloud Engineer.

Flutter is a firm choice for the FE however I'd really appreciate some guidance on which tools I should consider using to be in line with contemporary cloud languages and tools as well, if it is a good idea to suck it up and put Python on the back burner so I can learn JavaScript. I need things like ORMs, User Auth, etc.

Can anyone please advise?

READ MORE
15 upvotes·203K views
Replies (1)

I like to use nodejs with prisma ORM, you can also use Typescript, its very easy to learn and Prisma provides a own studio that helps you with the database; another option is PHP with Laravel with the Eloquent ORM, or you can still in your current stack, anyways i recommend you to use Redis from cache database, this will make your app or website very fast

READ MORE
4 upvotes·23.8K views
Needs advice
on
DjangoDjangoFastAPIFastAPI
and
FlaskFlask

Hello all,

I've been following the Django style guide from HackSoft (https://github.com/HackSoftware/Django-Styleguide) for a while now and I really liked it.

So currently at my workplace the project I'm working on, our lead architect (he's from .NET background I have asked a question a month back on a similar note) has asked me to write the Django code as per DDD principles (service layer, repository layer, entity layer etc) so after going through many articles and videos regarding DDD found out that following DDD principles in Django is an overkill.

Since I really like Django style guide and Django way of doing things, I am unable to convince our lead architect on following Django way of doing things/the style guide from HackSoft. He wants me to strictly use DDD principles. So with DDD I believe we cannot make use of any 3rd party Django libraries.

For example, I'm using Django REST framework for API development he's asking me not to use serializers, authentication & permission classes, and a lot of other things. Instead, he's asking me to write all these things without depending on Django/Django libraries. So his way of thinking is, code should be framework agnostic. For that if we want to migrate to some new framework then with DDD principles easily we'll be able to achieve is what he says. Also he said with DDD we can write pure unit test cases.

But from my POV, I guess it is doable. But since many people are using Django, DRF, and a lot of great 3rd party Django libraries it is battle tested and integrates great with Django. But if we follow DDD then we're missing out on these things, and again we have to reinvent the wheel for all the tasks which Django actually provides I think.

Seb Corben who gave DjangoCon 2022 talk on DDD Django says that for simpler projects and short term projects, it's not effective.

Lastly, I want to know have you guys tried DDD with Django? Can you please share your thoughts on this?

READ MORE
6 upvotes·18.8K views
Replies (1)
Avatar of lbatteau
CTO at Deepdesk·

If you want framework-agnostic code, Django is really not the right framework for you. Its large ORM layer, heavy use of middleware, and reliance on class inheritance, will make migrating to another framework very painful. For more freedom and control I would recommend Flask, or even better FastAPI.

At the same time, it seems DDD has nothing to do with using other libraries or not.

Either way, whatever framework you choose, remember the golden rule: Don’t Fight The Framework.

READ MORE
4 upvotes·5.3K views
Needs advice
on
DjangoDjangoGolangGolang
and
SpringSpring

So currently I have experience in Node.js, but just to expand my stack knowledge and for getting backend developer roles, I thought of learning another backend-related language/framework. I have heard about Django, Golang, and Spring. I am mostly trying for backend API roles, and far as I've heard, Django REST framework can be a pain to work with. I've heard there are issues with Golang for package management (like how recently the Gorilla web toolkit is archived) and as for Spring, it's a vast ecosystem to learn so not sure if it's worth investing in. I would like to know which tool/framework to learn, which can help me get high-paying jobs and has a lot of scopes, and also which is great for making REST APIs. Any other tool that can do the job better than these three is also welcome!

READ MORE
8 upvotes·46.7K views
Replies (1)
Avatar of nyashachiza
Software Engineer at Petalm Africa Group·

l'm building a backend service with Django REST framework and l was wondering which method of authentication should l choose?

3 upvotes·11.9K views
Replies (2)
Needs advice
on
DjangoDjangoPostgreSQLPostgreSQL
and
Vue.jsVue.js

I am planning on creating an application using the following tech-stack. Vue.js (TypeScript) for the front-end, Django (specifically Django REST framework) for the server-side work, and using PostgreSQL as the database. Is there any reason NOT to use this tech stack mentioned or are there better options? Without giving away too much info, my app will be logging information from the user, displaying this information, setting goals, displaying visual graphs, a friend system where you can add other people etc...

READ MORE
11 upvotes·74.2K views
Replies (6)
Avatar of cristianca
Engineering Manager at Opensignal·

Easy stack to start and develop your product. Vue is easy to learn and use, great support from the community if you have questions. Django is a powerful backend framework, the Django Rest Framework comes with a lot of generic views that you can use which will come in handy. Also, Django admin gives you and out of the box interface for all your admin/support needs.

READ MORE
6 upvotes·1 comment·38.7K views
Finacus Solutions
Finacus Solutions
·
November 21st 2024 at 10:57AM

Vue and Django are an excellent stack for building products. Vue’s simplicity and strong community support make front-end development smooth. Django, with its powerful backend framework and Django Rest Framework, speeds up development with useful generic views. The Django admin interface is also a great bonus for managing your application efficiently.

·
Reply

Great stack. Very productive and the vue development tools are excellent. The generic views from drf help a lot in productivity

6 upvotes·2 comments·39K views
Oziel Perez
Oziel Perez
·
November 16th 2022 at 4:58PM

Agreed, a very productive stack. Django takes care of a lot stuff for you down to the serialization of your data models, and Vue is just the best thing out there right now for front end projects, having good component structures while being flexible and easy to use.

·
Reply
Finacus Solutions
Finacus Solutions
·
September 5th 2024 at 11:53AM

The Great Stack is highly efficient and productive, especially with its Vue development tools that significantly streamline the development process. The generic views from Django Rest Framework (DRF) further enhance productivity by simplifying common tasks and reducing boilerplate code. Overall, this combination allows for rapid and effective development.

·
Reply
View all (6)
Avatar of jivcodes
Junior Product Manager at Vozz·
Needs advice
on
DjangoDjango
and
ReactReact

Hey everyone! I'm planning on building a personal project - this will be my first full-stack project and will be a web app.

The way it will work is that users will be able to post groups. This can be, groups for studying or groups for work, etc. They can also set the desired group size (e.g. limit the group to 3 members). Other users can then join said group - once the group is full, it will automatically close.

What tech stack would you all recommend for this? I have a lot of experience with Django so maybe that will be good for the backend but I'm not sure where to go from there. I've heard using the Django REST framework with a React frontend might be good. Always open to learning new technologies and thanks in advance!

READ MORE
13 upvotes·77.1K views
Replies (4)
Avatar of boffti6196
Software Engineer 2 at Dell EMC·
Recommends
on
Flask
Flask
MySQL
MySQL

I recently built a web app for college students to interact and trade books. I had built in a similar feature where students could create clubs (groups) and become a member and post content on the club's pages. Used Flask MVC throughout. But you also need to consider your data store and how you would model the data. I went with MySQL. The thing about Flask is that - 1. It's Python-based 2. It's a micro framework and perfect/easy for building MVC apps and also REST APIs to pair with React. 3. It is also modular, so you get to choose what libs/components you want to add on top of it.

READ MORE
GitHub - boffti/banter: Fun social media app for students in schools to exchange relevant information. Primarily a platform for students to buy and sell their items like books […] (github.com)
6 upvotes·34.8K views

Actually there are a lot of people that doesn't know that django and react is a good match when using the django rest framework, django is a python framework so that will make it very easy to use when building api endpoints, I recommend that you learn the django rest framework + JWT authentication system and the react routers v6 and protect routes, Hooks and how to fetch some data from api endpoints using the fetch function or axios.

READ MORE
5 upvotes·35.2K views
View all (4)
Avatar of rajeev28346263
District Informatics Officer at Informatics Center·
Needs advice
on
DjangoDjango
and
ReactReact
in

Hey Everyone,

I am using the Django with Django REST framework for backend and API.. for front-end using React..

  1. What will be the best way for deployment. Backend and front-end are at different domains or both at the same domain...
  2. My app will be used concurrently by more than 1000 users. How will I achieve performance? Is there any suggestions...
READ MORE
7 upvotes·31.7K views
Replies (4)
Avatar of piotrmaslanka
CTO at SMOK sp. z o. o.·

Best advice will be to put a reverse proxy nginx routing certain calls to frontend, and certain to backend. Best way to build will be Docker images and a docker-compose file for starters, where you will define the database, the backend, the frontend, and the reverse proxy nginx, which you can configure to use certificates and certbot from Let's Encrypt. You can worry about performance later, at which point you will probably need to migrate towards Kubernetes. Standard setup with docker-compose should serve you well for up to 1000 users. You can initially use the same domain with possibly /v1 routing keys towards backend, and the rest towards frontend, which should be a plain Nginx image with all of the frontend files compiled. You can compile them using multi-stage Docker builds, or just plain CI/CD such as GitLab.

READ MORE
7 upvotes·26.9K views
Recommends
on
C#
C#
Java
Java
Svelte
Svelte

Hello Rajeev!

In a global sense, if there is such an opportunity, and if it is applicable to your project, I really advise you to change the technical stack. Try using static UI frameworks (Svelte) and server oriented fast languages ​​(Java, C#).

But if we take current conditions, then your option would be to audit absolutely all technologies. Review your data consumption, such as how fast your database response is, how well you use the power of both languages, such as in optimization. Make sure the quality of your server provider, database, other technologies. If you're using an image extensively, consider a CDN.

As for placing the API and the Website on the same domain, the choice is yours, but in my experience, mostly people prefer the api sub-domain (example: api.example.com), it's easier and clearer.

These are big and complex decisions, but they will affect UX, and therefore your income :)

Happy coding!

Useful resources: https://reactjs.org/docs/optimizing-performance.html https://docs.djangoproject.com/en/4.0/topics/performance/ https://www.sisense.com/blog/8-ways-fine-tune-sql-queries-production-databases/

READ MORE
5 upvotes·26.9K views
View all (4)

Hi I am getting into web development and have two choices at hand learn Django and Django REST framework for apis and Node.js and ExpressJS for backend which one would be the better choice

2 upvotes·10.4K views

Hi

I’ve been using Django for the last year on and off to do my backend API. I’m getting a bit frustrated with the Django REST framework with the setup of the serializers and Django for the lack of web sockets. I’m considering either Spring or .NET Core. I’m familiar with Kotlin and C# but I’ve not built any substantial projects with them. I like OOP, building a desktop app, web API, and also the potential to get a job in the future or building a tool at work to manage my documents, dashboard and processes point cloud data.

I’m familiar with c/cpp, TypeScript.

I would love your insights on where I should go.

READ MORE
Not Your Average QS - Web Development and QS Blog (Notyouraverageqs.com)
7 upvotes·600.7K views
Replies (3)
Recommends
on
.NET Core
.NET Core

Theres a logt going on in the dotnet world. I currently do all my Rest APIs with asp.net core.

The Setup is very easy as the .net web sdk provides with a lot features you don't want to keep yourself concerned with. You can integrate Swagger with little effort.

READ MORE
10 upvotes·394.4K views
Avatar of zoongit
Researcher at Florida Institute of Technology·
Recommends
on
Spring Boot
Spring Boot

Spring Boot is the lightweight of the Spring framework. I used the Spring framework before, and I fall in love with the Spring Boot. I also use .NET core, but still, I like Spring boot the best. If you have time then you should experience both. You are more than halfway in gaining experience. My suggestion is always to try to learn many things as you can.

READ MORE
6 upvotes·397.1K views
View all (3)
Avatar of ilebedev
CTO @ BestDoctor·

Python's GraphQL version – Graphene – has some critical disadvantages, that we found critical: - Lack of code optimisation. It is also hard to write optimized code because of graphene node API. - Nonsecure by default. By using reversed fks, you can get a lot of extra data. To stop this, we have to explicit exclude wrong fields, which seems to be error prone. - Nonflexible code structure. You can't make abstract graphene.ObjectType class, this limits us a lot.

These are some reasons, that make us move to Django REST framework .

READ MORE
4 upvotes·41.3K views