All Projects → bigcommerce → hello-world-app-python-flask

bigcommerce / hello-world-app-python-flask

Licence: MIT license
Hello World sample app in Python and Flask

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to hello-world-app-python-flask

hello-world-app-php-silex
Hello World sample app in PHP and Silex
Stars: ✭ 23 (-25.81%)
Mutual labels:  oauth-application, bigcommerce
add-to-org
A simple Oauth App to automatically add users to an organization
Stars: ✭ 24 (-22.58%)
Mutual labels:  oauth-application
tgmusicbot
Telegram bot for downloading audio from YouTube, SoundCloud & MixCloud.
Stars: ✭ 66 (+112.9%)
Mutual labels:  heroku-ready
Feedback-bot
In Short This is An Personalized Livegram Bot Made Using Python.. Follow Me @HeimanPictures & Star This Repo
Stars: ✭ 23 (-25.81%)
Mutual labels:  heroku-ready
sinatras-skeleton
Basic Sinatra Skeleton MVC CRUD App with Sprockets, Warden, ActiveRecord and PostgresQL
Stars: ✭ 13 (-58.06%)
Mutual labels:  heroku-ready
big-design
Design system that powers the BigCommerce ecosystem.
Stars: ✭ 35 (+12.9%)
Mutual labels:  bigcommerce

Deploy (Heroku instructions)

BigCommerce Sample App: Python

This is a small Flask application that implements the OAuth callback flow for BigCommerce Single Click Apps and uses the BigCommerce API to pull a list of products on a BigCommerce store. For information on how to develop apps for BigCommerce stores, see our Developer Portal.

We hope this sample gives you a good starting point for building your next killer app! What follows are steps specific to running and installing this sample application.

Registering the app with BigCommerce

  1. Create a trial store on BigCommerce
  2. Go to the Developer Portal and log in by going to "My Apps"
  3. Click the button "Create an app", enter a name for the new app, and then click "Create"
  4. You don't have to fill out all the details for your app right away, but you do need to provide some core details in section 4 (Technical). Note that if you are just getting started, you can use localhost for your hostname, but ultimately you'll need to host your app on the public Internet.
  • Auth Callback URL: https://<app hostname>/bigcommerce/callback
  • Load Callback URL: https://<app hostname>/bigcommerce/load
  • Uninstall Callback URL: https://<app hostname>/bigcommerce/uninstall
  • Remove User Callback URL: https://<app hostname>/bigcommerce/remove-user (if enabling your app for multiple users)
  1. Enable the Products - Read Only scope under OAuth scopes, which is what this sample app needs.
  2. Click Save & Close on the top right of the dialog.
  3. You'll now see your app in a list in the My Apps section of Developer Portal. Hover over it and click View Client ID. You'll need these values in the next step.

Getting started

  1. Clone this repo: git clone [email protected]:bigcommerce/hello-world-app-python-flask.git
  2. Change to the repo directory: cd hello-world-app-python-flask
  3. If you want to use virtualenv: virtualenv ENV && source ENV/bin/activate
  4. Install dependencies with pip: pip install -r requirements.txt
  5. Copy .env-example to .env
  6. Edit .env:
  • Set BC_CLIENT_ID and BC_CLIENT_SECRET to the values obtained from Developer Portal.
  • Set APP_URL to https://<app hostname>.
  • Set SESSION_SECRET to a long random string, such as that generated by os.urandom(64).
  1. Make sure to populate the database by opening a Python shell from within the app and running
    from app import db
    db.create_all()
    
  2. Run the app: python ./app.py
  3. Then follow the steps under Installing the app in your trial store.

Hosting the app

In order to install this app in a BigCommerce store, it must be hosted on the public Internet. You can get started in development by simply running python app.py to run it locally, and then use localhost in your URLs, but ultimately you will need to host it somewhere to use the app anywhere other than your development system.

Getting started (Heroku version)

  1. Click this button: Deploy
  2. Fill in the details from the app portal on the Heroku deployment page
  1. Deploy the app, and click "view" when it's done
  2. Take the callback URLs from the instructions page and plug them into the dev portal.
  3. Then follow the steps under Installing the app in your trial store.

Installing the app in your trial store

  • Login to your trial store
  • Go to the Marketplace and click My Drafts. Find the app you just created and click it.
  • A details dialog will open. Click Install and the draft app will be installed in your store.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].