I want to deploy a Django application to a cloud computing environment, but I am worried about source code security. Can I deploy only the compiled .pyc files there? According to official python doc, pyc files are 'moderately hard to reverse engineer'.
What are the pros and cons of taking this approach? Is this a standard practice?
I am not using AWS, let me just say that I am in a country where cloud computing can not be trusted at all...
Generally, deploying PYC files will work fine.
The Pros, as you said, a bit helpful for protecting source codes.
Cons, here are the points I found:
1). PYC only works with same Python version. E.g., "a.pyc" was compiled by Python2.6, "b.pyc" was by 2.7, and b.pyc "import a", it won't work. Similarly, "python2.6 b.pyc" neither work. So do remember to use a same Python version to generate all PYC, as well as the version on your cloud server
2). if you want to SSH to cloud server for some live debugging, PYC cannot help you
3). the deployment work requires extra things to do
Should I deploy only the .pyc files on server if I worry about code security?