Skip to content

Missing styles.css after building styles with modern django-tailwind package (v3.1.1) #22

@paulrogov

Description

@paulrogov

The current version of django-tailwind (3.1.1) package builds styles.css into this folder:

theme/static/css/dist/styles.css

The previous version used in the video (Intermediate Django - Lesson 19.TailwindCSS Improvements) builds into this one:

theme/static/css/styles.css

So, after deploying it into production you'll get such an error (fullscreen):

And Server Error (500) on the prod.

Solution:
Fix a link to styles.css inside templates/base.html to be this:

<link  href="{% static 'css/dist/styles.css' %}" rel="stylesheet">

p.s.
I also had theme/static/css/dist/styles.css missing from a corresponding git commit at first, because it had turned out to be ignored by .gitignore.

The solution:
Add line !/theme/static/css/dist to .gitignore

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions