silverapp / silver

Automated billing and payments for Django with a REST API
https://www.presslabs.com/code/silver/
Other
301 stars 80 forks source link

Missing dependency xhtml2pdf #604

Closed sww314 closed 6 years ago

sww314 commented 6 years ago

pip install django-silver Add silver to installed apps and try to run migration it fails. django-silver version 0.6.1

[vagrant@dev workspace]$ ./manage.py migrate silver Traceback (most recent call last): File "./manage.py", line 13, in <module> execute_from_command_line(sys.argv) File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line utility.execute() File "/usr/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute django.setup() File "/usr/lib/python2.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models() File "/usr/lib/python2.7/site-packages/django/apps/config.py", line 202, in import_models self.models_module = import_module(models_module_name) File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/lib/python2.7/site-packages/silver/models/__init__.py", line 16, in <module> from documents import Proforma, Invoice, BillingDocumentBase, DocumentEntry, PDF File "/usr/lib/python2.7/site-packages/silver/models/documents/__init__.py", line 16, in <module> from .base import BillingDocumentBase File "/usr/lib/python2.7/site-packages/silver/models/documents/base.py", line 43, in <module> from silver.models.documents.pdf import PDF File "/usr/lib/python2.7/site-packages/silver/models/documents/pdf.py", line 3, in <module> from xhtml2pdf import pisa ImportError: No module named xhtml2pdf

pip install xhtml2pdf fixes this issue.

bogdanpetrea commented 6 years ago

Hi @sww314 , thanks for the tip!

I remember we had to pin a github version of xhtml2pdf because a new version hasn't been released for a while back then. For some reason I thought this would work: https://github.com/silverapp/silver/blob/master/setup.py#L80 Anyway, it seems some new versions of xhtml2pdf have been released since and I'll do a version bump.

bogdanpetrea commented 6 years ago

Closed in https://github.com/silverapp/silver/pull/610.