Teutranian
problem was python manage.py shell is diffrent than django-admin shell
Mr. COwO2 Preis
owner.get("id")
doesn't work too.
Teutranian
what is the error?
Mr. COwO2 Preis
what is the error?
i have solved it now without the update method: https://www.vhinandrich.com/blog/saving-foreign-key-id-django-rest-framework-serializer worth to be noticed: this doesn't work if you use primarykeyrelatedfield instead of integerfield, wich was my first attempt
Teutranian
no idea of rest , it seemed to be a python error but it's ok if it's not
Devo
Hai all I'm new to django , I know react js , a little and I want to learn django . To pursue career in full stack web development.. please guide me with best django beginner's material.. devop tools to deploy and maintain the web app.. please it will very help ful for me
Fred
Somebody will say read the docs But that did not help me tho
Fred
Just start with some YouTube videos and proceed with projects
Fred
Can y’all please show off some projects you have developed with Django
Ice
Anyone runs his django with litespeed?
Atkhamov
Could you, please, send the link to me too?
Anonymous
Hello everyone, i am here to ask you (i searched in google before a lot but doesn't find anything) but i have a models.ImageFIeld but i would like that in my db everytime it saves a data, it saves the path to the file not only the name of the file saved by default with the .url attribute! thank you so much for your help!
The url attribute of the FileField should provide you with relative url to access the file (Depends on the storage class your using), if you're looking for the path of the file in your local file system see the FileField.path attribute: https://docs.djangoproject.com/en/3.1/ref/models/fields/#django.db.models.fields.files.FieldFile.path
@l3j@ndr0
Hello anyone have an example of the use of paypal and other platforms with django oscar
Anonymous
can I get some help with this error? I think the groups got created. But in the shell that long strange traceback is there while importing and checking Group.objects.all().
Like the last line in the error message says ("Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings") your django project is ImproperlyConfigured you need to set DJANGO_SETTINGS_MODULE environment variable to mysite.settings. see: https://docs.djangoproject.com/en/3.1/topics/settings/#designating-the-settings
Doragonsureiyā
Hello anyone have an example of the use of paypal and other platforms with django oscar
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Doragonsureiyā
Anyone runs his django with litespeed?
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z" Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high. How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Luis
hi. if I create a form from django forms, and I put a field mykey on it on a function view, how do I access the data in mykey?
Luis
i thought it was with form.cleaned_data["mykey"] but it returns blank
Mirco
Share the code via pastebin
Mr. COwO2 Preis
Current Models: Model Company: - id - name - owner (ForeignKeyField(User)) Model User (buildin): - id - username - email What I want to add: Relation: 1 Company <-> n Users: - 1 company has many users - 1 user has only 1 company I can add models.ManyToManyField(User) to the Company Model, but this results into a many to many relation. I can't add a ForeignKeyField(Company) to user, because first it's a buildin class, and second there would be cyclic dependencies because of the owner field. How can i implement this relation?
Mr. COwO2 Preis
The foreign key inside Company is ok
the foreign key inside company is for the ownership of the company, not the membership of members. there should be 2 relations: membership and ownership
Luis
Share the code via pastebin
https://pastebin.com/aH8h3hAW
Mr. COwO2 Preis
I've answered u based on the models you have shared
the models i have shared are the current models but i want to add the new membership relation
Mirco
https://pastebin.com/aH8h3hAW
The if "urls" has no sense, I don't see any line where you put that key inside session It will be always False
Mirco
Line 15 of pastebin, the if block will be always False You do never set urls key inside session
Mirco
do you see any error besides that one?
That link at the first line outside classes and functions has not sense too
Luis
That link at the first line outside classes and functions has not sense too
are session variables available on other view functions?
Luis
i mean if i create a session variable in a function and then try to access it on another function, will it be available?
Luis
or do I have to pass it on render?
Luis
Yup, in every view
I think my problem is I'm trying to do everything on the same page, and I probably should have 3 pages instead of 2
Luis
i want to display a form on index
Luis
when someone gets there it will be a GET, but if someone submits, it will be a POST
Luis
so it makes no sense to check for POST in the GET page, I think
Luis
I mean in the first page
Anonymous
How to access current user details in class based views??
Anonymous
with request.user u can get the details
Anonymous
I'm use query_set but im unable to get detail in template
Sharayu
I am creating a ToDo list where I want to add Topics and the tasks under the topics. How can I do that? I just have started Django and Python. Any help would be highly appreciated!
Anonymous
I am creating a ToDo list where I want to add Topics and the tasks under the topics. How can I do that? I just have started Django and Python. Any help would be highly appreciated!
https://simpleisbetterthancomplex.com/series/2017/09/04/a-complete-beginners-guide-to-django-part-1.html Go through this It's like a todo list project.
Sharayu
I already have made the simple ToDo app. I wanna add another feature i.e of adding different topics and tasks under that topic.
Sharayu
Exa. Morning - Drink Tea - Run 1KM Afternoon - Meeting at Cafe - Visit School
Jatin
I think you can create categories like Morning, afternoon, evening
Sharayu
But it'd depend on user like what topics they want to add. It may vary. Like I wanna add as "Office", "Home" and then Tasks under it.
Jatin
Then you can allow user to create a dynamic categories
Jatin
Another option is using tags
Sharayu
Can you share any link for the same? I am new to Django as well as python. Thank you!
Jatin
Another option is using tags
https://dev.to/coderasha/how-to-add-tags-to-your-models-in-django-django-packages-series-1-3704
RENGANATHAN
i got a TypeError at django what can i do
Sam
You'll have to explain your problem better to get any help
RENGANATHAN
I got a os path error in my IDE
Sarwar
Can anyone suggest me project book of djago 3
Rotana
Dear all please help, Can i set default value on model form had relationship model? ______________________________________________________ class Category(models.Model): cats = models.CharField(max_length=255) ______________________________________________________ class Issues(models.Model): issue_cats = models.ForeignKey(Category, on_delete=models.CASCADE) _______________________________________________________ class IssueFormFault(forms.ModelForm): class Meta: model = Issues fields = ( 'issue_cats', ) widgets = { 'issue_cats': forms.CharField(attrs={'class': 'form-control'}), }
Jatin
There is a default_value field available in django models
Rotana
how could i do on it ? when i wanna update Category i need relationship to auto update on Issues but can not set default value. any way brother ?
Anonymous
Hello everyone! I'm sorry to bother anyone, I have been away for sometime and I believe have missed a lot from the group someone should please carry along
Rotana
just want set one of them to default.
Jatin
No idea bro
Rotana
No idea bro
yes thank for your help i will research more about this.
5P34R
hello all
5P34R
Im stucked with an django invoice project
5P34R
where i cant include multiple models for rendersing datas beased on catagory
5P34R
please any help to find a solution
Teutranian
Like what? Explain more
$iductive
Can anyone suggest me a best hosting service for django app, I want shared hosting/vps hosting preferably cheap one. Can't afford aws/gcp/digitalocean right now. I googled it but it was pretty much confusing.
5P34R
Like what? Explain more
in the invoice app i wanted to include all models like a catagory eg: in bill if i select fish Then i ender the code I will get all kind of details like this fish need to get all models invoice app