Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Receiving error 502 BAD CONNECTION nginx when deploying django app on Google app engine
Ive been trying to my django website but I've been having the same 502 BAD CONNECTION nginx error every time and I'm not sure how to troubleshoot it. When I run the program using py.manager runserver, it works perfectly fine, but but I only receive an error once I run gcloud app deploy, looking at the logs I haven't received any errors, just one warning stating that Container called exit(1). I've tried one solution from the Google's website: https://cloud.google.com/endpoints/docs/openapi/troubleshoot-response-errors and I added resources: memory_gb: 4 to my app.yaml file and I still end up with an error. I am not sure this is of much help my app.yaml currently looks like this: runtime: python39 handlers: # This configures Google App Engine to serve the files in the app's static # directory. - url: /static static_dir: static/ # This handler routes all requests not caught above to your main app. It is # required when static routes are defined, but can be omitted (along with # the entire handlers section) when there are no static files defined. - url: /.* script: auto resources: memory_gb: 4 And my gcloudignore looks like this: # This file specifies files that are *not* uploaded to … -
django templates, alpine.js - send tags to form
I have input that tokenizes words into tags built with alpine.js and tailwindcss. screenshot of the input I have 3 django forms: title body tags I want to send tags from words tokenizer input to "tags" form. How can i approach it? I'm struggling with alpine.js but i really want to have tokenized input functionality. django template, create_post.html: {% extends 'base.html' %} {% block title %}Create post{% endblock title %} {% block content %} <form method="post"> {% csrf_token %} <input type="text" name="title"> <input type="text" name="body"> <!-- send this to "tags" form--> <div x-data @tags-update="console.log('tags updated', $event.detail.tags)" data-tags='["aaa","bbb"]' class="max-w-lg m-6"> <div x-data="tagSelect()" x-init="init('parentEl')" @click.away="clearSearch()" @keydown.escape="clearSearch()"> <div class="relative" @keydown.enter.prevent="addTag(textInput)"> <input x-model="textInput" x-ref="textInput" @input="search($event.target.value)" class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" placeholder="Enter some tags"> <div :class="[open ? 'block' : 'hidden']"> <div class="absolute z-40 left-0 mt-2 w-full"> <div class="py-1 text-sm bg-white rounded shadow-lg border border-gray-300"> <a @click.prevent="addTag(textInput)" class="block py-1 px-5 cursor-pointer hover:bg-indigo-600 hover:text-white">Add tag "<span class="font-semibold" x-text="textInput"></span>"</a> </div> </div> </div> <!-- selections --> <template x-for="(tag, index) in tags"> <div class="bg-indigo-100 inline-flex items-center text-sm rounded mt-2 mr-1"> <span class="ml-2 mr-1 leading-relaxed truncate max-w-xs" x-text="tag"></span> <button @click.prevent="removeTag(index)" class="w-6 h-8 inline-block align-middle text-gray-500 hover:text-gray-600 focus:outline-none"> <svg class="w-6 h-6 fill-current mx-auto" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 … -
'super' object has no attribute 'objects' Python Django
you need to get the filter using the get_related_filter class method views modelPath = 'Money.models' app_model = importlib.import_module(modelPath) cls = getattr(app_model, 'Money') related_result = cls().get_related_filter(search_query='search_query') models.py class Money(models.Model): money = models.DecimalField(max_digits=19, blank=True, default=0, decimal_places=2) def get_related_filter(self, **kwargs): results = super(Money, self).objects.filter(Q(money__icontains=kwargs['search_query'])) return results def __str__(self): return self.money why gives 'super' object has no attribute 'objects' Python Django, and does not return filter -
JWT Authentication with Django REST Framework using otp for getting api tokens
I have a custom user login where, I use mobile OTP verification and not at all using any django user model through out my project.need to authenticate jwt django restframework by otp. please help me with this. thanks -
clean_<fieldname>() won't raise ValidationError; ManyToManyField
In attempting to control how many tags a User can apply to any one question, I have created a validate_tags method to the QuestionForm for this edge case. Upon testing for this, the form accepts the list of tags exceeding the limit of 4 tags; it should be raising a ValidationError. The tags end up in the form's cleaned data. What is causing the ValidationError to not be raised? class Question(models.Model): title = models.CharField(unique=True, max_length=100) body = models.TextField() dated = models.DateField(auto_now_add=True) likes = models.IntegerField(default=0) user_account = models.ForeignKey( 'users.UserAccount', on_delete=models.SET_NULL, null=True, blank=True, related_name="questions" ) tags = models.ManyToManyField(Tag, related_name='questions') class Meta: ordering = ['dated'] class QuestionForm(forms.ModelForm): tags = forms.ModelMultipleChoiceField(queryset=Tag.objects.all()) def validate_tags(self): tags = self.cleaned_data['tags'] if tags > 4: raise ValidationError( "Only attach a maximum of 4 tags.", code="tags_limit" ) return tags def clean(self): cleaned_data = super().clean() title = cleaned_data['title'] tags = cleaned_data['tags'] for t in tags: try: self.Meta.model.objects.get( title__exact=title, tags__name__exact=t ) except self.Meta.model.DoesNotExist: continue else: message = "A question like this already exists." message += "Reformat your question and/or change your tags." self.add_error("body", ValidationError( message, code="invalid") ) class Meta: model = Question fields = ['title', 'body', 'tags'] error_messages = { 'name': { 'required': "Question must be provided.", 'unique': "Question already exists. Reformat … -
Django da web sayfasında veri gelmeme sorunu
Merhabalar Django da web sayfayı yapmaya çalışırken web sayfasındaki verileri göstermiyor. Baya araştırdım lakin bir sonca varamadım. Bilen birilerileri yardım edebilirse çok sevinirim -
Import Exceptions When I Update Pycharm to 2020.3.3
I was working on a bot Project in python on Pycharm. Then, I decided to Update Pycharm to 2020.3.3 version while I was installing Pycharm 2020.3.3 it asked me to uninstall the old version I accept when I finish I open the Same Project it Shows import Exceptions. I don't know if this happened because of wrong working directory path I think it the problem is something wrong with Paths but I don't know the Old working directory Path I know the path of the python file that I was working on it and the path of the Python.exe.. the path of the code in my computer is in : C:/Users/Microsoft/PycharmProjects/untitled4/conversationbot.py python.exe path in my computer is in : C:\Users\Microsoft\AppData\Local\Programs\Python\Python38\python.exe This is the Exceptions: C:\Users\Microsoft\AppData\Local\Programs\Python\Python38\python.exe C:/Users/Microsoft/PycharmProjects/untitled4/conversationbot.py Traceback (most recent call last): File "C:/Users/Microsoft/PycharmProjects/untitled4/conversationbot.py", line 4, in from telegram.ext import(Updater,CommandHandler,MessageHandler,Filters,ConversationHandler,CallbackContext) File "C:\Users\Microsoft\AppData\Local\Programs\Python\Python38\lib\site-packages\telegram\ext_init_.py", line 21, in from .basepersistence import BasePersistence File "C:\Users\Microsoft\AppData\Local\Programs\Python\Python38\lib\site-packages\telegram\ext\basepersistence.py", line 25, in from telegram import Bot ImportError: cannot import name 'Bot' from 'telegram' (C:\Users\Microsoft\AppData\Local\Programs\Python\Python38\lib\site-packages\telegram_init_.py) this is my code: https://github.com/zieadshabkalieh/bot/blob/main/conversationbot.py Note: There Wasn't Any Exceptions Before I Update Pycharm It was Working Perfectly. -
Django adding eventlistener to a for...loop on template tag
thanks for your time. i'm trying to add a event listener to a list of links created by django template tag. It should take the list of objects with class div.cat-link and add an eventlistener to each one to display the matching id of div.cat-select html <div class="cat"> <div class="cat-links"> {% for t in tags %} <div id="{{t|lower}}" class="cat-link"> <a class="cat" href="{% url 'list_product1' t %}">{{t}}</a> </div> {% endfor %} </div> </div> <div class="cat-list"> {% for t in tags %} <div class="cat-select" id="cat_{{t|lower}}"> {% for p in t.produto_set.all %} <div class="cat-product"> <!--IMAGES--> <div class='img'> <amp-carousel lightbox controls autoplay delay="3000" width="250" height="250" layout="responsive" type="slides"> {% for pic in p.images.all %} <amp-img src="{{ pic.image.url }}" width="250" height="150" layout="responsive" alt="{{ p.nome }}"> </amp-img> {% endfor %} </amp-carousel> </div> <!-- INFOS --> <div class='infos-prod'> <a class='cat-product' href="{% url 'detail_product' p.id %}"> <h3>{{p.nome}} </h3> </a> <a class='cat-product' href="{% url 'detail_product' p.id %}"> R$: {{ p.preco }} </a> </div> </div> {% endfor %} </div> {% endfor %} </div> JavaScript: <script id="cat-script" type="text/javascript" target="amp-script"> function Showing(one) { var v1 = document.getElementById(one); v1.style.display = "flex"; }; function Hiding(one) { var v1 = document.getElementById(one); v1.style.display = "none"; }; function Category() { var v1 = document.getElementsByClassName('cat-link'); for (o in v1) … -
Django on Heroku: KeyError: 'collectstatic'
I'm trying to deploy my simple Django web app on Heroku, but the build fails with the following error: Successfully installed asgiref-3.3.4 dj-database-url-0.5.0 django-3.2 django-heroku-0.3.1 gunicorn-20.1.0 numpy-1.20.2 pillow-8.2.0 psycopg2-2.8.6 pytz-2021.1 sqlparse-0.4.1 torch-1.8.1 torchvision-0.9.1 typing-extensions-3.7.4.3 whitenoise-5.2.0 -----> $ python pytorch_django/manage.py collectstatic --noinput Traceback (most recent call last): File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 237, in fetch_command app_name = commands[subcommand] KeyError: 'collectstatic' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/build_6b3954ac/pytorch_django/manage.py", line 22, in <module> main() File "/tmp/build_6b3954ac/pytorch_django/manage.py", line 18, in main execute_from_command_line(sys.argv) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 244, in fetch_command settings.INSTALLED_APPS File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/__init__.py", line 82, in __getattr__ self._setup(name) File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/__init__.py", line 69, in _setup self._wrapped = Settings(settings_module) File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/__init__.py", line 170, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No module named 'project' ! Error while running '$ … -
SQL Query conversion to Django ORM
select l.student_id, SUM(l.sum_result) FROM (SELECT w.student_id, w.subject_id,r.total as sum_result from Student w INNER JOIN (SELECT COUNT(r.id) as total,r.subject_fk_id from Result r GROUP BY r.subject_fk_id) r ON w.subject_id=r.subject_fk_id) l GROUP BY student_id The tables are: Student ------------- -> id(PK) ->student_name ->student_email Subject -------------- -> id(PK) -> Students(Many to Many relationship) -> subject_name Results --------------- ->id (PK) ->subject_fk(FK to subject table) ->date there is one many to many table for student and subject Student_Subject ->id(PK) ->Student_id(FK) ->Subject_id(FK) I want to convert this SQL query to Django ORM I need to retreive the total number of results for a Student. I need to write this query in Django ORM without for loops. Thank you in advance -
how to pass a js value into the django url template tag
''' var c = "url chatloadchannel="+String(channel) fetch('% '+c+' %}') ''' how to pass this js value to the django -
Can't import file in django
I am learning Django and I am trying to import the "views" file. this doesn't work-> "from . import views". It gives this error->ImportError: attempted relative import with no known parent package. When I use "import views" it gives " Django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings." this error. All the files are in the same place. -
Django admin custom filter by ManyToMany through model
I need to create a filter in Django admin by a Through Model. class Location(models.Model): created_at = models.DateTimeField(editable=False, auto_now_add=True) lat = models.DecimalField(max_digits=13, decimal_places=10, default=None) lon = models.DecimalField(max_digits=13, decimal_places=10, default=None) class Place(models.Model): created_at = models.DateTimeField(editable=False, auto_now_add=True) lat = models.DecimalField(max_digits=13, decimal_places=10, default=None) lon = models.DecimalField(max_digits=13, decimal_places=10, default=None) ways = models.ManyToManyField(location.Location, through='Way') class Way(models.Model): created_at = models.DateTimeField(editable=False, auto_now_add=True) place = models.ForeignKey(Place, on_delete=models.PROTECT,) location = models.ForeignKey(Location, on_delete=models.PROTECT,) drive_distance = models.IntegerField(null=True, default=None,) Way model contains a drive_distance between models Place and Location. In the Django admin list display, I want to create a custom filter to filter out places, which has more that 0 locations where drive distance <= 100. Say, just a simple yes/no filter. How to do it? I can create a custom filter for the model fields, for a model relation, but I can't filter by a through model values. I use Django 3.1. -
How to check a request.user with raw sql in Django
I want to get data about a Student which is currently logged in Here is my code: def profile(request): cursor = connection.cursor() a = request.user.id cursor.execute("SELECT * from Student WHERE ID = a ") data = dictfetchall(cursor) return render(request, 'personal.html', {'data': data}) in table Student attribute ID is connected with attribute id in tha table auth_user Is it even possible to check? I know that with ORM it is easy to do, but I need to use raw sql -
How to increment Django CharField (containing an integer) using Django ORM?
Say I have a model as : class model(models.Model): remark=models.CharField(max_length=25) count=models.CharField(max_length=5) The entity having remark="counter" has count="34". I wish to retrieve entity (having remark="counter") and change its count to "35", i.e. cast to integer, increment it by 1, cast back to string, update. Is there any way I can do this using only Django ORM query(using F or something else) and no Python. -
Django Date Field, where you can go to the next/previous day
In my Django Project, I want to have a field, where the current date is showed. I know how to do that, but I also want two buttons, where you can go to the next day or the previous day. I dont want a Date Picker, where you have to use a calender to pick the date. Can you help me with that? Thanks :) -
Django 3.2 -makemigrations-no changes detected
I've seen all other answers but still keep getting this issue can someone please help -
Reverse for 'category' with arguments '('',)' not found. 1 pattern(s) tried: ['category/(?P<cats>[^/]+)/$']
Tell me please when I add a | slugify in the home.html I get this error if I don't add everything works fine, but also when I enter a category, posts are not displayed in some categories, writes that there is no post in this category, there are also critical errors constantly pop out, perhaps there is a bug somewhere or not the correct code, I still did not find the reason, I solve one second, an error pops out models.py from django.db import models from django.contrib.auth.models import User from django.urls import reverse #from datetime import datetime, date from django.utils import timezone class Category(models.Model): name=models.CharField(max_length=255) def __str__(self): return self.name def get_absolute_url(self): return reverse('home') class Post(models.Model): title = models.CharField(max_length=200) author = models.ForeignKey(User, on_delete=models.CASCADE) body = models.TextField() post_date = models.DateTimeField(auto_now_add=True) category = models.CharField(max_length=200, default='разные') def __str__(self): return self.title + ' | ' + str(self.author) def get_absolute_url(self): return reverse('article_detail', args=[str(self.id)]) views.py from django.shortcuts import render from django.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView from .models import Post, Category from .forms import PostForm, EditForm from django.urls import reverse_lazy #def home(request): # return render(request, 'home.html', {}) class HomeView(ListView): model = Post cats = Category.objects.all() template_name = 'home.html' ordering = ['-post_date'] def get_context_data(self, *args, **kwargs): cat_menu … -
Assign a user to a free trial plan on sign up in django
I've implemented subscription payments to my django app using dj-paddle. The only problem is if a user wants to start a free trial, they have to enter their credit card details.There's no option to disable credit card requirement on paddle. I want to handle free trials outside of paddle locally so users don't have to enter their credit card to try out the app. How do i assign a custom role to a user automatically after registering for example 'free_trial' that switches to another custom role 'trial_expired' after 7 days? This way i can just call the method in my templates e.g {% if user.free_trial %} "Access to app" {% else %} "Your trial has expired" {% endif %} user views.py def register(request): if request.method == 'POST': form = CustomUserCreationForm(request.POST) if form.is_valid(): form.save() username = form.cleaned_data.get('username') messages.success(request, f'Your account has been created {username}!') new_user = authenticate(username=form.cleaned_data['username'], password=form.cleaned_data['password1'], ) login(request, new_user) return HttpResponseRedirect('/dashboard/') else: form = CustomUserCreationForm() return render(request, 'users/register.html', {'form': form}) This is how i've currently implemented dj-paddle to restrict access to non subscribers in my app. User model class CustomUser(AbstractUser): def has_subscription(self): return self.subscriptions.filter(Q(status='active') | Q(status='trialing')).exists() My templates {% if user.has_subscription %} "Access to app" {% else %} "Payment … -
Apparent Bug with Python Usign Selenium : issue with PosixPath
Good evening, I have started a django project, using python 3.7 and Django 3.1.5 When I launch my unitary tests, they run perfectly. When running selenium, this is what I get: File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/wsgiref/handlers.py", line 137, in run self.result = application(self.environ, self.start_response) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/test/testcases.py", line 1322, in __call__ return super().__call__(environ, start_response) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/core/handlers/wsgi.py", line 133, in __call__ response = self.get_response(request) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/test/testcases.py", line 1305, in get_response return self.serve(request) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/test/testcases.py", line 1317, in serve return serve(request, final_rel_path, document_root=self.get_base_dir()) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/views/static.py", line 36, in serve fullpath = Path(safe_join(document_root, path)) File "/Users/fabricejaouen/Documents/OC_Parcours_Python/advocacy_project/venv/lib/python3.7/site-packages/django/utils/_os.py", line 17, in safe_join final_path = abspath(join(base, *paths)) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py", line 80, in join a = os.fspath(a) TypeError: expected str, bytes or os.PathLike object, not NoneType The strange part of it is: no Error linked to my project is raised, the Selenium tests pass perfectly and here is my Selenium setup: from django.test import LiveServerTestCase from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver import Firefox import os class CustomUserTest(LiveServerTestCase): fixtures = ['users.json'] @classmethod def setUpClass(cls): super().setUpClass() cls.browser = Firefox() cls.browser.implicitly_wait(10) @classmethod def tearDownClass(cls): cls.browser.quit() super().tearDownClass() def test_plaid_10_authenticate_on_the_website(self): """ The user wants to authenticate in order to have access to the functionalities of the website """ self.browser.get(os.path.join(self.live_server_url, ''))``` Therefore, I can go on with … -
could not connect to server: No such file or directory. PostgreSQL--> CloudSQL connection Error
Is the server running locally and accepting connections on Unix domain socket "/cloudsql/connection-name/.s.PGSQL.5431"? Whenever i deploy and login for superuser, i recieve this error. My app.yaml: runtime: python env: flex entrypoint: gunicorn -b :$PORT core.wsgi automatic_scaling: min_num_instances: 1 max_num_instances: 8 cool_down_period_sec: 180 cpu_utilization: target_utilization: 0.5 target_concurrent_requests: 100 beta_settings: cloud_sql_instances: <connection-name> runtime_config: python_version: 3 My Settings.py: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'HOST': config('DB_HOST'), 'PORT': config('DB_PORT'), 'NAME': config('DB_NAME'), 'USER': config('DB_USER'), 'PASSWORD': config('DB_PASSWORD') } } DATABASES['default']['HOST'] = '/cloudsql/<connection-name>' if os.getenv('GAE_INSTANCE'): pass else: DATABASES['default']['HOST'] = '127.0.0.1' STATIC_URL = config('STATIC_URL') STATIC_ROOT='static' AUTH_USER_MODEL = 'users.NewUser' MEDIA_URL='/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') I Run cloud_sql_proxy.exe file as well on port 5431 cloud_sql_proxy.exe -instances="<connection-name>"=tcp:5431 Deployment is successful but database connection is a problem. What is the solution for that. -
Django - Inserting Model field value into JavaScript
Im using the google maps api to show the users location. In order for it to work, it needs lat and long values. The lat and long values for the user are stored in a model which I then access in the html using hidden field since I dont want the user to see this information: <input type="hidden" id="hidden_lat" name="lat" value="{{object.author.profile.detail_lat}}"> Then in the JavaScript I use the following to get the lat/long value and pass it into the google api as a variable. var lat = +document.getElementById('hidden_lat').value Is this the best approach to achieve this or is there a better way. April 10, 2021 -
Fail with Django migrations when switching to MySQL
I might have hit something beyond my comprehension. Background I have dev and prod Django environments. Both of them were on SQLite, then I successfully migrated prod to server-based MySQL. I made a few more changes in my code in dev and decided to migrate it to MySQL as well (created local MySQL server) The problem I run migrations and the error I get - 'there is no table X in database'. I use 'show tables' to see what tables are available and it's not there indeed. This table was introduced in migration_0043. Now I'm much further - migration_0053, so rolling back does not seem like an option. Is there a way to either run that specific migration (I don't understand why it did not run automatically) or safely clean migrations and have a new 'initial' one? The complications are: 1) I have valuable data that I don't want to lose; 2) I will need to bring dev and prod back in sync after it. -
Validation Error not showing in django template
Everything works except for the fact that when there is invalid login, the validation error does not show. Any idea why this is so? views.py class LoginView(FormView): form_class = AccountAuthenticationForm def form_valid(self, form): email = self.request.POST['email'] password = self.request.POST['password'] user = authenticate(email=email, password=password) auth_login(self.request, user) return redirect("HomeFeed:main") if not authenticate(email=email, password=password): raise forms.ValidationError("Invalid login") forms.py class AccountAuthenticationForm(forms.ModelForm): password = forms.CharField(label='Password', widget=forms.PasswordInput) class Meta: model = Account fields = ('email', 'password') def clean(self): if self.is_valid(): email = self.cleaned_data['email'] password = self.cleaned_data['password'] else: raise forms.ValidationError("Invalid login") -
How can I render a highcharts solidgauge with Django?
I would like to display a highcharts solidgauge (https://www.highcharts.com/demo/gauge-solid). For my little app I use Django and Python3.8. But most examples that I found work only for Angular. tldr: I get a red error message from highcharts (No. 17), which states that the requested series type does not exist. The long story: As I did not know any better way I downloaded four js files (https://code.highcharts.com/modules/solid-gauge.js, https://code.highcharts.com/modules/solid-gauge.src.js, https://code.highcharts.com/highcharts-more.js, and https://code.highcharts.com/highcharts-more.src.js). I put them in my Django's static folder and ran manage.py collectstatic. In my views.py I just tried to replicate the example from the highcharts page, but I do not get it to render. The code looks like this. def landingpage(request): chart = { 'chart': { 'type':'solidgauge', }, 'title': {'text':'Example gauge'}, 'pane': { 'center': ['50%', '85%'], 'size': '140%', 'startangle': -90, 'endangle':90, 'background': { 'backgroundcolor': 'Highcharts.defaultOptions.legend.backgroundColor || \'#EE\'', 'innerRadius': '60%', 'outerRadius': '100%', 'shape': 'arc', } }, 'exporting': {'enabled': False}, 'tooltip': {'enabled': True}, 'yAxis':{'stops': [ [0.1, '#55BF3B'], # green [0.5, '#DDDF0D'], # yellow [0.9, '#DF5353'], # red ], 'min':0, 'max':200, 'lineWidth': 0, 'tickWidth': 0, 'minorTickInterval': 'null', 'tickAmount': 2, 'title': { 'y':-70, 'text': 'Speed' }, 'labels': { 'y':16 } }, 'credits': { 'enabled': False }, 'plotOptions': { 'solidgauge': { 'dataLabels': { 'useHTML': True, …