0

After deploying a Django project and giving server access to the client, is there anyway to protect the source code from being revealed?

Maybe somthing like seperating the servers for holding the database and the source code?
Or having some lock or something on the docker container of the Django project?

Mohawo
  • 47
  • 7
  • You can convert it to executable binary or other language. Maybe this answer will help: https://stackoverflow.com/questions/39913847/is-there-a-way-to-compile-a-python-application-into-static-binary – ruddra May 06 '23 at 20:23
  • What reason does the client need access to the server. You could have the django code owned by user x and have the client connect as user y assuming the client user doesn't have access to sudo or the likes. compiling to an exe etc offers little protection as they can normally just be decompiled – Chris Doyle May 06 '23 at 21:19
  • Can you explain what the client needs server access for? Do they want to use it to change and debug your code, for example? If so it's probably impossible to satisfy both parties here. Is there some reduced form of access you can give them? – Nick ODell May 07 '23 at 01:04
  • @ChrisDoyle The client wants the database under his protection!!! Only The database matters to him. – Mohawo May 07 '23 at 15:49
  • @NickODell The client wants the database under his protection!!! Only The database matters to him. – Mohawo May 07 '23 at 15:49
  • @ruddra I don't think that is possible for Django projects! Thanks anyway. – Mohawo May 07 '23 at 15:50
  • Well, Django can run on a different server than the database server, and connect to the database server over the network. – Nick ODell May 07 '23 at 15:55
  • You could run the data base as user X and the django app as user Y and make all the django files owned by user Y only readable by user Y that way the client logging in as user X wont be able to read them – Chris Doyle May 07 '23 at 16:03
  • @NickODell How can I do that? Can you please give instructions as an answer to the question? – Mohawo May 07 '23 at 17:46
  • @Mohawo Here's an example of how to do this: https://stackoverflow.com/questions/45973381/how-to-separate-a-database-from-a-django-web-app-when-going-live – Nick ODell May 07 '23 at 17:52

0 Answers0