Static Folder not loading

75 views
Skip to first unread message

hari49pf

unread,
Jan 28, 2021, 1:16:34 PM1/28/21
to Django users
Hi,

I am trying to load static file to my project its not loading,
I have changed the path of static in settting.py still its not loading static file.
tryed to check the file is loading by using
manage.py findstatic test.css
PLZ help


Regards,
Harish.B


Larry Martell

unread,
Jan 28, 2021, 1:21:20 PM1/28/21
to django...@googlegroups.com
Have you run collectstatic?

hari49pf

unread,
Jan 28, 2021, 1:27:30 PM1/28/21
to django...@googlegroups.com, Larry Martell
Yes, i did it created a folder with css & other files, but no use.

Frank Cipolone

unread,
Jan 28, 2021, 4:35:06 PM1/28/21
to django...@googlegroups.com
Whats your STATIC_DIRS, STATIC_PATH, and STATIC_URL and what it the tree to the folder your static is in?
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/928aaad3-3f02-45e4-91fa-d3a56da673db%40gmail.com.

hari49pf

unread,
Jan 29, 2021, 6:22:48 AM1/29/21
to Django users
Screenshot_2021-01-29_16-48-54(django_settings).png

above is a screenshot and path for the static folder. 

Frank Cipolone

unread,
Jan 29, 2021, 9:52:44 AM1/29/21
to django...@googlegroups.com
I’m sending from my phone so it won’t have markdown.

It looks like your not defining all of them properly. Put a static folder you’ll manually in trydjango/trydjango. This will be where Staticfiles_dirs gathers the files. Then static_root will be where is collectstatic will store them. Static_URL is important as it will be the file name target it will look for when running collectstatic.

Try:

STATIC_ROOT = os.path.join(BASE_DIR, ‘static’)
STATIC_URL = ‘/static/‘
STATICFILES_DIRS = [ os.path.join(BASE_DIR, ‘trydjango/static’)



Best Regards,
Frank Cipolone


On Jan 29, 2021, at 6:23 AM, hari49pf <hari...@gmail.com> wrote:


To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ceb2424c-870d-4467-a29a-7337d0471283n%40googlegroups.com.
<Screenshot_2021-01-29_16-48-54(django_settings).png>

ule...@gmail.com

unread,
Jan 29, 2021, 9:56:14 AM1/29/21
to Django users

try
./manage.py findstatic test.css
Op vrijdag 29 januari 2021 om 15:52:44 UTC+1 schreef fcip...@gmail.com:

Swelan Auguste

unread,
Jan 29, 2021, 2:12:34 PM1/29/21
to django...@googlegroups.com
What version of Django are you using?

Thankfully,

Swelan R. Auguste (Mr.)
KingShip
Technical - Information Officer
758-729-5289
https://KingShip.business.site/

Swelan Auguste

unread,
Jan 29, 2021, 2:12:36 PM1/29/21
to django...@googlegroups.com
Also, static, in staticfiles_dirs is misspelled


Thankfully,

Swelan R. Auguste (Mr.)
KingShip
Technical - Information Officer
758-729-5289
https://KingShip.business.site/
On Fri, Jan 29, 2021, 07:23 hari49pf <hari...@gmail.com> wrote:

Kasper Laudrup

unread,
Jan 29, 2021, 2:30:11 PM1/29/21
to django...@googlegroups.com
On 29/01/2021 15.56, ule...@gmail.com wrote:
>
> try
> /./manage.py findstatic test.css/

The user is running Windows, so I doubt that would work.

Also, what makes you think this would make a difference?

The only thing this would change as far as I can tell is that the users
"python" command is an alias to "python2" while Django requires Python
3. Do you think this is related to the Python version?

Kind regards,

Kasper Laudrup

hari49pf

unread,
Jan 31, 2021, 11:54:27 AM1/31/21
to Django users
runned colletcstatic,
there is no output.

hari49pf

unread,
Jan 31, 2021, 12:16:40 PM1/31/21
to Django users
Its returning

no matching file found for test.css


Regards,
Harish.B

hari49pf

unread,
Jan 31, 2021, 12:24:37 PM1/31/21
to Django users
Bair me, I am new to group

Abubakar Ibrahim Baiwa

unread,
Feb 2, 2021, 8:34:05 AM2/2/21
to django...@googlegroups.com
If you're using django's lightweight server, make sure DEBUG=True 

Gabriel Araya Garcia

unread,
Feb 2, 2021, 10:14:11 AM2/2/21
to django...@googlegroups.com
You are not saying if you trying it in local host or web server, because the statics folder is in different location (I have some program in PythonAnywhere).
Send your answer to gabriela...@gmail.com and I will give you the respective configurations that I have in SETTINGS.PY
Regards.

Gabriel Araya Garcia
GMI - Desarrollo de Sistemas Informáticos




--
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...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages