cloudvault
v1.2
تم تصميم CloudVault قبالة منصة ClouRinary. لذلك قبل تثبيت الحزمة ، سيكون من الرائع إنشاء حساب والحصول على "بيانات اعتماد API".
انقر هنا لإنشاء حساب ثم الحصول على بيانات الاعتماد الخاصة بك على تسجيل الدخول.
بعد ذلك ، يمكنك المتابعة إلى تثبيت cloudvault .
pip install cloudvault
بمجرد تثبيت cloudvault ، انتقل إلى إعدادات مشروعك. قم بإضافة الأسطر التالية
#!/usr/bin/python
# settings.py
INSTALLED_APPS = [
# ... other apps
"cloudvault" # can be omitted
]
CLOUDINARY = {
"cloud_name": "your_cloud_name",
"api_key": "your_api_key",
"api_secret": "your_api_secret"
}
DEFAULT_FILE_STORAGE = "cloudvault.cloud_storage.CloudinaryStorage"
لا شيء يتغير عند استخدام cloudvault في مشروعك.
#!/usr/bin/python
# models.py
class Picture(models.Model):
image = models.ImageField()
def __str__(self);
return str(self.id)
عندما يتم حفظ مثيل Picture ، فإنه يحفظه على self.image.url cloudinary
لتثبيت المشروع ، ما عليك سوى استنساخ المشروع إلى نظامك ثم تشغيله
python -m pip install /path/to/project/cloudvault/cloudvault/dist/cloudvault-1.1.tar.gz
يجب أن يتم تثبيت المشروع بنجاح.
غابرييل مايكل أوجوماكبين
[email protected]
09020617734