Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Everything is running fine in local host but when I deploy the code in heroku the news24 part is not running
The setopati and news24 functions scrape the respective site for news and the obtained data is passed in the context of the home view. I have tried using URL shortener to compress link of news24 which didn't work. def ratopati(): news = [] req = requests.get('http://ratopati.com/category/coronavirus') soup = BeautifulSoup(req.content, 'lxml') articles = soup.find_all('div', {'class':'item'})[0:10] for article in articles: d = {} d['source'] = 'Ratopati' d['img_link'] = article.find('a', {'class':'item-header-image'}).find('img').attrs['src'] d['content'] = article.find('p').text div = article.find('div', {'class':'item-content'}) d['title'] = div.find('a').text d['news_link'] = div.find('a').attrs['href'] d['news_link'] = 'https://ratopati.com' + d['news_link'] news.append(d) return news def news24(): news = [] req =requests.get('https://www.news24nepal.tv/category/%e0%a4%b8%e0%a5%8d%e0%a4%b5%e0%a4%be%e0%a4%b8%e0%a5%8d%e0%a4%a5%e0%a5%8d%e0%a4%af') soup = BeautifulSoup(req.content, 'lxml') articles = soup.find_all('div', {'class':'col-md-12'})[1:10] for article in articles: d = {} d['source'] = 'News24' links = article.find_all('a') d['img_link'] = links[0].find('img').attrs['src'] d['news_link'] = links[1].attrs['href'] d['title'] = article.find('h2').text d['content'] = article.find('p').text news.append(d) return news def home(request): news = ratopati() + news24() random.shuffle(news) return render(request, 'aggregator/index.html', {'articles': news}) -
Can we run a voice assistant in django template?
I have made a django website and I am rendering a template with html animation in front , linked to css. Now I want that when my template opens my python script of the voice assistant also starts executing . is is it possible? -
how to solve 413 "413 Request Entity Too Large" on elasticbeanstalk Django project
I am getting this error while uploading file of size larzer then 1MB and i am not able to configure nginx for Django project(Python) how to default file uploading size. -
Uncaught ReferenceError with javascript
I'm trying to use a variable passed from my Django view to a html's javascript. It reads the variable fine but whenever I use the variable to process my function it just shows uncaught reference error the variable is not defined. As shown in the image below, this shows up. My function's code from view.py and the javascript code for this part: userobj = request.session.get('uid') list = request.session.get('roles') avpath = "avatar/"+ userobj['localId'] +".jpg" avpath = pyrestorage.child(avpath).get_url(None) print(userobj) return render(request, 'dashboard/sidebar.html', {"lid": userobj['localId'],"dp": avpath,"email": userobj['email'],"roles": list }) <script> var firebaseConfig = { apiKey: "", authDomain: "", databaseURL: "", storageBucket: "", 'measurementId': "", }; firebase.initializeApp(firebaseConfig); function uploadimage(){ var storage = firebase.storage(); var file=document.getElementById("files").files[0]; var storageref=storage.ref(); var x = {{lid|safe}}; var y = x.concat(".jpg"); console.log(y); var thisref=storageref.child("avatar").child("avatar.jpg").put(file); thisref.on('state_changed',function(snapshot) { console.log('Done'); }, function(error) { console.log('Error',error); }, function() { // Uploaded completed successfully, now we can get the download URL thisref.snapshot.ref.getDownloadURL().then(function(downloadURL) { console.log('File available at', downloadURL); document.getElementById("url").value=downloadURL; alert('uploaded successfully'); }); }); } </script> -
django apache2 settings on ubuntu 20 for intranet access
I can't seem to get my django site to be accessible outside of development. I have looked at countless tutorials and they all say the same thing, which I have tried. nevertheless, it doesn't work. here is what I have ubuntu 20.04 installed in a virtual machine (an openstack instance) this is on an intranet that I can access at work or through a vpn I installed apache2 created a virtual host conf file tested it with a dummy page -- it worked installed djano and a few other items that most tutorials mention made my demo default django app collected static files to myproject/static enabled mod_wsgi modified my virtual host conf file like this (using the real server name instead of "example.com"): (my project is located at /home/.../myproject) <VirtualHost *:80> ServerAdmin [email] ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com DocumentRoot /home/.../myproject ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so Alias /static /home/.../myproject/static <Directory /home/.../myproject/static> Require all granted </Directory> Alias /media /home/.../myproject/media <Directory /home/.../myproject/media> Require all granted </Directory> <Directory /home/.../myproject/myproject> <Files wsgi.py> Require all granted </Files> </Directory> WsGIPassAuthorization On WSGIDaemonProcess myproject python-home=/home/.../myproject/myprojectenv python-path=/home/.../myproject> WSGIScriptAlias / /home/.../myproject/myproject/wsgi.py WSGIProcessGroup myproject </VirtualHost> I know there are two documentroots there. I tried both (but not … -
Django & GoLang: Is it possible to use GoLang with Django and python backend to serve api?
Hey guys i am currently developing an app with django backend, but heard about the problems dealing with concurrent requests. i want to know whether as our requirements increases, whether it will be possible to combine golang which can deal with concurrency a lot better than python and also keeping the robust django framework. Is it possible to serve API's using GoLang and Django working together? Thank you. -
Null value when send Post data using Ajax Jquery in Django
I am trying to makes pagination in django, i need some value (pagesNumber,SearchWord,Categories) to makes some query work ,but i cant get my post data from ajax jquery.I have succeeded in running jquery This my code CDN <script src="{% static 'plugins/jquery/jquery.min.js' %} "></script> <!-- jQuery UI 1.11.4 --> <script src="{% static 'plugins/jquery-ui/jquery-ui.min.js' %} "></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://code.jquery.com/jquery-3.6.0.slim.min.js" integrity="sha256-u7e5khyithlIdTpu22PHhENmPcRdFiHRjhAuHcs05RI=" crossorigin="anonymous"></script> scripts $(document).ready(function () { $('#submits li').click(function () { var a = this.id; linkUrl = 'library/postNewRA/71/' + a + '' alert(linkUrl); $.ajax({ type: 'POST', url: linkUrl, data: { 'pages': "testValue", csrfmiddlewaretoken: '{{ csrf_token }}' }, dataType: jsonp, success: function (result) { window.console.log('Successful');//I CANT GET THIS MESSAGES TOO }, error: function () { window.console.log('Error!');//I CANT GET THIS MESSAGES TOO } }); }); }); views.py def postNewRA2 (request,raID,page): pages = request.POST.get('pages',None) # this result "None" return JsonResponse({"pages":pages}) urls.py path('postNewRA/<int:raID>/<int:page>',views.postNewRA2,name = "postNewRA2"), -
How to perform simple raw query in django
I am trying to connect my django project with phpmyadmin, so far I am following this article: https://python.plainenglish.io/connect-django-with-database-43f1965565e0 and add this line in __init__.py: import pymysql pymysql.install_as_MySQLdb() and then success to connect it. But I am confuse how to perform a simple raw query like Select * from mydata. is there a guide that can I follow step by step -
Using TinyMCE 5 with Django admin TabularInline
I am trying to apply TinyMCE (preferably in inline mode) to my Django TabularInline forms. I have tried to use TinyMCE inline mode, which would be the best solution to my problem, but it only works on div or p, therefore it might not be suitable to use for CharFields/TextFields created by Django. Then I've tried applying it without using TinyMCE inline mode, The setup was successful, but the rich text editor created is disabled and I am not able to type anything onto it. After some investigation, I've found out that the iframe created by TinyMCE, which contains the rich html text, is not properly initialised by TinyMCE. Usable Editor: <iframe id="id_model" frameborder="0" allowtransparency="true" class="tox-edit-area__iframe"> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="stylesheet" type="text/css" id="mce-u0" href="./static/tinymce/skins/ui/oxide/content.min.css"> <link rel="stylesheet" type="text/css" id="mce-u1" href="./static/tinymce/skins/content/default/content.min.css"> </head> <body id="tinymce" class="mce-content-body " data-id="id_model" contenteditable="true" spellcheck="false"> </body> </html> </iframe> Not Usable Editor (In TabularInline): <iframe id="id_model" frameborder="0" allowtransparency="true" class="tox-edit-area__iframe"> <html> <head> </head> <body> </body> </html> </iframe> Below is the code used for creating said editor: (TinyMCE5, Django3.1) inlines.js tinymce.init({ selector: '.field-choice > textarea', plugins: [ 'advlist autolink lists link image charmap print preview anchor searchreplace visualblocks code ', 'fullscreen insertdatetime media table paste code codesample … -
Signal is not saved Django
I want to save the instance "code_nc" that contains the id that is created by means of a signal but does not save class NoConform(BaseModel): no_conform = models.CharField(max_length=1500, verbose_name='No Conforme') origin = models.CharField(max_length=30, verbose_name='Origen', choices=OriginNoconform.choices) correction = models.CharField(max_length=500, verbose_name='Corrección') treatment = models.CharField(max_length=30, default='Abierto', verbose_name='Estado', choices=TreatmentNoConform.choices) assigned = models.ForeignKey(Process, verbose_name='Proceso', on_delete=models.CASCADE) actions = models.CharField(max_length=20, verbose_name='Plan de Acción') code_nc = models.CharField(max_length=20, verbose_name='Código') response_nc = models.CharField(max_length=150, verbose_name='Responsable') evidence = models.FileField(upload_to='no_conform/%Y%m%d', max_length=200, verbose_name='Evidencias Complementarias', null=True, blank=True) date_event = models.DateTimeField(verbose_name='Fecha y Hora de Ocurrencia', null=True, blank=True) nc_resume = models.CharField(max_length=150, verbose_name='Defecto', null=True, blank=True) def __str__(self): return f'{self.nc_resume}, {self.id}' class Meta: db_table = 'No_Conform' verbose_name = 'No_Conform' verbose_name_plural = 'No_Conform' @receiver(post_save, sender='noconform.NoConform') def post_save_function(sender, instance, **kwargs): seq = instance.id year = datetime.now ().strftime('%Y') instance.code_nc = 'NC' + year + str (seq) def save(self, force_insert=False, force_update=False, using=None, update_fields=None, *args, **kwargs): user = get_current_user() if user is not None: if not self.pk: self.user_creation = user else: self.user_updated = user return super(NoConform, self).save(*args, **kwargs) -
Does transaction.atomic cover the called function too?
I'm working with Django / Celery and I would like to know if transaction.atomic on my create function cover also the called function (createUserTenant) too this is an example (as you can see i'm calling createUserTenant whiche contains some queries) : @transaction.atomic def create(self, request): formSerializer = CustomUserSerializer(data = request.data) if formSerializer.is_valid(): NewUserRecord = formSerializer.save() if createUserTenant.delay(NewUserRecord.id, connection.schema_name): return Response(TeamSerializer(Team.objects.all(), many=True).data, status = status.HTTP_201_CREATED) return Response(formSerializer.errors, status.HTTP_400_BAD_REQUEST) As you can see I have some transactions here @shared_task def createUserTenant(userid, current_schema): state = True try: with schema_context(current_schema): addUserInTeam = Team.objects.create(user = CustomUser.objects.get(pk=userid)) with schema_context('public'): userInQuestion = CustomUser.objects.get(id=userid) # create your first real tenant tenant = Client( schema_name=str(userInQuestion.username), name=userInQuestion.first_name + '_' + userInQuestion.last_name, paid_until='2014-12-05', on_trial=True) tenant.save() # migrate_schemas automatically called, your tenant is ready to be used! # Add one or more domains for the tenant domain = Domain() domain.domain = str(userInQuestion.username) + settings.BASE_URL # tx.domain.com domain.tenant = tenant domain.is_primary = False domain.save() except: state = False return state -
Celery, relation "x_x" does not exist
Issue with Celery during the query This is my code : from apps.teams.models import Team @shared_task @transaction.atomic def createUserTenant(): addUserInTeam = Team.objects.create(user_id = 1) this is the error : return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: relation "teams_team" does not exist LINE 1: INSERT INTO "teams_team" ("user_id") VALUES (1) RETURNING "t... Since every thing is OK when move the same query to my views it works fine but in celery -
How does a user stay signed in when accessing a class based view?
I'm currently implement Microsoft Login using Graphs. Using the code below, I am able to navigate to different parts of the website while staying in: context = initialize_context(request) user = context['user'] return render(request, 'Login/newclaim.html/', context) How do I implement this is a Class Based View? I am currently using django-tables2 to generate a datatable using this view: Views.py: from django_tables2 import SingleTableView from .models import SaveClaimForm from .tables import ClaimsTable class ClaimListView(SingleTableView): model = SaveClaimForm table_class = ClaimsTable template_name = 'login/existingclaims.html' -
Updating static files of docker volume
I have a Django website running in a docker image in my server, I need to update my static files without changing anything else, can I run a dockerfile just with that command or do docker exec COMMAND for that? What is the best practice in this case? If I run my dockerfile again, all the steps are in the cache memory and if I put the option of no-cache I am afraid that it will overwrite my media volume again, where I have images of the users. I think I have tried once without the cache but it did not update my volume of the static files. RUN python manage.py collectstatic --no-input --clear That is the command I think I need to run, but I am not sure if it works. -
The modal does not work when executing the following code and I can not type my username and password
In this code,i can not type username and password when i click on login button,The modal form is displayed but not accessible and the black screen is blurred. This project is written for Django. If I log in from my page, there is no problem, but I tried any method this way, but I could not fix it. The form starts from the {% else %} part and continues to the {% endif %} part. {% load static %} <!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", shrink-to-fit='no'> <title>{% block title %}XXX{% endblock title %}</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> </head> <body> <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <a class="navbar-brand" href="{% url 'home' %}">XXX</a> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarSupportedContent"> <ul class="navbar-nav mr-auto"> <li class="nav-item active"> <a class="nav-link" href="#">YYY <span class="sr-only">(current)</span></a> </li> {% block news %} <li class="nav-item active"> <a class="nav-link" href="{% url 'news_list' %}">ZZZ <span class="sr-only">(current)</span></a> </li> {% endblock news %} <li class="nav-item active"> <a class="nav-link" href="#">AAA <span class="sr-only">(current)</span></a> </li> </ul> <form class="form-inline my-2 my-lg-0"> <input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search"> <button class="btn btn-outline-success my-1 my-sm-0" type="submit">Search</button> </form> </div> <div class="d-flex flex-column flex-md-row … -
how to access the id of a ManyToManyField object?
my models: class Aula(models.Model): nome_aula = models.CharField(max_length=255) descricao_aula = models.TextField() ... def __str__(self): return self.nome_aula class Modulos(models.Model): numero_modulo = models.CharField(default="Módulo 1",max_length=400) aulas = models.ManyToManyField(Aula) def __str__(self): return self.numero_modulo my views: def aulasdomodulo(request, id): mod = get_object_or_404(Modulos, pk=id) aulas = mod.aulas.all() return render(request, 'wtic/aulasdomodulo.html', {'aulas':aulas, 'mod':mod}) def conteudodaaula(request, id): mod2 = get_object_or_404(Modulos, pk=id) aula = mod2.aulas.all() ... return render(request,'wtic/conteudo_aula.html', {'aula':aula}) my html where it shows the objects assigned that module accesses them {% for aula in aulas %} {{aula.nome_aula}} <a href="/aula/{{aula.id}}">Acessar</a> {% endfor %} but when I try to access classes I get it how can i access these objects one per page? -
Python Django, Convert Image object to File object
so basically i am trying to convert PIL Image object to File object so django can process it, this is what i have tried so far in views.py: if request.method == 'POST': title = request.POST.get('title','') fil = request.FILES.get('fil') img=Image.open(fil) img = img.resize((500,500)) img_bytes=io.BytesIO() img.save(img_bytes, format='PNG') img = io.TextIOWrapper(img_bytes) pt = Pt.objects.create(title=title,fil=img) basically this will return an error when trying to upload an image: -
tuple' object has no attribute 'is_valid'
I'm just new at coding and I tried to create a user registration and watch the tutorials on youtube, I followed all the steps but suddenly got an error in views.py and this is the message error I got from django.contrib.auth.forms import UserCreationForm from django.contrib import messages # Create your views here. from fyeah import f def register(request): if request.method =='POST': form = UserCreationForm(request.POST), if form.is_valid(): username = form.cleaned_data.get('username') messages.success(request, f'Account created for {username}!') return redirect('I-grade-home') else: form = UserCreationForm() return render(request, 'users/register.html', {'form': form})``` this is where my error appears ``` if form.is_valid():``` -
Django push notifications: InvalidRegistration with correct registration_id
I'm trying to send push notifications with my Django App and the library django-push-notifications to specific Android devices using FCM. I always get the same error: {'multicast_id': 7577544316157180554, 'success': 0, 'failure': 1, 'canonical_ids': 0, 'results': [{'error': 'InvalidRegistration', 'original_registration_id': <token>}]} I'm using a registration_id provided to me from an actual Android Device. I've tested that registration_id using the Firebase dashboard to send a test message and it works perfectly there. But my Django request never works. Is there anything else I'm missing from configuration? Do I need to enable something else to be able to send the push from besides the test tool of Firebase? -
Django multiple user roles in Admin panel
I am trying to build an electronic information system for one teacher and students. Using the tutorial shown here: https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html , in my models.py I have implemented the student and teacher models this way: class User(AbstractUser): is_student = models.BooleanField(default=False) is_teacher = models.BooleanField(default=False) class Student(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) f_name = models.CharField(max_length=20) l_name = models.CharField(max_length=30) parent_tel_numb = models.CharField(max_length=13) parent_f_name = models.CharField(max_length=20) parent_patronimic = models.CharField(max_length=30) parent_l_name = models.CharField(max_length=30) group = models.ForeignKey(Group, to_field='id', on_delete=models.SET_NULL, blank=True, null=True) class Teacher(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True) In settings.py I have added AUTH_USER_MODEL = 'main.User' Meanwhile, I am not sure about the proper way to register these models in admin.py. Do I need to register all of them just as basic models? For now I have only registered the User model: from django.contrib import admin from .models import User admin.site.register(User) After entering the Admin panel of my app I noticed that the User model is not located in AUTHENTICATION AND AUTHORIZATION section, but is in the MAIN section instead. Please, can someone suggest what is the proper way to implement this? I have just started learning Django and am really new to this -
PostgreSQL full text search weight/priority
I am using Full Text Search in PostgreSQL through Django. I want to associate weights to searchterms. I know it is possible to associate different weights to different fields, but i want to have different weight on searchterms. Example: from core.models import SkillName vector = SearchVector( "name", ) search = SearchQuery("Java") | SearchQuery("Spring") search_result = ( SkillName.objects.all() .annotate(search=vector) .filter(search=search) .annotate(rank=SearchRank(vector, search)) .order_by("-rank") ) for s in search_result.distinct(): print(f"{s} rank: {s.rank}") And now i want "Java" to be more important than "Spring" and get ranking accordingly. I guess i could do 2 different searches and multiply the ranks with factors, but is there a better way ? Is it really that weird to want to associate different priority to searchterms ? Generated SQL for reference, i honestly dont think this is possible in Django right now anyway and we might need the help of a PostgreSQL-guru. SELECT DISTINCT "core_skillname"."id", "core_skillname"."name", to_tsvector(COALESCE("core_skillname"."name", '')) AS "search", ts_rank(to_tsvector(COALESCE("core_skillname"."name", '')), (plainto_tsquery('Java') || plainto_tsquery('Spring'))) AS "rank" FROM "core_skillname" WHERE to_tsvector(COALESCE("core_skillname"."name", '')) @@ (plainto_tsquery('Java') || plainto_tsquery('Spring')) ORDER BY "rank" DESC;``` -
Unable to translate timezone for Django
I am following the polls tutorial. " While you’re editing mysite/settings.py, set TIME_ZONE to your time zone. ... TIME_ZONE='UTC' " I tried 'UTC-08:00' [per my pc's timezone] but that gave me an error. I viewed the link in the tutorial for a list of timezones, and found mine stated in the following way: US +433649−1161209 America/Boise Mountain - ID (south); OR (east) Canonical −07:00 −06:00 I am unsure of how to translate the above into an input for Django. -
How to solve a post request error on django
I encountered certain post request error on django. When I click on the form submit button the error pops up stating that django can't find the page I'm asking for. Please I want to know where I'm getting it wrong because I'm still a beginner in django. def account_register(request): if request.user.is_authenticated: return redirect('account:dashboard') if request.method == 'POST': registerForm = RegistrationForm(request.POST) if registerForm.is_valid(): user = registerForm.save(commit=False) user.email = registerForm.cleaned_data['email'] user.set_password(registerForm.cleaned_data['password']) user.is_active = False user.save() current_site = get_current_site(request) subject = 'Activate your Account' message = render_to_string('account/registration/account_activation_email.html', { 'user': user, 'domain': current_site.domain, 'uid': urlsafe_base64_encode(force_bytes(user.pk)), 'token': account_activation_token.make_token(user), }) user.email_user(subject=subject, message=message) return HttpResponse('registered succesfully and activation sent') else: registerForm = RegistrationForm() return render(request, 'account/registration/register.html', {'form': registerForm}) urlpatterns = [ path('account/register', views.account_register, name='register'), path('activate/<slug:uidb64>/<slug:token>)/', views.account_activate, name='activate') ] urls.py(main django app) urlpatterns = [ path('', include('account.urls', namespace='account')), ] views.py def account_register(request): if request.method == 'POST': registerForm = RegistrationForm(request.POST) if registerForm.is_valid(): user = registerForm.save(commit=False) user.email = registerForm.cleaned_data['email'] user.set_password(registerForm.cleaned_data['password']) user.is_active = False user.save() current_site = get_current_site(request) subject = 'Activate your Account' message = render_to_string('account/registration/account_activation_email.html', { 'user': user, 'domain': current_site.domain, 'uid': urlsafe_base64_encode(force_bytes(user.pk)), 'token': account_activation_token.make_token(user), }) user.email_user(subject=subject, message=message) return HttpResponse('registered succesfully and activation sent') else: registerForm = RegistrationForm() return render(request, 'account/registration/register.html', {'form': registerForm}) -
How to return single object as a json response inside django function?
I just want to get a single object of User model as a json response. I couldn't figure out how can i do that.. right now i'm getting an error that 'User' object is not iterable Here is my function: def some_view(username_to_toggle): print(username_to_toggle,"User to togle") user = User.objects.get(username__iexact=username_to_toggle) print(user,"User object") user_json = serializers.serialize('json', user,many=False) print(user,"User json") return HttpResponse(user_json, content_type='application/json') -
Neovim for Django: metaclasses are not recognized
Image of Error Message in Neovim I have been trying to configure my neovim for django development and everything seems fine except for this issue I am having with fields in metaclasses. the image provided gives a snapshot and the code is as follows: class UserSerializer(serializers.ModelSerializer): snippets = serializers.PrimaryKeyRelatedField(many=True, queryset=Snippet.objects.all()) the linting error indicates that it cannot access member objects for the Snippet class. I am using coc-pyright with default settings. I tried playing around with the settings by enabling pylint and installing pylint-django in my project as a dev dependency but that was unable to resolve the issue. How would I fix this issue? Does anyone have a recommended setup for Django development in nvim?