-
Notifications
You must be signed in to change notification settings - Fork 3
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
How to work with COLT & Django project? #4
Comments
There are several things to consider: 1
2 Livecoding in minified javascript is currently disabled for performance reasons, because it is expected that these files would be mostly things like jquery.min.js that take time to parse and at the same time noone edits them any way. |
@makc That is a great idea, it would be great to see that implemented! |
Thanks for answer, @makc. Implementation of the first point is really necessary for Django, because static files are located in app folders, while they are mapped to /static/ URL. Waiting for COLT updates in this direction then, and thank you for developing such a great development tool! P.S.: COLT + Django tutorial will be appreciated anyway ;) |
Ok, it appears I gave you wrong answer :) The thing is, COLT remembers and watches all requested URLs. If COLT cannot find local source file corresponding to the URL, it sends request to tht URL every 300ms and checks modification date header, or content if there is no date. So, you still should be able to use COLT for livecoding or live HTML editing even if URLs do not correspond to local source structure. |
Ok, but how could I debug my JS code if source file path is not equal to its URL on the page? |
Of course, there is no way to build sourcemap without association to original source, so browser devtools probably can't be used for anything beyond simple console.log(...) calls in that case. Sublime or webstorm plugins, again, will require that association in order to do things like variables inspection, etc. Code updates should still work¹, though, so you can use COLT event handlers to evaluate / log various expressions. ¹ btw this assumes you either edit source files directly on server filesystem or have something that reuploads them there. |
I want an advice, or some kind of tutorial - how to use COLT with a Django project?
I will explain the problem.
COLT has a live-proxy mode (which is recommended for my case), but then it still needs files to open: http://myserver/index.html, http://myserver/script.js
But Django doesn't have such files - URLs are dynamically mapped to views, which are dynamically generating pages from Django templates; JS files could be compiled from CoffeeScript and then minified and merged on the server-side (and I also use SCSS which is compiled to CSS).
I have installed COLT plugin into my PyCharm and successfully launched my Django project's homepage with COLT... but I don't understand what to do next. Please, advise
The text was updated successfully, but these errors were encountered: