-
Notifications
You must be signed in to change notification settings - Fork 144
Added optional configs for settings #43
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
base: master
Are you sure you want to change the base?
Conversation
Looks like there's one typo in the documentation and pull request description. The second |
Updated, thanks @rmutter for the catch. |
Great PR ! Should be great to have an input box on the web part for the API Key to be more dynamic and filling it by reading a default cookie like tastypie_credentials. |
You might look at the swagger 1.2 spec, which lets the name of api keys be set in the swagger json. The UI could easily read this and populate the key name. The authorizations info: An example of such: And an alternate UI that has the api key name driven off the spec: |
@fehguy Nice, I'll have to check that out. Currently I'm making modifications as I use it, but I'll definitely be looking forwards to making this play nice with upgraded versions of swagger. |
I love the idea but I would rather implement this as a dictionary ;-) |
@johnraz Agreed 100%. I'm going to restructure this. |
@joshkehn : also make sure to make it "multi-api" ready. I guess using the app_name has the first main dictionary key should be ok ;-) |
@joshkehn : any chance you'd get some time soon (in the coming days) to get this done ? otherwise I think I'll do it (need it for a paid project of mine). |
@johnraz I'll see what I can get done this weekend! |
Super awesome thanks :) |
@joshkehn : I know it's wrong but yet I friendly bump ;) |
I'll work on this today, sorry life got in the way 🍧 |
Splendid! |
@johnraz I updated it to be a dictionary and updated the documentation to match. The current app I have using this I can't drop-in this branch to replace because there are some errors in Let me know how this update looks and I'll pull this together into a separate branch from master and work out any kinks. |
I will try to give it a look tomorrow. Thanks ! |
Ok I finally had some time to look at it. |
This allows the following settings variables to be set:
TASTYPIE_SWAGGER_APP_NAME
configures the display name on the documentation page. Defaults toswagger
.TASTYPIE_SWAGGER_APP_LINK
configures the app link on the documentation page. Defaults to/
.TASTYPIE_SWAGGER_SHOW_DEV
allows showing or hiding the development links. Defaults toFalse
.TASTYPIE_SWAGGER_KEY_NAME
allows configuring the api key name. Defaults toapiKey
.TASTYPIE_SWAGGER_API_KEY
allows configuring a prefilled api key. Defaults to an empty string.The README file has been updated with explanations of these as well.