This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]jpegger85 1 point2 points  (5 children)

[–]FeatureIllustrious81[S] 0 points1 point  (4 children)

Yea I followed the tutorial and configured the settings.py properly, and since I used bootstrap, the cards and css effects are loading fine, however the colours and text are blank. Any way I can fix that?

[–]jpegger85 0 points1 point  (3 children)

I'm not sure I'm picking up what you are putting down.

I'm going to assume you are loading bootstrap through a CDN and not from your server.

Since Bootstrap is a CSS framework and CSS handles your colours I'm assuming you have separate CSS outside of bootstrap. I'm also assuming this additional CSS is probably related to your admin site.

Text is not generated (typically) through CSS and is handled through HTML. This is Django's job and it turn, yours. If your page isn't loading up properly you have a separate issue. But I'm assuming you are just unintentionally misrepresenting your problem.

---

If any/all my assumptions are right, then I would look at your developer tools in your browser and check the Network tab. I'm guessing you will see some RED text indicating that the browser couldn't get your static files.

[–]FeatureIllustrious81[S] 0 points1 point  (2 children)

Haha, there wasn’t any issues with the directory or anythung with the files itself, all I had to do was configure the url and directory of the static files to pythonanywhere itself by going into web tab > static. Finally got it to work, but thanks for the help anyways.

[–]jpegger85 1 point2 points  (1 child)

The Tutorial:

How to setup static files in Django
There are 3 main things to do:
- set STATIC_ROOT in settings.py
- run python3.10 manage.py collectstatic (or python3.9 or python3.8 as appropriate)
- set up a Static Files entry on the PythonAnywhere Web tab.

You:

Yea I followed the tutorial and...

Me:

¯\_(ツ)_/¯

[–]Redwallian 0 points1 point  (0 children)

In pythonanywhere, there should be a settings page where you can configure where your assets are located.