-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BK-2085 Add support for Django 1.11 LTS #887
Conversation
Hi @ride90, nice work! One thing that confuses me is that lib/booktype/apps/importer/management/commands/bookimport.py and lib/booktype/apps/loadsave/management/commands/bookload.py have the same functionality. Should we deprecate one of these? If so, I suggest we deprecate bookimport.py as we are getting rid of bookexport.py. This would leave us with bookload.py and booksave.py commands. |
action='store', | ||
dest='output_name', | ||
default=None, | ||
help='Output filename or -- for STDOUT, e.g. my_book.zip.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 37 should be:
help='Output filename or -- for STDOUT, e.g. my_book.epub')
action='store', | ||
dest='book_version', | ||
default=None, | ||
help='Book version, e.g.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to give an example of book_version on line 32. Is the only possible version 1.0 since we hid the version feature?
Hi @danielhjames , |
Hi @eos87 and @danielhjames , please test this pr. |
Good work @ride90 ! I'll test this when I'm back in the office. |
Hi @danielhjames, @eos87 any feedback? 😄 |
Hi @ride90, I checked this but I still feel like a need to test it more deeply. I will try to do it in next days and will be adding any suggestion that I could make. Great work so far :) |
Hi @ride90 I tested this branch on a Debian 9.x virtualbox server and the installation went fine, I can import EPUB and edit the book, but publishing does not work for me yet. I think our celery instructions need updating to work with these changes. Please see Running celery with supervisor in the 2.4.0 manual. This line in the (previously working) supervisord config no longer works, it results in
Following the output of
Now the error is:
|
Hi @danielhjames, @eos87 seems like not all changes I've added to the script which will generate skeleton with the settings. I will update pr. |
Thanks @ride90, looks like we are nearly there! |
@@ -13,6 +13,6 @@ python-ooxml | |||
django-rest-swagger==2.1.0 | |||
djangorestframework==3.5.3 | |||
Markdown==2.6.7 | |||
django-filter==1.0.0 | |||
django-filter==1.1.0 | |||
Ebooklib==0.16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs bumping to:
Ebooklib==0.17
to merge with #895
Hi @danielhjames @eos87 , |
@@ -3,10 +3,9 @@ import os | |||
from .base import * | |||
|
|||
# WEB SITE URL | |||
THIS_BOOKTYPE_SERVER = os.environ.get('BOOKTYPE_SERVER', '') | |||
THIS_BOOKTYPE_SERVER = os.environ.get('BOOKTYPE_SERVER', '127.0.0.1:8000') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a similar change for prod_settings.py.original please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @danielhjames , no, we don't need it. I've made it in dev settings to make it easier to kickstart dev instance from scratch. For production instance developer will change settings by himself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good!
@@ -664,7 +664,7 @@ def create_supervisor(destination, profile, virtual_env): | |||
|
|||
s = '''[program:%(project_name)s-celery-worker] | |||
directory = %(project_directory)s | |||
command = %(virtualenv)s/bin/python %(project_directory)s/manage_%(profile)s.py celery worker --concurrency=20 | |||
command = %(virtualenv)s/bin/python -m celery worker --app=%(project_name)s_site --concurrency=20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change fixed the celery issue for me, thanks @ride90!
EPUB3 works but not EPUB2, I am seeing this error again: https://dev.sourcefabric.org/browse/BK-2329 [2018-08-17 18:21:01,778: INFO/ForkPoolWorker-10] Starting new HTTP connection (1): booktype.64studio.com |
For the mPDF converter I got the error: AttributeError: 'dict' object has no attribute 'render_context' According to https://stackoverflow.com/questions/6333367/django-on-apache-web-server-dict-object-has-no-attribute-render-context it may be Django 1.11 related. |
XHTML, MOBI, DOCX and ICML work though, we are on our way :-) |
[2018-08-17 18:20:52,523: WARNING/ForkPoolWorker-3] /usr/local/lib/python2.7/dist-packages/unidecode/init.py:46: RuntimeWarning: Argument <type 'str'> is not an unicode object. Passing an encoded string will likely have unexpected results. |
This could be relevant to the mPDF issue: https://www.reddit.com/r/django/comments/64izv8/what_has_changed_with_django_111_in/ |
@@ -14,5 +14,6 @@ Ebooklib==0.17 | |||
django-rest-swagger==2.1.0 | |||
djangorestframework==3.5.3 | |||
Markdown==2.6.7 | |||
django-filter==1.0.0 | |||
django-filter==1.1.0 | |||
Ebooklib==0.16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have two lines for Ebooklib in this file now.
Seen when trying to run the compress step: ./manage_prod.py compress |
@danielhjames , please test it. |
There is a PR for docker support booktype/booktype-docker#2 |
Hi @eos87 , please, test this pr :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and seems to be working good. I'm going to merge it and when can create later tickets for newly found bugs.
Deployed and test on http://booktype-dev.sourcefabric.org |
Helmy's Update:
Points to be considered for testing - just so I don't forget about things ;)
Export