How to sync my local database of my web app to database of my deployed web app? - django

So my project is a school distributed system based on django web framework. My web app will be deployed in every school on their local computers. And all of the data on those computer will by synced with a main server on my side. What I want is how to implement a solution that would help me sync files/data with my server such that if some file/data is changed on a local computer it'll replicate itself in our server and if I change some file/data on my server, it'll update on those local computers whenever they get an internet connection.

Related

Remote Access to Django's Internet Server

I have a remote (virtual) Ubuntu development station, on which I installed Django, and on which I'm running "manage runserver".
Now, I need to browse my project's URLs, and debug their view functions line by line.
But I fail to remotely use the web browser on the remote development station (there was time that I succeeded doing so, but it was horribly slow).
I therefore would like to enable the web browser on my own laptop to connect the web server of Django that's running on the remote development station.
Is there a way to do so?

Offline Cache Web Application with Django

I have faced some problems with offline web application which used VueJS(frontend) and Django(Backend) with postgres database.
Currently postgres database are installed on cloud while frontend and backend are on local computer, in order to avoid retrieve or update data every time from cloud, I have used cache in Django to store data temporary.
But when internet connection is disconnected, cache suddenly stop working and show error on database disconnected.
Are there any solution to add some offline service worker to avoid database connection error and allow cache to work both offline and online ?
Thank you

Django app with offline mode: store datas both in remote and local postgresql database?

I have a problem quite similar with this post but was thinking for an easiest implementation
My Django app is deployed on a remote server with Postgresql database (main central remote database).
Users online: data are stored both in the remote database and, if possible, in a local postgresql database (local database hosted on a dedicated laptop)
Users offline (when server where app is hosted is down): 'central' user need to be able to use Django web app on the dedicated laptop (with PWA) with the most up-to-date local database
When back online, the remote database is synchronized
Django can use multiple databases.
But is my solution possible?
I have read for Django sync and collect-offline apps...
thanks for advices

Django website running on Azure web app extremely slow

I have a django web app which I have deployed to an Azure web app (running on the B1 app service plan). The website works as intended, except for the loading time which can routinely take up to 10 minutes to load a single page (even with cached static files).
While I have not correctly set up a web hosting platform and are instead simply running the server using the default manage.py system, the website still should not be running this slowly. Is there a simple way to fix this problem?
If you running with manage.py, it may possible that you face performance issue or django web server thread issue. For performance you must configure django application with Apache2or IIS server.
Django web server is for debugging purpose only.
Recommend you to use Azure web services fir website.
Since your code runs normally on the local side, I suggest you try to change from FastCGI to httpPlatformHandler in your web.config file.You could follow this
tutorial.
In addition, please refer to this official doc to troubleshooting the performance of your Azure web app.
Optimize your code, where is blocking. I am also running website on Azure but never face slowly response even in free instance.

Sync Framework and SQL Server in a centralized model - does SF need to be installed on the central server?

Good Day Everyone,
Excuse the newbie question, I am new to Microsoft Sync Framework. I've done extensive research on the Internet in order to find my way in this puzzle with the different versions of Sync Framework, of SQL Server, of Sync Services for ADO.NET, of SyncAgent vs SyncOrchestrator, etc. etc. and what should be used in which type of scenario. Unfortunately, after about a week of struggling all day long with how to code my ASP.NET 2.0 C# web application right, I am still lost.
My current situation is this: I am developing applications for a large Department and I cannot expect to get approval for installing new stuff on the server side. I am stuck with SQL Server 2008 and (I believe), the server has Sync Framework 1.0 installed on it. However, I have the freedom to install later versions on the client computers that will connect to the server. These will have SQL Server 2008 Express (NOT Compact) and will each run the web app. in their localhost IIS. The synchronization model is centralized in that the clients will only connect to the server for bidirectional synchronization (in a star-shaped network topology, do we call this the hub-spoke model?) but will not connect to each other (no peer-to-peer collaboration).
I have prepared both sides of the database for synchronization (enabled Change Tracking, put GUID data type for Primary Keys, etc. etc.)
The core of the synchronization, the program that makes the interface between the two nodes to synchronize, seem to be exclusively the web application on the client side. Right?
QUESTION: If I want to use Sync Framework v2.0 or v2.1, can I just ignore what version is installed on the server? In other words, is the Sync Framework on the server side even doing something? The SQL Server does not have the web application installed on it.
Unfortunately I could not find answer to this rather simple question on the web!
Thanks very much for your help! Have a great day!
Kindest Regards,
Zyxy
No, you don't need to install sync framework on the central sever. All you need from the central database is a connection string. As long as you can access the central database with a login that has sufficient rights, then you don't need to install anything on it. The sync application can run from anywhere as long as it is able to connect to the central server.
depends how you build your application.
if all sync code is on your app and you simply point it to connect the central sql server, then no need to have sync framework on the server.
if however you decide to use WCF such that you have a service component of the sync on the server side, then you need sync framework on the server. you client will have a proxy for the server side service and part of the synchronization will be executed server side on the wcf service.
with regards to SQL Express on the client side, SQL Ce is the only supported client database is you use VS Local Database Cache Project item or if you manually code against the SyncAgent/SQLCeClientSyncProvider/DbServerSyncProvider.
if you use SQL Express, you will have to use the newer SyncOrchestrator/SqlSyncProvider combo but that doesnt use the built-in SQL Change tracking.