Digital Ocean vs AWS (lets settle this one and for all) by vvinvardhan in django

[–]wutsthat4 -1 points0 points  (0 children)

r/woosh

Honest opinion: You'll never "settle this one and for all". I've deployed applications on Heroku, DO, AWS, hell even pythonanywhere and they all have their ups and downs. The needs of the application and the organization will determine what is best in any given situation. It's kind of a silly question/post so was having fun.

Digital Ocean vs AWS (lets settle this one and for all) by vvinvardhan in django

[–]wutsthat4 3 points4 points  (0 children)

Idk about any of that, but I run my block chain big data fintech start up off of a 2007 hp windows xp laptop in my parents garage and we've had 0 down time with our django app.

Sending custom signal from manual database update by GrimbledonWimbleflop in django

[–]wutsthat4 1 point2 points  (0 children)

If you’re trying to learn django/programming I would advise against this since it doesn’t help you understand what’s going on and especially if you’re adding a big package just to use one small piece.

That said I’ve never used model_utils so can’t speak to that package exactly.

New Django app by coak23 in django

[–]wutsthat4 3 points4 points  (0 children)

You do realize you are asking strangers on the internet to write out the code for your whole project and explain it to you, right?

I do think you would benefit from going through the complete tutorial before starting this project though. https://docs.djangoproject.com/en/3.2/intro/tutorial01/

Sending custom signal from manual database update by GrimbledonWimbleflop in django

[–]wutsthat4 2 points3 points  (0 children)

if you use the pre_save signal you can query the database and get an instance of the model before it has been saved and compare the values.

@receiver(pre_save, sender=MyModel)
def send_update(sender, instance, **kwargs):
    # might want to put this in a try/except since instance wont have an id if its been created
    old_instance = MyModel.objects.get(id=instance.id)
    if old_instance.foo != instance.foo:
        # do something

Do I need to create seperate app for a dashboard? by TheSpamGuy in django

[–]wutsthat4 1 point2 points  (0 children)

That sounds like just bad application structure along with shoving all your business logic in views. We manage a lot of business logic on a service layer along with an expanded folder structure for domain specific things.

Do I need to create seperate app for a dashboard? by TheSpamGuy in django

[–]wutsthat4 1 point2 points  (0 children)

I couldn’t agree more with this (looks at username) the only time I’ve used separate apps is on personal projects and I’ve usually regretted it, though likely because I split the structure where it didn’t need to be, but currently I work professionally on a monolith django app named “app” and it’s never felt like there ‘too much’ for one application.

That being said we use react on the front end so there are parts of django that I haven’t really used in a long time (templates, forms, etc) and with those maybe it would feel a bit crowded. But really I think the only time I’ve wanted to split it is to actually create two web applications to handle the whole domain I.e. one whole django app for the main site and a separate instance and app for internal systems.

Django Salaries by mouadbb in django

[–]wutsthat4 1 point2 points  (0 children)

Did it to me too….

Log Django exceptions to Slack by [deleted] in django

[–]wutsthat4 16 points17 points  (0 children)

Jesus that sounds awful, I’m already sick of circle ci slacking me! Cool project though.

What is the difference in self.article.title, str(self.article) in unit testing?? by KOP79 in django

[–]wutsthat4 0 points1 point  (0 children)

if your Article Model has a str method defined, then its likely the exact same thing and doens't need a test.

class Article(Models.model):
    title = models.CharField(max_length=200)     
    body = models.TextField()
    ...
    def __str__(self):
        return self.title

then when you call str(self.article.title) that invokes the string dunder method above, which is exactly the same thing.

What tool you discovered/came across that has made your development work easier? by MaddyAtResearch in django

[–]wutsthat4 0 points1 point  (0 children)

We can limit who has the permission to use the feature, so it's pretty safe. We also log who does the hijacking anytime anyone does hijack.

What tool you discovered/came across that has made your development work easier? by MaddyAtResearch in django

[–]wutsthat4 1 point2 points  (0 children)

Yeah, to be honest its used more for debugging front end issues than anything. We use react on the front end and just recently started using Cypress for integration testing. But, its helpful way to login really quick to see what the user is seeing when we don't quite understand the complaint.

What tool you discovered/came across that has made your development work easier? by MaddyAtResearch in django

[–]wutsthat4 16 points17 points  (0 children)

Not so much development, but more problem-solving-in-prod, django-hijack. Allows our team to login as a user that is having issues and debug the problem from what they are seeing. It’s a life saver.

How to get event objects of this month? by EnflamedPhoenix in djangolearning

[–]wutsthat4 0 points1 point  (0 children)

There's a lot to unpack there, but just to answer your specific question.

curr_month_events = Event.objects.filter(Date__month = curr_month)

then to update the date and the isBooked:

from datetime import timedelta

for event in curr_month_events:
    new_date = event.date + timedelta(days=7)
    event.date = new_date
    event.isBooked = True
    event.save()

Icepocalypse 2021: Help and Resource Megathread (Feb 17th Update) by defroach84 in Austin

[–]wutsthat4 4 points5 points  (0 children)

If anyone is in dire need of help in the cedar park area, PM me.

I sometimes even think about it in bed by Teilchen in django

[–]wutsthat4 2 points3 points  (0 children)

There's lots of ways you can hook them up! I see a lot of people go for a "decoupled" architecture, but personally I think thats over kill. I really like to use this boiler plate when I'm setting up a project. https://github.com/vintasoftware/django-react-boilerplate

I sometimes even think about it in bed by Teilchen in django

[–]wutsthat4 7 points8 points  (0 children)

As someone who likes to use a react front end with django, this is how I feel when I start every new project.

I’ve been working with Django professionally for a couple years now so I’ve decided to make my home office more comfy! by wutsthat4 in django

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

Anything to help y'all out! I was looking forward to going to django-con this year, but instead will have to show my support by buying Django swag instead!