image upload to azure

This commit is contained in:
Priyatham Sai Chand 2021-01-16 07:35:51 +05:30
parent cc13e9666d
commit 510bfdb982
7 changed files with 10 additions and 8 deletions

View File

@ -1,3 +1,3 @@
{
"python.pythonPath": "C:\\Python39\\python.exe"
"python.pythonPath": "C:\\Users\\bncha\\AppData\\Local\\Programs\\Python\\Python38-32\\python.exe"
}

View File

@ -1,3 +0,0 @@
body {
padding: 10px;
}

View File

@ -5,9 +5,9 @@
<head>
<a href="index.html"><title>{% block title %}Auctions{% endblock %}</title></a>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<link href="{% static 'auctions/styles.css' %}" rel="stylesheet">
</head>
<body>
<body style="padding: 10px">
<a href="{% url 'index' %}" style = "color:inherit;text-decoration: none;"><h1>Auctions</h1></a>
<div class = "text-right" style = "align-self: flex-end;">
{% if user.is_authenticated %}

View File

@ -9,7 +9,7 @@
<a href="listing/{{ listing.title}}" style = "color:inherit;text-decoration: none;">
<div class="card border-light" style="width: 18rem;">
<div class="shadow p-2 mb-2 bg-white rounded">
<img class="card-img-top" src="{{ listing.picture }}" alt="Preview not found">
<img class="card-img-top" src="{{ listing.picture.url }}" alt="Preview not found">
<hr>
<div class="card-body">

View File

@ -129,4 +129,9 @@ STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'auctions/static'),
]
STATICFILES_STORAGE = 'storages.backends.azure_storage.AzureStorage'
STATIC_LOCATION = "static"
DEFAULT_FILE_STORAGE = 'storages.backends.azure_storage.AzureStorage'
AZURE_ACCOUNT_NAME = 'auctionimages'
AZURE_ACCOUNT_KEY = '3W/fel22r8ExgQMDr8KOxxklp80/slPtAznb+G1Hkq0DWuX2bOIXnQMpgmU/BIJdIWnbDsgMr2SbC5l9qfJJ6g=='
AZURE_CONTAINER = 'media'

Binary file not shown.