Suren
LStyle
what is the difference on first page use styles to the first class, and on the second page to the second class
Suren
in widget use 'class': 'oneclass twoclass',
I already though about creating second email field and giving it second class, but thought if there is a better solution
LStyle
I already though about creating second email field and giving it second class, but thought if there is a better solution
https://stackoverflow.com/questions/63102909/how-to-change-form-field-attribute-in-the-view
SantiU
After deploying i get this error: Forbidden 403 CSRF verification failed. Request aborted Has anyone experienced the same thing and knows how to solve it? tks
SantiU
did you added the CSRF token to your requests?
I added the crsf in the template
Close
Is there a big difference in the way of handling back-end if I learn .Net then Django?
SantiU
How you did it?
Inside the form element I added {% csrf_token %}
SantiU
The error appear after deploy in aws
rtg
which package do you use for chat in django? or do you prefer websocket? thank you!
Chocolate_girl
I have used Myuser(AbstractBaseUser) and mentioned and i set USERNAME_FIELD = 'email' because i want only email field and password in the request then based on these two credentials i have to get the the token in the response by using the obtainAuthToken api. But the problem is that auth_token is having ForeignKey relationship with the auth_user but we want ForeignKey relationship of token table with nyuser as I'm not able to edit the ForeignKey in default auth_token. So, do we have any alternative way to get token by using only email and password with the help of obtainauthtoken api?
Suren
I have a list of products for which I have to use the same images. In Django admin I can only upload images from my computer and as many times as I will upload it, image will be saved in catalog. Is it possible not to upload but to create a gallery of images by specific category on website and instead of uploading all the time the same images select from that gallery only?
Sai
Can anyone tell.me why am i getting name error but i have declared the file name
Suren
Anybody knows how to save picture in it's category catalogue? https://dpaste.org/dG1c8 picture = models.ImageField(upload_to=f"pictures/{cat.name}") returning None
.
Anybody knows how to save picture in it's category catalogue? https://dpaste.org/dG1c8 picture = models.ImageField(upload_to=f"pictures/{cat.name}") returning None
See this post: https://forum.djangoproject.com/t/how-to-create-custom-image-save-folder/10818/3 You can’t call cat.name there, instead, call a function with instance and filename arguments. Another similar reference: https://stackoverflow.com/a/63807216
Tiger
Hello, guys. I made a project locally. My computer is connected to network of the company. How can I share my project? I tried to open http://127.0.0.1:8000/ on another computer connected to network, but it did not work.
Daler
Hello, guys. I made a project locally. My computer is connected to network of the company. How can I share my project? I tried to open http://127.0.0.1:8000/ on another computer connected to network, but it did not work.
1) Run project in 0.0.0.0:8000 2) open cmd on your computer, type ipconfig and find your local IPv4 address 3) on another computer connected to network open <your local ip>:8000 4) enjoy
Tiger
Thank you very much!!!
Kaustab Roy_C_24_CSE(AIML)
hello, i am new to django. I am getting this error, i can understand but cant solve it. Anyone plz help to overcome
Kaustab Roy_C_24_CSE(AIML)
ValueError at /register/ Cannot assign "'1'": "User.urole" must be a "Role" instance. Request Method: POST Request URL: http://127.0.0.1:8000/register/ Django Version: 4.1.4 Exception Type: ValueError Exception Value: Cannot assign "'1'": "User.urole" must be a "Role" instance.
Rahat
Anyone devops learn in this group
AAYUSH
I face the stripe problem while using it’s api.. when i press pay now button I’m getting Network Error : status 500.. with patterns and whitspaces on reverse..
Mahmood
Hi everyone In Django admin, how to change the fields in the inline in case in the new row (i mean when I'm adding an instance to the inline) So the fields will show differently from the new record form and the edit record form of the inline
rtg
Hi! Sometime doesn´t recognize forms.py why?
rtg
from applications.social.forms import AddFollowUserForm
rtg
forms.py is into social app. I don´t understand. 🤔
rtg
there is __init__.py files into social app
rtg
now is ok. I deleted forms.py, i created again and now it is recognized. I don´t understand.
AZ
If I finished designing my site, how do I add payment gateways such as Apple Pay and madtercard or PayPal?
Doragonsureiyā
If I finished designing my site, how do I add payment gateways such as Apple Pay and madtercard or PayPal?
These single steps will help you a lot: 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 first results
Ola
Is possible to return a set of object in a django query. If yes How pls
Rahul Yadav
Hi anyone can help me regarding file download
Rahul Yadav
I will pay for that
Rahul Yadav
Vas
what exactly are you interested in?
Vas
Yes
If this forms forms.FileField() If model models.FileField( ) I hope this helps you
.
hello , i have two tables table 1 and table 2 , that i wnat to update. h have one html page and one view in this view i wnat to check if the pk is ralted to table 1 then it will show the table 1 form with instance of the itme to update it , but if the pk was related to table 2 it will show the table 2 form with the instance of the item to update it thank you very much
SMAIL
IS THERE AN EXAMPLE OF DOING Bootstrap Tree View with Django?
Anonymous
why my django project doesn't recognise my template
Viachaslau
IS THERE AN EXAMPLE OF DOING Bootstrap Tree View with Django?
https://mdbootstrap.com/docs/standard/plugins/tree-view/ 🤔
ibraheem
hi i create forums app i have page for forums and page for posts in the page posts i create section to create post but whin i clec in the forum and open posts page i have thes problim: IntegrityError at / forumsforums / 1 NOT NULL constraint failed : forums_forums_posts.post_name my files: https://linkode.org/#UKjplL2iejyB60dojqV8C4
Rahul Yadav
Hi anyone knows how to download file in django
Doragonsureiyā
Hi anyone knows how to download file in django
To get an answer to your question, it is worth to formulate it more clearly, perhaps add more details, perhaps add explanations.
Rahul Yadav
My file uploads thig workings fine.but file download is not working
Rahul Yadav
What code should I write for that
Rahul Yadav
May anyone send some sample
Rahul Yadav
?
Doragonsureiyā
My file uploads thig workings fine.but file download is not working
No one can help you until you explain your difficulties.
Rahul Yadav
Is there any working example of download file in django?
Daler
bro use google
Erfán.R
yo guys look at this error: get() returned more than one UserRole -- it returned 3!
Erfán.R
class ListFirmPos(RetrieveUpdateDestroyAPIView): serializer_class = FirmPositionListSerializer(many=True) queryset = UserRole.objects.all() lookup_field = 'firm_uid' http_method_names = ['get'] def get_queryset(self): return self.queryset.filter(firm_uid=self.kwargs['firm_uid'])
Erfán.R
why i can get multi data?
Erfán.R
yeap thats what i need
Daler
yeap thats what i need
So u should use firm_uid as a filter field, not a lookup_field
Erfán.R
take a look at django-filters
i changed the lookup to lookup_url_kwarg but cant find anything
Daler
Bro why do u want list view but inherit ur view from RetrieveUpdateDestroyAPIView. U should read docs carefully
Tiger
1) Run project in 0.0.0.0:8000 2) open cmd on your computer, type ipconfig and find your local IPv4 address 3) on another computer connected to network open <your local ip>:8000 4) enjoy
So, basicly my ip would be in url. Is it possible to cover it with any string? For example, when they type "somestring" in their browser, they will see my django project. P.s. we all are in one lan network.
Главный
Good hour! Is there a ready-made solution with tables, planning?
Daler
So, basicly my ip would be in url. Is it possible to cover it with any string? For example, when they type "somestring" in their browser, they will see my django project. P.s. we all are in one lan network.
U can use ngrok, if u want. It generates domain string and proxies this domain requests to your local port. But it cannot make custom domain string that u want. Note that ur computers are not obliged to be in one lan network if u use ngrok. But, as i know, it is impossible to create custom string-domain that proxies requests to your local lan port
Maxim
Good hour! Is there a ready-made solution with tables, planning?
we do not provide ready-made solutions use search engines
Главный