Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Does max_retries limit the quantity of "retries" when using acks_late&
I have a task that looks like this (ofcourse the run method if more complex): class SomeTask(celery.Task): max_reries = 3 acks_late = True def run(self): print('some code') I know that celery has acks_late and retry options. I need to use acks_late. So Im wondering: max_reries = 3 limit the quantity of "retries" just for retry() or for acks_late also. I tried to find this in celery docs, but there was no information about that. -
IntegrityError on migration using Geodjango + Spatialite
I have a Model CoordenadasPonto that uses one PointField from django.contrib.gis.db.models in an app called mc. When I try to migrate a modification of this Model, Django raises: django.db.utils.IntegrityError: The row in table 'geometry_columns_statistics' with primary key 'CONSTRAINT' has an invalid foreign key: geometry_columns_statistics.f_table_name contains a value '**new__**mc_coordenadasponto' that does not have a corresponding value in geometry_columns.f_table_name. It doesn't matter if I modify the PointField or other fields. It seems every time I modify the Model, Django try to copy all the data to a new Table in Database using new__ plus original table name. After that, I guess Django would delete/drop the original table and rename new__ to the original name. But due to the IntegrityError, this never happens. It seems the problem is with GIS/Spatialite because some data is linked with the GIS table geometry_columns_statistics not migrated in accordance. I tried to modify directly the geometry_columns_statistics in the sqlite file, but other dependencies problems came out. -
How do I get Django to not add carriage returns in a Textarea in the admin UI?
I am using a Textarea in Django admin with strip=False as outlined here. def formfield_for_dbfield(self, db_field, **kwargs): formfield = super().formfield_for_dbfield(db_field, **kwargs) if db_field.name == 'some_text': formfield.strip = False formfield.widget = forms.Textarea(attrs={'rows': 10, 'cols': 80}) return formfield The DB field comes from an HTML input box, and has newlines in it (\n). After I edit and save in Django, it has carriage-return newlines (\r\n), as seen when I query from the DB. BEFORE: select md5(some_text), some_text from myapp_obj where id = 328; md5 | some_text ----------------------------------+----------------------------------------------------------- adb48a782562ef02801518c4e94ca830 | foo1. + | foo2 + ... AFTER: select md5(some_text), some_text from myapp_obj where id = 328; md5 | some_text ----------------------------------+----------------------------------------------------------- e9e06c1d9764be70fc61f05c5fd6292c | foo1.\r + | foo2\r + ... How do I get the Django admin UI (the Textarea) to save back exactly what was loaded into its UI, without adding or subtracting anything? I'm using Django 3.2.9, Postgres 13. -
I'm a django beginner, and I do not know why this kind of error is ocurring
'carro' Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 3.2.8 Exception Type: KeyError Exception Value: 'carro' Exception Location: :\Users*\Envs\django2\lib\site-packages\django\contrib\sessions\backends\base.py, line 65, in getitem Python Executable: *:\Users******\Envs\django2\Scripts\python.exe Python Version: 3.9.5 Python Path: ['F:\ProjectoWeb', 'c:\python39\python39.zip', 'c:\python39\DLLs', 'c:\python39\lib', 'c:\python39', 'C:\Users\\Envs\django2', 'C:\Users\\Envs\django2\lib\site-packages'] Server time: Wed, 22 Dec 2021 19:06:41 -0300 -
how to access django database on the remote site from a local script?
I have the following code in a script: import django django.setup() This loads my project settings for local development but what I actually want is to load the server's settings (specifically the database access). What I tried? I created another file settinge_remote.py (same folder as settings.py) and setting the DATABASES dictionary to hold the remote server host/ip. but the code: import django django.setup() os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_project.settings_remote") has no effect (I also moved the setting_remote line in first place). It still reads the my_project.settings and not the my_project.settings_remote. -
All the testcases have assertion error: 401 !=200 django
I have a custom abstract base user and basic login with knox view, I made some simple tests to the register and login process, however all the testcases fail to assertion error:401!=200 and when I use pdb.set_trace to know the sent data it always has that error (Pdb) res <Response status_code=401, "application/json"> (Pdb) res.data {'detail': ErrorDetail(string='Authentication credentials were not provided.', code='not_authenticated')} Here is the test setup from rest_framework.test import APITestCase from django.urls import reverse class TestSetUp(APITestCase): def setUp(self): self.register_url = reverse('knox_register') self.login_url = reverse('knox_login') self.correct_data = { 'email':"user@gmail.com", 'password': "Abc1234#", } self.wrong_email_format = { 'email': "user@gmail", 'password': "Abc1234#", } self.missing_data = { 'email':"user@gmail.com", 'password':"", } self.wrong_password_format = { 'email': "user@gmail.com", 'password': "123", } return super().setUp() def tearDown(self): return super().tearDown() and the test_view from .test_setup import TestSetUp import pdb class TestViews(TestSetUp): #register with no data def test_user_cannot_register_with_no_data(self): res = self.client.post(self.register_url) self.assertEqual(res.status_code,400) #register with correct data def test_user_register(self): self.client.force_authenticate(None) res = self.client.post( self.register_url, self.correct_data, format="json") #pdb.set_trace() self.assertEqual(res.status_code,200) #register with wrong email format def test_register_with_wrong_email_format(self): res = self.client.post( self.register_url, self.wrong_email_format) self.assertEqual(res.status_code, 400) # register with wrong password format def test_register_with_wrong_password_format(self): res = self.client.post( self.register_url, self.wrong_password_format) self.assertEqual(res.status_code, 400) #register with missing_data def test_register_with_missing_data(self): res = self.client.post( self.register_url, self.missing_data) self.assertEqual(res.status_code, 400) #login with correct Credentials … -
Django / app import problem from submodule
I'm writing my own Django app, and trying to import submodule from my core library like that: INSTALLED_APPS = [ 'django.contrib.admin', ... 'core.login', ] And interpreter gives me: django.core.exceptions.ImproperlyConfigured: Cannot import 'login'. Check that 'core.login.apps.CustomloginConfig.name' is correct. So login.apps looks like that from django.apps import AppConfig class CustomloginConfig(AppConfig): name = 'login' Are there any rules how I can edit this files to start Django properly? -
Application error on heroku failed to update heroku config
I have hosted a django project on heroku and I'm trying to update my environment variables through heroku config but, I wrote the following command heroku config:set SECRET_KEY="djang...j*yb13jkqu-+q+l&)#b(g..." And it shows me the following result j*yb13jkqu-+q+l was unexpected at this time. -
Django is installed but it couldn't run - ModuleNotFoundError: No module named 'django'
I installed django on my mac but i couldn't run my project as because this issue: ModuleNotFoundError: No module named 'django' I don't know about this, The problem is i couldn't import django on my system but tried this way too... (my_project) my_project % python Python 3.6.8 (v3.6.8:3c6b436a57, Dec 24 2018, 02:04:31) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> print(sys.path) ['', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages'] >>> import django >>> It's all fine, But i dont no the problem where is? -
What triggers these Django urls tag?
Programmers in the house, I want to know what triggers both of these types of django urls {% url '$name' %} {% url 'appname:$name' %} is there a setting that helps you to choose either of them? -
WaveSurfer.js audio is muted on the Django site (MediaElementAudioSource outputs zeroes due to CORS access restrictions...)?
For some reason, the audio file is muted on the site on the production server. The files are located on the Selectel container and and downloading from the Selectel CDN. When loading the page, this error appears in the console MediaElementAudioSource outputs zeroes due to CORS access restrictions for https://cdn.x.fullfocus.uz/media/audio/2021/12/20/news_audio-20211222-110648.mp3 On NGINX and CDN/Container setting there is the header Access-Control-Allow-Origin = '*' NGINX settings server { server_name xabardor.uz; client_max_body_size 500M; access_log /var/log/nginx/xabardor.log; root /var/www/html; index index.html index.html index.nginx-debian.html; location ~* \.(eot|ttf|woff|woff2|mp3|wav|ogg|wob)$ { add_header Access-Control-Allow-Origin *; } location / { proxy_pass http://127.0.0.1:8001; proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Host $http_host; add_header P3P 'CP="ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV"'; add_header 'Accept-Encoding' 'gzip, deflate'; add_header 'Access-Control-Allow-Origin' '*'; add_header 'Access-Control-Allow-Credentials' 'true'; add_header 'Access-Control-Allow-Methods' '*'; add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-CustomHeader,Keep-Alive,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; } location = /favicon.ico { root /home/www/xabardoruz-django/xabardor/news/static/news/images/favicon.png; } location /static/ { root /home/www/xabardoruz-django/xabardor/static_files; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/xabardor.uz/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/xabardor.uz/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } Screenshot of CDN settings Screenshot of container settings Screenshot browser's Network Has anyone faced a similar problem? But all working fine without WaveSurfer.js with simple … -
NoReverseMatch at /courses/detail/modules/create_content
I want to create a quiz app for my e learning project and when i tray to add a new quiz in the modules content is says "Reverse for 'new-quiz' with arguments '('', '')' not found. 1 pattern(s) tried: ['courses/(?P<courses_id>[^/]+)/modules/(?P<modules_id>[^/]+)/quiz/newquiz\Z']" here is my code in quiz models from django.db import models from django.contrib.auth.models import User from courses.models import Modules,Courses class Answer(models.Model): answer_text = models.CharField(max_length=900) is_correct = models.BooleanField(default=False) user = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.answer_text class Question(models.Model): question_text = models.CharField(max_length=900) answers = models.ManyToManyField(Answer) points = models.PositiveIntegerField() user = models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self): return self.question_text class Quizzes(models.Model): module=models.ForeignKey(Modules,related_name='Quizzes',on_delete=models.CASCADE) title = models.CharField(max_length=200) description = models.CharField(max_length=200) date = models.DateTimeField(auto_now_add=True) due = models.DateField() allowed_attempts = models.PositiveIntegerField() time_limit_mins = models.PositiveIntegerField() questions = models.ManyToManyField(Question) def __str__(self): return self.title class Attempter(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) quiz = models.ForeignKey(Quizzes, on_delete=models.CASCADE) score = models.PositiveIntegerField() completed = models.DateTimeField(auto_now_add=True) def __str__(self): return self.user.username class Attempt(models.Model): quiz = models.ForeignKey(Quizzes, on_delete=models.CASCADE) attempter = models.ForeignKey(Attempter, on_delete=models.CASCADE) question = models.ForeignKey(Question, on_delete=models.CASCADE) answer = models.ForeignKey(Answer, on_delete=models.CASCADE) def __str__(self): return self.attempter.user.username + ' - ' + self.answer.answer_text class Completion(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) course = models.ForeignKey(Courses, on_delete=models.CASCADE) completed = models.DateTimeField(auto_now_add=True) quiz = models.ForeignKey(Quizzes, on_delete=models.CASCADE, blank=True, null=True) def __str__(self): return self.user.username class Completion(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) course … -
Can we fetch real time data with rest api in DRF if yes please tell me what steps we need to perform?
I want to build a listing API that returns the most recent data without reloading the page. -
Django update from 3.2 -> 4.0 and DRF Paths
I wanted to try and upgrade my django app that runs just fine on django 3.2.6 to the next release, but even in testing I came across the deprecated url (https://docs.djangoproject.com/en/4.0/ref/urls/). So I replaced the last lines in the urls.py: router = routers.DefaultRouter() router.register(r'products', views.ProductViewSet, basename = "products") urlpatterns = [ ..., url('api/', include(router.urls)), ] to: urlpatterns = [ ..., path('api/', include(router.urls)), ] but on a site that has the url http://127.0.0.1:8003/productspage/ I now get the error message: The current path, productspage/api/products/, didn’t match any of these. The path for the api in the ajax calls with django 3.26 was working: async function doAjax ( ) { let result = await $.ajax({url: "api/products/"}); } so I totally see why this would not work - but how (and where?) do I fix it? I thought about handing an absolute path (like ${window.location.hostname}/api/products/) to ajax, or providing a basename for the template? Can I fix it in Django? -
How to run celery task only once amongst multiple replicas?
I have a bunch of fargate instances on AWS, and they have celery running on them locally with Elasticache for redis. Due to Auto Scaling policies instances keep spawning and de-spawning, the issue is, the celery tasks that I have run as many times as there are replicas of my server. Can anyone suggest a way to prevent this behaviour? The celery beat tasks takes a bunch of rows in the database and performs certain operations on them, I tried adding a "processed" flag on the rows to indicate that they've been processed, but since all the replicas start the task at the exact same time, this solution fails. Currently the scheduler for celery beat is set to DatabaseScheduler. Here's the config that I have right now. CELERY_BROKER_URL = os.environ.get('CELERY_BROKER_URL', 'redis://127.0.0.1:6379/0') CELERY_RESULT_BACKEND = os.environ.get('CELERY_RESULT_BACKEND', 'redis://127.0.0.1:6379/0') CELERY_ACCEPT_CONTENT = ['application/json'] CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'json' CELERY_TIMEZONE = 'US/Central' CELERY_BEAT_SCHEDULE = { 'withdraw_money_daily': { 'task': 'app_name.tasks.perform_the_task', 'schedule': crontab(minute=0, hour=0), } } REDIS_HOST = os.environ.get('REDIS_HOST', 'localhost') CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", "CONFIG": { "hosts": [(REDIS_HOST, 6379)], }, }, } Command that starts the celery celery -A app worker -l info -E celery -A app beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler -
Django render image created with PIL
I know there are similare questions but they are 9 - 11 years old. I need to create an image dynamically with PIL in the view and then show it in the html. This is the code: views.py def certificate_preview(request, cert_id): template = "courses/certificate_preview.html" certificate_image = Image.new(mode="RGB", size=(400, 400), color=(209, 123, 193)) context = {"certificate_image": certificate_image} return render(request, template, context) certificate_preview.html ... <img src="{{ certificate_image }}" alt="No Image"> It doesn't work. What am I missing? -
Django Optimal Way of Getting a List of Model Attributes
Let's say this is my models.py file: class Paper(models.Model): title = models.CharField(max_length=20, null=False, blank=False) class Author(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) papers = models.ManyToManyField(Paper, null=False, blank=False) An author can have multiple papers and a paper can have multiple authors. I need to get all the papers titles for a given author. In my views.py, once I have an author object, I need to get a list with all the titles of his papers. I'm doing this: user = User.objects.get(username=request.user) author = Author.objects.get(user=user) papers = [paper.title for paper in author.papers.all()] Is there a way in Django to make this query without having to iterate over the author papers? Maybe there is a built-in function or something that I'm missing, any suggestions? -
NoReverseMatch at / Reverse for 'comment' with no arguments not found. 1 pattern(s) tried: ['comment/(?P<forum_id>[0-9]+)/$']Problem in Django 3:
The pages work together if I don't add the <int:forum_id> tag in the urls.py. When I do that the homepage stops working and give me the error message in the title. Home.hmtl <a href="{% url 'base:comment'%}"> <div class="card-header"> <div class="media flex-wrap w-100 align-items-center"> <div class="media-body ml-3"> <a href="javascript:void(0)" data-abc="true">{{ forum.user }}</a> <div class="text-muted small">{{ forum.date_created }}</div> </div> <div class="text-muted small ml-3"> <div><p>{{ forum.user}}</p></div> </div> </div> </div> <div class="scrollable"> <h3>{{ forum.title }} {{ forum.id}}</h3> <p>{{ forum.description }}</p> </div> <div class="card-body" style="border-color=red;"> {% for comment in comments%} {% if forum.id == comment.forum.id %} <div class="card-header"> <h6>{{ comment.user}}</h6> <p>{{ comment.discuss }}</p> </div> {% endif %} {% endfor %} </div> <div class="px-4 pt-3"> {% if user.is_authenticated %} {% comment %} <a href="{% url 'base:comment' forum.id %}"><button type="button" class="btn btn-primary" ></i>&nbsp; Reply</button></a> {% endcomment %} {% else %} <a href="{% url 'login' %}"><p>Please log in first to reply to messages</p></a> {% endif %} </div> {% endfor %} views.py from django.contrib.auth.forms import UserCreationForm from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.forms import UserCreationForm from django.contrib import messages from django.contrib.auth.models import User from .models import * from .forms import * # from .models import forum def about(request): return render(request, 'about.html') def home(request): forums=forum.objects.all() count=forums.count() discussions=[] for i … -
How to use datetime filter in django just for day and month?
I need to filter objects of users in a viewset whose birthday is today. Here, I will just need to check it with today's day and month irrespective of year. How do I do that? -
Using "%" as a modulo operator in Django template
I have color swatches being displayed under some ecommerce items in a Django 3.6 template. I would like to add a line break after every 5 swatches. To implement this I used this HTML. {% if forloop.counter % 5 == 0 %} <br> {% endif %} but when I render the page I get this error. Could not parse the remainder: '%' from '%' How can I use this operator inside of a template? -
NoReverseMatch at /details/The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f
I am trying to add comments in my blogs of my project. When I post a comment it shows NoReverseMatch at /details/The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f Here's is blog details page {% extends 'base.html' %} {% block content %} <div class="container jumbotron"> <div class="row"> <div class="col-sm-6"> <h2><i>{{blog.blog_title}}</i></h2> <h4>Posted By: @ {{blog.author}}</h4> <i><h6>Published On : {{blog.publish_date}}</h6></i> </div> <div class="col-sm-6"> <img src="/media/{{blog.blog_image}}" alt="{{blog.blog_title}}" title="{{blog.blog_title}}" width="500px" height="200px"> </div><hr> <p>{{blog.blog_content|capfirst}} </div> <div class="row"> <div class="col-sm-6"> <hr> <h5>Comments*</h5> </div> <div class="col-sm-6"> <form method="post"> {{comment_form.as_p}} {% csrf_token %} <button type="submit" class="btn btn-primary btn-sm">Comment</button> </form> </div> </div> </div> {% endblock content %} views.py of blog details page- def blog_details(request, slug): blog= Blog.objects.get(slug=slug) commet_form=CommentForm() if request.method=='POST': commet_form=CommentForm(request.POST) if commet_form.is_valid(): comment=commet_form.save(commit=False) comment.user=request.user comment.blog=blog comment.save() return redirect('blog_details',kwargs={'slug':slug}) return render(request,'blogs/blogdetails.html',context={'blog':blog,'comment_form':commet_form}) urls.py mapping for blog details page urlpatterns = [ path('details/<slug:slug>',views.blog_details,name="blog_details"), ] servel url http://localhost:8000/details/The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f But in server site I get this NoReverseMatch at /details/The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f Reverse for 'blog_details' with keyword arguments '{'kwargs': {'slug': 'The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f'}}' not found. 1 pattern(s) tried: ['details/(?P<slug>[-a-zA-Z0-9_]+)$'] Request Method: POST Request URL: http://localhost:8000/details/The-Shortest-Scientific-Papers-Ever-Published-fa9c94fc-626a-446a-8b34-e6aeddcc086f Django Version: 3.2.8 Exception Type: NoReverseMatch Is there any problem with slug? models.py of the slug class Blog(models.Model): slug= models.SlugField(max_length=264,unique=True) help me out please. -
Posting data via cURL throws an APPEND_SLASH error
I'd like to post data to an endpoint hosted by Django. I am using cURL in my terminal to do this: curl -X POST -H "Content-Type: application/json" http://127.0.0.1:8000/bucket/create/ --data '{"name":"test2", "description":"hey"}' But this throws the following error: RuntimeError at /bucket/create You called this URL via POST, but the URL doesn't end in a slash and you have APPEND_SLASH set. Django can't redirect to the slash URL while maintaining POST data. Change your form to point to 127.0.0.1:8000/bucket/create/ (note the trailing slash), or set APPEND_SLASH=False in your Django settings. As you can see I've added a slash to the URL in my request and am not sure why this is happening. -
Not able to create multipe modal in django template
i am using django to create a website before deleting a product I want to ask "are you sure to delete" in modal form but modal is not opening in django template Here all Blogs are showing the Modal of the first one. I cannot create multiple modals for each Blog. {% for o in info %} <div class="job-right"> <div class="job-right-jobs"> <div class="jobs-main"> <div class="text-jobs"> <h5>{{o.0.name}}</h5> </div> </div> <p class="job-para"> phone :{{o.0.phone}} {% if o.1 %} Shipment :Assigned<br> {% for a in o.1 %} truck:{{a.transport}} pickup: {{a.job_id.picking_Address}}<br> drop: {{a.job_id.droping_Address}}<br> Job description:<br> {{a.job_id.job_description}}{% endfor %} {% else %}Shipment :Not Assigned{% endif %} </p> <div class="share"> <button type="button" id= "modalToggle" class="btn btn-sm btn-danger" data-toggle="modal" data-target="#modal-blog-{{o.0.pk}}">Remove Driver</button> </div> <div class="modal fade" id="modal-blog-{{o.0.pk}}" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title">{{o.0.name}}</h4> </div> <div class="modal-body"> <p>Are you sure you want to remove the driver?</p> </div> <div class="modal-footer"> <a type="button" href="{% url 'partner_company:RemoveDriver' o.0.pk %}" class="btn btn-danger">Yes</a> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> </div> </div> {% endfor %} -
how we can show users in admin panel in django in m2m field without list comprehension
class Page(models.Model): user = models.ManyToManyField(User) post = models.TextField() post_date = models.DateField() def get_user(self): return ", ".join([str(p) for p in self.user.all()]) how we can do without list comprehension https://i.stack.imgur.com/PPnYj.png -
Django custom field has no attribute 'set_attributes_from_name'
I have a custom field to convert the input date to a timedelta in years, rounded up: class CustomField(models.Model): start_date = models.DateField() def days_to_years(self, date: timedelta): return math.ceil(date.days / 365) def save(self, *args, **kwargs): delta = datetime.today() - self.start_date self.start_date = math.ceil(delta.days / 365) super(CustomField, self).save(*args, **kwargs) Which I use in models like: from django.contrib.postgres.fields import ArrayField class Component(ComponentBase): years = ArrayField( CustomField() ) When I try to make migrations, the error AttributeError: 'CustomField' object has no attribute 'set_attributes_from_name is raised, which I can't seem to debug because I'm still quite fresh to Django. Any suggestions would be very welcoming :).