Dajaxice randomly stops working - django

So i have a Django project where I'm using Dajax and Dajaxice. The project runs well (being served locally using python manage.py runserver) but when I started it up again the next day (with no changes made to any files). The Dajaxice just stopped getting generated/parsed/served (I'm not sure what's wrong). This results in none of my Dajax methods in ajax.py getting called. Again, no settings or configuration or code was changed from a previously running instance of the project.
Here are the error messages various browsers show
Chrome
Resource interpreted as Script but transferred with MIME type application/octet-stream: "http://localhost:8000/modmap/static/dajaxice/dajaxice.core.js".
Firebug on Firefox
#onloading the html with dajaxice script
SyntaxError: syntax error
{% load url from future %}
#on trying to trigger a dajax function
ReferenceError: Dajaxice is not defined
Safari
#on loading page
SyntaxError: Unexpected token '%'
#on triggering method
ReferenceError: Can't find variable: Dajaxice
Interestingly enough, when I access the site through Chrome, whatever was working before the "disaster" works but if I write a new method in ajax.py and call it, it doesn't. I'm thinking that the new method doesn't get registered because the dajaxice.core.js script is not getting generated as it should each time. But on Firefox and Safari, none of the methods work. I also think that my static files are being served up fine because the dajax script gets loaded as it should.
I have read all the documentation and Q/A I could find but just can't seem to trace the source of my problem. I'd really appreciate if someone could point me in the right direction.
EDIT : collectstatic registered new functions too. Everything works on Chrome. Nothing works on Safari and Firefox. I'm starting to think this is a browser compatibility issue but I doubt myself when I think that without any change in the versions of anything, stuff used to seamlessly work on Safari and Firefox too.

Actually dajax and dajaxice are anymore improved so it is unwise to use them:
Should I use django-dajax or django-dajaxice?
In a word, No. I created these projects 4 years ago as a cool tool in
order to solve one specific problems I had at that time.
These days using these projects is a bad idea. (...) If you want to
use this project, you are probably wrong. You should stop couplig your
interface with your backend or... in the long term it will explode in
your face.

Related

Static files doesn't update - 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.

Why is my React app not loading correctly in Edge 84 (chromium) but does in chrome?

I have tried a django/react app as well as a base react app made using the create-react-app command. Both end up breaking in one way or another. For instance, the align-items tag does nothing (tried center, right, left). On my django/react app I have a header that loads perfectly on chrome but all I see is a background color on edge.
Maybe you should try adding display:flex so that the align-items property works.And for different browser testing try the webkit rule so that it is stable across all browsers.
See if it helps. Thank You
I'm going to be honest, I went and reloaded the server (have not changed anything since my posting) and it's working completely fine now. I was looking for errors but I dont see any. To clarify, I was having issues with displaying CSS correctly in a react app. Even using the baseline create-react-app and using a align-items property would not function at all in Edge, but would in chrome. Thanks to all who tried to help; hopefully this was a weird one-off.

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

What is spy.js often seen in the console

Sorry if this is obvious but i cannot find a straight forward answer on the net so far...
What exactly is spy.js?
I keep seeing it in the console sometimes of firefox or chrome... is it somehow related to spry.js
I understand that spry is a js framework from adobe though..
spy.js is file within a firebug based development tool meant for debugging a website with nice tools (http://code.google.com/p/fbug/source/browse/branches/firebug1.4/content/firebug/spy.js?r=2796)
My guess is that spry, an ajax framework, is at times calling some jsonp that uses functions defined inside of spy.js, thus throwing a console error for the missing file if it wasn't properly loaded.
Checking that all of your dependencies are properly loaded will likely solve the problem. But i'm just guessing.

Inconsistent 'Cannot find CFML template for custom tag' error

I have a CF9 site set up locally on OSX Snow Leopard, and it's started to behave very strangely - probably about 1 out of every 5 times I load any page in the site, it will throw a 'Cannot find CFML template for custom tag' error. I just refresh the page and then everything works fine. It can happen on any page, but it never happens consistently with any one page. Furthermore, this doesn't happen at all on the live server when the code is checked in through SVN, so I figure it has to be some kind of configuration problem on my local instance. I can still do my work, but it's pretty annoying having to refresh pages ALL the time. Has anyone run into similar difficulties?
Try using <cfmodule template="pathTo/yourTag.cfm"> rather than <cf_yourtag>, so you can specify the exact location of the template (in case the server is getting confused as to where it resides).
FYI, this is based on a tip from Raymond Camden's blog post: http://www.raymondcamden.com/index.cfm/2006/8/17/ColdFusion-Custom-Tag-Tips
Chris, odd that I should run into your question now, as this just started happening to me last night. I have all of my CF errors being emailed to me, and I am seeing that similar problems are happening across multiple sites that all run the same software, some of which haven't been touched in a long time. That got me thinking, it's probably a corrupt compiled template in the CF cache. You can recompile the template by making a slight change to it, say add an extra line or a comment or something, then access the site again. Or, purge the whole cache and let CF rebuild everything, which is likely what I'll do since who knows what else might be affected.
Clearing the Cache in Coldfusion Production server