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

Gene Wiki article creator broken #14

Closed
andrewsu opened this issue May 13, 2017 · 13 comments
Closed

Gene Wiki article creator broken #14

andrewsu opened this issue May 13, 2017 · 13 comments

Comments

@andrewsu
Copy link
Member

A user requested creation of a gene wiki page for FCHO1 (Entrez Gene 23149). The Gene Wiki BioGPS plugin goes to http://genewiki.sulab.org/map/wiki/23149, which then redirects to http://genewiki.sulab.org/map/wiki/23149/genewiki.wiki.views.article_create which returns 404.

If @julialturner is still around it would be great if you can take a look and see if it's something simple. If we don't hear back in a couple days, we should just take this one on ourselves...

@andrewsu
Copy link
Member Author

On fix, someone should also create the FCHO1 page and/or follow up with this user https://en.wikipedia.org/w/index.php?title=User_talk%3AProteinBoxBot%2FPhase_3&type=revision&diff=780219122&oldid=653967701

@julialturner
Copy link
Collaborator

@andrewsu I can create the page with my local copy of code and will see if there is an easy fix for the page creation.

@julialturner
Copy link
Collaborator

It seems this is something to do with the server configuration. Did it ever work after everything was moved over?

@andrewsu
Copy link
Member Author

Thanks @julialturner -- not sure if we tested the article creation feature after migration. Just want to confirm as we try to debug server-side, is the redirect to http://genewiki.sulab.org/map/wiki/23149/genewiki.wiki.views.article_create correct? Or should that be mapping to another URL?

@julialturner
Copy link
Collaborator

@goodb
Copy link

goodb commented May 15, 2017

@julialturner thanks for chiming in. Could you confirm that this line is correct and matches your local situation? (line 29 in mapping/views.py ) . I believe thats the line that starts the redirect problem.
https://github.com/SuLab/GeneWikiCentral/blob/master/genewiki/genewiki/mapping/views.py#L29

Should go to http://genewiki.sulab.org/wiki/article/create/23149/ but instead goes to
http://genewiki.sulab.org/map/wiki/23149/genewiki.wiki.views.article_create

Seems like it needs some indication to go up to the root context to find the URL pattern with name = article_create ? (here https://github.com/SuLab/GeneWikiCentral/blob/master/genewiki/genewiki/wiki/urls.py ) ??

@julialturner
Copy link
Collaborator

@goodb yes my line 29 in mapping/views.py is the same

@goodb
Copy link

goodb commented May 15, 2017

Okay thanks @julialturner . @putmantime is looking into it. Most likely something about the django/nginx server configuration I guess.

@goodb
Copy link

goodb commented May 16, 2017

Update. multiple problems actually. # 1 python not importing gene wiki module. Fixed by @putmantime . # 2 Looks like cross-origin request problem: Safari: "Refused to display 'http://genewiki.sulab.org/wiki/article/create/23150/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'. # 3 its not actually reading any password file so once we get it to execute will fail to make the wikidata write. Hopefully will cure these tomorrow...

@goodb
Copy link

goodb commented May 16, 2017

@putmantime For the X-frame-options error I think this is a result of the latest django release being made 'safer' by default. See https://docs.djangoproject.com/en/1.11/ref/clickjacking/#setting-x-frame-options-for-all-responses . Its defaulting to SAMEORIGIN, blocking all attempts to render the content in an iframe like biogps. Looks like it needs the @xframe_options_exempt decorator added to the views that we want to be able to show in iframe. (Tried fixing this at nginx conf level, but needs django-specific fix)

@putmantime
Copy link
Contributor

@goodb The decorator fixed it and the prompt to create a new article is now rendering in GPS. I am now trying to fix the password issue. Is there a different set of credentials for writing to wikipedia?

@putmantime
Copy link
Contributor

Update. Article creator is now functional.
Fixes implemented:

  1. Python import of article_create view into mapping view.
    -less than ideal Python path append to allow import
    -restructuring of project for proper python path imports would be optimal
  2. Cross origin request error for rendering in BioGPS;
    -added '@xframe_options_exempt' decorator to article create view
  3. password import for PBB:
    -created a pbb_secret.py file with password and user name
    • imported into /wiki/views.py and wiki/textutils.py for wikipedia article and interwikilink creation.
  4. created .gitignore file
    -added django secret key to pbb_secret.py and imported into django settings.py
    -added pbb_secret.py path to .gitignore

@goodb
Copy link

goodb commented May 16, 2017

plugin functional once more. closing.

@goodb goodb closed this as completed May 16, 2017
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

4 participants