2 ms·
1) Profile. You really shouldn't start blindly optimizing code without profiling. Profile it, find your bottlenecks, optimize, rinse, and repeat. You should a
by brooksbp 19y ago
1) Profile. You really shouldn't start blindly optimizing code without profiling. Profile it, find your bottlenecks, optimize, rinse, and repeat. You should also benchmark your hardware; run scripts that make requests to your www server. Check out Apache's ab benchmark. Etc...
2) Cache. Google "Memcached". Django has support for this. This will alleviate huge database bottlenecks (if your app is read heavy). Also possibly consider some sort of FS (file-system) structure specific for your app. It looks like you deal with a bunch of media files, that could get hard to manage without a proper FS plan.
3) Write clean code. There is no sense in profiling, optimizing, caching, etc if your code is horrible. Those things will lead to even worse, unreadable, unmanageable, possibly slower code.
From your description you asked slightly more specified questions, but you really need to understand the basics of above before specializing for your app. At least that's what I believe.