Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
CSRF token missing - django/ajax
CSRF token missing - django/ajax Have already tried each and every solution proposed in this article but nothing seems to work for me. "CSRF token missing or incorrect" while post parameter via AJAX in Django $(document).on('click', '.attendance_submit', function(){ var urlname = '{% url "test" %}' var tableSel = $('.attendance_table tr:not(.group)'); alert("DATA :"+html2json(tableSel)); $.ajax({ url : urlname, type: 'POST', dataType: 'json', contentType: 'application/json', data: { csrfmiddlewaretoken: '{% csrf_token %}', 'TableData': html2json(tableSel) }, success: alert('Attendance updated successfully') }); return false; }); PS: CSRF Token is also enabled in the form which I am using in this template, even tried removing from the form but to no avail. -
I have some issues with Django templates that I downloaded
I am working on Django templates so I downloaded one template "Travello" and I am trying to customize it but the template can not be loaded CSS, js files. so I am getting errors like this... Refused to apply style from '' because its MIME type ('text/HTML) is not a supported stylesheet MIME type, and strict MIME checking is enabled. GET http://127.0.0.1:5500/templates/%7B%%20static%20'js/jquery-3.2.1.min.js'%20%%7D net::ERR_ABORTED 400 (Bad Request) please help me I'm just a beginner... thank you for helping me -
Deploying heroku - Push failed
I need some help to solve this. I don't have much experience with Heroku, this is my first time doing it but I need to deploy some app really quickly. I've tried to disable collectstatic with heroku config:set DEBUG_COLLECTSTATIC=1 -a name_of_app But it haven't made any change. Can anyone help me, please ? Here are logs: -----> Building on the Heroku-20 stack -----> Using buildpack: heroku/python -----> Python app detected -----> No Python version was specified. Using the buildpack default: python-3.9.5 To use a different version, see: https://devcenter.heroku.com/articles/python-runtimes -----> Installing python-3.9.5 -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2 -----> Installing SQLite3 -----> Installing requirements with pip Collecting asgiref==3.3.1 Downloading asgiref-3.3.1-py3-none-any.whl (19 kB) Collecting Django==3.1.5 Downloading Django-3.1.5-py3-none-any.whl (7.8 MB) Collecting django-crispy-forms==1.10.0 Downloading django_crispy_forms-1.10.0-py3-none-any.whl (107 kB) Collecting pytz==2020.5 Downloading pytz-2020.5-py2.py3-none-any.whl (510 kB) Collecting sqlparse==0.4.1 Downloading sqlparse-0.4.1-py3-none-any.whl (42 kB) Installing collected packages: asgiref, sqlparse, pytz, Django, django-crispy-forms Successfully installed Django-3.1.5 asgiref-3.3.1 django-crispy-forms-1.10.0 pytz-2020.5 sqlparse-0.4.1 -----> $ python Project/manage.py collectstatic --noinput Traceback (most recent call last): File "/tmp/build_784131b5/Project/manage.py", line 22, in <module> main() File "/tmp/build_784131b5/Project/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 401, in execute_from_command_line utility.execute() File "/app/.heroku/python/lib/python3.9/site-packages/django/core/management/__init__.py", line 345, in execute settings.INSTALLED_APPS File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/__init__.py", line 82, in __getattr__ self._setup(name) File … -
how to do a aggregate sorting across various django models?
I have 4 models User, Posts, Comments, Friends. Please refer the below models now I need an API for the top 10 recent activities done by the user which can be a combination of all the three i.e recent posts by the user + recent comments made by the user + recent friend added by the user or it can be one only comments or it can be only on posts or it can only be friends basically I need the top 10 recent things done by the user , how can I sort this data's by date across the three models and put in a single result list? so I can pagination to the result list User model- stores all details about the users class User(models.Model): ...... '' '''' Posts model- stores the posts created by the users class Posts(models.Model): ...... '' '''' Comments - stores the comments made by the users on a post class Comments(models.Model): ...... '' '''' Friends - stores the friends information class Friends(models.Model): ...... '' '''' -
Template inheritance: Change Nav-Tab active tab and URL with Click on Tab (Django, Bootstrap)
I'm currently designing a Web-App with Django and Bootstrap. I have several HTML files which I want to load dynamically in one "Parent" HTML-file via different URL's. Everything is working so far. My Goal is to use a Tab or Nav-Bar for the Template inheritance. As soon as I click on another Tab, the corresponding URL becomes targeted an the HTML content should open in the selected Tab . I can't manage both at the same time. Either the Tab opens or the new URL is loaded. In the second case the default Tab is active again which is caused by reloading the page. I also tried using a JavaScrip function to load the new URL and afterwards show the corresponding Tab. But no success so far... Im happy with every hint regarding my problem. Thanks a lot -
How to transform a queryset instance to dictionary Django
In order to optimize my function, I would like to transform a queryset to a dictionary and stock it in cache. Here is my instance and the output: nodes = Node.objects.select_related().all() <QuerySet [<Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network IDF )>, <Node: Node : No name of ( Network … -
Need to create users reference chart using python, django
I am creating an MLM application using python, Django, need to print all users according to reference users in a tree diagram. The new user added automatically in the reference of the user. I want this design But getting In cmd, i am getting the user with refer user name but not able to display in template. (views.py) def referringtree(request): mainuser = User.objects.filter(username__contains=request.user) user = User.objects.all() allud = [] udd = [] for us in user: username = us.username print(username) allud.append(username) ud = UserDetails.objects.filter(refer_by = username) for u in ud: print(u.email) uemail = u.email udd.append([username, uemail]) subuser = UserDetails.objects.filter(refer_by = mainuser[0].username) alluser = UserDetails.objects.all() return render(request, 'referring_tree.html', {'mainuser':mainuser, 'subuser':subuser, 'alluser':alluser, 'user':user, 'username':allud, 'udd':udd}) (template) <figure class="top-scroll"> <ul class="usertree"> <li> {% for mainuser in mainuser %} <span>{{mainuser.username}}<img class="user-avtar-tree" src="{% static 'images/user-icon.png' %}"> </span> {% endfor %} <ul> {% for subuser in subuser %} <li> <span>{{subuser.email}}<img class="user-avtar-tree" src="{% static 'images/user-icon.png' %}"> </span> <ul> {% for alluser in alluser %} {% if alluser.refer_by == subuser.email %} <li><span>{{ alluser.email }}<img class="user-avtar-tree" src="{% static 'images/user-icon.png' %}"></span> </li> {% endif %} {% endfor %} </ul> </li> {% endfor %} </ul> </li> </ul> </figure> -
NoReverseMatch at /... With no argument not found
Please at all. I'm currently facing this issue trying to redirect to previous page after form submission ** NoReverseMatch at /studentportal/8/result/resultcreate/ Reverse for 'student_result' with no arguments not found. 1 pattern(s) tried: ['studentportal/(?P[0-9]+)/result/$'] ** Views.py class ResultCreateView(CreateView ): template_name = 'studentportal/result_create.html' form_class = ResultModelForm queryset = StudentResult.objects.all() model = StudentResult def form_valid(self, form): print(form.cleaned_data) return super().form_valid(form) def get_success_url(self): return HttpResponseRedirect(reverse('studentportal:student_result')) Urls.py app_name = 'studentportal' urlpatterns = [ path('student_list', StudentListView.as_view(), name='student_list'), path('<int:pk>/', StudentDetailView.as_view(), name='student_detail'), path('create/', StudentCreateView.as_view(), name='student_create'), path('<int:pk>/update/', StudentUpdateView.as_view(), name='student_update'), path('<int:pk>/delete/', StudentDeleteView.as_view(), name='student_delete'), path('<int:pk>/result/', StudentResultView.as_view(), name='student_result'), path('<int:pk>/result/resultcreate/', ResultCreateView.as_view(), name='result_create'), ] Template html <form method="POST" action=" "> {% csrf_token %} {{ form|crispy }} <button class="regBtn">Submit</button> <form/> -
Accessing inline fields within inline get_formset in Django Admin
I have the following example where I have buildings(address, location,...) and apartments(name, size, type, building). One building containing multiple apartments. class BuildingAdmin(admin.ModelAdmin): inlines = [ApartmentInline,] class ApartmentInline(admin.StackedInline): def get_formset(self, request, obj=None, **kwargs): formset = super(ApartmentInline, self).get_formset(request, obj=None, **kwargs) #Here i'd like to see the values of inline fields, for example size or building that. #Similar to how one can access ModelAdmin fields with obj.location within get_form formset.form.base_fields["type"].widget = SelectMultiple(choices=custom_choices) return formset I'd like to be able to get the current apartments instance and field values when editing the object (for example size), so that I can create custom choices (querying other DB's or API's) for another field (type). -
not able to execute urls.py in pycharm
enter image description here NOT ABLE TO EXECUTE "URLS" FILE IN PYCHARM. EVEN IF I CREATE NEW FILE NAMED URLS THAT ALSO WONT WORK. TRIED EVERYTHING TO MAKE THIS WORK BUT NOTHING WORKED. PLEASE HELP HOW TO SOLVE THIS PROBLEM. -
database not updated by a task running in celery beat
Hello I have a celery task that is suppose to run every 1 hour to fetch a key and it runs and even acts like it has updates the database but it does not update in reality @app.task def refresh_token(): r = requests.get(AUTH_URL, auth=HTTPBasicAuth(CONSUMER_KEY, CONSUMER_SECRET)) obj = json.loads(r.text) obj['expires_in'] = int(obj['expires_in']) try: mpesa_token = MpesaAccessToken.objects.get(id=1) mpesa_token.access_token = obj['access_token'] mpesa_token.save() print(obj) print(mpesa_token.access_token) print("saved") except: print(obj) mpesa_token = MpesaAccessToken.objects.create(**obj) return 1 the last thee prints all shows in the logs but checking the admin panel, the values are not updated however when I use a view and make a request then call the function, the database get updated, could anyone know what is going on -
ModuleNotFoundError: No module named ' django'
Hello there I am following a tutorial on YouTube I use postman to post request of a user to an api just following his tutorial. I found an error: Internal Server Error: / Traceback (most recent call last): File "E:\UsamaComputer\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "E:\UsamaComputer\env\lib\site-packages\django\core\handlers\base.py", line 204, in _get_response response = response.render() File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 105, in render self.content = self.rendered_content File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 81, in rendered_content template = self.resolve_template(self.template_name) File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 63, in resolve_template return select_template(template, using=self.using) File "E:\UsamaComputer\env\lib\site-packages\django\template\loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) django.template.exceptions.TemplateDoesNotExist: index.html [17/May/2021 12:38:41] "GET / HTTP/1.1" 500 80940 Internal Server Error: /favicon.ico Traceback (most recent call last): File "E:\UsamaComputer\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = get_response(request) File "E:\UsamaComputer\env\lib\site-packages\django\core\handlers\base.py", line 204, in _get_response response = response.render() File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 105, in render self.content = self.rendered_content File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 81, in rendered_content template = self.resolve_template(self.template_name) File "E:\UsamaComputer\env\lib\site-packages\django\template\response.py", line 63, in resolve_template return select_template(template, using=self.using) File "E:\UsamaComputer\env\lib\site-packages\django\template\loader.py", line 47, in select_template raise TemplateDoesNotExist(', '.join(template_name_list), chain=chain) django.template.exceptions.TemplateDoesNotExist: index.html [17/May/2021 12:38:41] "GET /favicon.ico HTTP/1.1" 500 80843 Bad Request: /auth/users/ [17/May/2021 12:38:45] "POST /auth/users/ HTTP/1.1" 400 58 Internal Server Error: /auth/users/ Traceback (most recent call last): File "E:\UsamaComputer\env\lib\site-packages\django\core\handlers\exception.py", line 47, in inner … -
MySQL + Django / ERROR 1045 and CommandError
I configured MySQL as follows: CREATE DATABASE IF NOT EXISTS foodb; CREATE USER IF NOT EXISTS 'foo'@'localhost'; ALTER USER 'foo'@'localhost' IDENTIFIED BY 'qux'; GRANT ALL ON foodb.* to 'foo'@'localhost'; SHOW GRANTS FOR 'foo'@'localhost'; FLUSH PRIVILEGES; SELECT user, host, authentication_string FROM mysql.user ORDER BY user, host; When I run python manage.py dbshell I get the following error: ERROR 1045 (28000): Access denied for user 'foo'@'localhost' (using password: YES) CommandError: "mysql --user=foo --host=localhost foodb" returned non-zero exit status 1. Also, this query SHOW GRANTS for 'foo'@'localhost'; returns +--------------------------------------------------------------+ | Grants for foo@localhost | +--------------------------------------------------------------+ | GRANT USAGE ON *.* TO 'foo'@'localhost' | | GRANT ALL PRIVILEGES ON `foodb`.* TO 'foo'@'localhost' | +--------------------------------------------------------------+ 2 rows in set (0.00 sec) Finally, switching user to root and the root account password works just fine. So I think the issue must be with the user permissions on MySQL itself. What additional permissions does 'foo'@'localhost' need for this to work? -
Is it possible to use `__date` for a `timestamp` field in `filterset_fields` list of `DjangoFilterBackend`
I am using ListAPIView to list the records from my database table which is represented as ExpiredOrders(models.Model) in models.py. The Django model has several columns along with created_at and modified_at as timestamp. I want to filter the records on the created_at against the query parameters created_at. I am trying to use the DjangoFilterBackend to achieve the same. filter_backends = [DjangoFilterBackend] filterset_fields = ['craeted_at__date'] However, it return me an error - 'Meta.fields' must not contain non-model field names: created_at__date As created_date is a timestamp and in query parameter I will only get the date as YYYY-MM-DD, I am using __date to make the record of database table comparable with the query parameter. The other way to achieve this is - def get_queryset(self): try: queryset = ExpiredOrders.objects.filter(created_at__date=self.query_params['created_at']) except: queryset = ExpiredOrders.objects.all() return queryset I want to know if it is possible to get it done by just defining the filed name in the list filterset_fields. Also, please explain me what does this __ means here. Best to my knowledge it is a convention to represent class variable or methods which must not be used with the objects of other class or subclasses. Perhaps, this concept is known as name mangling in Python. … -
`HyperlinkedIdentityField` requires the request in the serializer context. Add `context={'request': request}` when instantiating the serializer
This is what my serializers.py file is looking like: from rest_framework import serializers from .models import * class EinsatzSerializer(serializers.ModelSerializer): class Meta: model = Einsatz fields = ('pk', 'url', ...) # ... = all my other fields But when I create an "Einsatz", I get this error: Exception Value: `HyperlinkedIdentityField` requires the request in the serializer context. Add `context={'request': request}` when instantiating the serializer. Exception Location: .../venv/lib/python3.9/site-packages/rest_framework/relations.py, line 378, in to_representation I don't understand why I am getting this Error, when I am not even using HyperlinkedIdentityField. And where would I even put context={'request': request}? I also have a views.py and urls.py to show if needed. Thank you in advance! -
How to remove nesting from Django REST Framework serializer?
I have two models defined in my models.py file: class Album(models.Model): album = models.CharField(max_length=100) band = models.CharField(max_length=100) class Song(models.Model): album = models.ForeignKey(Album, on_delete=models.CASCADE) song = models.CharField(max_length=100) For these, I have defined the serializers in my serializers.py file as: class AlbumSerializer(serializers.ModelSerializer): class Meta: model = Album fields = "__all__" class SongSerializer(serializers.ModelSerializer): album = AlbumSerializer() class Meta: model = Song fields = "__all__" When I make a request, the data I get is in this format: [ { "id": 1, "album": { "id": 1, "album": "Hybrid Theory", "band": "Linkin Park" }, "song": "Numb" }, { "id": 2, "album": { "id": 1, "album": "Hybrid Theory", "band": "Linkin Park" }, "song": "In the End" } ] How do I remove the nesting from the album name, from the songs Serializer? I would want data something like this: [ { "id": 1, "album_id": 1, "album": "Hybrid Theory", "band": "Linkin Park" "song": "Numb" }, { "id": 2, "album_id": 1, "album": "Hybrid Theory", "band": "Linkin Park" "song": "In the End" } ] -
Django Project could not resolve pylance
How to resolve this error. New to Django kindly help. I have tried installing pylint but it doesn't work -
Outputting a table to a template
I recently began to study Django and cannot understand how to correctly implement the template (table) I have a model: She has ties to Company and bank. class BankAccount(models.Model): company = models.ForeignKey('Company.Company', null=True, on_delete=models.CASCADE, verbose_name='Фирма', related_name='company') bank = models.ForeignKey('Bank', null=True, on_delete=models.CASCADE, verbose_name='Банк', related_name='bank') login_bank = models.CharField(max_length=255, verbose_name='Логин', null=False) password_bank = models.CharField(max_length=255, verbose_name='Пароль', null=False) date_created = models.DateTimeField(auto_now=True) date_updated = models.DateTimeField(auto_now_add=True) balance = models.DecimalField(max_digits=15, decimal_places=2, blank=True, null=True) In the template I want to display a table where all firms / banks will be displayed at the intersection of these columns and rows, a value from this model will appear. I've been looking for an answer for 5 days and | | Company1 | Company2 | Company3 | Company4 | |-------|-------------------------|-------------------------|------------------------|-------------------------| | Bank1 | Balance(Company1/Bank1) | Balance(Company2/Bank1) | Balance(Company/Bank1) | Balance(Company4/Bank1) | | Bank2 | Balance(Company1/Bank2) | .... | .... | .... | | Bank3 | Balance(Company1/Bank3) | .... | .... | .... | -
ValueError: Unable to configure handler 'console'
I'm django new user, why i use the official settings.py from Django to start my project, it still throw exception? -
LookUp in django HTML's input tag
I am building a BlogApp and I am stuck on a Error. I am trying to lookup in HTML template, Because, I have two models for upload multiple images AND I am trying to access my second model field named file in HTML with input tag. Why i want to access model field in input tag ? I am trying to make my custom choose file button, AND which cannot be donw using {{ form }}, I have to access field name with <input> tag. I want to access model field in input tag because , When i try to upload file using <input type="file" name="file" > then it is not uploading or saving. AND when i try to access or save file using {{ form }} then it is working correctly. So i think this is because of i have two models , so i have to access model field name in input tag using LookUp. models.py class G(models.Model): user = models.ForeignKey(User,on_delete=models.CASCADE) text = models.CharField(max_length=30,blank=True) class GImage(models.Model): gimage = models.ForeignKey(G,related_name='imagess',on_delete=models.CASCADE) file = models.ImageField(upload_to='images') forms.py class GForm(forms.ModelForm): class Meta: model = GImage fields = ['file',] template.html When i try this then it is working correctly. <form method="post" action="" enctype="multipart/form-data"> {% … -
Django form data not saving into SQLite database
I am making a Django project and I want to submit a link name and a link into my form and make it appear on links.html but when I press submit, it prints onto the console that a post method had happened but when I check the database the data has not saved into it. In case this was a problem with my models I made one through the shell but it seemed to have been fine. Here is my forms.py: from django import forms class LinkForm(forms.Form): link_text = forms.CharField(label="Link text", max_length=150) link = forms.URLField(max_length=100000) models.py: from django.db import models # Create your models here. class Topic(models.Model): topic_text = models.CharField(max_length=40) def __str__(self): return self.topic_text class Link(models.Model): topic = models.ForeignKey(Topic, on_delete=models.CASCADE) link_text = models.CharField(max_length=150) link = models.URLField(max_length=100000) def __str__(self): return self.link_text links.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Links</title> </head> <body> {% if links %} {% for link in links %} <a href="{{link.link}}">{{link.link_text}}</a> <br /> {% endfor %} {% else %} <h1>This topic has no links</h1> {% endif %} <a href="/topics/{{ topic.id }}/newLink">Add a new link</a> </body> </html> newLink.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" … -
how assign permission different model to one object?
i have this model i need to assign permission Relation model to object TableRelation model because i want have one model permission class Relation(models.Model): title = models.CharField(max_length=100) layer = models.ForeignKey(Layer, blank=True, null=True, on_delete=models.CASCADE) related_from_table = models.CharField(max_length=150, default='', blank=True) related_from_connection = models.ForeignKey(DataBaseProfile, null=True, on_delete=models.CASCADE) related_source_field = models.CharField(max_length=150) def __str__(self): return self.title class Meta: permissions = ( ('view_relate', 'Can view relate'), ('delete_relate', 'Can delete relate'), ('add_relate', 'Can add relate'), ('edit_relate', 'Can edit relate'), ) class TableRelation(Relation): connection = models.ForeignKey(DataBaseProfile, blank=False, on_delete=models.PROTECT) related_table = models.CharField(max_length=150) related_destination_field = models.CharField(max_length=150) related_table_fields = JSONField() related_table_fields_view = JSONField(default=dict) form = models.OneToOneField(Form, null=True, on_delete=models.CASCADE) class Meta: default_permissions = () class APIRelation(Relation): class Meta: default_permissions = () api_profile = models.ForeignKey( APIProfile, on_delete=models.CASCADE) connection = models.ForeignKey(DataBaseProfile, blank=True, null=True, on_delete=models.PROTECT) I want to use parent-class permissions and not create separate permissions on the chile models. for example: from guardian.shortcuts import assign_perm assign_perm('relates.view_relation', user, table_relate_obj) assign_perm('relates.add_relation', user, table_relate_obj) assign_perm('relates.change_relation', user, table_relate_obj) assign_perm('relates.delete_relation', user, table_relate_obj) that do not work this example thanks -
Django QuerySet annotation with Case appears to be falsely positive
I am trying to annotate a QuerySet on a case-by-case basis but I get all results positive (1) when they should be all but one negative (0). The filter looks like so related_params[distro.id] = table.objects.filter( ProductId__in=[map["ProductId"] for map in related_maps_by_distro.values("ProductId")]).annotate( has_agr_param=Count( models.Case( models.When(DistributionParameterId__Code__in=[agr_parameter.Code for agr_parameter in agr_parameters], then=1), default=0, output_field=models.IntegerField(), ) ) ).order_by("DistributionParameterId__Name") where everything works just fine except for the annotate part. Values of [agr_parameter.Code for agr_parameter in agr_parameters] are ['ZARIZENI', '443', '10071', 'PC4.12', 'PC4.121', 'PC4.6', 'PC3.101', 'AIO 2.1'] while all possible DistributionParameterId__Codes are ['10176', '10175', '10171', '10177', '563', '10172', '10179', '829', '10174', '10173', '10170', '10178'] so there is only one match - 10071 - and therefore all but one should be annotated with 0. What am I missing? Any help would be appreciated. -
How do I copy to the clipboard in Django
I am new to django and currently I am working on a project where I need to create a functionality where the website users can copy the url to a post by a clicking on a button so that they can be able to share with other people. I am thinking of pyperclip module but I don't how to implement it in a web app and/or django templates. I have no other idea on how to go about this -
Using django-tables2 to show all admin tables in admin.py instead of default render
I am trying to use https://github.com/jieter/django-tables2 to replace the default Django admin table that you see when you login into the admin part. All the examples that I have found are based on creating a different view for the Model where you want to use, for example https://github.com/jieter/django-tables2/blob/master/example/templates/base.html but in this case, I want to use https://github.com/jieter/django-tables2/blob/master/example/app/admin.py. I do not how to tell Django to render these two fields ("name", "continent") using Django-tables2, instead of rendering with the default table. Can someone give me a hint? Thanks in advance!