Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple apps using django-tailwind in the same project. #53

Closed
dhruv-jadhav opened this issue Mar 24, 2021 · 4 comments
Closed

Multiple apps using django-tailwind in the same project. #53

dhruv-jadhav opened this issue Mar 24, 2021 · 4 comments

Comments

@dhruv-jadhav
Copy link

In the docs, the author has specified how to use all the utlity classes of Tailwind in an app. But hasn't mentioned how to use Tailwind in other Django apps.

TAILWIND_APP_NAME = <the app name> is the way to specify the Tailwind app

So how do I specify other apps I have like which I would like to use Tailwind.

By creating a list:

TAILWIND_APP_NAME = [<app1>, <app2>]

Or some other way? Thanks.

@timonweb
Copy link
Owner

Hello, usually you don't need more than one tailwind app in a project. Once installed, it works for all your templates, regardless number of other apps you use. What's your case? I'm curious.

@dhruv-jadhav
Copy link
Author

Well it's not a very interesting use case, its just that in the tutorials I have seen, its good practice to separate stuff like authentication in one app and other functionality in some other app.

Anyways, thanks for your response.

@timonweb
Copy link
Owner

@Alpha249 ok, I get it, but the Tailwind app works globally. You can use Tailwind classes across all your Django apps, as long as they belong to the Django project that has Tailwind installed.

@karimone
Copy link

For more complex projects, you need to create an app only for tailwind and share the tailwind config and CSS between different apps. This could be an issue if you have very different websites running on your project.

E.g.

src/
  data/
  domain/
  interfaces/
     restapi/
     appsite/
     frontendsite/
     supportsite/
     shared_tailwind/ <<< this is the app registered with tailwind

appsite, frontsite and supportsite are 3 different interfaces website served by the same project. shared_tailwind contains the tailwind stuff.

This seems to be a border case situation, but if you think about this already happens in most of the Django projects. The Django admin is completely different from the frontend app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants