簡體   English   中英

配置cloudinary以進行開發和生產

[英]Config cloudinary for development and production

在我的Rails應用中,我使用carrierwave和cloudinary來上傳圖像。

我設置了配置文件cloudinary.yml,一切正常。

development:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: false
production:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: true
test:
  cloud_name: _my_app_name_
  api_key: '_my_cloudinary-key_'
  api_secret: _my_cloudinary_secret_
  enhance_image_tag: true
  static_image_support: false

如何配置cloudinary僅將其用於生產?

對於開發,僅使用本地存儲。

您可以在上傳器中使用類似以下的內容:

storage :file unless Rails.env == "production"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM