Forums

Working directory vs Source Code

if i attached domain to pythonenywhere and my app is run from /home/szyle/szyle.pythonanywhere.com wich one is it to load when i visit my domain? Working directory or Source Code? and whats the difference?

Source code is where your web app code is, working directory is the place where relative paths should resolve from. For example if you have set working directory to your home directory and you want your code to read file "file.txt', it will be looked for in /home/szyle/file.txt (unless you provide the full path to file.txt).

so if working dir is /home/szyle/ then writing /.virtualenvs/file path is enough if its in /home/szyle/.virtualenvs/file path ?

If it's in a web app code, that should be OK (but without the initial "/") -- but the good practice is to use absolute paths, to reduce possible confusion.