Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:21:38+00:00 2026-06-15T01:21:38+00:00

I have to transform my Django application so that it is compliant with 21

  • 0

I have to transform my Django application so that it is compliant with “21 CFR Part 11“, that is make electronic records have the same validity as signed paper records. Is there any project or application I should look at?

Some issues:

  1. audit trail: every change in selected models must be traced (who, when, what)
  2. detect unauthorized record editing: if a record has been changed/added/deleted outside normal procedure, the application should detect it
  3. for particular operations, user has to enter the password again
  4. passwords must be changed periodically and must satisfy certain criteria
    etc…

I’ve found no ready solution on the net…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:21:40+00:00Added an answer on June 15, 2026 at 1:21 am

    I work in an environment requiring CFR 21 Part 11 and similar. I have not yet gotten our apps fully compliant, but I have gone through a number of trial and errors so helpfully I can get you started in a few places.

    1) I would also suggest Django reversion; however, you will require a little more than what it offers to achieves a variable level audit trail with the action that was taken (in addition to by whom and when). For this I used one of the reversion signals to turn the comment field into a dict that could be evaluated and then called for any variable in the row and the action that was taken on it etc. This is below:

    https://github.com/etianen/django-reversion

    @receiver(reversion.pre_revision_commit)
        def it_worked(sender, **kwargs):
        currentVersion = kwargs.pop('versions')[0].field_dict
        fieldList = currentVersion.keys()
        fieldList.remove('id')
        commentDict = {}
        try:
            pastVersion = reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
        except IndexError:
            for field in fieldList:
                commentDict[field] = "Created"
        except TypeError:
            for field in fieldList:
                commentDict[field] = "Deleted"
        else:
            for field in fieldList:
                try:
                    pastTest = pastVersion[field]
                except KeyError:
                    commentDict[field] = "Created"
                else:       
                    if currentVersion[field] != pastTest:
                        commentDict[field] = "Changed"
                    else:
                        commentDict[field] = "Unchanged"
        comment = commentDict
        revision = kwargs.pop('revision')
        revision.comment = comment
        revision.save()
        kwargs['revision'] = revision
        sender.save_revision
    

    2/3) You are going to need to use an object-level permission system for this. I have implemented django-guardian. Pretty much the only limit on the complexity you can implement is how many things you can keep straight yourself. The base set of permissions you will need to implement are view, edit, delete, and some sort of data controller/manager role; however, you will probably want to go more complicated. I would highly suggest using class-based-views and mixins for permission checking, but function based can work as well. This can also be used to prompt for password for certain actions because you can control what happens to a field in any way you like.

    https://github.com/lukaszb/django-guardian

    4) Expiring passwords can be implemented with even just the Django auth system if you want or any user account management app. You will just need to add an extra field to record whatever datetime you want to begin your expiry countdown. Then on login just check for time from countdown and see if they have gone beyond the window, and if so require them to create a new password by directing them through the built-in view for password change or which mechanism is appropriate to your app.

    I will tell you the most difficult part of implementing CFR 21 Part 11 will be getting the appropriate people to tell you exactly what your project should do to meet requirements, and getting inspected for compliance can be time consuming and costly.

    Hope this helps you get started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a task to import/transform and extract zipped binary files that contain both
I have a generated JSON file that I would like to transform. Is there
I have a series of divs that slide down using -webkit-transform from a negative
I have a datetime column in db that I want to transform into a
My application uses Django non-rel . I don't have access to model. I have
We have a web based application in production built using django. It is deployed
Background I have a custom authentication back end for our django applications that refers
I have Django project on Dreamhost server which has several views that returns Json
I have a website that is being served by nginx and django. My staging.py
I have to transform a python web application into an ASP.net application. Problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.