Deployment (for Mac & Linux)


Create a new IAM User for aws

Go on create new IAM user to create a new IAM User for your S3 Bucket.

At first enter a User name` and activate Programmatic access and than on Next: Permission button.


On the next page Set permissions for YourNewIamUser just click on Next: Review without to add any group or policies.


On Review ignore the warning This user has no permissions and click on Create User.


On the last page write down your new Access key ID & Secret access key to use it later on the deployment. And in the end click on Close


Now get the User ARN, for that click on your new created user.


In the Summary page you will see the user ARN, also write it down for using to setup your S3 Bucket.


Setup a S3 Bucket

To create a S3 Bucket for the media & static files go on create new S3 Bucket and click on + Create bucket.


In the following wizard enter your Bucket name and select your Region than click on Next.


On the next page ‘Set properties’ just click on Next.


And again on ‘Set permission’ just click on Next.


For the last time ‘Review’ just click on Create Bucket.


So after the Bucket is created click on your new Bucket in the list and on the right side click on Permissions.


At next click on Bucket Policy and write down the following policy.

Importent change BUCKET-NAME with your Bucket name and USER-ARN with your just befor created user.

    "Version": "2008-10-17",
    "Statement": [
            "Sid": "PublicReadForGetBucketObjects",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::BUCKET-NAME/*"
            "Effect": "Allow",
            "Principal": {
                "AWS": "USER-ARN"
            "Action": "s3:*",
            "Resource": [

Cors Setup


Policy & Cors by Blog - Amazon S3


Heroku Deployment

Official Tutorial from Heroku:

Create a Heroku App

$ heroku login
Enter your Heroku credentials.
$ heroku create --region eu
Creating intense-falls-9163... done, stack is cedar |
Git remote heroku added
$ git push heroku master
-----> Python app detected
-----> Launching... done, v7 deployed to Heroku

Setup Enviroment

Run the bash script to setup the environment for the heroku instance.

$ ./

Fill the Database & Upload the Static files

$ heroku run python collectstatic --noinput
$ heroku run python createsuperuser
$ heroku run python oscar_populate_countries

Show if anything work’s fine

$ heroku info

Continuous Deployment

To enable Continuous Deployment on enable Piples in your Bitbucket project & set the enviarables `HEROKU_APP_NAME` & `HEROKU_API_KEY`

More details:

Push Updates (CLI)

This is only if you want to push updates via the CLI

$ git add -A
$ git commit -m "your update"
$ git commit -m "your update"
$ heroku run python collectstatic --noinput
$ heroku run python migrate
$ heroku run python createsuperuser