Alex
Aryan
Axmadullo🦁
path('courses/subject/about/', anotherView),
path('courses/subject/info/<int:pk>/', anotherView),
.
Guys, are u trolling
Aryan
.
.
Its just wasting time
.
Read rules firstly and use fcking pasta
Aryan
.
Aryan
anything?
.
?
Aryan
huh
Axmadullo🦁
.
.
Omg, read rules
.
!paste
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Axmadullo🦁
// views.py
def dataSubjects(request):
subjects = '',
error = ''
if Subject.objects.all().count() == 0:
error = 'No subjects'
else:
subjects = Subject.objects.all()
return render(request, 'subject.html', {
'subjects': subjects,
'error': error,
})
def anotherView(request, pk):
subjects = Subject.objects.all(pk)
return render(request, 'about.html', {
'subjects': subjects,
})
urls.py
from courses.views import dataSubjects, anotherView
urlpatterns = [
path('courses/subject/', dataSubjects),
path('courses/subject/about/', anotherView),
path('courses/subject/info/<int:pk>/', anotherView),
]
Axmadullo🦁
// views.py
def dataSubjects(request):
subjects = '',
error = ''
if Subject.objects.all().count() == 0:
error = 'No subjects'
else:
subjects = Subject.objects.all()
return render(request, 'subject.html', {
'subjects': subjects,
'error': error,
})
def anotherView(request, pk):
subjects = Subject.objects.all(pk)
return render(request, 'about.html', {
'subjects': subjects,
})
urls.py
from courses.views import dataSubjects, anotherView
urlpatterns = [
path('courses/subject/', dataSubjects),
path('courses/subject/about/', anotherView),
path('courses/subject/info/<int:pk>/', anotherView),
]
it's here
Axmadullo🦁
my code
Axmadullo🦁
Where may be my mistake?
Akhmad Osmanov
subjects = Subject.objects.all(pk) ????
Axmadullo🦁
Yes
Akhmad Osmanov
Subject.objects.filter()
Axmadullo🦁
I watch in video
.
Not fcking videos
Axmadullo🦁
Axmadullo🦁
And I learn Python Django by this course
Alex
Alex
not after or during
Axmadullo🦁
Axmadullo🦁
I have finished learning Python
Axmadullo🦁
And Start Leaning Django
Seth
hi guys, can you do a form autofill in django? to fill itself just by typing the pk?
Alex
!ALIEN
Hey guys, I have recently hosted Django applications on Azure.. With whitenosie, Azure is able to server css, js static file but not image file?
!ALIEN
Any idea why?
Manjunaath
Manjunaath
?
!ALIEN
Anonymous
class ProductDetailView(View):
def get(self: View, request, pk):
product = Product.objects.get(pk=pk)
return render(request, 'app/productdetail.html', {'product': product})
Anonymous
Get is not taking properly showing error
Anonymous
But Syntex is right
Alex
Ashutosh
I think remove view from second line
5P34R
def get(self: View, request, pk) self: ?
Anonymous
I removed view too but then also showing error
Ashutosh
Self also remove
Alex
Ashutosh
def get(request,pk):
Anonymous
Anonymous
But I didn't understand why not working
Ashutosh
Send the error msg which is showing on the terminal
Anonymous
Ok
Anonymous
Sending media is not allowed in the group
Doragonsureiyā
Sending media is not allowed in the group
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Anonymous
Hello, how can I give https access to Django Channels?
My website could not connect to the web socket. In fact, https only has this problem.
what's the solution?
Mixed Content: The page at 'https://fo.bar/ws/dashboard/' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://fo.bar/ws/dashboard/'. This request has been blocked; this endpoint must be available over WSS.
Javokhirbek
Hey everyone, my user serializer is not hashing the password? set_password is not working in my serializer. What do I have to do?
Hilariyus
Hey amigo's how to add login and register to an django project
Vicky
I have separate python code with multiple functions define in a class and I want to execute that code in Django .. how to do that ?
Arunkumar
[<name:Arun>,<name: Tony>,<name:Mike>]
Which type of data type is this in python?
And how to convert it into list?
Hilariyus
Aneesh
I am using mqtt paho. Is it possible to wait for the message without giving a time.sleep. when we I publish and wait for the return message
Сергей
is there way to customize model of any django molule, without copy the module to my poroject directory?
Nayan
Hi i have a form when i click on it everytime it is throwing me the error
str returned non string (type none )
It works fine at my development server but throws error on live server
Anyone can help ?
Anatolie
Hi, help me with smtp gmail django
Jasurbek
class Category:
title = models.CharField()
class Item(models.Model):
category=models.ForeignKey(Category, on_delete=?)
what can I do so when Category is deleted its title will be written on Item's category
Jasurbek
Alex
Asdf
Any good resources for django rest framework?