Static files doesn't update - Django - django

This is the second time i'm commenting about this problem and I really hope you can help me this time since i've gained some more information about the problem. So the problem is basically that all my Django projects doesn't update the static files (this also includes projects which I have downloaded). So I can fx still see the old styling from the css files but the changes is not displayed. When i insert the css or js directly into the html file i can see it though. I thought that it maybe had something to do with my browsers stored caches but I have tried to do a hard refresh, clearing all my caches, installing whitenoise and forced browser to reload the css file by adding an extra parameter to the end of the src tag. I have also tried python manage.py collectstatic and almost everything else on this thread.
When the problem bagan to occur I was working with the implementation of stripe. I don't neccessarily think that stripe is the problem since the problem occured hours after i had already implementet the checkout site. I just think it's worth at least mentioning.
Some of my venv packages:
Django | 3.0.3
django-bootstrap4 | 2.2.0
stripe | 2.50.0
Weird behaviour:
Yesterday when I decided to comment out the bootstrap link to see if that was somehow the problem, the changes to the css file got applied to the site. I tried to do that several times and that seemed to be the problem but that only worked for like an hour. Now I cant apply any changes to the sites whatsoever.
My first post:
If you want to see my first post about the problem, you can check it out here. Keep in mind that the problem is not only happening to my Django projects but also the projects which i've downloaded.
I have no idea whats happening and I would very much appreciate your help. If you need any more information please just ask.
Edit:
I created a new folder and css/js file and it kind of worked. I believe the reason it worked was bcs whenever you create a new css/js file, Django needs to atleast load the content of the file once. But whenever I wanted to make other changes it suddenly didn't work again. In my file i had two links to css files. This should usually not be a problem, but apparently it was for me. I deleted one css link and It suddenly worked fine again. If anyone knows why this happened pls tell me, i'm all ears.

Assume you did everything correctly! I once faced this problem too and I fixed it by changed the directory name inside static folder to the same name as my app name. static/css/style.css change to static/app_name/style.css. Also don't forget to refresh the browser (ctrl + r or cmd + r). Hope this would help.

Related

Boot and Hoplon not loading the CSS file and the images in the 'resources' folder

I have been using the Boot build tool with Hoplon and a Castra backend for a bit but recently have come across a glitch that I don't quite seem to understand. It happens across all my Hoplon projects often. The problem seems to be that when I go to localhost:8000 in the browser sometimes it displays the CSS that is written in 'app.css' correctly and sometimes it doesn't. On top of that sometimes it displays the background images and sometimes it doesn't. I mean in the browser.
I have tried debugging the error for a very long time and have found some ways of getting both loading but not consistently. Sometimes if I edit the hLisp page and save it loads the CSS and Background Images but sometimes that doesn't work. Another way is to edit the app.css file and save. Both are somewhat unreliable.
Any help would be greatly appreciated.
Cheers
I figured out what was causing the error.
(link :href "app.css" ...
Should be replaced by
(link :href "public/app.css" ...
Cheers

How to not always compile all assets on autoload in ember.js

I've started my first ember.js project with ember-cli including ember-cli-broccoli-compass to compile my stylesheets with compass. Now that I've done my first styling, my stylesheets need 5 seconds to compile. When I now work on my javascripts and there are any changes to my files, my whole project, including the stylesheets, is re-compiled, which lasts a bit too long for me. So, is there any way to exclude the stylesheets from the compiling process?
EDIT:
I don't know this is "the answer", but using https://github.com/quaertym/ember-cli-compass-compiler instead avoids the problem.
Not sure on compass but I think its related to this issue over on ember-cli-less with sourcemaps
https://github.com/gdub22/ember-cli-less/issues/10
https://github.com/ef4/broccoli-sourcemap-concat/pull/3
The issues have been closed but on a fresh ember new they are still present

How to solve cache? issue when using jasmine standalone

When I go to SpecRunner.html in my browser, the unit tests run fine. The issue I am having is if I change one of the tests, or the code that it tests and refresh the page, it doesn't load the new tests or change at all. I thought that this would be a cache issue, but I have the chrome dev tools disable cache selected.
What am I doing wrong?
Thanks
EDIT: tried restarting my computer, nothing. Clearing cache, nothing. I don't understand why this would be happening.
EDIT2: tried force reload, nothing... changed the file name and reference and still loaded the old code...
This might not answer your specific problem, as there are a million reasons this could happen.
For me, it was because I had deleted some files and then re-added them as a git submodule. After doing this, ls was showing me the OLD files, and I didn't realize that I had to go up a directory and then back in to interact with the new files I had just pulled down.
Old question but I ended up here when looking for an answer, so here's my solution in case it helps anyone - I was having a similar problem with jasmine-rails, removing jasmine-specs.js from public/assets did it for me. I'm using the jasmine-rails gem from https://github.com/searls/jasmine-rails.

integrating wmd editor with a django site

this is probably a really dumb question but im struggling to integrate it. im playing with a reusable app called brookie that uses wmd-editor.
in the install instructions it states to "Link admin_wmdeditor/media/admin-wmdeditor in your MEDIA_ROOT as admin-wmdeditor"
im assuming this is a symlink?
I've tried to create a symlink to point at the wmd folder in lib/python2.6/site-packages/wmd but i don't think it worked. i say that, as i cant see any symlink created in my folder.
so 1st question, is there a simple way to list symlinks so i can see if i've really created one? i know this is a noob question, im not a mac genius. i also know this should be covered by a quick google but do me a favour and do it, i can only find noise.
if anyone has some slightly more explicit instructions other than the ones on django-adminwmd_editors github page i'd love to see them. i can normally work this stuff out, but i've got an hour in just trying to hook this stuff up and its a wind up.
I'm not a Mac crack, but usually (on Linux) you can see a symlink, when you list the directory content.
I've played around with the brookie app some time ago and if I remember it right I have had some trouble with wmd also, after researching stackoverflow I changed to Markitup, which works fine.
Have a look here: WMD in Django Admin?
in the end i just commented out the lines referring to wmd and removed the class reference to it, forced it back to a std modeladmin.
will be adding tiny mce in if it needs it, nice n simple. not sure why this single text box needed something as complicated as wmdeditor.

How do I install CKEditor with Django-WYSIWYG

I am trying to install the CKEditor for use with Django-WYSIWYG. This is proving to be oddly difficult.
As mentioned on the site for Django-WYSIWYG, it is possible to "install" CKEditor by dropping the distribution file in the MEDIA_URL folder on one's system.
In addition, you've got to set a variable in settings, which determines Django-WYSIWYG's "flavor."
I've done both of these things. I get no errors, but the thing still wants to use YUI. I'm really dissatisfied with YUI and would much prefer CKEditor, but for some reason it won't install.
If I am missing a step, or if you have done this somehow, please let me know!
Sorry for what is probably an obvious question.
https://github.com/shaunsephton/django-ckeditor u can use it.
I was able to get this to work. It is likely that you are not setting the URL correctly in your settings file. For Django 1.3, the ckeditor files are placed in static.