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.
INSTALLED_APPS = [ ... 'csvexport', ]
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 django.core.management import execute_from_command_line execute_from_command_line(sys.argv)