I am implementing xhtml2pdf module for my django app. I have been able to print reports, however I am not getting my static configuration to work. I am getting error
SuspiciousFileOperation at /moc-content/165/print-report
The joined path (/moc/static/moc/main.css) is located outside of the base path component (/Users/xxx/Documents/django-projects/MOC/env/lib/python3.10/site-packages/django/contrib/admin/static)
I have implemented link_callback function as xhtml doc is suggesting, but could not figure it out whats wrong with my settings:
# settings.py
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'moc/static')
STATIC_URL = 'moc/static/'
# Media files (uploads)
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = 'moc/media/'
My xhtml functions are as per official docs
My vs code directory tree https://i.stack.imgur.com/FWGuv.png