CSS not showing on Github pages - github-pages

My CSS is not showing. This is my first time using Github Pages and I'm really confused.
The link to the site is: https://jevoncochran.github.io/index.html
The link to the repo is: https://github.com/jevoncochran/jevoncochran.github.io
I tried playing around with the CSS link in the html file
this is what I have now:

<link href="css/index.css" rel="stylesheet">
In your index.html, the above line should be:
<link href="index.css" rel="stylesheet">

Related

Django ckeditor codesnippet plugin shows codes without color

I am using ckeditor in my django project, everything is working fine, but when add code snippet there is only simple text code without colors but in my admin panel it is normal.
add it in html
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/default.min.css"> 
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/styles/monokai.min.css"> 

Flask does not loads css with url_for()

I am writing a flask web application that needs to have css. I have used the correct syntax, i think.
my web application is at its start and the css is simple too. I don't know why the flask won't load my css.
the code i used to link css to the html file
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">
image contains file structure, code and localhost browser image
You are getting HTTP 404 errors trying to get /static/static/style.css. You have the line correctly in the question here, but in the Jinja template (on the screenshot), it reads:
<link rel="stylesheet" href="{{url_for('static', filename='/static/style.css')}}">
i.e. there's /static/ added in the filename. Remove it and make it read
<link rel="stylesheet" href="{{url_for('static', filename='style.css')}}">

error with an url that does not exist in my project in django

I was having this issue just in my production environment. I have an icon that is in my static files. I can load it through https://mydomain/static/img/favico.ico, but at the same time I get a 500 error for the following url https://mydomain/favico.ico . <- this url does not exist in my project.
I can't replicate in my local environment. I already did collectstatic.
The default favicon URL is /favicon.ico.
You should change it in your template to what you need:
<link rel="shortcut icon" type="image/png" href="{% static 'img/favico.png' %}"/>
make change in href and type according to your favicon file.

How can I change the Django Admin Static Files url?

I'm hosting my Django project on my own server, and exactly as the docs say, the Django admin media stop showing up.
The solution is simply to host it yourself, which I'm doing. The problem I'm having is that the url the Django admin is using to try to find them is incorrect. Specifically, Django is looking at
<link rel="stylesheet" type="text/css" href="/ceasarb-cfa/admin/css/base.css">
when I want it to look at
<link rel="stylesheet" type="text/css" href="/ceasarb-cfa/static/admin/css/base.css">
My question is, how can I change that path?
Intuitively, I've tried adjust the ADMIN_MEDIA_PREFIX file in settings.py (currently set to /ceasarb-cfa/static/admin) but fiddling with that value didn't seem to change anything.
My guess is that your settomgs.py you have:
STATIC_URL = "/ceasarb-cfa/"
but it should be
STATIC_URL = "/ceasarb-cfa/static/".
Here's more documentation on that setting:
https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-STATIC_URL

Django template not loading javascript and css properly due to urlpatterns

When this one runs everything goes fine:
(r"^newobject$", "views.myobjects.newobject"),
All the CSS + JS files are properly fetched from:
static/css/...
static/js/...
When this one runs:
(r"^mybjects/(([a-z]|[A-Z]|[0-9])+)$","views.myobjects.loadobject"),
All the css and JS files that are being fetched, are run trough the urlpatterns and are returning my defailt page:
(r"", 'views.main.index'),
This makes all my CSS and JS code to actualy be HTML. My guess is that i'm giving some noob mistake. Is there any common reason why this should happen? And how to fix it?
Edit:
Css example:
<link href="static/css/style.css" type="text/css" rel="stylesheet">
JS example:
<script src="static/js/libs/date.js" type="text/javascript"></script>
See the difference:
when you access *some url*/newobject the static/css/style.css refers *some url*/static/css/style.css*
when you access *some url*/newobject/whatever the static/css/style.css refers *some url*/newobject/static/css/style.css*
If your URL will always be floating around in depth, include your javascript and CSS using URLs relative to the server root (start them by /) instead of relative to the current dir.