Skip to content

evanhesketh/pix.ly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pix.ly (backend)

This is the backend for a photo storage/filter app

Local setup

  1. Create virtual environment and activate

    python3 -m venv venv  
    source venv/bin/activate
    
  2. Install dependencies

    pip3 install -r requirements.txt
    
  3. Create a new PostgreSQL database

    createdb pixly
    
  4. Set up AWS:
    Create a free AWS account at https://aws.amazon.com/
    Create a new S3 bucket
    Under permissions, add the following to bucket policy:

     {
      "Version": "2012-10-17",
      "Statement": [
          {
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:GetObject",
              "Resource": "arn:aws:s3:::[remove brackets and replace with your bucket name]*"
          }
        ]
      }
    

    Permissions should be:
    -Access: public
    -Block all public access: off
    -Object ownership: Bucket owner enforced

  5. Create a file named .env and add environment variables with values from your AWS account:

    AWS_ACCESS_KEY_ID=*add your value here*
    AWS_SECRET_ACCESS_KEY=*add your value here*
    BUCKET_NAME=*add your value here*
    REGION=*add your value here*
    
  6. Create the database tables
    Run IPython:

    ipython
    

    In IPython:

    %run app.py
    db.create_all()
    
  7. To start server:

    python3 -m flask run -p 5000 (or 5001 if on newer mac)
    
  8. Refer to instructions for front end at https://github.com/evanhesketh/pix.ly-frontend

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published