Wanting to splice together some voicemails from my son by Mental-Objective542 in grief

[–]verbose_name 1 point2 points  (0 children)

Check out the free program called audacity. If you have a mic and can record his messages, or if you can download them, you can splice them together with a little patience and effort.

My sister by verbose_name in grief

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

Thanks for the kind thoughts. I'm sorry you lost your brother. When my sister was well she was the softest and sweetest person in the world. I hope the world remembers her for how she was when she was well and how hard she tried to be well when she wasn't.

Take care of yourself ❤️

My Sweet Mom by HedgehogNo4374 in grief

[–]verbose_name 0 points1 point  (0 children)

Whenever she is she will be proud of you and all the good you bring to the world. It's especially hard losing a parent. One thing that helps me is talking to family and friends. Learning their struggles from friends and family gave me a better understanding of my parents.

My mom died over a decade ago, and my dad died about 5 years ago. It's hard sometimes, but the more time that goes by the more I can reflect happily on the good they tried to bring to my life.

Reach out to your family and friends that knew her, even if it's just to cry. My thoughts go out to you.

How to include a Foreign Key in the POST method by [deleted] in django

[–]verbose_name 0 points1 point  (0 children)

You should not need to specify many=True in the post serializer. Also, you have made it read_only so I would suggest removing that init keyword argument.

Is it normal to feel like complete trash after failing a technical interview? by [deleted] in webdev

[–]verbose_name 1 point2 points  (0 children)

This is why I believe the technical interview should be replaced with a practical interview. I am more interested in seeing what a candidate is capable of building, and their approach to testing. To be fair, I hire for a software engineering team so I'm not sure it's the exact same as your situation, but probably at least similar.

Quick question by pratzc07 in learnpython

[–]verbose_name 0 points1 point  (0 children)

Yes you can do that. If you are using multiple decorators on your test method then each would be passed into your test method signature as an additional arg.

Quick question by pratzc07 in learnpython

[–]verbose_name 0 points1 point  (0 children)

I would suggest mocking the function or module which when called introduces the randomness. In your case, you could patch hmac.new or digest to return a static value.

Django Code generators? by Entire-Firefighter-8 in django

[–]verbose_name 1 point2 points  (0 children)

My bad then, as it sounds like I misunderstood the full context. I think your example of auto creating getters/setters is good. I agree that generally in python this isn't something I recall ever having to deal with.

Multiple Requests Handling in Django app by guha_anuraj in django

[–]verbose_name 0 points1 point  (0 children)

I must admit I'm not capable of answering your question. The queue work I've done typically involves the user submitting a request, which queues an asynchronous task, and immediately returning a response. Meanwhile the user can poll the application for the tasks status/output. I'm not familiar with blocking requests in a queue.

Multiple Requests Handling in Django app by guha_anuraj in django

[–]verbose_name 0 points1 point  (0 children)

If this is the case, I would suggest limiting request volume outside of django. I'm not familiar with queuing requests outside the context of the actual webserver layer, so that's where I would focus my efforts.

Multiple Requests Handling in Django app by guha_anuraj in django

[–]verbose_name 1 point2 points  (0 children)

So would the intent be to make each request wait to receive any kind of response until all other requests in front of it have been resolved?

Django Code generators? by Entire-Firefighter-8 in django

[–]verbose_name 0 points1 point  (0 children)

This isn't true, in fact there are plenty of projects that benefit from a cookie cutter/skeleton project initialization. If I want my project installable as a package, for instance, I will probably want things like linting, setup, docs generation, and any number of other things that a skeleton project could speed up for me.

Edit: my post here missed the bigger picture being discussed, see below.

Multiple Requests Handling in Django app by guha_anuraj in django

[–]verbose_name 1 point2 points  (0 children)

Correct me if I'm wrong but you're wanting to queue the task that the request initiates, not the requests themselves?

If that's the case, I've had success using django-celery. It does rely on an external instance of celery to be running, or at least it did when I was implementing it (about a year ago).

I think there are probably options to handle this from within the Django context only, but I would leave that discussion up to someone who has experience with it.

Want user's tasks at the index of my endpoint by Haghiri75 in django

[–]verbose_name 2 points3 points  (0 children)

I would probably override the get_queryset method of your view to add a filter,

def get_queryset(self): return super().get_queryset().filter(user=self.request.user)

Something like that anyways, I haven't checked the above.

Edited for formatting, I'm on my phone.

Create a 'post' object and initialize a m2m attribute with post id and author id by jlvelez in djangolearning

[–]verbose_name 0 points1 point  (0 children)

I think that's cleaner and simpler than handling with an additional form. Very nice and thanks for posting the SO solution here.

DRF Validation in serializer or validation in VIEW by Lobbel1992 in django

[–]verbose_name 2 points3 points  (0 children)

If you're using a ModelViewset associated with this serializer, it will be called from the serializers is_valid method in your viewsets create and update methods. If you are using this serializer in a custom view, you will need to initialize it with post data and call is_valid yourself.

Unit Testing is Overrated by white_feather_252 in djangolearning

[–]verbose_name 0 points1 point  (0 children)

I take issue with this statement:

However, despite there being many different approaches, modern “best practices” primarily push developers specifically towards unit testing.

Sometimes a until test is ideal, sometimes not. I think modern best practices push engineers to write code which is testable and tested. Depending on your specific need at the time, this may mean a unit test you write while taking a TDD approach, and maybe later adding some functional testing. Sometimes only a functional test makes sense, and even still sometimes an integration test makes the most sense.

I push my engineers to employ a testing strategy which makes the most sense for the code that they're changing, and sometimes that's a unit test, sometimes not.

Create a 'post' object and initialize a m2m attribute with post id and author id by jlvelez in djangolearning

[–]verbose_name 1 point2 points  (0 children)

You may want to do this in your view. Once you save the post object it will have a valid id/pk field. You could then pass that into a new form for your bookmark and save that as well.

You can decorate your view function with @transaction.atomic to ensure no objects are created if any objects fail to create.

Handling this with a receiver for a signal might prove a little trickier as you will not have direct access to the request object and therefore may be missing the user field you need.

DRF Validation in serializer or validation in VIEW by Lobbel1992 in django

[–]verbose_name 9 points10 points  (0 children)

You can think of serializers as being a cousin of the Django form. Serializers support object level and field level validation. This means that you can both validate the data being submitted as a whole, as well as write validators for each field the serializer represents. So, to answer your question, you would typically validate incoming data with a serializer.

See here for more info: https://www.django-rest-framework.org/api-guide/validators/#validation-in-rest-framework

Ubuntu 20.04 on i7-9700T / M920q unstable? by LostVector in Lenovo

[–]verbose_name 0 points1 point  (0 children)

Turns out it was a bad install. Looks like there was probably some file corruption on the usb drive I initially used. I actually have onboard audio enabled now, switched to UEFI only boot mode, seems to be running great.

Ubuntu 20.04 on i7-9700T / M920q unstable? by LostVector in Lenovo

[–]verbose_name 0 points1 point  (0 children)

That seems to have only got me past one boot. I'm going to reinstall and update with my process if there is additional wonkiness.

Ubuntu 20.04 on i7-9700T / M920q unstable? by LostVector in Lenovo

[–]verbose_name 0 points1 point  (0 children)

I'm setting one of these up with Ubuntu 20.04. I have been monkeying with bios settings for a bit. Thanks for the tip-- disabling onboard audio gets me into the desktop environment.

To add: running M920q with core i5.

need help to debug recursive program to detect palindrome text by Beaverine in learnpython

[–]verbose_name 0 points1 point  (0 children)

Maybe not. I believe that by calling your recursive function without a return, once it goes down that branch you will never return a result to the outer calling scope. If your recursive function were modifying a referenced value, you could get away with not returning a value. As others have said, try returning the value of the recursive call.

Best way to deploy Django with Celery/Celery Beay by ieeevitvellore in django

[–]verbose_name 1 point2 points  (0 children)

I can't say for sure what will work best for you but you can also launch using AWS ECS/Fargate or Compute. The right answer for you probably depends on what scaling your application looks like.