STATIC_URL = "/static/%s/" % get_file_changeset(BASE_DIR) Timestamp = datetime.utcfromtimestamp(int(timestamp))Ĭhangeset = timestamp.strftime('%Y%m%d%H%M%S')Īnd next change in your SETTINGS: from utils.misc import get_file_changeset Timestamp = max(map(lambda x: os.path.getmtime(x), os.walk(os.path.join(absolute_path, 'static')))) In this recipe, we will set a dynamic path for STATIC_URL using time of last edit in os. With the dynamically changing URL, whenever the code is updated, the visitor's browser will force loading of all-new uncached static files. If you don't want to refresh the browser cache each time you change your CSS and JavaScript files, or while styling images, you need to set STATIC_URLdynamically with a varying path component. Then you can use tag to create a path with random arguments! Return StaticExtraNode.handle_simple(path) Return StaticExtraNode.handle_token(parser, token) Return super().render(context) + '?v=' + do_static_extra(parser, token): And you create any file in this package, and write something like this: from django import templateįrom import get_random_stringĬlass StaticExtraNode(static.StaticNode): Specifically, you need to create a package called templatetags in whatever apps you have created (or create a new one if you want). One possible way to handle this problem is to introduce a custom tag. I have tried to inject random string using Javascript, but this method seems stupid and ugly-looking. I have also struggled with this problem for hours. What can it be? is there an option to force django to refresh staticfiles? I thought restarting the server was enough. Then I open Chrome and try it all again, same problem. Therefore the old login.js file must be cashed somewhere I don't know. Then I include the login.js file, comment out the js inside the html but I delete all the content inside the login.js file, making it an empty file. Then I deleted the reference to the login.js file and put all the js inside script tags in the HTML, of course, the new sentence appears. So, I changed the js and restart the server, still the html shows the old sentence. New_sentence = "Run, rabbit, run" // this is the new sentence, it just won't show up. The JavaScript is something like this: old_sentence = "Dig that hole, forget the sun" // this is what I want to change More details about this error (the #$&%# weirdest thing I've found): Please help me understand, I can get away with including all the js inside the HTML but it bothers me that I can't do it the normal way anymore. I have tried closing the server and running runserver several times, I've also tried changing from Firefox to Chrome. If I remove the JavaScript from the file and put it in the HTML, it works correctly, but if I try to do it using the external js file then it doesn't. Then, I refresh the page and I can't see the changes happen. I also uninstalled Revive and rebooted, installed again, and problem still persists to bring up the unreal crash screen.I have a JavaScript file referenced on a django template: I know this isn't a multiplayer game, but the oculus sign in is a new feature missing from previous versions so I'm sure I'm on 2.0.0. I did sign into oculus too if that makes any difference or not. I've been waiting for today's update to drop to include the fixes for TWDS&S but alas mine still doesn't work on Revive 2.0.0. Launching The Walking Dead Saints and Sinners will bring up the unreal crash bug screen asking to send the reports onto the developer. Using Oculus Quest wirelessly and Virtual Desktop to stream games.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |