Django Not Reflecting Changes Made to App - django

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!

Related

I can't sign into the Django admin login page

I have started multiple Django projects with like four different tutorials. Every single time I try "python manage.py createsuperuser", the admin login page just loads and loads and never goes anywhere. I want to make it absolutely clear that I haven't touched a thing in the code and everything is default code. I migrated everything before login. I've tried deleting the database and re-migrating. None of that works. Can someone help me? I have made around 10-15 accounts and NONE of them work. The page just keeps loading indefinitely and never goes anywhere. I've looked at EVERY stackoverflow post and no answers work. I started a virtualenv, downloaded Django, didn't touch the code, made migrations, I followed every tutorial TOO THE LETTER(!!!) and this is what I keep getting. The current tutorial hasn't changed in default code and he signed in with no problems. I'm assuming if he did, I can...I don't think putting code in is necessary since it's all virgin code, never touched. I didn't even make any apps yet.
I've tried deleting database and re-migrating
changing the password of current superuser
deleting the entire project and following everything the instructor said (TO THE LETTER!!!)
I have made 10-15 superuser accounts and none work
This sounds similar to a problem I was seeing. I wrote a question for it here (no answers yet): Django local dev server hangs with chrome after form submission. Works in firefox
Are you using windows and the chrome browser? Try using firefox to access the admin page and login. That worked for me. I'm still trying to figure out why Chome doesn't work, though. Like you, I created a brand new project from scratch; sometimes Chrome works and most of the time it doesn't. I've also found that hitting the stop button while the browser is sitting there thinking, then refresh, makes the logged in admin page show up.

django redirect is applied to all projects directly

I was studying mozilla django tutorial and in between that I came across one point where I have to redirect the url ' ' to '/catalog/' with permanent = True.
Now I have one new project (another project in different directory ) with django-admin and gave the command of manage.py runserver (notice I haven't made any changes in this project) the url '' is automatically being redirect to '/catalog/' in chrome it works fine in opera mini though.
It’s probably not a Django issue, but due to Chrome caching certain requests. You could try a hard refresh of the page:
https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/
Unless the redirect is being handled by some unusual Javascript (and you are doing this in Django so probably not), you probably just need to refresh the page. Hold the shift key while clicking on the refresh button in Chrome.
This is because chrome has cached this particular redirect and uses it without checking with the server. You can get rid of this by clearing your browser cache - but you might not want to do this because you'll lose other data too. Instead, right click on the page in question and go to developer tools (or hit F12). Go to the Network tab and tick "Disable cache". Now refresh the page without the redirected part of the url, and the page should load correctly. Now close developer tools and it should continue to work as intended.
I solved it by deleting the browser history(going to Advanced mode and selecting everything).

Django Debug Toolbar 1.10 (and 1.10.1) Not Showing

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!

Django website toggling between latest and previous state on reload

today, I have recognized a strange behaviour of my Apache served Django 2.0.2 (Webfaction) website. After I have made a change and restarted the Apache server, the reloaded website shows the latest change. But when I hit F5 (reload) again, the view of the previous state is displayed again. Another reload and the latest state is displayed. That continues back and forth. For example, see the smallcaps and line-break changes:
Before, the same happened to the background opacity, too, so it's not limited to the font.
It happens on Firefax (PC) as well as on Opera and Chrome browsers (on mobile dev). So, I assume the issue lies in Apache - or Django. I've never seen such a behaviour, before. Does anyone have an idea what causes this effect?
Not sure whether it is of help (because the site will soon change), but for reproduction of the error, this is the site: http://campfire.skylet.de/
Thank you
Michael

problems with database after moving live drupal site to local site

To move my live drupal 8 site to a new local site I followed this tutorial by OS Training on YouTube. I am aware that they are doing the migration the other way around, but it shouldn't make that big a difference I guess.
They tell you to start by creating your new drupal 8 site and then moving some folders between your old site and the new one. The last step is to import your old database into the database of the new site.
I did all that but when I visit my new local drupal 8 site it first appears to show nothing until you scroll A LOT and then I'm able to get to things like my content and content types, where I see that nothing has happened. If I go check the database of the new site I see that everything is there that should be there, but I just can't get it to show up on the site itself.
I guess there's something wrong with the connection to the database, but I have no clue how to fix it. Any ideas?
-sidenote: I am using Acquia Dev Desktop to set up my local site
Compare the sites/default/settings.php file between live and local.
Make sure you have cleared all caches and rebuilt the DB. Also, check for errors using chrome developer console and write them down here.