Anonymous
For example
Anonymous
So how I can add to the follows
Anonymous
Follower.objects.create(user=request.user,follows=anotheruser)
Anonymous
Anonymous
it says use follows.set
Mohit
follower=Follower.objects.create(user=request.user)
follower.follows.add(anotheruser)
Mohit
Here the many to many field should be to User model
Mohit
models.ManyToManyField(User)
Anonymous
Thanks bro
Anonymous
I think that will solve my problem
Mohit
✌️
Prosto
Hello djangers! There is an interesting thing in products category layout - each 5 or 6(doesn't matter) product_card comes with big picture. Any help with this pls!
Michael the wolf 🐺
can we inherit variables from parent template?
Sourav
How to add a non model field to django rest serializer ?
ɱσσɳ
Mihir
django.db.utils.IntegrityError: could not create unique index "auth_user_email_1c89df09_uniq"
Mihir
Key (email)=() is duplicated.
Vera
How past into MinValueValidator exept 0.0 value other models. Something like: validators=[MinValueValidator(auction.price)] ? 🙂
Now it look like this:
class Bid(models.Model):
auction = models.ForeignKey(Auction, on_delete=models.CASCADE)
user = models.ForeignKey(User, on_delete= models.CASCADE, related_name='bids')
price = models.DecimalField(max_digits=10, decimal_places=2, validators=[MinValueValidator(0.0)])
محمد دلشاد
sugget me with some of open source projects on django with class based and generic views
also if having any idea then for React+Django complete site
Pra
source to learn django from scratch pls
Dear there are so many youtube channels but they do properly explain things ..but there is a site called django girls where u will learn step by step procedures , installation , few command in cmd which you will learn , and they will guide u step by step .in starting u will feel confusing but as things u will do u will get to all of them ..and will end up making an app .
Zokir
.
++
What is meaning of ++ here
Zokir
Богдан
how use 2 classes in one model admin?
class InsuranceAdmin(admin.ModelAdmin):
It works
class InsuranceAdmin(ImportExportModelAdmin, TranslationAdmin):
it doesn’t work
Near
How to solve
can't drop 'column name' ; check that column/key exists
Mehmet
Богдан
Hassan
Where can i learn this?
I have csv files which contains data i have developed models.py with foreign keys now i want to dump these csv files into database using django ORM and through python seprate script and want to dump the data with respect to the foreign keys connections
Hassan
I have say movies data in csv files
Yes
Hi everyone.. please I need some help .... i am trying to deploy my project ( appweb - website- gestion program) on my vps ( centos 7 + LAMP + CENTOS WEB PANEL ) but it was impossible please anyone know how can I do it? Many thanks
cj
Dexter
Are there any example for stacked bar chartjs in Django with epoch in one of the field
Dexter
Thanks like I didn't try
Dexter
It
Chandraprakash
Guys any is there any validator which show error when data is not unique
Umesh
Umesh
Umesh
https://docs.djangoproject.com/en/3.1/ref/models/constraints/
Chandraprakash
Chandraprakash
Basically I m checking the value from another table if the value I posted matches from the value from the database it should pass else it should return error message
Umesh
Chandraprakash
Okay so how to do that
Chandraprakash
Is there any article of something I can refer to
Umesh
https://docs.djangoproject.com/en/3.1/topics/db/queries/
Anonymous
Mayur
Hello guys i want help, i m getting this error in django when i run command
Python manage.py collectstatic
Error found - STATIC_ROOT = os.path.join(BASE_DIR, 'static')
NameError : name 'os' is not found
And i am already import os
cj
cj
well 🤷🏻♂️ if you don't help us to help you, nothing can be done
Mayur
posting media content isnt allowed in this group
Yash
I have created a for loop template , but when I run , nothing is displayed on webpage
Yash
Can anyone help ?
ɱσσɳ
Mayur
Thanks for replying, i am already used 3.1.1 version
ɱσσɳ
cj
Yes
what steps?
For example I was got several tutorials, example ..the steps when I type run server mydomain.com:8000/admin I can see DJango panel administration on the browser.. after when I am doing the setup Django within Apache... and go to on the browser to check domain.com/admin nothing show me
cj
Dexter
SELECT date_trunc('day', to_timestamp(ts)) as "Day",host,COUNT(host) from http GROUP BY(date_trunc('day', to_timestamp(ts)), host) ORDER BY(date_trunc('day',to_timestamp(ts))) DESC;
Dexter
how do i write it it in django orm
Doragonsureiyā
how do i write it it in django orm
So, why don't you do it yourself first? and when you have an issue with the Python code you wrote, come back here and people will help you 😉
cj
Yes
Ok. I can build both option and setup that domain with nginx
Yes
I tried that option and I couldn't deploy it neither
Dexter
models.otp.objects.exclude(host='0').filter(Q(ts__gte = start_ts_epoch) & Q(ts__lte = end_ts_epoch)).values('host','ts').annotate(Count('host')).order_by('-host__count')[:3]
Mayur
cj
still not working
why don't you share your settings.py file? so you can get a straight help
Dexter
'''models.otp.objects.exclude(host='0').filter(Q(ts__gte = start_ts_epoch) & Q(ts__lte = end_ts_epoch)).values('host','ts').annotate(Count('host')).order_by('-host__count')''' I wanted day wise but i am not getting it can anyone help me
Yes
cj
ɱσσɳ
still not working
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'app_name/static')]
STATIC_ROOT = os.path.join(BASE_DIR, 'app_name/assets')
may be you can try this way
ɱσσɳ
still we don't know problem, we're assuming