Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USER STORY: Create Config Vars & static files #2

Closed
18 tasks done
chris-townsend opened this issue Nov 8, 2022 · 0 comments
Closed
18 tasks done

USER STORY: Create Config Vars & static files #2

chris-townsend opened this issue Nov 8, 2022 · 0 comments
Assignees
Labels
1 User Story Estimate is 1 story point deployment Deployment Process must-have A must-have feature

Comments

@chris-townsend
Copy link
Owner

chris-townsend commented Nov 8, 2022

User Story:

As a developer, I can add my config vars to my app in Heroku so that I can allow deployment to production

Acceptance Criteria:

  • Config vars are viewable from the 'settings' tab of your app within Heroku

Related User Stories:

#1 Create Heroku App

#4 Cloudinary Setup

Tasks:

  • Login to your Heroku account and select the App

  • Go to the settings tab and scroll down to Config Vars

  • USER STORY: Cloudinary Setup #4 Setup Cloudinary

  • Add correct config vars

    • CLOUDINARY_URL
    • DATABASE_URL
    • SECRET_KEY
    • PORT - 8000
    • DISABLE_COLLECTSTATIC - 1 (only used for development)
  • Copy Cloudinary API Environment variable in your Cloudinary dashboard

  • Add variable to your env.py file

  • Add 'cloudinary_storage' & 'cloudinary' to INSTALLED_APPS

  • Tell Django to use Cloudinary to store our static files

  • Add to settings.py -
    STATICFILES_STORAGE = 'cloudinary_storage.storage.StaticHashedCloudinaryStorage'
    STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
    STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
    MEDIA_URL = '/media/'
    DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'

  • Add to the build paths -

    • TEMPLATES_DIR = os.path.join(BASE_DIR, 'templates')
  • Add 'DIRS': [TEMPLATES_DIR], to TEMPLATES

  • Add Heroku host name to ALLOWED_HOSTS

    • ALLOWED_HOSTS = ['kitchen-tales.herokuapp.com', 'localhost'] (localhost is added so we can run it locally)
  • Create 3 new folders in the top level of the project

    • 'media'
    • 'static'
    • 'templates'

@chris-townsend chris-townsend added must-have A must-have feature 1 User Story Estimate is 1 story point deployment Deployment Process labels Nov 8, 2022
@chris-townsend chris-townsend added this to the EPIC: Early Deployment milestone Nov 8, 2022
@chris-townsend chris-townsend self-assigned this Nov 8, 2022
@chris-townsend chris-townsend changed the title USER STORY: Create Config Vars USER STORY: Create Config Vars & static files Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 User Story Estimate is 1 story point deployment Deployment Process must-have A must-have feature
Projects
Development

No branches or pull requests

1 participant