Reusable Code like Helper OR Component.

17 views
Skip to first unread message

Pravin Yadav

unread,
Jun 11, 2018, 10:23:10 AM6/11/18
to Django users

Hello,

I have created the websites in Python 3.6 and Django 2.0.6. I have created separate the header.html, footer.html, index.html & base.html.  I want to create the reusable code like Helper OR Component. I have no idea about this how to create the helper or component. if any one know abut this kindly let me know.


Thanks,

Pravin Yadav

Pravin Yadav

unread,
Jun 12, 2018, 9:03:55 AM6/12/18
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a920009c-ca15-4fe4-a146-26cfddef809b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony Flury

unread,
Jun 12, 2018, 11:16:53 AM6/12/18
to Pravin Yadav, django...@googlegroups.com
Reusable components are exactly what separate apps are for; Give your
resuable code a nice API - whether it adds new field types,
new models, new templates etc, and then put that all in an app.

Writing an entirely reusable app takes a lot of skill and thought in my
experience; extra fields, model mixins, new tags and even new
middle-ware components are relatively straightforward; providing
reusable templates that another project can extend easily can be
challenging.

The key in my experience is to document it all - make sure you write
down exactly how you re-use your components.
> --
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users...@googlegroups.com
> <mailto:django-users...@googlegroups.com>.
> To post to this group, send email to django...@googlegroups.com
> <mailto:django...@googlegroups.com>.
> <https://groups.google.com/d/msgid/django-users/a920009c-ca15-4fe4-a146-26cfddef809b%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--
--
Anthony Flury
email : *Anthon...@btinternet.com*
Twitter : *@TonyFlury <https://twitter.com/TonyFlury/>*

Reply all
Reply to author
Forward
0 new messages