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

Add integration instructions for drf-yasg #145

Merged
merged 10 commits into from
Jul 7, 2021
Merged

Add integration instructions for drf-yasg #145

merged 10 commits into from
Jul 7, 2021

Conversation

johnthagen
Copy link
Contributor

@gwtwod
Copy link

gwtwod commented Mar 18, 2020

Thanks for the recipe, I just stumbled upon this problem too.

@Andrew-Chen-Wang
Copy link
Member

I’d be glad to add a a new file to the docs for all these third-party integrations. Seems to be pretty abundant for this repo. @davesque Thoughts?

@davesque
Copy link
Member

davesque commented Mar 19, 2020

I guess we should probably have a proper readthedocs site at this point. The README will get a bit unwieldy if we add much more to it.

@davesque
Copy link
Member

I just added a docs site this evening. Feel free to create an article in the docs dedicated to this topic. Sorry, but you'll probably have to rebuild this branch in order to do that. You can rebuild it and force push.

@johnthagen
Copy link
Contributor Author

@davesque I moved the section into its own docs page. Please let me know what you think.

@Tusky
Copy link

Tusky commented Jun 30, 2020

Still not implemented, but thanks @johnthagen it helped me!

@taraspos
Copy link

taraspos commented Aug 3, 2020

Hey guys.
Thanks for implementing this, but it seems to be open for quite some time. Any plans to merge it?
@davesque @johnthagen

Thanks!

@johnthagen
Copy link
Contributor Author

@trane9991 Everything is complete as for as I understand. It's just awaiting a merge by @davesque if approved.

@johnthagen
Copy link
Contributor Author

@davesque Friendly ping to see if this could get merged.

@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Feb 5, 2021

@johnthagen Will gladly merge once another merger merges #349 and then this PR needs to rebase with the updated master branch. Not sure when David will come back to merge it though. (I can't merge this PR if the tests fail).

@johnthagen
Copy link
Contributor Author

@Andrew-Chen-Wang I merged in master and everything is green except docs:

sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.8.5

Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/sphinx/config.py", line 368, in eval_config_file
    execfile_(filename, namespace)
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/sphinx/util/pycompat.py", line 150, in execfile_
    exec_(code, _globals)
  File "/home/circleci/repo/docs/conf.py", line 57, in <module>
    django_configure()
  File "/home/circleci/repo/docs/conf.py", line 52, in django_configure
    django.setup()
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/django/apps/config.py", line 301, in import_models
    self.models_module = import_module(models_module_name)
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/circleci/repo/rest_framework_simplejwt/models.py", line 6, in <module>
    from .settings import api_settings
  File "/home/circleci/repo/rest_framework_simplejwt/settings.py", line 20, in <module>
    'SIGNING_KEY': settings.SECRET_KEY,
  File "/home/circleci/repo/.tox/docs/lib/python3.8/site-packages/django/conf/__init__.py", line 90, in __getattr__
    raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.

make[1]: *** [Makefile:53: html] Error 2
make[1]: Leaving directory '/home/circleci/repo/docs'
make: *** [Makefile:37: build-docs] Error 2
ERROR: InvocationError for command /usr/bin/make build-docs (exited with code 2)
___________________________________ summary ____________________________________
ERROR:   docs: commands failed

But I'm not quite sure how changes to only .rst files could affect the SECRET_KEY config? Any thoughts?

@Andrew-Chen-Wang
Copy link
Member

@johnthagen I'm not sure either, but I do have an idea. Take a look at https://github.com/jazzband/django-rest-framework-simplejwt/blob/cb323efa4644ba74efaf106ad96c80d8449a7006/Makefile#L35-L44

You've included the views.py files as well. What happens if you edit that into the Makefile?

@Andrew-Chen-Wang
Copy link
Member

Just edited your branch since I thought might as well try :P sorry if that messes with your commits

@Andrew-Chen-Wang
Copy link
Member

Ok well another option is to set the secret key in conf.py... somehow...

@johnthagen
Copy link
Contributor Author

@Andrew-Chen-Wang Is there a reason that the CI didn't run on the latest commit to master?

https://github.com/jazzband/django-rest-framework-simplejwt/commits/master

Trying to see if CI is actually green for master as well.

@Andrew-Chen-Wang
Copy link
Member

Good question. In conf.py, do you mind adding SECRET_KEY="123123123" to settings.configure?

@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Apr 16, 2021

Seems like David may have disabled SimpleJWT from using CircleCI (probably for credit reasons). We should prob migrate to GitHub actions asap.

Because if you try to click on like the projects in the breadcrumb navigation above, it says page not found.

@johnthagen
Copy link
Contributor Author

Good question. In conf.py, do you mind adding SECRET_KEY="123123123" to settings.configure?

Do you mean settings.py?

https://github.com/johnthagen/django-rest-framework-simplejwt/blob/patch-1/rest_framework_simplejwt/settings.py

@Andrew-Chen-Wang
Copy link
Member

In docs/conf.py

@johnthagen
Copy link
Contributor Author

Would that go here? https://github.com/johnthagen/django-rest-framework-simplejwt/blob/patch-1/docs/conf.py#L47

I haven't used Django's Settings system before within a Sphinx project.

@Andrew-Chen-Wang
Copy link
Member

I just added it. I took a look at the Django docs to double check, but I'm honestly not too sure myself. Just running and testing.

@Andrew-Chen-Wang
Copy link
Member

Awesome passing. I'll just remove the Makefile change, approve the PR, and merge it.

@johnthagen
Copy link
Contributor Author

As for GitHub Actions, in case it helps I have an example setup for GitHub Actions for Python/tox here: https://github.com/johnthagen/python-blueprint#continuous-integration

Makefile Outdated Show resolved Hide resolved
@Andrew-Chen-Wang
Copy link
Member

Cool! Thank you! I think #269 was on the right track. Haven't seen it for awhile, so not sure how well it'll work.

@Andrew-Chen-Wang
Copy link
Member

Andrew-Chen-Wang commented Apr 16, 2021

The bane of my existence:

workflow Expected — Waiting for status to be reported

I think we'll have to migrate to GitHub actions before this is merged because.... CircleCI is being stupid YET AGAIN :( (also happening on other PRs)

@johnthagen
Copy link
Contributor Author

Now that this was migrated to jazzband, was anyone else given more admin rights over the GitHub repo?

@Andrew-Chen-Wang
Copy link
Member

Yes auvipy of the celery project. Hopefully has admin privs, but I don't know enough details; I'm just updating the repo in auvipy's absence being in Jazzband...

@johnthagen
Copy link
Contributor Author

johnthagen commented Jul 6, 2021

@Andrew-Chen-Wang I've resolved conflicts again in this PR and it is ready to merge.

Could you please merge or comment what else needs to be changed?

Thanks.

@Andrew-Chen-Wang
Copy link
Member

@johnthagen will do, sorry. It was just so far down the PR list and took way too long to get approval for the release last night that I forgot about it. Priority for me for today.

@Andrew-Chen-Wang Andrew-Chen-Wang merged commit c941b99 into jazzband:master Jul 7, 2021
@Andrew-Chen-Wang
Copy link
Member

Merged @johnthagen again super sorry to everyone here!

@johnthagen
Copy link
Contributor Author

Merged @johnthagen again super sorry to everyone here!

No worries! Thanks for merging!

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

Successfully merging this pull request may close these issues.

Provide django-rest-framework-simplejwt integration
6 participants