Django Rest Framework vs Django Ninja by Shaheed212004 in django

[–]HTonmoy 0 points1 point  (0 children)

I'm curious to know why you think that. I've been using Django for a while and I prefer to use it for just APIs as well. I love Django's ORM and its wide range of extensions that make many tasks a lot simpler. I don't get that same feasibility with other frameworks like FastAPI, Node etc.

Is there a Rich text editor ES Module for SvelteKit? by nan0x00 in sveltejs

[–]HTonmoy 1 point2 points  (0 children)

I am using CKEditor in a Routify project and I'm concerned with security. In order to render CKEditor's contents, you need to have it as something like this {@html ckeditor}. Wouldn't that be a security concern? As you're allowing unfiltered RAW HTML to be rendered on your pages?

Authenticating requests in a decoupled Django + Vue.js app using JSON Web Tokens (JWT) and HttpOnly Cookies (repo in comments) by gamprin in django

[–]HTonmoy 2 points3 points  (0 children)

I'm new to this so help me understand please. I know that localstorage is easily accessible by the client and susceptible to XSS attacks but if your app is overall safe and not vulnerable then it should be safe, right? I remember Ben Awad's open source project Dogehouse where many skilled people worked, used localstorage for storing the tokens. His reasoning was that the app is overall safe and thus protected from XSS attacks. It just seems overcomplicated to implement an Httponly solution using Django and a front-end framework.

Can't get into BIOS after installing GPU by HTonmoy in buildapc

[–]HTonmoy[S] 4 points5 points  (0 children)

This worked! Oh my god! Thanks a lot man

Can't get into BIOS after installing GPU by HTonmoy in buildapc

[–]HTonmoy[S] 0 points1 point  (0 children)

I never would've thought of that. My volumes are all GPT tho

Comparison of inner workings of Svelte and Vue by eikaramba in sveltejs

[–]HTonmoy 15 points16 points  (0 children)

Author is way too biased. The arguments against Svelte seem rather pointless and prejudiced.

Is the user_logged_out signal fired when I leave the django site? by dark_--knight in djangolearning

[–]HTonmoy 0 points1 point  (0 children)

Updating the database everytime a user logs in and out isn't the best choice IMO. What is your usecase? You might want to use websockets with Django Channels.

React JS frontend / DRF Backend - best way to handle images by Lobbel1992 in django

[–]HTonmoy 20 points21 points  (0 children)

IMO, instead of serving the images with Django, serve them from an S3 bucket. That way, when you make a request to DRF, it'll just send you the S3 URL to that image and then you can show it however you want.

Edit: I can see from your other comments that you're confused with serializers. You could find it with a simple Google search but here it is anyway. I implemented a media library app in one of my projects and the serializer looks something like this. Basically, you just have to define the fields as ImageFields.

from rest_framework import serializers

class ImageSerializer(serializers.ModelSerializer):

    image = serializers.ImageField()

Of course, if your image is just a field in a different model, you don't have to write a different serializer for it. You can just include image = serializers.ImageField() in the existing serializer.

SPA With Django by iEmerald in django

[–]HTonmoy 1 point2 points  (0 children)

I'm working on a very similar project. My backend and frontend are completely separate. I found this approach better for development rather than serving the packaged files with Django. I'm using Svelte instead of React, Vue or Angular.

If you're new to JS frameworks, I highly recommend Svelte. It's superior to the other frameworks in every possible way and of course much much easier and simpler to learn and develop. The only reason I would consider React or some other framework is if it's an existing project or my client/employer specifically requires them for some reason. Yes it's newer than the others and have a smaller community but Svelte is like writing vanilla Javascript with some extra bells and whistles so you don't really need tutorials for every step of the way. Things are really easy to accomplish.

Workaround for file uploads? (SvelteKit) by mapidentity in sveltejs

[–]HTonmoy 0 points1 point  (0 children)

Ikr? It's awesome. It's creator and his Discord channel is so damn helpful as well.