cj
or make another model of just an ImageField and make a ManyToOne relation to it
cj
https://docs.djangoproject.com/en/2.2/topics/db/examples/many_to_one/
Vachagan Muradyan
Thank you
Kaushal
I have a model named "mydatabase" which is related with "user" model using OneToOne. I have stored "password" and "username" in "User" model and "location" and "bloodgroup" in "mydatabase" model. Now I am creating profile in profile.html file. How can I send "username" and its consecutive "location" to profile.html? I am new to django so please guide me...
Vachagan Muradyan
Plese send me some projects that include that arrayfield
Vachagan Muradyan
If it is not hard for you
Kaushal
"Username" and its respective "location"
Vachagan Muradyan
Please send me direct example of that project
Vachagan Muradyan
In zip form
cj
🙄 I don't know if you're being serious with that
Vachagan Muradyan
I am too serious
Vachagan Muradyan
Please send me project that include that multiply image adding in model, dm, in zip form
cj
is google forbidden to use for you?
Anonymous
How to access mysql in Django?
cj
How to access mysql in Django?
Mohammad. Here you have a useful link: https://duckduckgo.com/?q=How+to+access+mysql+in+Django%3F
Vachagan Muradyan
I can,t find
S
How to access mysql in Django?
Dude,, it's default database comes with django
cj
you can use any other —supported— DB just by installing the proper driver/connector (and of course installing or having access to that DB engine/server)
drunktimelord
the default is SQLite
really? i thought it was mysql
drunktimelord
👀
Anonymous
the default is SQLite
What u think about Campo server to connect database
cj
Xamppp server**
also XAMPP is not a server
Doragonsureiyā
Thank you bro. It worked.
I'm not your bro, bro; we weren't hatched from the same egg 🐍🥚
cj
Xamppp server**
if you're thinking on using XAMPP and Django, you'd better stop right now
drunktimelord
what's the command for this
cj
So sqlite is good by default db
it's enough for simple things... depends a lot on what you want to do. take in mind that Django performs better —really better— with PostgreSQL
Pruthvi
Friends iam getting error as "windows djangwindowso admin is not recognized as an internal or external command"
cj
Friends iam getting error as "windows djangwindowso admin is not recognized as an internal or external command"
read the docs about built-in management commands, I've never seen that command, is it a custom one? 🤔
Pruthvi
Sry "windows 'django-admin' is not recognised as an internal or external command"
Pruthvi
Everytime iam getting this while cmd django-admin startproject
Pruthvi
Project name
cj
Sry "windows 'django-admin' is not recognised as an internal or external command"
make sure you're working on an active virtual environment and you have installed django on in before
Kaushal
again I want to search users using "location" which is in "mydatabase"model. I want to get the "username" and "email" of the users from "User" model which is connected to "mydatabase" using OneToOne. How can I do that?
cj
depends on what name you wrote to the field you're using to make the relation between the models
Kaushal
Okay I will try
Sushanth
Hello all
Sushanth
Can anyone suggest me good sources for learning django
Anonymous
https://www.justdjango.com/articles/build-an-api-with-django I just read Build an API with Django. Check it out here:
Doragonsureiyā
Can anyone suggest me good sources for learning django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Dextroleav
Can anyone suggest me good sources for learning django
First with techgram academy then with telusko nd thn with cleverprogrammer
Andrew
Ребята подскажите как снюхать class Post: ... category = models.ForeignKey('name', on_delete=models.PROTECT, verbose_name='Категория') class Category(models.Model): name = models.CharField(max_length=255) из класса Category в класс Post надо добавить name категории
Anonymous
Hi
Anonymous
How retrieve the saved form data in a webpage by using django?
Anonymous
Saved in database
Anonymous
How retrieve the saved form data in a webpage by using django?
In views.py 1) import yourModleName 2)get the objects from model datas=yourModelName.objects.all() return render(request,'templateName.html',{'datas':datas} 3) set it in your html template {% for data in datas %} <p>{{data}}</p> {% endfor %}
Aamin
Saved in database
I'd it's the database you know where your data is saved when the the form is saved. You yourself create the views which interact with forms to save the data onto the desired models. Backtrack from forms.py to views.py to find the models.py where the data is stored, query the required models to get the desired results.
Viktor
hello! has anyone worked with django-guardian or django-rules packages? which one is better?
Abhi
I want to make game of chess using Django.
Abhi
So It can be possible
Abhi
because i am new in Django
Сергей
hello, if I applied delete on queryset and termainate it by crt + c in shell befor it done and show result of deleted, deleted in this case any fk that deleted model realted or not?
Anonymous
What is the difference between OneToOneField and ManyToManyField anyone plz?
Tural
What is the difference between OneToOneField and ManyToManyField anyone plz?
https://stackoverflow.com/questions/25386119/whats-the-difference-between-a-onetoone-manytomany-and-a-foreignkey-field-in-d
🧩
Hi, who could help me? I have a problem. Only registered users can comment posts on site (for unregistered works, I commented it), but i don’t know what’s wrong with this one. My code: https://gist.github.com/aleksandrlozko/fa5b10e1368d89d1ac645b5cbf11e260
Андрей
Hi, anyone know how to exclude models description from swagger page degenerated by drf-yasg
🧩
request import from which lib?
🧩
doesn’t work