Shourya
Which i dont want it to read
inchidi
Incorrent auth credentials
so you are passing incorrect creds and expect your BE to ignore it?
Shourya
so you are passing incorrect creds and expect your BE to ignore it?
The JWt token that i am passing in headers is for the other url i am hitting inside my view
Anonymous
kartik use caching
But my main concern is to save the storage. Is there any way to save space?
Britto
django beginners materials pls
Doragonsureiyā
django beginners materials pls
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Shourya
Actually its like localhost/api/<path:some_other_url>
Anonymous
You can do it using jquery
Hi Thkx for answer But How can i set the hidden field not requered, and set showen fields requered.?
Shourya
Then i m passing header authorization Bearer....
Shourya
Hi Thkx for answer But How can i set the hidden field not requered, and set showen fields requered.?
Its not a big deal just see how to add a Javascript file in admin load
Shourya
And then code there
Shourya
Then i m passing header authorization Bearer....
This header authorization is for that some_other_url
Shourya
But django is reading it as its own
Shourya
Any idea @Inchidi
Shourya
?
inchidi
This header authorization is for that some_other_url
yes, some other url here is from same app or not?
Anonymous
I do this, it will be like notification requered field ? I found any thing in google
Shourya
I do this, it will be like notification requered field ? I found any thing in google
What i understood from your query is like you want to make admin panel dynamic
Shourya
In a way that when the user clicks on php from drop down then only php questions should be there right?
inchidi
Not its on azure platform
then the problem is on your client side because it's sending same authorization header to your django app, not on your django app side
Shourya
Ok umm in summary
Shourya
I have a backend django server
Shourya
In this i have a view which will do a GET request on azure platform......the url for azure platform will be passed in the url i shared above
Shourya
I need to enter authorization token in azure so i am passing it here in the same django app
Shourya
I want django app to not read this token and get my control straight to view
Shourya
Instead
inchidi
same thing, your problem is on client side because you pass azure token on authorization header
Shourya
Is there a way django server doesn't read this header and not read it as its own
inchidi
if i guide you how to make your django app ignore authorization header, its gonna be equals with i tell you to jump from a bridge because you are thirsty
Shourya
pass on body instead of header
Well its a requirement
inchidi
Well its a requirement
why it's a requirement?
Shourya
I need to make something like cors-anywhere.herokuapp.com
inchidi
I need to make something like cors-anywhere.herokuapp.com
so your django app doesnt need authentication at all?
Shourya
so your django app doesnt need authentication at all?
It needs authentication in other urls
Shourya
In this particular one i dont need
inchidi
what's the point of having authentication if you dont apply authorization?
Shourya
@Inchidi Any idea you have on how to make django ignore headers completely in a request
inchidi
create authentication class, extends from BaseAuthentication from drf override the authenticate() method and add check (pseudo): if request.build_absolute_uri == 'your cors anywhere path': return None then add that authentication class to drf config on your settings.py
Damron
Who was using django-markdown-editor, how did you save styles for mrdwn field in templates? Content style always rewriting by other styles, so I loose mrkdwn like view
Damron
Or maybe I need to copy-paste styles into my static file and link to them? - In case of DEBUG mode
Бекказы
Hi, everyone. I have a question on djandorestframework. Is it possible to include or exclude fields using a single serializer, depending on the method? Models - https://dpaste.org/cYAB Serializers - https://dpaste.org/rcpu Views - https://dpaste.org/nxyU using multiple serializers and classes for GET POST and PUT methods seems to me not a good idea
Damron
I really have no idea
Damron
I think styles for mrkdwn are rewriting by another css file
inchidi
I really have no idea
i dont really get your question actually
Damron
My mrkdwn content in {{ object.text|safe_markdown }} is getting another style Not as mrkdwn's style
inchidi
My mrkdwn content in {{ object.text|safe_markdown }} is getting another style Not as mrkdwn's style
is this the plugin you are using? https://github.com/agusmakmun/django-markdown-editor
inchidi
yes
martor.css and martor.js loaded on that page already?
Damron
yes
Damron
in browser console all files are included
Damron
<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap.css' %}" media="screen"/> <link rel="stylesheet" type="text/css" href="{% static 'css/font-awesome.min.css' %}" media="screen"/> <script src="{% static 'js/3.4.1_jquery.js' %}"></script> <script src="{% static 'js/general.js' %}"></script> <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}" media="screen"/> <link href="{% static 'css/martor.min.css' %}" type="text/css" media="all" rel="stylesheet" /> <link href="{% static 'css/martor.css' %}" type="text/css" media="all" rel="stylesheet" />
inchidi
that means if you open the link for that css and js file, you can see the contents of martor.css and martor.js right?
Damron
yes, u're right
inchidi
I think styles for mrkdwn are rewriting by another css file
most likely this is true, you can try remove style.css first to make sure
Damron
yes, that's worked!
Damron
But now I don't have styles for other other part of code
Бекказы
that's good idea actually, your api schema gonna be clearer and more verbose
If I use several serializers, I will need to write several views for each serializer like this https://dpaste.org/hEYQ#L And write them in url like this: urlpatterns = [ path('blank/', views.BlankList.as_view()), path('blank/', views.BlankAdd.as_view()), path('blank/<int:pk>/', views.BlankDetail.as_view()), path('blank/<int:pk>/', views.BlankPut.as_view()), ] it is right?
Damron
that's weird styles.css has no !important
Damron
but markdwn files are got many
Бекказы
that wont work since you are using same path for different views there tho
there is no way to redefine the serializer inside one view?
inchidi
but markdwn files are got many
cant really help you much on this point, css is not my strong suit 😕
Damron
I understand, but thank you very much - now I know what's the problem)
inchidi
there is no way to redefine the serializer inside one view?
so what you want is same url path, different method, different serializer class right? then viewset more suitable for that, you can define the serializer class used on each viewset action
isa
https://pastebin.pl/view/2ed6a67b
isa
I am doing this import but have following error. (EYT) focuser@focuser:~/EYT/EYT/EYTHABER$ python makale/gazete_views/birgun.py Traceback (most recent call last): File "makale/gazete_views/birgun.py", line 4, in <module> from makale.models import Yazar, Makale, Gazete ModuleNotFoundError: No module named 'makale'