eadwincode / django-compressor-parceljs Goto Github PK
View Code? Open in Web Editor NEWSimply enables VueJs, ReactJs, SCSS, LESS, Typescript etc on your Django project
License: Other
Simply enables VueJs, ReactJs, SCSS, LESS, Typescript etc on your Django project
License: Other
I believe I have everything installed and configured correctly.
STATICFILES_FINDERS = [ "django.contrib.staticfiles.finders.FileSystemFinder", "django.contrib.staticfiles.finders.AppDirectoriesFinder", "compressor.finders.CompressorFinder", ]
COMPRESS_ENABLED = True
COMPRESS_REBUILD_TIMEOUT = 2592000 # (30 days in seconds)
COMPRESS_OFFLINE = False
COMPRESS_OFFLINE_TIMEOUT = 31536000 # (1 year in seconds)
COMPRESS_OUTPUT_DIR = 'dev'
And in my template:
{% block extra_js %}
<script type="text/javascript" src="{% static 'bundle.js' %}"></script>
{% compress parcel file myts %}
<script src="{% static 'test.ts' %}"></script>
{% endcompress %}
{% endblock %}
However, when I hit the page I get the following error:
TypeError at /todo/
Signal.__init__() got an unexpected keyword argument 'providing_args'
Any idea what could be wrong?
Hi, I just try to get a Vue example running, without success by now.
Just one thing: STATIC_ROOT / COMPRESS_ROOT has to be set, else ./manage.py compress
complains. Could you add that to your readme, like
STATIC_ROOT = BASEDIR / "static"
Thanks
Hello
I have the package as described in the ReadMe.md file. Unfortunately I get the error unknown option '--no-minify' when calling my Django page.
in the file <<project path>>/venv/lib/python3.8/site-packages/compressor/filters/parceljs.py line 86, in input
Did I do something wrong?
My Python Version is 3.8.5
Django Version: 3.1.3
Parcel Version: [email protected]
When creating an img element in a Vue template, I run into two alternative scenarios:
I've also tried the '///../static/images/foo.png' trick mentioned in the css section, but to no avail (the browser simply does not load the '///../static/' png.
How do I refer to a png from a Vue component in a file.
When following the instructions to install Parcel, it installs Parcel v2, which seems not not have the same command line arguments that Parcel v1 used. I ran into this when trying to get the "typescript directly in my django templates" example working.
You can fix this by installing parcel-bundler instead. which I guess is also known as parcel v1.
The error message that comes up when trying to use this with just parcel is:
CommandError: An error occurred during rendering /Users/me/Desktop/code_testing/typescript/django_typescript/home/templates/home/index.html: error: unknown option '-d'
To fix this, I did:
sudo npm uninstall -g parcel
sudo npm install -g parcel-bundler
Edit: By the way I love this package, i'm just digging into Typescript and this is the first way that makes sense to me on how to get that working in django where my ts code is in my django templates!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.