简体   繁体   中英

Django development on Windows IDE but deployment on Ubuntu

I'm looking to start development on Django for the first time and I'm looking to deploy the site on a Ubuntu server when production ready. I have never coded with anything other than Windows but I understand that Python references file structure differently on Windows compared to Linux. I would prefer to develop code that can be deployed easily after development. Hence I'm looking for a Windows IDE that syncs files with the deployment machine when saved so that I can run the tests over on the remote machine immediately. I would like to utilise venvs.

Thanks!

Use os.path.join().

Example:

instead of

'output'+'/'+'log.txt'

do

os.path.join("output","log.txt").

This way your file structure issue would be solved.

ps: Never concatenate strings manually to get file path.

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