Django ImproperlyConfigured error with django-admin-csvexport

So I have been working on adding an admin function to a Django project so that I can export the model instances to csv. It is all working fine locally whilst using Docker. But when deploying it to the server it doesn’t work. When I activate the virtualenv (source /home/vfs/.cache/pypoetry/virtualenvs/vfs-gOLk6wo–py3.7/bin/activate) and try to import the csvexport module I get this error:

I’ve been looking on the internet for quite some time now and can’t find a solution. I took over this project and wasn’t involved in the server set up or anything. As I’m not that specialized in server side stuff I would appreciate it a lot if someone could help me with this.



from csvexport.actions import csvexport
from django_summernote.admin import SummernoteModelAdmin

class FundAdmin(SummernoteModelAdmin):
    actions = [csvexport]

#!/usr/bin/env python
import os
import sys

if __name__ == '__main__':
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')

    from import execute_from_command_line


How are you running the shell in which you’re trying to do this? Is this the Django shell you’re using from