how to Auto page reload in angular 7 - django

Using API I fetch the data from the python framework to (Angular 7).
But when I add more values in the database than at (Angular 7) side its shows me added data when I click on refresh.
But I want to auto-reload my page when I change in the database.
Then give me some suggestion.
I have already tried the pusher in angular but it's can't work.

Related

The django-geoposition map widget is not showing up in the django admin on my production server, but it is working perfectly fine on my test server

The django geoposition widget shows up in admin when I am testing everything on my laptop with the django test server. However, when I put everything onto my production server, there is no map showing up and no labels showing up for the latitude and longitude. Both setups are using django == 2.1.7 and geoposition == 0.3.0. The production server is being served with nginx and gunicorn.
I opened the browser inspection window and it turned out that the geoposition.js is being served by django before jQuery is being called. So I tried calling jQuery directly in the geoposition.js file, but there is still no widget. I then revert everything back to it's original stage and I am now including js = (setting.STATIC_URL + 'geoposition/geoposition.js") in a media class in admin.py. This is causing two maps to appear in my test server, but still no map in my production server. I added an if statement so that it doesn't run if jQuery is not loaded, so no jQuery errors on the first geoposition.js being served. I added some console.log() statements to the file so I can see where it is at and it is getting into the main function fine, but not getting into the $('.geopostion-widget').each(function() ...
When I look at the html, the map and latitude and longitude values are wrapped in a div of class = "geoposition-widget", but that there is no such div from my production server which makes sense as to why the '.geopostion-widget' function is not doing anything. It seems to be putting in that div automatically on my test server, which it is supposed to do, but not on my production server.
Any clue as to why this is happening? Do I just need to create a custom form for the admin on my production server and wrap the field in a div with class = '.geopostion-widget'? This just seems kind of janky since it is working fine on my test server. Or does it have something to do with the way it's being served with gunicorn and nginx?
Found the answer on github here - https://github.com/philippbosch/django-geoposition/issues/83.
imdario's answer at the bottom solved it. Upgraded geoposition package to imdario's geoposition pakcage with 'pip install django-geoposition-2' and voila - it works.

push live updates to client through Django Channels & Websockets when database get updated

I am very new to django channels.I wan't to try out. using django channels, If I added one user through django admin portal then this will be update on live on page where i am displaying users list. Using django post-save is this possible Please help me on this. I have tried one week on this till not get any solution.

React + Django app refreshes for every deletion in Django admin panel

I'm not really sure what to share (i.e. which part of my application code) as I'm still a beginner with React so please bear with me.
I have a React application running on top of a Django application. Basically, there are Django Admin Panel URLS, REST API URLS in Django, and one path to catch all paths that don't belong to the first two groups.
I have a page (or a React Container) that calls Django's REST API to query all entries in the users DB Table. This part is okay but what I've noticed is, everytime I manually delete a row in the Django Admin Panel, the whole page refreshes. What are possible reasons for this?
By the way, I'm using Redux as well to manage the whole application state.

Django website that refreshes page on new postgres entry to provide realtime updates to user

I want to automatically refresh / reload the django webpage in the users webbrowser when a new entry is found in the database. Currently i use a meta refresh as a temporary solution. I have installed and am using pgpubsub. So i can get a notification when there is a new item in the database. But how can i trigger django to reload the website?
import pgpubsub
pubsub = pgpubsub.connect(host="localhost",database="somedb",user="somebody")
pubsub.listen('pg_news');
for e in pubsub.events():
print(e.payload)
any ideas are welcome

How to check in my ember 2.5 application if IE browser is being used and if so generate an error page?

How do I check in my ember 2.5 application if IE browser is being used to view my webpage by the client and if so generate an error page? I only want my customers to use firefox and chrome to view my webpage.
There are some ember addons you can use.
One of them is ember-cli-ie-check