Comments (4)
request.REQUEST['code'] is provided as an example, and would only work if you're in a Django request handler.
essentially, once you click 'approve' on Box's dialog, they will redirect you to a URL of your choosing (see their docs to see how to change that).
They supply a HTTP GET parameter named 'code' to that url, which is what you use to call finish_authenticate_v2.
So for example, if you configured Box to hit http://www.myapp.com/finish_box, when you click on "approve", Box will issue a request that looks something like 'http://www.myapp.com/finish_box?code=code_goes_here&.....'
from box.py.
See documentation here: http://developers.box.com/oauth/
from box.py.
Thanks for the clarification. This may or may not be the appropriate forum
to ask this question but I have a Django app already made and want to
incorporate this API into my app. Is there anything I need to do to set up
a Django request handler so that your code works out of the box?
Also, I see that Box issues a request that can look like ''
http://www.myapp.com/finish_box?code=code_goes_here&.....', how would i
grab the code and put it into the finish_authenticate_v2?
Thanks
Nate
Nate
On Mon, Dec 2, 2013 at 3:34 PM, tals [email protected] wrote:
request.REQUEST['code'] is provided as an example, and would only work if
you're in a Django request handler.essentially, once you click 'approve' on Box's dialog, they will redirect
you to a URL of your choosing (see their docs to see how to change that).
They supply a HTTP GET parameter named 'code' to that url, which is what
you use to call finish_authenticate_v2.So for example, if you configured Box to hit
http://www.myapp.com/finish_box, when you click on "approve", Box will
issue a request that looks something like '
http://www.myapp.com/finish_box?code=code_goes_here&.....'—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-29669707
.
from box.py.
It's not the right forum, but for django, you need to do the following (more or less):
in urls.py, add a pattern routing. Say something like:
urlpatterns = patterns(
....
(r'^finish_box', box_authentication_done),
...
)
and then in your views.py, have something like:
def box_authentication_done(request):
code = request.REQUEST.get('code')
....
so if you hit /finish_box?code=1234
code will be '1234'
For anything more, please check django tutorials and forums. That library has no relation to Django :)
from box.py.
Related Issues (12)
- ValueError thrown when running the example from the README HOT 2
- Remove support for deprecated v1 API HOT 3
- Asynchronous requests with grequests? HOT 2
- Function for PUT request on file object HOT 1
- Allow download_file to return non-raw socket response HOT 5
- content_modified_at in upload_file HOT 4
- Deletion related APIs should be executed with "raw=True" HOT 3
- share_link api HOT 4
- Long Poll Error HOT 2
- Thumbnail retrieval HOT 2
- There seems to be an issue uploading files with non-ascii character in their names HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box.py.