Jay
https://dpaste.org/iAq6R manager.py
z
Does anyone know how to show ads on django?
z
Not google ads but users will create their own ads.
Jay
show model
can you please share your views on this
Jay
TypeError: User() got unexpected keyword arguments: 'is_staff', 'is_active'
Jay
while creating superuser
Firdaus
fields and methods provided by AbstractBaseUser ==> https://docs.djangoproject.com/en/4.1/topics/auth/customizing/#django.contrib.auth.models.AbstractBaseUser
Jay
trying your tip
Jay
AbstractBaseUser provides those fields\
Jay
fields*
Андрей
Hello, tell me I use drf in my django project to display and use viewsets.ViewSet , but the path is not displayed in the Root Api, the paths are prescribed normally in drf-ysng, how can I fix it, I searched the documentation and did not find an answer
Georg
hello. How can I suppress None values in django templates ?
Georg
Are there any options like "suppress nones" or similar?
Samoiddin
Hi guys . I'm trying to setup my site from HTTP to HTTPS on AWS Elastic Beanstalk Can anyone help me ?
Mirco
Abhie
Georg
I have two models:
Master and Detail, where Master<—Detail
I can go like this: detail.master if detail is a single model instance
but how can I get this:
details.somemethod('master') to get a Queryset of Master objects ?
Yooo
Which one is best for django for learning
Coding blocks or durgasoft?
cj
Yooo
jaxx
How to group by foreignkey and show its values
Альберт
hi all! Has anyone made Ajax requests? I need the messages sent by me to load without refreshing the browser page
Irshod
hello. how to make html tabs dynamically using django?
Hyperboria
hello, im really desperate cant find solution.
{{ cl.queryset|dictsort:"button" }}
button is a foreign key for this model, but some objects has no button relations. so dictsort doesnt work. what can i do?
Doragonsureiyā
Mahmood
Hi everyone
I have a BaseImage class which is abstract class and have ImageField inside of it
What i wanted to do is override the default method inside the ImageField from the inherited classes
I didn't find anyway to do this
Mahmood
class BaseImage(models.Model):
def upload_image_to(instance, filename):
return get_upload_to_path(instance, filename)
def default_image():
pass
value = models.ImageField(
upload_to=upload_image_to,
default=default_image,
verbose_name=_("Image"),
blank=True,
null=True,
)
Irshod
What are you talking about?
I have for tabs in my template. each tab has its own title and body and when clicked on title only that tabs body should be displayed. I created a class to add content from admin panel so how to show it on template?
https://pastebin.com/5xF4eZ29
this html part
Tура
Hi, I use allauth Django to send mail verification, but there is delay on live version, locally everything is fine
Tура
Some domains like @outlook.nl and @outlook.be, are not receiving at all
Tура
Could you give suggestions please
Erick
Hi guys, so I have a django implementation and I need to implement charts.js in this project, so my user is AbstractUser, where I made the differentiation through groups, now to implement the charts.js I need to get the users of their certain group and list them. Could someone point me to a documentation or something that can help me? I thank you for this. And sorry for my English, I'm using Google translator.
JavaScript
cj
Daniel
Works!
cj
Works!
but there's no need to add an extra dependency when you already have everything you need in the framework
¯\_(ツ)_/¯
0x
gus .how to format the datetimefield time to yyy-mm-dd h:m:s in django model 
Nidhi
Hi, Can anyone help me debug Django code ?
Nidhi
I am facing errors in my project.
RRH
Ibrahim
@pytest.fixture
@pytest.mark.django_db
def auth_client():
def get_auth_user(cur_user=None):
client = APIClient()
user= Extended_User.objects.all()[0] if cur_user is None else cur_user
......
error :
RuntimeError: Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures
to enable it. ?
any help ?
Yooo
Anyone have durgasoft django course videos?
Maxim
MAHDI™
Hi, i want to make login and register in same page
Anyone have repository so i can use it?!
Ras
Hi guy.
I have these three models (I've summarize them):
class Tourist(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
class Etablissement(models.Model):
name = models.CharField(max_length=30)
class Arrival(models.Model):
tourist = models.ForeignKey(Tourist, on_delete=models.CASCADE)
place = models.ForeignKey(Etablissement, on_delete=models.CASCADE)
I want, for a Tourist, to have all his arrivals, per year. I've tried this:
def detailTourist(request, id):
touriste = Tourist.objects.get(id=id)
datas = Arrival.objects.annotate(year=TruncYear('arrival_date')).values('year').annotate(total=Arrival.objects.filter(tourist=touriste)).order_by()
but it give me an error: sub-select returns 19 columns - expected 1 (the arrival model has 19 field so i guest that's why it says 19.
So finnaly, how can I do it please ?
.
Hello guys
I was watching dinnes 7 hours django course and in the search part we couldn't see all rooms until we put icontains in the Room objects.filter()
Can anyone explain why?
And in order to search we put question mark followed by 'q'
In the url
Like this
<a href="{% url 'home' %}?q{{topic. name}} " >
Why did we do this and can i change the letter?
I want to learn Django in its details so please give best source for this
And forgive me for my bad English, thank you
Mike
Good evening all,
Can you please help me in understanding decimal widget i want the data to have preceeding with 2 zeros while export
Mike
Is it possible to give decimal places in decimal widget
Ray_Beast
Hi anyone knows how from current server to another we can create log files.
Ray_Beast
Or any reference
Doragonsureiyā
Nidhi
👑 Dharmzeey
👑 Dharmzeey
Mike
Mike
Decimal widget or DecimalField
I used decimal widget it works in exporting the data shows right in txt format but when opening in csv the decimal values are displayed in integer format
👑 Dharmzeey
👑 Dharmzeey
Georg
Hello. Since I added a field BinaryFIeld into my model I can't delete records from it anymore..
if I run delete I get this:
TypeError: cannot pickle 'memoryview' object
👑 Dharmzeey
.
T-Br
Hell everyone. I am a new to Django and i am going to start studying? what do you recommend me?
Erick
Hi guys, so I have a django implementation and I need to implement charts.js in this project, so my user is AbstractUser, where I made the differentiation through groups, now to implement the charts.js I need to get the users of their certain group and list them. Could someone point me to a documentation or something that can help me? I thank you for this. And sorry for my English, I'm using Google translator.
T-Br
anrays
Hello guys i need solver django channels and redis problem.,?
👑 Dharmzeey
No
Okay
That variable q (in views.py ) will hold the value for the key q that is sent from the browser (the html) which the keyword is sent as a get request.
Then rooms will hold the value for the returned queryset you get from filtering the Room object.
The filter function returns queryset of any room object that has the value q in it
Example
Say for instance
<a href="{% url 'home' %}?q={{topic. name}} " >
the first part is normal URL that you configured the second part after? Is the variable topic.name which the q will hold the value. Then the q is the accessed in the views.py.
So for views.py if the value of q that is sent from the html is "computer memory" then in the views.py when you accessed the q the value will also be "computer memory"
And when you perform the filter function, the Room will return the object the contains "computer memory" as a topic name.
But icontains flag looks up any object which has the keyword in it either partially or fully
If the q="computer" and in your models the topic is "computer memory" , the object will get returned because it contains computer in it ("computer memory")
Look up django docs for more and well explained info
.
My
I have a problem with statci files.
They raise 404 error what i shoul do
İremsultan
Hello,
I have a html template i want to code in django.
For now i need to take the header and footer parts and make images, css and js into static files.
I tried to do it but it does not quite work, can anyone help me with it? I would greatly appreciate if someone can fix my mistakes and send me the file
Ndubuisi
My
thank u i found whitenoise