1. Create a folder in the project root directory named "z_css" for tailwind
  2. Open terminal and go inside "z_css"
  3. type "npm init -y" and enter
  4. run
  5. npm install tailwindcss @tailwindcss/cli
  6. create file "input.css" inside z_css folder and paste the code
  7. @import "tailwindcss" source(none);
    @source "../templates/**/*.html";
    @source "../**/templates/**/*.html";
  8. Inside package.json paste the following code
  9. "dev": "npx @tailwindcss/cli -i ./src/input.css -o ../static/css/tailwind.output.css --watch",
    "build": "npx @tailwindcss/cli -i ./src/input.css -o ../static/css/tailwind.output.css --minify"
  10. Now at last add below code to settings.py in django below STATIC_URL = 'static/'
  11. STATICFILES_DIRS = [
                os.path.join(BASE_DIR, 'static'),
            ]
    STATIC = '/static/'
    STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

Comments

Popular posts from this blog