Connect with us

ViralNewsDude.com

Django and DRY belief. : django


Viral News

Django and DRY belief. : django

Hi, I am learning Django (currently working on my first large project, third one overall), and I have a questioin about repeating my code. It seems to me that in Django this is an inevitable part of the experience, for example, when I want to have the same form on two different views in which…

Whats up, I am learning Django (in the meantime working on my first broad project, third one total), and I if reality be told obtain a questioin about repeating my code. It appears to me that in Django that is an inevitable portion of the journey, shall we embrace, after I desire to obtain the identical produce on two assorted views wherein there are some things performed on the produce sooner than posting it (ie I if reality be told obtain the produce to post a topic matter, and I test whether the person’s ip is banned (and when it’s whether the ban expiration date is in the lengthy lumber or past because if or now not it’s prior to now then I obtain to earn it), and to automatically add his ip to the thread object in my devices).

I if reality be told obtain learn, on this subreddit that, as you originate writing more code, you originate to switch your common sense from views.py to other recordsdata, nonetheless I make now not obtain any belief the explicit contrivance to construct that. I tried to search the accumulate, nonetheless I wasn’t successful.

I am fairly particular that there’s a better contrivance to construct things than what I am in the meantime doing, and that there are other novices available that are having the identical self-discipline that I am.

Thanks for the total replies.

Subscribe to the newsletter news

We hate SPAM and promise to keep your email address safe

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s Hot

To Top