1👍
If someone has the privileges to access anything/anywhere on the server
you can’t do much, because what you can do others can do too, you can try some way of obfuscation but that will not work. Only solution is NOT to use such shared repository.
Edit: options
- Keep working with shared repository if your data is not very sensitive
- Use dedicated hosting from companies like rack-space etc
- Use AWS to run your own instance
- Use google-app-engine server but that may require a DB change
- Run your own server (most secure)
1👍
There is almost no scenario where your hosting provider would be interested in your source code. The source code of most websites just isn’t worth very much.
If you really feel it is necessary to protect your source code, the best thing to do is serve it from a system that you own and control physically and have exclusive access to.
Failing that, there are a few techniques for obfuscating python, the most straightforward of which is to only push .pyc files and not .py files to your production server. However, this is not standard practice with Django because theft of web site source code by hosting providers is not really an extant problem. I do not know whether or not this technique would work with Django specifically.
- [Django]-DJango URL Reverse Error: argument to reversed() must be a sequence
- [Django]-Is it safe to query Django ORM directly with the user input?
- [Django]-How can I prevent circular {% include %} calls in Jinja2 templates
1👍
While your source code’s probably fine where it is, I’d recommend not storing your configuration passwords in plaintext, whether the code file is compiled or not. Rather, have a hash of the appropriate password on the server, have the server generate a hash of the password submitted during login and compare those instead. Standard security practice.
Then again I could just be talking out my rear end since I haven’t fussed about with Django yet.
- [Django]-Instance.__dict__ in django templating language
- [Django]-Non_field_errors : ["Expected a list of items but got type "dict"."]
- [Django]-Can't get nginx to cache uwsgi result
- [Django]-Memory usage with Django + SQLite3
- [Django]-ImportError: module incorrectly imported
0👍
Protecting source code is not that important IMHO. I would just deploy compiled files and not worry too much about it.
Protecting your config (specially passwords) is indeed important. Temia’s point is good.