I've got an application that needs to upload a file to an Azure Blob Storage container. I've been trying for a very long time and followed every tutorial to no avail.
I have installed the following:
pip3 install django-storages[azure]
Here is my settings.py file:
DEFAULT_FILE_STORAGE = 'backend.custom_azure.AzureMediaStorage'
STATICFILES_STORAGE = 'backend.custom_azure.AzureStaticStorage'
STATIC_LOCATION = "static"
MEDIA_LOCATION = "http://{AZURE_ACCOUNT_NAME}.blob.core.windows.net/media"
MEDIA_ROOT='http://{AZURE_ACCOUNT_NAME}.blob.core.windows.net'
AZURE_ACCOUNT_NAME = '<mystorageaccount>'
AZURE_ACCOUNT_KEY = '<my key here>'
AZURE_CUSTOM_DOMAIN = f'{AZURE_ACCOUNT_NAME}.blob.core.windows.net'
AZURE_LOCATION=f'{AZURE_ACCOUNT_NAME}.blob.core.windows.net'
STATIC_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{STATIC_LOCATION}/'
MEDIA_URL = f'https://{AZURE_CUSTOM_DOMAIN}/{MEDIA_LOCATION}/'
Here is the .backend/custom_azure.py <- my customer storage class
from storages.backends.azure_storage import AzureStorage
class AzureMediaStorage(AzureStorage):
account_name = '<mystorageaccount>'
account_key = '<mykey>'
azure_container = 'media'
expiration_secs = None
class AzureStaticStorage(AzureStorage):
account_name = 'mystorageaccount'
account_key = '<my key>'
azure_container = 'static'
expiration_secs = None
Here is my .account/models.py:
from django.db import models
from django.urls import reverse
from django.contrib.auth.models import User
from billing.models import Subs
from PIL import Image
import phonenumbers
from backend.custom_azure import AzureMediaStorage as AMS
class MasterAccount(models.Model):
image = models.ImageField(default='default.jpg', storage=AMS, upload_to='profile_pics')
profile_pic = models.FileField(default='default.jpg', storage=AMS, upload_to='profile_pics')
def __str__(self):
return "MasterAccount Number: " + str(self.number)
def save(self, *args ,**kwargs):
super().save(*args ,**kwargs)
img = Image.open(self.image.path)
if img.height > 300 or img.width > 300:
output_size = (300, 300)
img.thumbnail(output_size)
img.save(self.image.path)
I am running this in apache.(not runserver)
PROBLEM: I have figured out that with this configuration, I am able to retrieve all of the files from blob storage including the media files and the static files. They all show up perfectly. However, when I try to add and save a MasterAccount instance it barfs with the absolute paths error:
NotImplementedError at /admin/account/masteraccount/2/change/
This backend doesn't support absolute paths.
Request Method: POST
Request URL: http://13.67.214.185/nbn/admin/account/masteraccount/2/change/
Django Version: 2.1.7
Exception Type: NotImplementedError
Exception Value:
**This backend doesn't support absolute paths**.
Exception Location: /opt/bitnami/apps/django/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg/django/core/files/storage.py in path, line 106
Python Executable: /opt/bitnami/python/bin/python3
Python Version: 3.7.2
Python Path:
['/opt/bitnami/python/lib/python37.zip',
'/opt/bitnami/python/lib/python3.7',
'/opt/bitnami/python/lib/python3.7/lib-dynload',
'/opt/bitnami/python/lib/python3.7/site-packages',
'/opt/bitnami/apps/django/lib/python3.7/site-packages',
'/opt/bitnami/apps/django/lib/python3.7/site-packages/Django-2.1.7-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/pytz-2016.7-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/gevent-1.3.7-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/olefile-0.46-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/Pillow-4.0.0-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/lxml-4.2.5-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/mysqlclient-1.3.12-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/psycopg2-2.7.3.1-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/html5lib-0.90-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/python_Levenshtein-0.12.0-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/scandir-1.5-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/argparse-1.2.1-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/pyparsing-2.1.10-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/simplejson-3.11.1-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/pyldap-2.4.28-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/reportlab-3.3.0-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/pydot-1.2.3-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/MarkupSafe-0.23-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/psutil-4.3.1-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/pytz-2016.7-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/six-1.10.0-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/libsass-0.15.1-py3.7-linux-x86_64.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/virtualenv_clone-0.2.6-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/virtualenv-15.1.0-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/jmespath-0.9.3-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/python_dateutil-2.6.1-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/botocore-1.7.43-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/s3transfer-0.1.11-py3.7.egg',
'/opt/bitnami/python/lib/python3.7/site-packages/boto3-1.4.7-py3.7.egg',
'/opt/bitnami/apps/django/django_projects/nbn']
Server time: Sat, 16 Feb 2019 21:38:11 +0000
So it looks like no matter what, it's just passing the 'default.jpg' filename but doesn't know where to send it?
Do I need to change settings in azure? Is my config all wrong? Please help, I've been wracking my brain on this one and exhausting google for about 3 weeks! Thanks!!!
UPDATE
After the helpful suggestion below I can at least now log into the admin panel. but whenever I try to edit a MasterAccount model by clicking on it, I get a typeError error:
TypeError at /admin/account/masteraccount/5/change/
url() missing 1 required positional argument: 'name'
Request Method: GET
Request URL: http://localhost:8000/admin/account/masteraccount/5/change/
Django Version: 2.1.4
Exception Type: TypeError
Exception Value:
url() missing 1 required positional argument: 'name'
Exception Location: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/files.py in url, line 62
Python Executable: /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
Python Version: 3.7.2
Python Path:
['/Users/elliottcastillo/Documents/azure-git/trt/src',
'/Library/Frameworks/Python.framework/Versions/3.7/lib/python37.zip',
'/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7',
'/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/lib-dynload',
'/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages']
Server time: Mon, 18 Feb 2019 13:46:22 +0000
Here is the copy-paste traceback Environment:
Request Method: GET
Request URL: http://localhost:8000/admin/account/masteraccount/5/change/
Django Version: 2.1.4
Python Version: 3.7.2
Installed Applications:
['account.apps.AccountConfig',
'administrative.apps.AdministrativeConfig',
'users.apps.UsersConfig',
'blog.apps.BlogConfig',
'billing.apps.BillingConfig',
'videos.apps.VideosConfig',
'stats.apps.StatsConfig',
'train.apps.TrainConfig',
'external_content.apps.ExternalContentConfig',
'tinymce',
'phone_field',
'phonenumbers',
'colorfield',
'djmoney',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'storages',
'azure']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Template error:
In template /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/contrib/admin/templates/admin/includes/fieldset.html, error at line 19
url() missing 1 required positional argument: 'name'
9 : {% for field in line %}
10 : <div{% if not line.fields|length_is:'1' %} class="fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}"{% elif field.is_checkbox %} class="checkbox-row"{% endif %}>
11 : {% if not line.fields|length_is:'1' and not field.is_readonly %}{{ field.errors }}{% endif %}
12 : {% if field.is_checkbox %}
13 : {{ field.field }}{{ field.label_tag }}
14 : {% else %}
15 : {{ field.label_tag }}
16 : {% if field.is_readonly %}
17 : <div class="readonly">{{ field.contents }}</div>
18 : {% else %}
19 : {{ field.field }}
20 : {% endif %}
21 : {% endif %}
22 : {% if field.field.help_text %}
23 : <div class="help">{{ field.field.help_text|safe }}</div>
24 : {% endif %}
25 : </div>
26 : {% endfor %}
27 : </div>
28 : {% endfor %}
29 : </fieldset>
Traceback:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
34. response = get_response(request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
156. response = self.process_exception_by_middleware(e, request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
154. response = response.render()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/response.py" in render
106. self.content = self.rendered_content
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/response.py" in rendered_content
83. content = template.render(context, self._request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/backends/django.py" in render
61. return self.template.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
171. return self._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py" in render
150. return compiled_parent._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py" in render
62. result = block.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py" in render
62. result = block.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py" in render
188. return template.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
173. return self._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in _render
163. return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py" in render
209. nodelist.append(node.render_annotated(context))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py" in render
309. return nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py" in render
309. return nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
937. bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_annotated
904. return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render
993. return render_value_in_context(output, context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py" in render_value_in_context
972. value = str(value)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/utils/html.py" in <lambda>
397. klass.__str__ = lambda self: mark_safe(klass_str(self))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/boundfield.py" in __str__
33. return self.as_widget()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/boundfield.py" in as_widget
93. renderer=self.form.renderer,
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in render
229. context = self.get_context(name, value, attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in get_context
415. context = super().get_context(name, value, attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in get_context
281. context = super().get_context(name, value, attrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in get_context
221. 'value': self.format_value(value),
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in format_value
411. if self.is_initial(value):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/forms/widgets.py" in is_initial
405. return bool(value and getattr(value, 'url', False))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/files.py" in url
62. return self.storage.url(self.name)
Exception Type: TypeError at /admin/account/masteraccount/5/change/
Exception Value: url() missing 1 required positional argument: 'name'
Here's what it looks like in the browser
When I try to load the front-end I get the following error in django:
Internal Server Error: /
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 829, in _resolve_lookup
current = current[bit]
TypeError: 'ImageFieldFile' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/core/handlers/base.py", line 124, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/elliottcastillo/Documents/azure-git/trt/src/account/views.py", line 49, in index
return render(request, 'account/index.html', context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/shortcuts.py", line 36, in render
content = loader.render_to_string(template_name, context, request, using=using)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader.py", line 62, in render_to_string
return template.render(context, request)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/backends/django.py", line 61, in render
return self.template.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 171, in render
return self._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/loader_tags.py", line 150, in render
return compiled_parent._render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 163, in _render
return self.nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/defaulttags.py", line 309, in render
return nodelist.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 937, in render
bit = node.render_annotated(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 904, in render_annotated
return self.render(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 987, in render
output = self.filter_expression.resolve(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 671, in resolve
obj = self.var.resolve(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 796, in resolve
value = self._resolve_lookup(context)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/template/base.py", line 837, in _resolve_lookup
current = getattr(current, bit)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/django/db/models/fields/files.py", line 62, in url
return self.storage.url(self.name)
TypeError: url() missing 1 required positional argument: 'name'
Here is the message from the browser... It seems that the url() method is not acting properly:
Error during template rendering
In template /Users/elliottcastillo/Documents/azure-git/trt/src/account/templates/account/base2.html, error at line 178
url() missing 1 required positional argument: 'name'
168 <input class="rd-navbar-search-form-input form-input" id="rd-navbar-search-form-input" type="text" name="s" autocomplete="off">
169 <div class="rd-search-results-live" id="rd-search-results-live"></div>
170 </div>
171 <button class="rd-search-form-submit fl-budicons-launch-search81" type="submit"></button>
172 </form>
173 </div>
174 </li>
175 {% if user.is_authenticated %}
176 <li class="rd-nav-item">
177 <a class="rd-nav-link" href="{% url 'users:profile' %}">
178 <img class="rounded-circle border border-info mr-2" src="{{ user.masteraccount.image.url }}" width="50" height="50">
179 Account
180 </a>
181 <!-- RD Navbar Dropdown-->
182 <ul class="rd-menu rd-navbar-dropdown">
183 <li class="rd-dropdown-item">
184 <a class="rd-dropdown-link" href="{% url 'users:profile' %}">
185 My Profile
186 </a>
187 </li>
188 <li class="rd-dropdown-item">
AZURE_CONNECTION_STRING
seems simpler. – Sadfaced