Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3056534

Browse files
committed
F
1 parent c528585 commit 3056534

File tree

3 files changed

+11
-24
lines changed

3 files changed

+11
-24
lines changed

‎Readme.md‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# python-django-react-sample-app
2+
23
Sample BigCommerce App using Python, Django, and React
34

45
How to run it in Local machine ?
@@ -22,9 +23,10 @@ https://www.anaconda.com/products/individual
2223

2324
FOr Ngrok :
2425
In .env file use http instead of https for callBackURL for ngrok.
25-
_____________________________________________________________________________________
2626

27-
Steps to follow to install the app on BigCommercestore.
27+
---
28+
29+
Steps to follow to install the app on BigCommercestore.
2830

2931
We will highly recommend watching video during installation app on the store.
3032
Here is installation video
@@ -60,10 +62,6 @@ https://youtu.be/FKf5pOBC3z0
6062

6163
15.Click Reveal Config Variable and Add following Variables
6264

63-
apiToken = dwvhv8miusl07noqz7ax5crh9iox7l4
64-
65-
apiStoreHash = 4zjutairi8
66-
6765
appClientId = elfctt4r8cai3u6cw4yg70lamxroke8
6866

6967
appClientSecret = ee074094318cdbd56bba82dd7e1ba9df2f5794b51fdeb27c0e8ac0f88a95f904
@@ -80,7 +78,7 @@ appClientSecret = ee074094318cdbd56bba82dd7e1ba9df2f5794b51fdeb27c0e8ac0f88a95f9
8078

8179
21.Click Edit App and Go to Technical Tab of APP and Fill the following fields
8280

83-
22.Auth Callback URL (add cb/auth athe the end of heroku app url)
81+
22.Auth Callback URL (add /auth at the end of heroku app url)
8482

8583
23.Load Callback URL
8684

@@ -92,4 +90,4 @@ appClientSecret = ee074094318cdbd56bba82dd7e1ba9df2f5794b51fdeb27c0e8ac0f88a95f9
9290

9391
27.from side Menue Apps > My Apps
9492

95-
28.go to My Draft Apps Tab and Install the App
93+
Note: To run React at development run "yarn run" and to compile Reactjs code run "yarn build" at root level folder.

‎api/views.py‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
from django.http import HttpResponse
22
from django.views.decorators.csrf import csrf_exempt
33
import requests
4-
import json
5-
from decouple import config, Csv
64
from callback.models import Auth
75
from django.shortcuts import get_object_or_404
8-
from bigcommerce.api import BigcommerceApi
9-
106
import url64
117
import json
128

139

1410

15-
def client_secret():
16-
return config('appClientSecret')
17-
18-
1911
def authData(request ):
2012
payload = request.GET.get('payload')
2113
x = payload.split("=")
22-
a = BigcommerceApi.oauth_verify_payload(x, client_secret())
23-
__store_hash = a['store_hash']
24-
14+
y = x[1].split(".")
15+
decoded = url64.decode(y[0])
2516

26-
# y = x[1].split(".")
27-
# decoded = url64.decode(y[0])
28-
# json_object = json.loads(decoded)
29-
# __store_hash =json_object["store_hash"]
17+
json_object = json.loads(decoded)
18+
__store_hash =json_object["store_hash"]
3019

3120
authData = get_object_or_404(Auth, storehash = __store_hash)
3221
token = authData.token

‎dashboard/views.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ def dashBoard(request):
1515
signed_payload = request.GET.get('signed_payload')
1616
a = BigcommerceApi.oauth_verify_payload(signed_payload, client_secret())
1717
store_hash = a['store_hash']
18-
return render(request ,'index.html')
18+
return render(request ,'index.html')
1919
return HttpResponse('Some thing Went Wrong')

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /