I've got django-debug-toolbar 1.9.1 working fine in my configuration (Django 2.1.2), but if I simply update it to 1.10 or 1.10.1, without changing anything else, it doesn't show up anymore. I don't see anything in the change logs that indicate I need to update any settings.
Does anyone have any suggestions? Or there a way I can turn on some kind of logging to see where it's not working?
Thanks!
This issue on GitHub was solved by refreshing the browser cache.
Try running manage.py collectstatic and refresh your browser cache, to make sure you aren't running javascript from an old version.
I had this issue when running 'manage.py runserver'. All I had to do is Refresh my browser cache. In Chrome, you just open View/Developer/Developer Tools and now right click the "Refresh" button and click 'Empty Cache and Hard Reload'.
That did it for me (using Chrome), same thing under Chromium. Cheers!
Related
I recently made some changes to my django site, one big one being upgrading from Django 2.2 to 3.1. Now my admin site styling is all messed up. I can't figure out what went wrong or how to fix. Any pointers would be appreciated!
See image of what it looks like after update....
The main home page for admin looks fine, but when I click on one of the models to view, the formatted is definitely not correct.
Also, some not all, of my images on the site are saying 404 not found...
It looks like your browser is caching the CSS / JS from the old version, you can clear your cache and reload. In chrome use ctrl + shift + r to reload.
I was facing the same problem, First I thought it was a Cache issue but it wasn't.
I checked the page source and found a css file being applied to the page which wasn't even present on my drive.
In my case the file was:
static/admin/css/nav_sidebar.css
So I created new file in static/admin/css named nav_sidebar.css,
then copy pasted the code which I got from page source and
added "display:none;" in the #nav-sidebar section(line:34) and [dir="rtl"] #nav-sidebar section(line:45 in my case).
You can find the Original code here by using Google Chrome's inspect tool.
Where to find the code
I had the same issue after bumping django from v3.0 to v3.1. I run python manage.py collectstatic to update css which solved my issue
I was experiencing the same styling as the OP's screenshots.
I had upgraded incrementally from 2.2 -> 3.0 -> 3.1 -> 3.2. I only experienced the styling issues in 3.2
The issue was that there were legacy admin styles committed to the repo in the static folder. To resolve, all I did was delete the committed admin styles, and Django then appeared to use its own styling
I was upgrading from 3.0 to 3.2 and I tried a couple of the answers here without luck. At the end, the following procedure solved it for me:
manually delete the content of the directory STATIC_ROOT (see in settings.py what you named the folder)
run the command python manage.py collectstatic This will repopulate the directory with the newst files
hard refresh your page (ctrl + F5)
I think the other answers here are necessary, but I'll add one more: You might have to bust caches in your server itself. In our example, nginx was configured to provide really long caches to our static files, so we just had to reset it to make changes come through.
Ok maybe I am late to the party but it may help others,
What works for me is:
Set STATIC_ROOT in settings.py (I guess it should be already there as project is old one)
Comment STATIC_DIR in STATICFILES_DIRS list (otherwise it will give error) and run python manage.py collectstatic
Clear browser cache.
I wrote selenium test cases for submit button in sample website. Here I am facing a problem like, when I click on submit button results are not coming, while it happens only when I execute selenium test case. but manually I checked it, results are coming fastly. How to overcome this problem.
selenium version - 3.6.0
Google chrome version - 59.0.3071.86.
can anyone help this? How to overcome this problem.
It could be cookies issues.
Try to clean your browser cookies then load the page or try to load the page multiple times on selenium driver.
use throws InterruptedException method
add this after click on submit button
example:-
driver.findElement(By.id("submitid")).click();
Thread.sleep(5000);
Hope this work!!
I just upgraded to Wagtail 1.10.1 and the preview shows only a blank page. When I force the preview by appending preview/ to the edit URL, then I get a server error. It all works just fine on my development and staging sites, so I also need some help tracking down where the error might be.
Internal Server Error: /admin/pages/81/edit/preview/
KeyError at /admin/pages/81/edit/preview/
'wagtail-preview-81'
Django Version: 1.11.1
Python Executable: /usr/local/bin/uwsgi
Python Version: 3.5.2
I've been doing only minimal upgrades for a few months, so it's possible I missed something in a previous upgrade that used to work but that now I need to fix (although why it would work in the dev and staging sites but not the real one puzzles me); any suggestions would be welcome.
Please refresh your browser cache in the edit page (Ctrl + F5) then click again on preview.
The issue is that the admin Javascript changed, but Wagtail no longer compresses its assets, so your browser cached the previous version of the Javascript file. So preview data is not correctly sent to the server, and it’s therefore unable to retrieve it when displaying the preview.
You can avoid such issues in the future by compressing admin assets.
I've written an app and have been testing it within a project. Any change I make to the project is reflected immediately. But when I make a change to the app and run the install script again, none of the changes are shown. I even look at the files in the site-packages directory and see that the change has been installed.
I've tried clearing the browser cache, restarting the browser, trying a different browser, shutting down and restarting the django server, re-sourcing the virtual environment, setting $PYTHON_PATH, and even restarted my system to no avail.
This has happened just recently, within the past hour. I was able to make django reflect the changes when I set $PYTHON_PATH and, afterword, re-sourcing the virtual env. But now that won't work, either.
I keep thinking it's a caching issue, but I'm not seeing anything on the django cache that would cause this problem.
I'm using lighttpd as the server backend if that's an issue.
If your using google chrome:
Open your site to the page where the changes are not reflecting.
press f12 to open inspect window, the developer tool in chrome.
Now left click on the reload button for a longer duration continuously, about one second long.
You will get three options Go for empty cache and hard reload in this case.
Done!
everytime i test my selenium test, the instant of firefox will popup and show page of selenium rc. It's ok and cool. But i have problem. For every test i also have to see a firefox's page pop up and shown selenium plugin have been add to firefox.
is there any way to configure selenium so it initiate firefox without a popup page cause after a hundred test, it start to irritate me ;D
I'm sure this is a duplicate of another SO question, as I feel like I've answered it before, but I can't find it. If I do subsequently find it then I will update my answer.
You need to set the extensions.lastAppVersion preference to match the version of Firefox that you're launching. Otherwise you will generally have an additional tab in Firefox and the Addons manager popup.
You may need to configure Selenium to use a custom Firefox profile in order to make this change.
Removing the extensions.rdf file from profile directory will fix this issue . I have created a separate profile for Selenium tests, which is only used for Selenium Tests. I would love to hear if there is other way around . My "extensions.lastAppVersion" is updated and reflects the current browser version therefore the above trick does not work for me .
Remember, invoking selenium by user will re-create extensions.rdf file, therefore I prefer to keep separate profile for Selenium
Having found this answer and had a go, I found that merging the Extensions.rdf and extensions.ini file from the temporary profile created in a Selenium session and putting that into your Custom Profile directory solves this problem.
When merging extensions.ini, be careful to avoid getting the pathnames wrong.
Use this -
From the address bar type “about:config” and add/update the following:
- extensions.update.notifyUser (type=boolean; value=false)
- extensions.newAddons (type=boolean; value=false)
It worked for me.