Typically, we set it to "/static/".
STATIC_URL = "/static/"
Don't forget to run your collectstatic management command.
python manage.py collectstatic
-----Original Message-----
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of johnf
Sent: Thursday, May 11, 2017 7:29 AM
To: Django users
Subject: trouble with setting static for img and css
Hi folks,
I have researched this issue and I know all I have to do is read the doc's. But I can seem to get the correct path working to allow the website to find the correct files in my Media,CSS and JS folders.
I'm using 1.11.x and have the following setup in OS file system.
I have set DEBUG = True
/z/pes_django1.11/pesweb/ is where my manage.py is located - it runs just fine.
my files are in
/z/pes_django1.11/pesweb/static/static/css/ - this of course is for CSS
/z/pes_django1.11/pesweb/static/static/js/ -this of course is for JS
/z/pes_django1.11/pesweb/static/static/img/ -this of course is for images like favicon.ico
In my settings.py file I have tried many combinations such as:
STATIC_URL = '/pesweb/static/static/'
STATIC_URL = '/static/static/'
STATIC_URL = '/pesweb/static/'
So would some kind soul please tell me what I need in STATIC_URL, and MEDIA_URL.
Thanks in advance,
Johnf
--
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-users@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/4bf10da8-e78b-147c-78dd-0d4206143ba9%40jfcomputer.com.
For more options, visit https://groups.google.com/d/optout.
--
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-users@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/93aa2844d50e461e9c5f46a42b6eacf9%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment