Anonymous
Gil
Start with achieving this, only with html5 and template, later, backend
Bootstrap carrousel doc
Django template doc
Or better,Start all with html5 and 2 images, all static code, then steep by steep
Anonymous
Anonymous
Gil
pass static location images to model, and loop for i in inside django template to generate each carrousel-item
Anonymous
Gil
each image, one obj, multiple obj into this model
Fabian
class ClientesViewSet(NestedViewSetMixin, viewsets.ModelViewSet):
serializer_class = ClienteSerializer
queryset = Cliente.objects.all()
def list(self, request, *args, **kwargs):
serializer = self.serializer_class(self.queryset, many=True)
json = js.dumps(serializer.data)
return Response(json)
Fabian
Fabian
i basically just want to json encode the response
Fabian
from the listviewmixing
Pogos
Hi, please i need help. )
If i will create virtual env and download django 3, system says that he not have django 3, because you have python 2.7, but i have python 3.8.)
How a i can change default start python settings
Pogos
Sorry for my english ))
Anonymous
Pogos
Can you please tell me how to do this?
Current
Pogos
I figured it out
Pogos
Thank you
Current
also if system is not recognizing your python3 in system variables type python3 or pip3
Pogos
ok )
Abhi
I am looking for django developer to develop backend of E COMMERCE ERP backend design
IT'S paid project.
Developer must have experience in django 3-5 Year. Also portfolio of there work and GitHub
Anonymous
django.db.utils.operationalerror: fatal: ident authentication failed for user "postgres"
Anonymous
how to remove it
Omair
how to remove it
Setup the password for the user you have in your settings.py file
✙Yaroslav
Help someone who doesn t sleep. Children, such question. On the left there is a list of groups on the base page, when you click on one of them, the announcements concerning it are displayed. At this time, in the url address of the id group. Then, when choosing an ad, a detailed info about it opens, and in the urla already id of the group and id of the ad. Under the announcement, the list of commentaries, and the ones you left behind, can be deleted/corrected. Removal and correction I did, but the trouble is, That when you click on a comment that you want to correct, the shape of the correction opens under the url, Where just some-text/ id-comment and everything, and after correction I can t redirect to the announcement, Under which there was a list of commentaries and in the url there were two id, And so at the moment made a redirect that doesn t quite fit in logic. How do I take 3 id from the url and make a normal rediret?
Anonymous
hey
Gil
Help someone who doesn t sleep. Children, such question. On the left there is a list of groups on the base page, when you click on one of them, the announcements concerning it are displayed. At this time, in the url address of the id group. Then, when choosing an ad, a detailed info about it opens, and in the urla already id of the group and id of the ad. Under the announcement, the list of commentaries, and the ones you left behind, can be deleted/corrected. Removal and correction I did, but the trouble is, That when you click on a comment that you want to correct, the shape of the correction opens under the url, Where just some-text/ id-comment and everything, and after correction I can t redirect to the announcement, Under which there was a list of commentaries and in the url there were two id, And so at the moment made a redirect that doesn t quite fit in logic. How do I take 3 id from the url and make a normal rediret?
sorry, maybe a gif/video or somthing to see could help to understand the problem
✙Yaroslav
Chiranjeevi
https://github.com/justdjango/django-ecommerce
Chiranjeevi
https://github.com/bradtraversy/btre_project
Chiranjeevi
:)
Ярик
guys, help me pls
i need to implement update_or_create method in folowing code:
https://dpaste.org/iEP8
it should check if ContractItems object you add already exists and increase its quantity with its value
srikanth
hi guys i want to host my django rest server with static media and accessible database where I can add new files or delete can anyone suggest me platform for hosting my rest server for front end iam using Angular
srikanth
i heard that heroku database support will be paid one
𝖜𝖎𝖑𝖑𝖘𝖎𝖗
which book is best to learn python as well as django faster?
George
!djangotut
Doragonsureiyā
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Jesus
I have created a basic API using Django REST Framework, with a header key "Authentication" and value "Token X". It works fine using Postman but when I try to use it with jQuery in a separate project, it gaves me this error: "has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource." Any ideas?
George
George
Jesus
Why I dont need it in Postman?
cj
Jesus
Jesus
Access to XMLHttpRequest at 'http://0.0.0.0:8000/api/get-tasks' from origin 'chrome-extension://ilknfndkanjdgekllmhjmloheiiilnii' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
cj
Jesus
https://pastebin.com/K7mT9L52
Jesus
I have fixed this issue using django-cors-headers library
Jesus
https://github.com/adamchainz/django-cors-headers#configuration
Jesus
I think this is the best solution
Martin
any one have a django ecommerse project tutorials or codes
Jesus
George
cj
I think this is the best solution
I did the same things using a more simple jquery code and I didn't need to use the csrf token 🤷🏻♂️, also you're doing a GET, so you really shouldn't need the crsf_token for that
George
mmmmm
Jesus
cj
if you're making a GET request, you don't need csrf_token, something is wrong in you JS code
Jesus
cj
Jesus
yeah, I said it was from a separate project
cj
still, if you're using DRF, it shouldn't complain about the CORS thing 🤔
cj
DRF eliminates the CORS protection for the endpoints 🤔
George
I love it when in the docs it's included but not in vanilla but in JQuery
https://gist.github.com/sirodoht/fb7a6e98d33fc460d4f1eadaff486e7b
cj
but, again, if you're using DRF, you don't need the csrf_token 🤷🏻♂️ neither if you're making a GET request
Anonymous
Class slide(models.Model):
Title = models.charfield(max_length=10)
Class image(models.Model):
Slideshow = models.imagefield(upload_....)
slide = models.foreignkey('slide')
View.py
I only context the objects out
For my template I want the image to work as carousels
Please I need help to get object from the foreignkey in my template and 2. If you have another solution to this please suggest I dont want it done using static image
cj
George
:(
cj
still DRF allows you to make requests and no need to mess with CORS
inchidi
cors in nutshell is basically browser doing:
if request.url != self.url:
if self.url not in response.header['Access-Control-Allow-Origin']:
raise CORSPolicyBlock()
George
TIL
cj
Doragonsureiyā
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Jesus
Anonymous
Let's play Django...
Who's in?