Can you try moving the templatetags directory to be underneath the webpage directory. I think that templatetags should be a part of an app.
Right now your templatetags are under the mysite folder, which if I'm not wrong isn't considered an app. Regards, Asad Jibran Ahmed <surfer...@gmail.com> http://blog.asadjb.com On Tue, Jan 10, 2017 at 12:43 PM, Anjali Mk -X (anmk - WIPRO LIMITED at Cisco) <a...@cisco.com> wrote: > Asad, > > > > > > My Application directory hierarchy is like this: > > Project is “mysite”, Application within the project mysite is “webpage” > > mysite > > |_ webpage > > |_ __init__.py > > |_ views.py > > |_ urls.py > > |_ models.py > > |_ static > > |_ templates > > |_ mysite > > |_ __init__.py > > |_ settings.py > > |_ urls.py > > |_ admin.py > > |_ templatetags > > |_ __init__.py > > |_ nbsp.py > > > > > > Regards, > > > > [image: banner7] > > > > *Anjali Mk* > > Engineer - Software > > a...@cisco.com > > Tel: *8 066 3356* > > *Cisco Systems, Inc.* > > No: 72 & 73, Keonics Electronics City Hosur Main Road > BANGALORE > 560100 > India > cisco.com > > > > [image: http://www.cisco.com/assets/swa/img/thinkbeforeyouprint.gif]Think > before you print. > > This email may contain confidential and privileged material for the sole > use of the intended recipient. Any review, use, distribution or disclosure > by others is strictly prohibited. If you are not the intended recipient (or > authorized to receive for the recipient), please contact the sender by > reply email and delete all copies of this message. > > Please click here > <http://www.cisco.com/web/about/doing_business/legal/cri/index.html> for > Company Registration Information. > > > > *From:* django-users@googlegroups.com [mailto:django-users@ > googlegroups.com] *On Behalf Of *Asad Jibran Ahmed > *Sent:* Tuesday, January 10, 2017 1:09 PM > *To:* django-users@googlegroups.com > *Subject:* Re: Trying to print data containing a space in html > > > > Hi Anjali, > > Where inside your project are you storing the nbsp.py file? > > Regards, > > > Asad Jibran Ahmed <surfer...@gmail.com> > > http://blog.asadjb.com > > > > On Tue, Jan 10, 2017 at 11:09 AM, <anjalim...@gmail.com> wrote: > > I have a data attached with multiple spaces, I want to print the data on > html page along with spaces but in html spaces are getting stripped off. I > found a solution of creating a package as nbsp and use that in template. I > tried that but it is throwing error as " > > 'nbsp' is not a registered tag library > > I am able to import nbsp package which I have kept in templatetags > directory explicitly in python interactive mode "python manage.py shell". > > Below is the code details: > > nbsp.py: > > from django import template > from django.utils.safestring import mark_safe > > register = template.Library() > > @register.filter() > def nbsp(value): > return mark_safe(" ".join(value.split(' '))) > > html: > > {% load nbsp %} > > {% for x in data %} > > {{ x | nbsp }} > > {% endfor %} > > > > Pleas let me know ur suggestions where I am going wrong. > > > > > > Thanks in Advance, > > Anjali > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@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/75478ccd-feed-4835-9e67-4474a2bfc246%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/75478ccd-feed-4835-9e67-4474a2bfc246%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@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/CA%2BYYaWc%2Bsq6eARE%3DXz2UKEG4pEVC3x9vkM4G2jd7FNpC > UyrJLA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CA%2BYYaWc%2Bsq6eARE%3DXz2UKEG4pEVC3x9vkM4G2jd7FNpCUyrJLA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@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/96b399c2385e41ebbe31b726864842 > 88%40XCH-ALN-003.cisco.com > <https://groups.google.com/d/msgid/django-users/96b399c2385e41ebbe31b72686484288%40XCH-ALN-003.cisco.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users@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/CA%2BYYaWdFqgnzjt1%3Dnc7GHOPqYWt9mU2z%2BV2msbOXUr_R_bPdJw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.