0

Hay, I Have An HTML with Css + JavaScript Page When I Try Rendring This Page In Django Like This:

def about(request):
    return render(request, 'about/index.html')

but I Only Get The Html Content Without The Css And JavaScript.

I Thought This Might Be Because Of The Statics.. So I Run:

python manage.py collectstatic

But I Get This:

0 static files copied to 'C:\Users\Ammar\Desktop\Python Learning\vidly\static', 128 unmodified.

What Should I Do, I Wish Someone Can Help.

1 Answers1

0

Django has a feature of managing a good directory structures i.e. project->apps->templates/views/urls

In a Django project all static files example images,css files,(designing part) is stored in a directory named static.

This helps in leveraging the same static properties over several apps and keeping the code structure clean.

The collect static command helps to get all static files present in the project to a static folder and we need to mention the static path in settings.py file .

Django documentation might clear your doubts further I am putting link here that might help you .

https://docs.djangoproject.com/en/3.2/howto/static-files/

What's the point of Django's collectstatic?

Jay Jain
  • 59
  • 7