Anonymous
For example
Anonymous
So how I can add to the follows
Anonymous
Follower.objects.create(user=request.user,follows=anotheruser)
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.
Rodolfo
After django what to learn
Flask first > Then Django > Vue > React.
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 .
.
++
What is meaning of ++ here
Zokir
What is meaning of ++ here
It means “I am agree”
Богдан
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
how use 2 classes in one model admin? class InsuranceAdmin(admin.ModelAdmin): It works class InsuranceAdmin(ImportExportModelAdmin, TranslationAdmin): it doesn’t work
https://stackoverflow.com/questions/51215847/django-admin-use-importexportmodeladmin-and-markdownxmodeladmin-multiple
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
Dexter
Are there any example for stacked bar chartjs in Django with epoch in one of the field
Doragonsureiyā
Are there any example for stacked bar chartjs in Django with epoch in one of the field
Step 1: Open a browser Step 2: Write down https://google.com or https://duck.com and press Enter Step 3: In the search box write down the same words you asked here Step 4: Read the firsts results
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
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
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/
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
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
Yes
why was it impossible?
Because, when I do all the steps and the end on the browser the web is not load
cj
posting media content isnt allowed in this group
why don't you read the rules to know how to share your code?
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
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ā
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;
Please use Markdown to style your text/code: - Use a single back-tick: ` at the beginning and end of your code for single line code: print("hello world") - Triple back-tick ``` at the beginning and end of your code for multiple lines code: def hello(name): print(f"hello {name}") - Two asterisks * at the beginning and end to make words bold: hello - Two underscores __ at the beginning and end to make words italic: world
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 😉
Yes
why do you want to use Apache to deploy a Django project?
Well, I have Apache.. I mean the is the opcion to use only Apache or apache/nginx
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]
cj
I tried that option and I couldn't deploy it neither
here there's a good tutorial you can follow https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7
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
ɱσσɳ
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
cj
still we don't know problem, we're assuming
if he doesn't show his settings.py file; you're walking blindly 🤷🏻‍♂️
Yes
read the tutorial, it's explained there
Cool I gonna read and try it .. thanks let see