简体   繁体   中英

Django Data synchronisation between local and online server

I got a local server running a djanago application only for local use in this network.( 1 )

Now I want to have some sort of report site that can be accessed from the Internet. Also as a django app. ( 2 )

My question is now what is the best way to get the data from 1 regarding security and usability.

The best way is using Requests.

This is the documentation: http://docs.python-requests.org/en/master/

r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
r.status_code
r.headers['content-type']
r.encoding
r.text
r.json()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM