0👍
I finally discovered the error: Apache was running as default and serving the html templates in port 80, but without permissions for the static files.
1👍
The settings you have are generally discouraged, for local development they will work fine, however if you were to attempt to run that on a Linux based machine, it wouldn’t work.
Here’s how it should be formatted:
Here are the settings that would make it like that:
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
#this applies to all operating systems
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static', 'static_dirs'),
)
You would put your static folders and files in “static_dirs”, and then whenever you needed to sync to “static_root”. You would type: “python manage.py collectstatic”.
In your template file you would then type:
{% load static from staticfiles %}
<img id="logo" src="{% static "images/logo.png" %}"\>
That should work.
- Email send in django
- Static files not showing up on live server
- How to send the data to Loading Html page directly without any request while the data is getting processed in views.py in Django
- How to put default avatar for a user
- Create a unit test using Django's test client post method passing parameters and requesting JSON from rest_framework
0👍
check if the source is loaded using view source and if yes from there check if any link to your static assets are accessible if present then you have to hard refresh the browser
- The value of 'prepopulated_fields' refers to 'slug', which is not an attribute of 'shop.Product'
- Django cant upload image
0👍
You comment in reply to the post by Allen Fernandes above indicates you are in DEBUG mode. Is django.contrib.staticfiles
in your INSTALLED_APPS
?
- Django session IDs for anonymous sessions
- Django Signal User when is registred with facebook
- Django sending email not show up in inbox