Pavel
hello everyone, I create DRF + vue cli app and I have a error like this "Access to XMLHttpRequest at 'http://127.0.0.1:8000/' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource." MIDDLEWARE CorsMiddleware before CommonMiddleware CORS_ORIGN_WHITELIST = [ 'http://localhost:8080', 'http://127.0.0.1:8000', ]
Sajjad
hello
Pavel
Add origin 127.0.0.1:8080
it doesn't help, may be it is'n working: class AnimalsAPIViews(APIView): def post(self, request): animal = AnimalsSerializer(data=request.data) if animal.is_valid(): animal.save() return Response(animal.data) I will get POST request from vue cli but CORS...
Pavel
Okey, thanks
Pavel
It is already working, thank you
Владислав
Hi everybody. Advise a good editor, modern (not old ckeditor), file uploading (no filebrowser like in Tinymce), easily customizable and compatible with modeltranslations. Tried: Editorjs, Ckeditor-5, Tinymce, Ckeditor, now trying quill-editor
Владислав
I'm pretty surprised you tried things I haven't heard of but you didn't try JetBrains' software
What collateral from jetbrains? Maybe the translator let me down and translated it wrong ... I mean the WYSIWYG editor, but not IDE.
kuzmich
What collateral from jetbrains? Maybe the translator let me down and translated it wrong ... I mean the WYSIWYG editor, but not IDE.
Just refer to https://www.merriam-webster.com/ It won't let you down as far as you know English
Владислав
:) thanks.
𝑴𝒂𝒔𝒖𝒎𝒆 🦋
Hi,i have trouble adding the html template to the project,can someone help me?
Optimus
Hi , is there any package to upload multiple file in single object ? eg- if i want to create an object and want to upload 3 files then 3 separate object should not create , i want a single object in that 3 file attached
Найденов
What's the problem?
Optimus
tar?
no not in compress format
Wanna_Phonila
no not in compress format
tar - is not copressed format
Optimus
Wanna_Phonila
its a package ?
tar just "glue" few files in one
Optimus
Wanna_Phonila
is it a package or what ?
https://docs.python.org/3/library/tarfile.html try this
Optimus
seems its file compression but will check this
Optimus
Thanks :)
shashikant
i have multiple images in my post model. i want to separate images from post model.if i create another image model and have foreign key relation with post,then while creating post api ,post api have to direct to upload image api.i need help how can i separate model without creating another api?
shashikant
can you expalin it more,
Wanna_Phonila
seems its file compression but will check this
https://en.wikipedia.org/wiki/Tar_(computing) tar creates archive of your files/directories, but not compress them itself. For compression used another programs/formats. If you just want union few files in one - that is task what tar resolves.
игорь/igor
Hi,i have trouble adding the html template to the project,can someone help me?
You probably put them in wrong directory. The error message would be helpful, although use pastebin or similar services to paste it there not in chat directly
highnes
Hi im trying to set a forget password for django, how can a customize the reset password page, im getting the django admin page
highnes
Someone please help
highnes
https://codeshare.io/6pVxEY
highnes
Ive tried with this url settings still its same
Вин Король Саксов
If you are using your own view and template this shouldn't be happening
Вин Король Саксов
you want to customize admin reset password, or make your own?
highnes
I have set a custom view here https://codeshare.io/6pVxOO With urls https://codeshare.io/nzDq01
.
Can someone please....tell me what is web framework and django... please please
highnes
But now password_reset/done doesn't redirect, it loads the same password_reset page
Jerome
Тимофей
Hey guys. I made a form on my site, help me how to set it up so that the answers are displayed in the admin panel or somewhere else, thanks 🙏
Вин Король Саксов
Set price depending on what they need
игорь/igor
But now password_reset/done doesn't redirect, it loads the same password_reset page
1. redirect() shouldn't have spaces between function name and parentheses, although it is not error, it is just a better style of writing code 2. pass url-names to redirect, not the actual paths 3. I guess redirect shouldn't be inside your for loop 4. The actual problem is in your urls, because you are using regex without understanding how it works. change every path to path(..... without regular expressions and dont forget to add '/' at the end of first argument
Almaz
Hello, everyone! https://dpaste.org/KABz Please, who can help? I can't find what's wrong
Almaz
Hello, everyone! https://dpaste.org/KABz Please, who can help? I can't find what's wrong
I learn Django by watching Dennis Ivanov's tutorial videos and here is such unexpected error
игорь/igor
I learn Django by watching Dennis Ivanov's tutorial videos and here is such unexpected error
the error is because your user doesn't have any group associated with it I guess so both last if's in the 'wrapper_function' are not applicable thus wrapper_function doesn't return any response. To fix that, either follow video till the end to make users have at least one group or add manually from admin I guess.
игорь/igor
I think you should associate your user to some group from admin part
Fer
I have django 3.2, PostgreSQL 13 and when I try to create/update a model in the database it says: Blablabla.0001_initial... OK But it doesnt create any table nor columns... Does anyone came across with this issue?
Fer
I've tried everything, nothing works
Fer
Like --fake zero Deleting databases Naming differently ...
Almaz
I think you should associate your user to some group from admin part
All of my users already in groups, but the error is still unsolved
Almaz
I can't continue watch tutorial
Sai Kiran
Hi all, I using clean method in form.py to validate input data, however in logs I can say that input data is not reaching to view.py which says that validation is working. But when I watch tutorials, they are getting the raise errors in HTML page, but not for me
Sai Kiran
I am using form.ValidationError
Sai Kiran
Also I tried using Validationerror from django.core.exceptions
Sai Kiran
Not works, I mean I can see that error in HTML page
Almaz
while being authenticated?
Sorry, what? I'm a beginner in django
игорь/igor
while being logged in?
Almaz
while being logged in?
No. The error is showed when i tried to go to login page, but not when I tried to log
Almaz
I couldn't logged in, because the page showed error instead of login form
Charly
Can anyone help me??
Be patient, also you'll need to provide mor information like debug logs details if you are using multiple databases and so on
Almaz
Which error?
The problem is already solved. But anyway thanks for attention
игорь/igor
I have django 3.2, PostgreSQL 13 and when I try to create/update a model in the database it says: Blablabla.0001_initial... OK But it doesnt create any table nor columns... Does anyone came across with this issue?
python manage.py migrate appname, just guessing that you forgot your appname, or you forgot to add your app to INSTALLED_APPS list in settings.
Fer
😕😕
Anonymous
Hello. What causes any function in views to run twice? In any function I add print ('something') and it is printed twice in the terminal.
Anonymous
all functions work like that. which code should I show you?
Fer
I have django 3.2, PostgreSQL 13 and when I try to create/update a model in the database it says: Blablabla.0001_initial... OK But it doesnt create any table nor columns... Does anyone came across with this issue?
I discovered that having just one db and use it as a default works... But I dont know what to do now. If I go back to the previuosly admin database it crashes again
Anonymous
any with this effect
def service_obj(request, service_pk): service= get_object_or_404(Service, pk= service_pk) print('yes') context= {'service': service} return render(request, 'carmol/service.html', context)