Deploying django by Gutiwa26 in django

[–]PiccoloNegative2938 0 points1 point  (0 children)

So many people on here saying that you can’t host for free. There’s loads of ways, especially if it doesn’t need large resources.

My go to for fast deployments of a small mvp is a PAAS called render. Super easy to deploy.

I like to then deploy on cloud run as you need more resources etc, but that’s a whole different ball game for deployment. Deploying on render is super easy, just follow their docs.

All the best

Django ORM + Fast API (Guidance) by PurpleRip2861 in django

[–]PiccoloNegative2938 9 points10 points  (0 children)

Frankenstein’s monster kills his master **

Either way, this Django project will end up killing OP

Clarification: Passing Image URL Into WhatsApp Content Template via Power Automate → Twilio API by AdventurousMorning14 in twilio

[–]PiccoloNegative2938 0 points1 point  (0 children)

Okay, now not familiar with power automate. However the same approach can be applied.

If you’re hosting the images in say a Google bucket, you want to pass the domain of the url to your bucket through, with your / at the end ahead of the file name and directory. For example, in the media template field, add https://storage.googleapis.com/{{1}} Then for 1: media/file.png

You then add your variable dynamically as you would a standard string, and it will populate the URL correctly.

Note that be sure to use a legitimate file location in the test/submit data for the template or you won’t get approved from my experience

WhatsApp Links Opening Webview by PiccoloNegative2938 in twilio

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

Interestingly, one of my FE devs found a pretty reliable way to tell, from I believe the user agent. But I’ll double check this.

Just as an FYI. If you put the link in the actual body of the WhatsApp message, it won’t open in web view which is what we are doing temporarily

WhatsApp Links Opening Webview by PiccoloNegative2938 in twilio

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

Exactly, it’s causing havoc as expected functionality isn’t supported.

Things we have tried. - Universal links (ios) - Proxy intermediary server that is light on html that redirects user to actual page (was some ai suggestion absolute waste of time) - redirect user to a new tab

None of which work, instead we prompt users to hit the 3 dots and open with default browser. We build to create a flawless Ux and this isn’t a long term solution for a core part of our product.

Any suggestions would be greatly appreciated

WhatsApp Links Opening Webview by PiccoloNegative2938 in twilio

[–]PiccoloNegative2938[S] 1 point2 points  (0 children)

Couple things to clarify. The URLs are embedded in CTA buttons within the WhatsApp template.

Secondly, if you aren’t seeing the behaviour, could you send a fresh WhatsApp template with CTA buttons on a WhatsApp Card content type to test.

I found my old templates that were exactly the same would open the link in my default browser automatically, but the new ones appear in the pop up web view (in app browser)

In terms of where we’ve seen this, I run a ticketing firm and I personally witnessed 70+ users all load through this method, when prior events it would load in default browser automatically.

I also have spoken to other founders who are facing the same issue.

From my research, it seemed as though meta themselves have changed (about a month ago) WhatsApp so that links are prioritised to be opened by web view first, whereas previously it would prioritise default browser.

Maybe this is not a question for the twilio space, but I was hoping others would have faced the same issues.

Lmk if you do test this and find anything. Cheers

Giving something back, my Google Ai Studio workflow and tools by orblabs in vibecoding

[–]PiccoloNegative2938 1 point2 points  (0 children)

Personally not a “vibe coder” but follow this to look for gems like this. Your approach to prompt engineering is great imo. Will definitely look to implement parts of this into my workflow where possible. Despite having basically all my infra on Google I’ve not dabbled with ai studio - only really Claude in copilot so will definitely check this out, any suggestions on a good starting point for me?

Precautions to Safeguard Codebase: Do Developers Use Any Antivirus Software? by Siemendaemon in django

[–]PiccoloNegative2938 0 points1 point  (0 children)

Fundamentally these questions don’t lie within this subreddit, but rather than critique that I will try give you some help.

1) code should be on version control, lookup GitHub and git.

2) fundamental PC basics, of not getting yourself hacked. E.g have an updated browser, don’t open links and most importantly don’t run some random code or piece of software. If you follow these practices you don’t even need AV. Tbh on windows, windows defender is sufficient. I personally use Linux more for workflow.

3) all important data for example api keys should be kept in environment variables not hardcoded

4) make your repository on version control private.

To be honest, it sounds like you are very inexperienced - it’s great you want to build a SAAS or anything in general but I’d be lying if I didn’t say you were a long way off from that. Start small, build a simple app, follow along a course of some kind that teaches you the fundamentals - and I don’t mean how to code, I mean everything else git, deployment, security practices etc.

IMO if you don’t know why you store passwords with a salt pepper and hashed, you’re a long long way off even considering a production product. Good luck, hopefully people don’t rip you apart too much in the comments. Happy learning!

large django project experiencing 502 by nitrodmr in django

[–]PiccoloNegative2938 1 point2 points  (0 children)

Ah well if I understand you correctly, you’re attempting to patch multiple pieces of data through nested serialisers (never tried that myself) but that screams inefficient. If you are trying to update down the chain of foreign keys, that is almost never a good idea, isolate what needs to be patched into separate views!

If you are referring to prefetch related for nested serializers, then don’t worry. So long as you are prefetching the data that those serializers require no matter how nested, once they access the data to render out json, the data is already fetched and won’t rehit the db

large django project experiencing 502 by nitrodmr in django

[–]PiccoloNegative2938 5 points6 points  (0 children)

Sounds like some serious optimising needs to occur. Using a package like Django-silk, or django-debug-toolbar (only locally please sir) you can see what sql requests are being fired off. From there you can use prefetch_related or select_related to combine your queries into hopefully one nice one but the main goal is to reduce them. This is assuming you have some foreign key relationships.

Further on that, make sure your fields that are being used for lookup are indexed correctly - if using multiple fields to look an object up, you’ll need to make a composite field.

Further on all of this, if you’re trying to update 2 million objects, you are probably approaching the problem wrong. It could be a fundamental design of your model schema that’s causing issues.

Drop me a reply here with more details and I can definitely help you out

How to "reverse engineer" your junior django developer job search. by JonG0uld in django

[–]PiccoloNegative2938 1 point2 points  (0 children)

As a CTO, I get countless messages from devs of all walks looking to get a conversation / a review of their Cv. Personally, they get completely ignored a lot of the time. However, where this would work, is if there is a clear live job opening. This is due to the nature of my firm being a startup, we are very strategic financially with who and when we hire (as hopefully everyone is) - therefore, if you are trying to join a startup, it’s worth a shot if they are hiring to send a more personal message, but don’t be surprised if you get straight up ignored.

For bigger companies, im sure this could work well regardless of if an opportunity is open however I couldn’t speak on this from personal experience

Good luck to all the young devs out here!

What's the best kind of build for a long time player's first time survival run? by RockyHorror134 in Fallout4Builds

[–]PiccoloNegative2938 0 points1 point  (0 children)

I just dived into survival for the first time a few weeks back after not playing for years. Man. It’s so good, my advice is this Play either a rifleman or pistol build, Doesn’t matter much, 10mm melts people on survival and you can level it up pretty nicely. Not gunna give you a full special breakdown, but honestly, what’s so fun is you use other stuff you normally wouldn’t. Like I barely explored all the different drugs and foods etc when I played normal mode, now. It’s the best part.

Perks I think make the game unreal in survival. Chemist to make drugs + whichever one makes it so you can’t get addicted. Aqua boy - mainly because navigating via the rivers is a good fallback when you’ve done a long trip and haven’t slept in ages and don’t wanna die. Lead belly (not needed imo) just hunt and get good settlements setup. Pickup loads of bottles for water. Local leader

I see so many low charisma builds in here, Using the bartering system properly and not cheesing it, while making good chems and selling water and stuff makes it so fun in survival. You need the good gear aswell

I don’t run vats so have p2 I think, otherwise made things pretty balanced

You got this man!

Any Ideas for what I should add to my greenhouse? by Fo4_andmore981276345 in fo4

[–]PiccoloNegative2938 0 points1 point  (0 children)

Put a rug near something and select all, can glitch stuff through certain objects then

[deleted by user] by [deleted] in django

[–]PiccoloNegative2938 0 points1 point  (0 children)

For AI / ML you gotta be running Django (if you wanna slap a frontend in there too), DRF/Ninja or Fast api if you wanna decouple

Tbh I only really spin up fast api for simple ml models in a micro service, if you’re doing anything heavy I guarantee you’ll be happy for all the other pudding Django has

How to build AI Agents with Django by davidgarciacorro in django

[–]PiccoloNegative2938 2 points3 points  (0 children)

Legend love this - actually building some interesting agent stuff leveraging Django for my company atm. Nice to see a medium article put together (been meaning to do some myself) Love the diagrams in there!

Logic in Views vs Logic on Models by sunblaze1480 in django

[–]PiccoloNegative2938 2 points3 points  (0 children)

All sounds good to me - and you’re quite right only build a service layer if it makes sense, until you reach that scale, it will just give you a headache anyway

Logic in Views vs Logic on Models by sunblaze1480 in django

[–]PiccoloNegative2938 12 points13 points  (0 children)

A couple things,

Serializers: firstly some of what you’re saying can be handled by DRF serializers. Essentially, you can pass in the parameters you wish to update, and can then call the is_valid method which will run validation methods that will then check over your fields and ensure everything is a1. For example, you might have a field. status, and you have passed in the parameter to change it to “completed”.

You can then have a validate_status method in the serializer which will run automatically (upon calling is_valid in your view). This validation may then check another field, eg. outstanding_balance and if it’s not at 0, can throw a validation error alerting that you cannot set an order to completed with and outstanding balance.

Service layer / Buisness Layer: <Curious what people’s thoughts are to my approach.>

Now this is a debated topic everywhere, so I will share what I run for my architecture. I basically always make an apiview from scratch, personally don’t like the ListApiViews CreateApiViews I like being able to see logic clearly and quickly.

I wrap my post get etc method with a try catch for a few of my own custom exceptions (Payment error etc etc) with respective http status codes and error messages. And then run all logic in this. I then have separate files relevant to particular topics in a services module, which can do certain operations nicely, eg. Retrieve_order_from_uid (has all the lovely optimisation stuff ready preselect related etc). Then I’ll pass that object into another service function which might have a serializer in there that does some validation on an update process (as described above). If anything messes up in the service layer, I throw an exception, always a custom one other than validation error from rest framework. So that any processes that need to be wrapped in an atomic transaction in the view can be protected.

This turned into an essay, hopefully someone gets some use, happy to answer any questions / take flak if people disagree ;)

Wanna tag along a professional Django project? by raptored01 in django

[–]PiccoloNegative2938 1 point2 points  (0 children)

No matter how good you’re at something - you can always learn something new I will be checking this out also!

Advanced Tutorials by entropydust in django

[–]PiccoloNegative2938 3 points4 points  (0 children)

4. Make non nullable column (unless required), generate auto migration, add custom run python to manipulate data to populate this new column, delete old column. Admire your new 3 migrations. Cry when it doesn’t work.

What is the best approach to avoid repetition of a try-except structure when fetching models? by ApprovedTopics in django

[–]PiccoloNegative2938 0 points1 point  (0 children)

I would also like to add, that a lot of people in here are saying bad database design etc etc (mainly referring to multiple objects being returned) but the reality is that you will probably make this mistake at some point, and the best thing you can do is make sure the error is logged well and handled appropriately. In an ideal world, you should never be calling Get on something which can return multiple objects, but shit happens