GithubHelp home page GithubHelp logo

Comments (1)

simkimsia avatar simkimsia commented on June 8, 2024

I figured it out after studying the source code by searching the message not in INSTALLED_APPS

In my case, i want to put theme inside themes.

These are the steps for those who want to put their theme folder in nested folders

  1. Change the apps.py in the theme folder to themes.theme (already did this in my question)
  2. Update the INSTALLED_APPS to include themes.theme (also did this in question)
  3. Update the TEMPLATES so that it prioritizes the right folder. (also did this)

What I didn't do is update TAILWIND_APP_NAME to themes.theme

So my final answer is

step 1: in settings.py

# TAILWIND
# ------------------------------------------------------------------------------
TAILWIND_APP_NAME = "themes.theme"
# Split the string by '.'
tailwind_tokens = TAILWIND_APP_NAME.split(".")

# Get the last token
TAILWIND_APP_FOLDER_NAME = tailwind_tokens[-1] if tailwind_tokens else None

INTERNAL_IPS = [
    "127.0.0.1",
]

TAILWIND_APP_DIR = BASE_DIR / "themes" / TAILWIND_APP_FOLDER_NAME
TEMPLATES[0]["DIRS"] = [str(TAILWIND_APP_DIR / "templates")] + TEMPLATES[0]["DIRS"]

step 2: in the apps.py

from django.apps import AppConfig


class ThemeConfig(AppConfig):
    name = "themes.theme"

Note that BASE_DIR is defined to be the full path going towards project root.

from django-tailwind.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.