GithubHelp home page GithubHelp logo

timonweb / django-tailwind Goto Github PK

View Code? Open in Web Editor NEW
1.4K 15.0 84.0 6.23 MB

Django + Tailwind CSS = 💚

Home Page: https://django-tailwind.readthedocs.io

License: MIT License

Python 73.28% HTML 6.65% JavaScript 14.92% Makefile 0.32% CSS 0.44% Dockerfile 4.40%
tailwind-css django-tailwind css tailwind django

django-tailwind's Introduction

Tim's GitHub stats

django-tailwind's People

Contributors

bittner avatar cachitas avatar dependabot[bot] avatar justinmayer avatar korverdev avatar markusdosch avatar matthewpull avatar peterhijma avatar pvanliefland avatar roushikk avatar sethbashamdev avatar simkimsia avatar thomasmatecki avatar timonweb avatar tomdyson avatar xyvs avatar ydx-2147483647 avatar yedpodtrzitko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-tailwind's Issues

Requesting for a quick installation video

Hi Tim,

I have been having issues installing and now stuck at step 5.

I have compared your clone and the best I can find with reference is in test.

Kindly do a dummy's quick installation video. I think it would assist a lot.

My opinion.

Thanks

Supporting Tailwind Plugins

Hey,
I wanted to try out Tailwind UI in a Django project, for that I need to include a plugin. However, I get an error when I try to run the dev server with the plugin in place.

Update to 1.4

I'd love to help update this to 1.4 but I'm not very familiar with javascript. If there's a recommendation you could make to help clarify what needs to be added for a version upgrade I'd love to help out.

error executing "manage.py tailwind start"

help please when I run: python manage.py tailwind start I get the following error:

`C:\Users\DAVID\PycharmProjects\Tailwind\theme\static_src\node_modules\watch\main.js:73
if (err) throw err;
^

[Error: ENOENT: no such file or directory, stat 'C:\Users\DAVID\PycharmProjects\Tailwind\theme\static_src\run'] {
errno: -4058,
code: 'ENOENT',
syscall: 'stat',
path: 'C:\Users\DAVID\PycharmProjects\Tailwind\theme\static_src\run'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ start: watch 'npm run build-postcss' ./src
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the django_tailwind@ start script.
`
Is it a problem with the configuration? or django-tailwind

Tailwind start not working

django_tailwind@ start C:\Users\This PC\Desktop\coding-dojo\python_stack\django\book_author_proj\theme\static_src

npm run dev

django_tailwind@ dev C:\Users\This PC\Desktop\coding-dojo\python_stack\django\book_author_proj\theme\static_src
watch 'npm run dev:sass && npm run dev:postcss' ./src

Watching run
Watching dev:sass
C:\Users\This PC\Desktop\coding-dojo\python_stack\django\book_author_proj\theme\static_src\node_modules\watch\main.js:73
if (err) throw err;
^

[Error: ENOENT: no such file or directory, stat 'C:\Users\This PC\Desktop\coding-dojo\python_stack\django\book_author_proj\theme\static_src\run'] { errno: -4058, code: 'ENOENT', syscall: 'stat', path: 'C:\\Users\\This PC\\Desktop\\coding-dojo\\python_stack\\django\\book_author_proj\\theme\\static_src\\run' }
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ dev: watch 'npm run dev:sass && npm run dev:postcss' ./src npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the django_tailwind@ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\This PC\AppData\Roaming\npm-cache\_logs\2020-06-03T11_47_15_291Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ start: ```npm run dev`` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the django_tailwind@ start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.`

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\This PC\AppData\Roaming\npm-cache\_logs\2020-06-03T11_47_15_351Z-debug.log

Release notes

Sorry if release notes exist and I couldn't find them.
Could you add release notes to explain each version upgrade? this will help people understand what new features/bug fixes/ breaking change will occur by upgrading the package to the new version.

Many thanks for your work!

how to make the class name completion work ?

Everything works fine on me rendering the tailwind css in my Django project. But when I type the classname the IDE would not show the options to make completion work. I did install a Tailwind CSS IntelliSense plugin in my VScode, it works fine in my official tailwind enviroment.
So is this django-tailwind module not trigger the plugin ? Anyway, how to make to completion work.

Unknown command: 'tailwind'

This is my requirements.txt

## Django
django==3.2b1  # https://www.djangoproject.com/
django-extensions==3.1.0  # https://github.com/django-extensions/django-extensions

django-allauth==0.44.0  # https://github.com/pennersr/django-allauth

psycopg2==2.8.6 --no-binary psycopg2  # https://github.com/psycopg/psycopg2
dj_database_url==0.5.0 # https://github.com/jacobian/dj-database-url

django-htmx # https://github.com/adamchainz/django-htmx

## 3rd party system connectors and wrappers to call their API

### DigitalOcean

python-digitalocean==1.16.0 # https://github.com/koalalorenzo/python-digitalocean#how-to-install

### tailwind
django-tailwind # https://github.com/timonweb/django-tailwind/releases

and my settings.py include tailwind

image

But I still get unknown command. Why?

"tailwind init" does not respect dotted app names.

when starting an app usign ./manage.py tailwind init foo - it works flawlessly. Django says that it sort of "recommends" top level directory apps. But the directory structure of bigger projects could be more complicated. Apps are normal python packages which could be installed in any directory, e.g. in one of my projects under the plugins/ directory.

But calling ./manage.py tailwind init plugins.foo tells me that

CommandError: 'plugins.foo' is not a valid app name. Please make sure the name is a valid identifier.

According to the Django docs for AppConfig.name, it is a "full Python path to the application, e.g. 'django.contrib.admin'."

Only the label must be a single Python identifier.
So I think django-tailwind mixes up these two (I too did this in a similar library) - could you correct this?

If I create a tailwind app with tailwind init, and copy the static_src folder + base template manually into another app, or move that whole app directory a level deeper, and set TAILWIND_APP_NAME="plugins.foo - it does work, and I can use tailwind install.

$ python3 manage.py tailwind install error on OSX

Hi, I have this error when installing on osx:

...
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.13.1/darwin-x64-83_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.13.1/darwin-x64-83_binding.node":

HTTP error 404 Not Found

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234
...

The problem seems to be access to node-sass v4.13.1
I changed the version to the latest (v.4.14.0) in package.json and now can install correctly.
This version fixes: Reporting wrong LibSass version

whitelist classes

Hi,
I'm currently using django + tailwindcss and i have forms which i render manually in my forms.py like this :
image
so my question is how to make the classes used in my forms be in the styles.css as if i had put them in the *.html file and how to whitelist from python3 manage.py tailwind build ( i google a bit about purgecss whitlisting but didn't know how to implement it in this project), Also i'm not interested in using django crispy forms because i use a tailwind css plugin named kutty https://kutty.netlify.app/ for rendering the classes of these forms.
Thank's in advance

py manage.py tailwind start error

im having issues starting tailwind when i run the py manage.py tailwind start command i get the following error

django_tailwind@ start E:\projects\1stDjangoApp\ToDoList\theme\static_src
watch 'npm run build-postcss' ./src

Watching run
Watching build-postcss'
Watching ./src
E:\projects\1stDjangoApp\ToDoList\theme\static_src\node_modules\watch\main.js:73
if (err) throw err;
^

Error: ENOENT: no such file or directory, stat 'E:\projects\1stDjangoApp\ToDoList\theme\static_src\run'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ start: watch 'npm run build-postcss' ./src
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the django_tailwind@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Dell\AppData\Roaming\npm-cache_logs\2020-02-03T08_52_21_435Z-debug.log

./manage.py tailwind build doesn't purge CSS

I have configured tailwind.config.js as following:

module.exports = {
  purge: [
      // Templates within theme app (e.g. base.html)
      "../templates/**/*.html",
    ],
  }
}

When I run ./manage.py tailwind build, a full 3.2 MB css file gets generated. But when I explicitly turn on purging with:

module.exports = {
  purge: {
      enabled: true,
      content: [
        // Templates within theme app (e.g. base.html)
        "../templates/**/*.html",
      ],
    }
  }
}

Then a stylesheet of only 10 KB gets generated, so that means that purging works and that the path to the HTML templates is correct.

Now, the Tailwind documentation says:

Now whenever you compile your CSS with NODE_ENV set to production, Tailwind will automatically purge unused styles from your CSS.

Does that mean that ./manage.py tailwind build doesn't run with that environment variable turned on? And is this a bug or is this intentional behavior and should I run ./manage.py tailwind build with the forementioned env variable?

Thank you for your effort and I'm looking forward to a response!

Dependencies wrongly specified in pyproject.toml

I just created a new django project running on Python 3.8.3 and I manage dependencies with poetry. I tried adding django-tailwind to the project with:

poetry add django-tailwind

and got the following error:

[SolverProblemError]
The current project's Python requirement (^3.8) is not compatible with some of the required packages Python requirement:
  - django-tailwind requires Python >=3.6,<3.9

Because django-tailwind (0.9.0) requires Python >=3.6,<3.9
 and no versions of django-tailwind match >0.9.0,<0.10.0, django-tailwind is forbidden.
So, because achsoapp depends on django-tailwind (^0.9.0), version solving failed.

I tried changing the Python requirement in my project from python = "^3.8" to ^3.7 and ^3.6, but the only thing that allowed installation was python = ">=3.6,<3.9".

TailwindCSS v2.0 support

Hi Tim! First of all, many thanks for creating such a useful project. I really appreciate all your work on making it easier to use TailwindCSS with Django. ✨

As you may have heard, TailwindCSS v2.0 was just released this week, and while I don’t yet fully understand the scope of the new changes, the TailwindCSS folks have provided a v2 upgrade guide.

It’s not clear to me what might be needed for this project to fully support the changes in the new version. Do you have any thoughts about what might be required?

Tailwind Install Not Working (Ubuntu)

I'm getting this error every time I try to run python manage.py tailwind install. I've also tried running npm install from the static_src directory.

(django_nlu) vagrant@vagrant:~/code/django_nlu$ python manage.py tailwind install
npm WARN django_tailwind@ No description
npm WARN django_tailwind@ No repository field.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /home/vagrant/code/django_nlu/theme/static_src/node_modules/dir-glob/node_modules/path-type/package.json.2383928083
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/code/django_nlu/theme/static_src/node_modules/dir-glob/node_modules/path-type/package.json.2383928083'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2020-05-17T16_15_15_832Z-debug.log

Tailwind CSS JIT

Hi,

Do you intend to implement new Tailwind CSS JIT?

Thanks :)

Eric

`tailwind start` ignoring changes in certain files

I noticed that tailwind start only watches for changes to files in ./src, therefore ignoring changes to files directly at ./ such as tailwind.config.js.

Would it not be better to watch ./ for changes instead of ./src?

PyCharm's Tailwind CSS plugin fails to show code assistance without symlinks in project root

This is not an issue with django-tailwind but a note for anyone using it along with PyCharm and the JetBrains Tailwind CSS plug in.

I filed a bug with JetBrains, as the intellisense/code assistance was not working for Django templates inside of the 'normal' app structure of [project root]/app_name/templates/app_name/htmlfiles.html which may eventually make the steps below unnecessary.

It was found that if you create symlinks to node_modules, package.json and tailwind.config.js in the root of the Django project (same directory as manage.py) to the appropriate targets under theme/static_src that the JetBrains official Tailwind CSS plug in works perfectly with the setup described in the django-tailwind's readme.

In the root of your Django project, assuming you named your django-tailwind app 'theme'

ln -s theme/static_src/package.json package.json
ln -s theme/static_src/tailwind.config.js tailwind.config.js
ln -s theme/static_src/node_modules/ node_modules

Reference to JetBrains YouTrack bug tracker:
https://youtrack.jetbrains.com/issue/WEB-50354#focus=Comments-27-4829062.0-0

python3 manage.py tailwind start doesn't exit

Hello,
I noticed that "python3 manage.py tailwind start" doesn't exit after finish so i have to exit it it by Keyboard Interrupt (Ctrl + C) every time , its not that big of a deal since i just let it go for 20 seconds before interrupting it and it works but it would be better if it did automatically.
Python : 3.8.5
django-tailwind : latest
image

New to both Tailwind and Django

Hi! I was super excited to see this library because i am trying to not use Bootstrap. However, i am finding that i am lost on how to use it. Now i followed the instructions exactly but still lost. I think that is mostly due to still learning Django but might not be.
For reference i am tying to follow along to this tutorial . I have 2 apps. first is my accounts app and second is the newly created 'theme' app. I am lost on how i use the base.html in the accounts app. Should these not be shared in the way i am trying? When i try extending the base.html i get a "TemplateDoesNotExist" error.
image

install validation

I got the following project structure:

/my_project
   |--my_site
     |--apps/
       |--app1/
       |--app2/
     |--common/
     |--settings/
       |--prod.py
       |--dev.py
     |--theme/   (tailwind app)
     |--urls.py
     |--asgi.py
     |--wsgi.py
    |--setup.py
    |--manage.py
    |--.flake8
    |--etc pp

now in my settings.py (here prod.py/dev.py) i have to install my theme as website.theme, the app name however is theme.
In the validation.py of django-tailwind it checks if the app is installed, by looking for the app name (theme), instead of in this case website.theme.

Not quiet sure if my project structure is odd (but it follows a pretty common approach), or even an issue of django-tailwind (cause the 'apps.is_installed("theme")' of django returns false.

So my next approach was to rename the app (theme/apps.py) to website.theme and in settings also alter the TAILWIND_APP_NAME to 'website.theme'.

The install command now passed the "is installed"-mark, but therefore failed on the "is a tailwind app"-mark, due to LookupError in djangos apps/registry.py in get_app_config("website.theme").

I think I bypassed the issue by renaming the theme app back to "theme" and just returning at the "is installed"-mark. But this process makes deployment that much harder than just saying: Run 'pip install -r requirements'.

If you think this is not an issue of this project, just ignore it. I thought I mention my thoughts. ;)

Other than that, gotta admit I<3 django-tailwind. GJ man

If I use docker to run dev server for local dev env, how do I run the tailwind server?

Related to this comment about feedback #56 (comment) on the new django-tailwind v2

I saw this in the migration docs
image

There's a python manage.py tailwind start which I suspect is meant for the jit mode. I am using jit.

but because I use docker what happens is that I just have this script that's executed as part of my docker up

#!/bin/sh

set -o errexit
set -o pipefail
set -o nounset
set -o xtrace


python manage.py migrate
python manage.py runserver 0.0.0.0:8000

Do I write a separate script for the tailwind server as well?

Can't set NPM_BIN_PATH on Windows

After getting info on where the npm is stored by executing where npm on Windows, I gotthe information that the path is located at C:\Program Files\nodejs\npm & C:\Program Files\nodejs\npm.cmd. Putting this information to settings.py does not do anything, I still get the

CommandError:
It looks like node.js and/or npm is not installed or cannot be found.

I have tried the following:
NPM_BIN_PATH = C:\Program Files\nodejs\npm
NPM_BIN_PATH = "'Program Files'\nodejs\npm"
NPM_BIN_PATH = "Program Files\nodejs\npm"
NPM_BIN_PATH = C:/Program Files/nodejs/npm
NPM_BIN_PATH = "'Program Files'/nodejs/npm"
NPM_BIN_PATH = "Program Files/nodejs/npm"

Nothing seems to work. Any suggestions?
Thanks a ton in advance.

'tailwind_tags' is not a registered tag library when added to base template

Hi there, I'm a bit lost during the installation process, specifically step #8:
https://django-tailwind.readthedocs.io/en/latest/installation.html

I'm using my own base template in another app, primary.html:

<!DOCTYPE html>
<html lang="en">
{% load tailwind_tags %}
<head>
    {% load static %}
    <meta charset="UTF-8">
    {% tailwind_css %}
    <title>Placeholder</title>
</head>
<body>
    {% block content %}{% endblock %}
</body>
</html>

However, this returns the following error:

TemplateSyntaxError at /

'tailwind_tags' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz

I've been trying to figure this out for the last 45 minutes, to no avail. tailwind and theme (the app name for tailwind) have been added to INSTALLED_APPS, as well as TAILWIND_APP_NAME = 'theme'. All command line steps have been followed. Would you know what the cause of this is?

Thanks for your time,

Mark

Two resolved issues in Win10

I encountered a couple issues getting this library to work on my system, and I thought I should post them here in case they're helpful for others.

First error (running tailwind start):

Tracking file by folder pattern:  migrations

> django_tailwind@ start ***\static_src
> npm run dev


> django_tailwind@ dev ***\static_src
> watch 'npm run dev:sass && npm run dev:postcss' ./src

> Watching run
> Watching dev:sass
***\static_src\node_modules\watch\main.js:73
    if (err) throw err;
             ^

[Error: ENOENT: no such file or directory, stat '***\static_src\dev:sass'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: ***\\static_src\\dev:sass'
}
`

The fix here was modifying the dev script in `package.json` from:

"dev": "watch 'npm run dev:sass && npm run dev:postcss' ./src",

to:

"dev": "watch "npm run dev:sass && npm run dev:postcss" ./src",


Second error (still on `tailwind run`):

TypeError: node.getIterator is not a function
at LazyResult.visitTick (\static_src\node_modules\postcss\lib\lazy-result.js:484:33)
at LazyResult.runAsync (
\static_src\node_modules\postcss\lib\lazy-result.js:372:30)
at async Promise.all (index 0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ dev:postcss: postcss --config . --map true --output ../static/css/styles.css ../static/css/styles.css
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the django_tailwind@ dev:postcss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


The fix here was to update `postcss-scss` to v.3.0.4.

Now, everything is working great.  Thanks!  Let me know if there's any other info you'd like.

How easy is it to switch between modes after theme app generated? for v2.0.0b1

Related to this comment about feedback, #56 (comment)

I saw this

/code # python manage.py tailwind init
app_name [theme]:
Select mode:
1 - jit
2 - default
Choose from 1, 2 [1]:

So I have fear about selecting the wrong one.

My question is how easy is it to switch from default to jit or jit to default after the theme app is generated?

If it's easy to undo then I have less compunction about selecting any mode.

And do you mind not naming default mode default?

Because it's weird that the default choice is jit mode. Maybe call default mode Refresh per build? or any other name that's not also default?

npm is not installed error

Everything works fine until the:
python manage.py tailwind install

Then it throws an error:
CommandError: npm is not installed or cannot be found at path "None"

Any ideas?
Thanks in advance

PurgeCSS and Heroku deployment

Hi,

Thanks for the great plugin. I have two questions regarding this project:

  1. Does it use PurgeCSS by default? or do I have to install and use it individually?
  2. Regarding deployment on Heroku: Heroku state that they expect a package.json file in the root of the project:

Heroku Node.js support will only be applied when the application has a package.json file in the root directory.

But this plugin creates its own package.json inside of the theme folder. I'm wondering how can this be resolved, and also: what commands should be ran before deploying on Heroku, and which should be deployed in the deployment process?

I’m asking because I want to integrate Tailwind with an existing project. I need to use the prefix option for compatibility reasons, and I’m wondering how I can do that without committing the node_modules directory (which is inside theme...) to the repo, but still overwrite the config file.

Template syntax with Vue + Django Tailwind not working

I'm using Vue from a CDN, and after setting up django-tailwind, the template does not render dynamic content. I tried setting up different delimiters:

<div id="app">
[[msg]]
</div>
  var app = new Vue({
        delimiters: ['[[', ']]'],
        el: '#app',
        data: {
        msg: "Hello"
     }

In my template, all I see is [[msg]], instead of "Hello".

I also tried

{% verbatim %}
{{msg}}
{% endverbatim %}

Without success. Do I need to configure something to have Vue templates work?

Multiple apps using django-tailwind in the same project.

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.

Issue with postcss script

I followed the installation instructions and now I'm getting the following when using python3 manage.py tailwind start

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/mnt/c/Users/Matt/Desktop/Code/python/church/bhc/design/static_src/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ dev:postcss: * postcss --config . --map true --output ../static/css/styles.css ../static/css/styles.css *
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the django_tailwind@ dev:postcss script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/$USERNAME/.npm/_logs/2020-07-26T18_56_35_038Z-debug.log 

NOTE: Needed to replace back ticks with asterisks for formatting
I'm using WSL so I have no idea how to find the log file but after getting this the first time, I tried installing postcss with npm and, though it installed, I still get the same error. Is there anything I can do to try to fix it? I'll attempt to find the file and upload it for better debugging but again, I have no idea where it is so I need to search (may take a bit)

setup.py egg_info UnicodeDecodeError

I have anaconda. However, even if I use venv or pipenv for some reason I still get this error. It may be because I have anaconda installed?

    ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "~\Temp\pip-install-owbdvwgs\django-tailwind\setup.py", line 10, in <module>
        long_description=open("README.md").read(),
      File "~\Anaconda3\envs\mls\lib\encodings\cp1252.py", line 23, in decode
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]
    UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 84: character maps to <undefined>
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in ~\Temp\pip-install-owbdvwgs\django-tailwind\

Preexisting Django app

How can I add django-tailwind if I already have an app created? I wasn't able to use python manage.py tailwind init since the app exists already.

I keep getting error on Tailwind Start command

I keep having troubles on tailwind installation and setup i do not know how to go about it

node:internal/fs/utils:320 throw err; ^ Error: ENOENT: no such file or directory, scandir 'C:\Users\Lanre Adetoro\CODE\djangoProject1\osmotheme\static_src\node_modules\node-sass\vendor' at Object.readdirSync (node:fs:1044:3)

image

what do you think might be the problem

Getting node to work with Docker

This is not specifically a django-tailwind problem, but could be a good augmentation for the documentation.

The problem I'm experiencing is that I have a Docker container for my Django project, but that container itself doesn't have node or npm available.

Again, I would imagine this requires more Docker training for myself rather than asking a package to do a bunch of extra work, but it would be definitely be helpful if the README could walk us through it.

Keep up the great work!

Issue building tailwind css on windows 10

Hey guys!

When I run the command 'Python manage.py tailwind build' I get the following error:

'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! django_tailwind@ build:postcss: NODE_ENV=production postcss --config . --map false --output ../static/css/styles.css ../static/css/styles.css
npm ERR! Exit status 1
npm ERR!

Running the 'tailwind start' command works fine.

I have already set my NPM_BIN_PATH in settings.

How do I fit the package.json, tailwind.config.js and postcss.config.js within the context of django-tailwind?

I'm also simultaneously taking a course on tailwind for beginners.

the course provides a package.json amongst many other things for their starter templates.

I'm unsure how to place some of these files within the context of django-tailwind.

Can advise?

image

Let's concentrate on these 3 files: tailwind.config.js, postcss.config.js, and package.json

package.json

{
  "name": "beginner-tailwind-site",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "parcel src/index.html",
    "build": "parcel build src/index.html"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/chris-on-code/beginner-tailwind-site.git"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/chris-on-code/beginner-tailwind-site/issues"
  },
  "homepage": "https://github.com/chris-on-code/beginner-tailwind-site#readme",
  "dependencies": {
    "tailwindcss": "^1.8.0"
  },
  "devDependencies": {
    "parcel-bundler": "latest",
    "postcss-modules": "latest",
    "autoprefixer": "^9.8.6"
  }
}

postcss.config.js

module.exports = {
  plugins: [require("tailwindcss"), require("autoprefixer")],
};

tailwind.config.js

module.exports = {
  purge: ["src/**/*.html"],
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [],
};

SASS not compiling!

I made a sass variable in sass file but in css file the actual sass is compiled!

SASS
$primary: #333;
.bg-primary {
background: $primary
}

CSS file
$primary: #333;
.bg-primary {
background: $primary
}

**Expected CSS file **
.bg-primary {
background: #333;
}

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.