Please accept my apologies for “hijacking” a previous thread. Offense was unintentional. My original question is:
I build healthcare applications and the gov't regs require we log most
user access to patient info.
Since I've only built one (rather large) Django app, my logging is in
the same DB as my data and I use decorators in views.py to log all
access. There is only one table in it's own schema that is used for
this.
Now I'm building additional, functionally unrelated projects but would
like to use the same logging model.
We use MySQL and have very low throughput and use several databases
(i.e. mysql schema's) on a single linux server.
Since this is used by several unrelated applications, I would
appreciate some advice from more experienced developers on a good technique.
Please bear in mind that I'm the only Python/Django.SQL developer in
my organization so there is not the need to coordinate with multiple
independent teams..
Would you recommend:
a) Just duplicate the model definition in each app (i.e. move to
separate file and import it for DRY) and use the ".using() clause or a
db router?
b) Create a separate app, dedicated to this -- but what's the best way
to do a "cross app" reference
c) create a separate site dedicated to this -- then should I use a url
to pass it the logging data making it decoupled or is there a better
way
Any insight would be appreciated. As I said, I work solo at the
office so this is my only way to collaborate with other professionals.
F
I agree too. But in today's mail is a link to an answer to a similar
question about centralising control of login-required. It may be useful
to consider a middleware approach to logging.
See Colin Bean's email headed Re: Automatically direct unauthenticated
users to homepage
Cheers
Mike