django template

49 views
Skip to first unread message

ngangsia akumbo

unread,
Jul 16, 2014, 3:47:57 AM7/16/14
to django...@googlegroups.com
Good Morning Django Users
I have a question.

I am building a website for django and this site will consist of separate apps.

I have created the first app already with a base.html file.
OK, when i am creating the second app will it inherit from the base.html template
or i will have to create a separate base.html for that app?

Andreas Kuhne

unread,
Jul 16, 2014, 5:11:45 AM7/16/14
to django...@googlegroups.com
Hi,

All of your templates are available in all of your apps. So you can use a template from one app in another app (our website is created this way). In other words you can continue to use the same base.html for the second app as well.

Regards,

Andréas

--
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.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ab515a24-5ec0-415c-add9-7dfa2b76fa51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

ngangsia akumbo

unread,
Jul 16, 2014, 7:38:45 AM7/16/14
to django...@googlegroups.com
After creating these app with their html files , how do i link them together ?
I am sorry if the question is stupid


On Wednesday, July 16, 2014 10:11:45 AM UTC+1, Andréas Kühne wrote:
Hi,

All of your templates are available in all of your apps. So you can use a template from one app in another app (our website is created this way). In other words you can continue to use the same base.html for the second app as well.

Regards,

Andréas

2014-07-16 9:47 GMT+02:00 ngangsia akumbo <ngan...@gmail.com>:
Good Morning Django Users
I have a question.

I am building a website for django and this site will consist of separate apps.

I have created the first app already with a base.html file.
OK, when i am creating the second app will it inherit from the base.html template
or i will have to create a separate base.html for that app?


 After creating these app with their html files , how do i link them together ?
I am sorry if my question is stupid

Andreas Kuhne

unread,
Jul 16, 2014, 7:43:29 AM7/16/14
to django...@googlegroups.com
Hi again,

You can create separate base files, but you will have to save each under different names. For example if you had an app called website, you could have a website_base.html that has {% extends "base.html" %} in it.

As to how to link them together? What do you mean?

Each app should contain a separate piece of your website. For example if you are creating a webbshop, you could put the products in one app, the checkout in another. Then all you need to do is include your views from each app in a urls.py file, and then the views will be exposed to your website.

Regards,

Andréas


2014-07-16 13:33 GMT+02:00 ngangsia akumbo <ngan...@gmail.com>:
ok can i create a seperate base.html in other app and link that app to the main base.html file. 

because after creating all these html files which links back to the main base.html, how would i link them?

Thanks


On Wednesday, July 16, 2014 10:11:45 AM UTC+1, Andréas Kühne wrote:
Message has been deleted
Message has been deleted

Andreas Kuhne

unread,
Jul 16, 2014, 10:12:51 AM7/16/14
to django...@googlegroups.com
Hi,

Sure, but I won't always be able to answer :-)

Regards,

Andréas


2014-07-16 13:49 GMT+02:00 ngangsia akumbo <ngan...@gmail.com>:
Thanks bro for this inside , can i always contact u personally if i had some issues please.

I am from western Africa - Cameroon.

Thanks in advance

--
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.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.

ngangsia akumbo

unread,
Jul 17, 2014, 3:19:40 AM7/17/14
to django...@googlegroups.com
Thanks 

ngangsia akumbo

unread,
Jul 17, 2014, 3:20:50 AM7/17/14
to django...@googlegroups.com
Thanks 



On Wednesday, July 16, 2014 3:12:51 PM UTC+1, Andréas Kühne wrote:
Reply all
Reply to author
Forward
0 new messages