Naynesh
Create an application that has two apps. 1. User with user and Post model User : first_name, last_name, email, password, username Post : user, text, created_at, updated_at Foreign key relationship exists between User and Post on Model level not on Database level. 2. Products app with Product model. Product : name, weight, price, created_at, updated_at Both of the apps should use two different databases. Create a form that an authenticated user can use to create a post. Note: Register all models on admin dashboard.
Anonymous
Hi buddies I am beginner to Django, anyone can help me how to use Mongodb Database on Django
cj
Hi buddies I am beginner to Django, anyone can help me how to use Mongodb Database on Django
don't do that, Django is not made to work with NoSQL databases, but yes you can force it to use them, just google for it, you'll find answers in the first results you can be sure to have some headaches tho 😉
Anonymous
PostgreSQL
Thanks again. Do you mind recommend me any books or sites which are best for you?
cj
Thanks again. Do you mind recommend me any books or sites which are best for you?
here you have: google.com and duck.com definitely the best sites
Anders (izzno / gooood) 🇳🇴
startpage.com
Anders (izzno / gooood) 🇳🇴
^ still not dead ;)
Pogos
Hi, i have macbook. And i wanna create django project, but terminal showed me message "command not found: django-admin"
Pogos
Sorry for my English )
Doragonsureiyā
Hi, i have macbook. And i wanna create django project, but terminal showed me message "command not found: django-admin"
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Pogos
Did you install django, the macbook part is irrelevant
Yep, i write in terminal pip3 inastall django
Pogos
no
George
Then you cant use django-admin, as simple as that
cj
learn how to use virtual environments
George
Let me 🦆 DuckDuckGo that for you: 🔎 django-admin not recognized
Pogos
Guys! One more question. I checked version django (terminal show) 1.11.28 Is it normal ?
Eddie
I have data in json that has to be displayed in html table how can i dynamically add another column to that html table and fill it with values based on a condition between two other columns already in the table...is this possible and any advice on how to approach this
cj
Guys! One more question. I checked version django (terminal show) 1.11.28 Is it normal ?
if you installed that version, yes, but chances are that you're using a very old Python version
Pogos
How update vesrion ?
Pogos
)
cj
How update vesrion ?
learn how to use virtual environments
George
And pip
cj
And pip
IIRC he said he's using a Mac, so chances are that he's using Python 2.7 🤷🏻‍♂️
Supernoobuser
What course of Django related with MVC do you recommend me
Vivek
Someone pls tell me , What is list view,detail view
Fabian
Someone pls tell me , What is list view,detail view
its a generic view in Django, u just past it a model, template and form, List view works for retreiving a list of items of a given model from the BD, detailed, to retrieve details of just one item
cj
Someone pls tell me , What is list view,detail view
it's explained in the documentation, did you read it?
Chiranjeevi
I am creating a social media clone. I want to create a post using modelform. My models are Post, PostImage, Comment. A post can have multiple postimages. How do i create a post using modelform?
Anonymous
I read one of conversation and it said mongodb can't be used with django...basically why?like does it work with sql base only or what?
Muflone
Maybe with this https://nesdis.github.io/djongo/
Chiranjeevi
class PostForm(models.ModelForm)
I get it but how to create all the post images when creating a post. My postimage has manytoone relationship with post, so for one post i may have to create upto a p postimages.
Chiranjeevi
i have been subclassing modelform and writing code in meta inner classes (only configuration changes)
Chiranjeevi
ModelForm will do lot of job for you 😊
Ok, then i will spend sometime reading the documentation more closely on how to do it. Thanks.
Aleksandr
Hey, guys. Anyone used multiple forms like FormView class?
Ярик
hey guys, need your help i have 2 objects: — 1st one — Model1: number - charfield date - datefield Model2: number - foreignkey(Model1) item - charfield quantity - int These 2 are created by inline form — 2nd one — Model3: invoice - charfield invoice_date - datefield number - foreignkey(Model1) Model4: invoice - foreignkey(Model3) item - foreignkey(Model2) quantity - int they have to be created by inlineformset too the logic is following: 1) i create Model1 post where i add Model2 instances (as many as i need) using formset 2) i have to create Model3 post based on Model1 adding Model2 instances and giving them quantity 3) on create - for each Model2 item, the quantity has to be substracted by the quantity of chosen item in Model4 i know that description is big, but i can realize how to implement in and make it work properly if someone know how to do it, help me pls
Anonymous
Does anyone have django course
Anonymous
Trying to create slide image using bootstrap but I want the image to be uploaded from the admin panel have try using foreignkey but is not given what I want please help
Ярик
how to write an update_or_create method for that model so that if an item exists - increase its quantity? class ItemSet(models.Model): dogovor = models.ForeignKey(Dogovor, related_name='itemset', on_delete=models.CASCADE) item = models.ForeignKey(Items, related_name='itemset', on_delete=models.CASCADE) quantity = models.PositiveIntegerField()
Doragonsureiyā
Does anyone have django course
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Eleven
I want user to first change his password when logging in for first time. Till it changes password i don't want him to access any other urls. How to do it?
Eleven
add a flag to your custom user model
I have done that when user logins for first time i redirect him to change password url but until it does that he cannot access any other urls of the site.
cj
How to stop access to other urls of site until user changes password?
overwrite LoginRequiredMixin and add your customized code
George
How to stop access to other urls of site until user changes password?
I would invalidate his login credentials, don't know how
v
Hi guys please suggest me tutorials videos to learn django as a beginner
Doragonsureiyā
Hi guys please suggest me tutorials videos to learn django as a beginner
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Please guys ,how can Iink my website to my telegram channel
Anonymous
How can I add multiple images to a model in admin and use the model in slideshow with bootstrap please help
Julio
Hi people anyone knows how to display in Django admin model create info from another model?
Julio
I need to display a variable for a calculator
Gil
May be your interest https://docs.djangoproject.com/en/3.0/topics/db/queries/#lookups-that-span-relationships
Gil
How can I add multiple images to a model in admin and use the model in slideshow with bootstrap please help
Two thinks: - save data for images or location. Backend and db - show slides, html5/js I think better to play with media, but will be open to all public If must be private images, you will need api
Gil
Hi guys please suggest me tutorials videos to learn django as a beginner
The best of the best of the best,https://docs.djangoproject.com/en/3.0/intro/tutorial01/ The brain needs to rest, take some days to do all tutorial