issue with bootstrap

42 views
Skip to first unread message

Tosin Ayoola

unread,
Aug 9, 2018, 11:31:49 AM8/9/18
to Django users

Halo guyz working on a Django project that requires me using bootstrap but the issue I'm having is that I can use the load static to include bootstrap @ be base_generic.html, but can't use it with the index page, tried fixing it, what should I do, how to i fix this and move on ?

Kasper Laudrup

unread,
Aug 9, 2018, 2:10:55 PM8/9/18
to django...@googlegroups.com
Hi Tosin,
You're question is extremely vague, so it's not really clear how you are
using bootstrap and what your problem is.

I have personally used django-bootstrap4:

https://django-bootstrap4.readthedocs.io/en/latest/

Which works well in my experience.

If you have problems using it in other templates than your base
template, remember that you need to load it on every template you use,
even if it's extending another template that has already loaded the
template library.

Hope that helps. Otherwise, please provide some more information.

Kind regards,

Kasper Laudrup

Tosin Ayoola

unread,
Aug 10, 2018, 3:58:25 AM8/10/18
to django...@googlegroups.com
oh Thanks for the reply, I load it at each of the templates i intend using it with but the I still getting same issues, it only shows the content of the generic page, even after using the loading it.



--
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/7a80655d-3fd3-8f07-5374-2cc6eb12984a%40stacktrace.dk.

For more options, visit https://groups.google.com/d/optout.

Kasper Laudrup

unread,
Aug 10, 2018, 4:17:49 AM8/10/18
to django...@googlegroups.com
Hi Tosin,

On 08/10/2018 09:57 AM, Tosin Ayoola wrote:
> oh Thanks for the reply, I load it at each of the templates i intend
> using it with but the I still getting same issues, it only shows the
> content of the generic page, even after using the loading it.
>

It sounds like the browser is not loading the bootstrap CSS files. Try
to look at the developer console in your browser and see if any errors
are shown there.

Also, please provide some more details.

Are you using the bootstrap4 Django package I linked to or are you
loading bootstrap some other way?

Which errors do you see in the browser console (if any)?

Which errors do you see in the output from django runserver (if any)?

Or anything else that might help others help you.

Kind regards,

Kasper Laudrup

Tosin Ayoola

unread,
Aug 10, 2018, 4:22:17 AM8/10/18
to django...@googlegroups.com
thanks, but the browser is actually loading it because, the bootstrap i'm using at the base.html is been loaded by the same browser



Kind regards,

Kasper Laudrup

--
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.

Tosin Ayoola

unread,
Aug 10, 2018, 4:43:18 AM8/10/18
to django...@googlegroups.com
Maybe it is my error that is leading to that, I have it uploaded on github this is the link https://github.com/olaneat/ask_the_schools, probably you can be of help.
thanks

Kasper Laudrup

unread,
Aug 10, 2018, 5:03:09 AM8/10/18
to django...@googlegroups.com
Hi Tosin.

On 08/10/2018 10:42 AM, Tosin Ayoola wrote:
> Maybe it is my error that is leading to that, I have it uploaded on
> github this is the link https://github.com/olaneat/ask_the_schools,
> probably you can be of help.
> thanks
>

So you are not using the boostrap django package I linked to earlier,
but instead you have copied the CSS and javascript files to you static
directory. Information like that is quite useful if you want someone to
help you.

Quickly looking at your templates, I can see that you are attempting to
include the bootstrap CSS in the body of your rendered HTML page in the
index template. That will probably not work. At best, it probably just
doesn't do anything. That is probably not the cause of your error, but
it is definitely suspicious.

If I were you, I would look at the HTML django sends to your browser for
the index page. There should be one link reference to you static files
bootstrap CSS in the head section.

Debugging this further would require me to checkout your code and
attempt to run it, which I don't have the time for right now.

Kind regards,

Kasper Laudrup
Reply all
Reply to author
Forward
0 new messages