Skip to content
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

Upgrade django-wiki and Django #164

Open
nschneid opened this issue Nov 19, 2019 · 15 comments
Open

Upgrade django-wiki and Django #164

nschneid opened this issue Nov 19, 2019 · 15 comments

Comments

@nschneid
Copy link
Contributor

nschneid commented Nov 19, 2019

Consider whether it would be beneficial at this point to upgrade to django-wiki 0.5 and Django 2.2/3. Django 3 comes out in December.

@nschneid nschneid changed the title Upgrade? Upgrade django-wiki and Django Aug 22, 2020
@nschneid
Copy link
Contributor Author

nschneid commented Aug 22, 2020

  1. Upgrade to django-wiki 0.5
  2. Upgrade django-wiki to 0.6—watch for stylesheet breakage
  3. Upgrade Django to 3.0
  4. Upgrade django-wiki to 0.7
  5. Upgrade Django to 3.1

@nitinvwaran
Copy link
Contributor

nitinvwaran commented Mar 4, 2021

Just to update, I set the main django-wiki repo as an upstream and did a git pull from their master with the -Xtheirs option, meaning remote changes are automatically merged by favouring the remote django-wiki repo. ( i noticed this might be possible, since the main difference is the addition of the plugins/metadata folder in Xposition, but i'm not 100% sure).

I'm testing this with Django==3.1.0 and django-wiki==0.7.3 (basically, the pull from the upstream master).

Trying to get this to run, i now get this below, which suggests need to upgrade django-categories. I noticed this is configured as a fork from the main django-categories repo, and Xposition relies on the fork as a dependency, so i think I will need to also upgrade the nert-nlp/django-categories fork. I'm not sure, can I resolve merge conflicts like was done for the Xposition fork of django-wiki by generally favouring the upstream ( i can test this as well)

File "/home/nitin/anaconda3/envs/Xposition-upgrade/lib/python3.7/site-packages/categories/registration.py", line 4, in
from django.db.models import FieldDoesNotExist, ForeignKey, ManyToManyField, CASCADE
ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models' (/home/nitin/anaconda3/envs/Xposition-upgrade/lib/python3.7/site-packages/django/db/models/init.py)

@nitinvwaran
Copy link
Contributor

the merge of the upstream django-categories 1.8, to the nert-nlp/django-categories fork was a lot smoother than anticipated, but i had to install the django-categories from PyPI to resolve the error above (installing from setup.py didn't resolve the error). I'll continue testing to see if this has any impact.

@nitinvwaran
Copy link
Contributor

nitinvwaran commented Mar 4, 2021

OK, it looks like its running on Django 3.1, django-wiki 0.7.3, django-categories 1.8, and the latest versions of the other django submodules. I ran manage.py [makemigrations --merge, migrate] before runserver.

A lot of CSS (.less) files were removed (and replaced with a new scss format) in the latest django-wiki version , and the new website looks like this. The top navigation menu is notably missing (next steps..)

xpos-djangowiki-3_1-0_7_3

@nschneid
Copy link
Contributor Author

nschneid commented Mar 4, 2021

Sounds great! Yes, django-categories is a dependency that we rely heavily on.

Apart from the CSS, does the metadata on articles for adpositions, supersenses, etc. still display? If not this may indicate that some manual merging of upstream django-wiki changes is necessary, e.g. to views/article.py IIRC. But you're correct that we tried to make the Xposition code as modular as possible under plugins.

@nitinvwaran
Copy link
Contributor

I got the navigation bar back by adding some new bootstrap 0.4 js scripts to the html page, though the menu mow appears as a hamburger menu and it doesnt look good. Navigating to the language specific pages now throws a server side error, will look into that.

I was then able to navigate to the other supersense / construal pages with the nav bar back. The metadata does display (screenshot below), i successfully tested editing the description for one of the pages, but the metadata displays on the bottom of the page instead of the side.

Would you have any suggestions, for next steps? I thought, now the js scripts are added, I would start to try fix some of the CSS layout issues (and that server side bug).

metadata

@nitinvwaran
Copy link
Contributor

Just to document: this is the server side bug:
server-side bug

@nschneid
Copy link
Contributor Author

nschneid commented Mar 9, 2021

Yes please see if you can get it working as before. You may want to see if there are django-wiki default templates/CSS you can refer to. It may be that the Xposition ones were adapted from the older versions of those.

@nitinvwaran
Copy link
Contributor

I'm now working on cleaning up the webpage layouts in the upgraded website (upgraded to django-wiki 0.7.5 in addition to upgrades above). One place where i'm currently stuck is that Markdown has stopped rendering in the upgraded website. An example is in the screenshot below (preview window, but the same issue is present in the Article view):

Trying to google some ideas, was wondering if anyone might have an idea how to tackle this.

no_markdown

@nschneid
Copy link
Contributor Author

nschneid commented Jun 1, 2021

It's displaying Markdown, just not the Xposition-specific macros. So it might be that custom macros are turned off, or that the Xposition-specific ones are being ignored.

@nitinvwaran
Copy link
Contributor

nitinvwaran commented Jun 7, 2021

Thanks, i had to add back the Xposition specific changes to the src/wiki/plugins/macros files which were overwritten when i did the merge from the latest django-wiki (0.7.5), and these macros now work.

I tested the new site and made front-end changes to get the look (mostly) back to what it was before. Also fixed a few bugs while testing the pages (tested the admin functionality also and the login/signup functions). I think I am done testing the new site and making the fixes. I'm wondering what the next steps would be, maybe, host the new site on a test environment so maybe some more users can try it out? The new site is on the djangiwiki-upgrade branch that i created earlier.

These are the screenshots of the home page and a page with positional macros:

Screenshot from 2021-06-07 12-52-37

Screenshot from 2021-06-07 12-56-27

@nschneid
Copy link
Contributor Author

nschneid commented Jun 7, 2021

Great progress! Comparing the screenshot to http://flat.nert.georgetown.edu/Ancillary/, I see a few CSS issues:

  • The font of the bulleted examples is different.
  • The spacing below the short definition box at the top is different.
  • The layout of the page title with respect to the tag and globe icon is different. Not sure if the updated django-wiki has intentionally altered this or it's a problem with the Xposition-specific stylesheet.

@nschneid
Copy link
Contributor Author

nschneid commented Jun 8, 2021

^ The font issue seems to be specific to Firefox on Nitin's Ubuntu machine (the CSS rule specifies 'Roboto Light', sans-serif and the default sans-serif font is used on <ul> elements but not <p> elements with that rule). Not new to the upgrade, and not a problem with Chrome. The bug was that the name "Roboto Light" is defined as a local font on Nathan's machine but not in the web font. Changed to font-family: 'Roboto', sans-serif; font-weight: 300;

@nitinvwaran
Copy link
Contributor

nitinvwaran commented Jun 8, 2021

Documenting a few more issues noticed:

  • The pagination doesn't highlight the selected page
  • the links 'Open table in a new window' / 'See more examples in a separate window' do not always display below the PTokenAnnotation table (possible javascript error)

@nitinvwaran
Copy link
Contributor

Deployed djangowiki-upgrade to master and to production server. Two o/s issues, in the immediately prior comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants