django-crispy-forms / crispy-tailwind

A Tailwind template pack for django-crispy-forms
MIT License
331 stars 56 forks source link

add doc for 'Missing form style' #111

Open michael-yin opened 2 years ago

michael-yin commented 2 years ago

This PR is to help people who got #103 and #110

tok3rat0r commented 1 year ago

Tried this with my current deployment on Heroku, unfortunately I ran into the problem that I was generating the CSS (using npm run build) at the heroku-postbuild stage whereas Python packages (needed to resolve pySitePackages) are installed after that point. I'm not sure how to run the script late enough to resolve pySitePackages correctly when deploying on Heroku.

michael-yin commented 1 year ago

@tok3rat0r

It is better to use Docker to deploy on Heroku.

You can check https://github.com/AccordBox/django-tailwind-alpine-htmx to see how I deploy it on Heroku (which also use this project)

Thx.

GitRon commented 5 months ago

Hi @michael-yin!

Is this MR still up-to-date?

Best
Ronny

michael-yin commented 5 months ago

Hi, @GitRon

This method is still working and I am using it in my projects.

You can merge the PR if you want to.

Thx.

GitRon commented 5 months ago

Hi @michael-yin

thanks for your answer! We've already addressed the issue with adding a link to Carltons blog to our docs. Here's the commit: https://github.com/django-crispy-forms/crispy-tailwind/commit/4422619018a3ddac2a7767ad6787f25633cba99a

I know his solution works. Do you think that'll work for you?

Best
Ronny

Supplemental: I still think about adding Carltons solution to this package so people don't have to fiddle around with the configuration.

michael-yin commented 5 months ago

@GitRon

It seems the solution focus on Django templates.

What if css class are written in Python code? https://github.com/django-crispy-forms/crispy-tailwind/blob/main/crispy_tailwind/layout.py

Would it work?

Thx.

GitRon commented 5 months ago

Hi @michael-yin !

As far as I understand Carltons script, all Django apps (also the ones from third-party) will be added for the Tailwind CLI. Please have a look at this management command, and check for yourself.

If you don't agree, I'd be happy to update the docs accordingly.

Best
Ronny