Rajjix
Like you’ll have the same data process u should have in any particular AI project u’ve worked with before, just with django or any other web framework u’d be receiving/sending this data through http packets instead of direct input.
Vladyslav 🇺🇦🇪🇺
folks
Anders (izzno / gooood) 🇳🇴
folk
Vladyslav 🇺🇦🇪🇺
need help with forms
Vladyslav 🇺🇦🇪🇺
need to send request to def get_position() in model Group (contrib.auth.model)
Vladyslav 🇺🇦🇪🇺
problem:
Anonymous
<div class="sl-slide-inner" style="background-image: url(img/hero-bg.jpg);"> how to convert this tag to django templates
Sanjay Krishnan
<div class="sl-slide-inner" style="background-image: url({% static 'img/hero-bg.jpg' %});">
Sanjay Krishnan
I think this would do the trick
Sanjay Krishnan
But it is not a good practice to write inline styles
Sanjay Krishnan
And images instead of img as the folder name would be nice 🙂
Anders (izzno / gooood) 🇳🇴
Some programs will also access the db directly, but as django has this ORM I need to figure out a "django" way of solving this as well and not just throw it all in one row.
Sanjay Krishnan
Isaías
Good afternoon. How to pass parameters in the django url as follows?
Ex: test? Key = jbfljbajshfa
Anders (izzno / gooood) 🇳🇴
You mean like an API ?
Isaías
yes
Rohan
Anders (izzno / gooood) 🇳🇴
django-rest-api
Rohan
Or you want a variable in url?
Isaías
Rohan
variable in url
https://docs.djangoproject.com/en/2.1/topics/http/urls/
Anonymous
Hmm
R
Anders (izzno / gooood) 🇳🇴
R
I didnt get that
The related_name would just be needed if both relations are to the same model which I don’t think is the case, so let’s say attr1 is category and attr2 subcategory (different models) you could just make a fk from each subcategory to a category and when the user selects a category in your form, perform the ajax request to get all the chosen category associated subcategories to display to the user, then it would depend on your business logic if your ProductItem model has fk’s or m2m to your category/subcategory models
R
I think your application is for local use, but anyways I would make sure to don’t just trust on the front end logic and validate the form on the server side to don’t allow a ‘malicious’ user save subcategories that are not associated to a category by sending raw http requests
Rajjix
but if he’s just using python as a backend api , and a javascript framework on the frontend, wouldn’t it be much easier to just change the select field according to selected category with another fetch or axios request?
Rajjix
I just remember him refering to using an api more than once, hence my theory
R
Yes, that’s what I’m saying but server side validation is also required as you could have users who dont perform requests from the browser, so they could send requests selecting a subcategory which is not related to a subcategory
R
It’s never good idea to trust front end validation, as you can easily bypass it by just sending requests through postman or let’s say burp suite or zapproxy as a more advanced tools
Rajjix
Rajjix
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
Rajjix
ye that’s a big advantage for php, but with wsgi and awsgi things are really promising for python to take over. considering it’s usability in many other fields, and with the new pwa (progressive web apps) gaining a lot of popularity, i think python and javascript will take over the world 🌎
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
Its down to a PHP needs and i supply...
Anders (izzno / gooood) 🇳🇴
So now I am thinking to add all the attributes to the model and use ajax to "open" the options ? Any other suggestions ?
Anders (izzno / gooood) 🇳🇴
has anyone done something like this ? Multiple choice based on choice.
Anders (izzno / gooood) 🇳🇴
But the important thing here is the demo went well and we have a global project :/ ....
Rajjix
Anders (izzno / gooood) 🇳🇴
Thank you, and THANK YOU... for all your help.
Maz
Maz
R
John
gi huys
John
I'am tryng using formset
John
don't success implementation
068089
How to remind when admin's change_form exits
Anonymous
How to correct sentence mistakes in django?.Can we use grammarly api?
Meera
Hi i want to create a django app
Meera
which have choose file button on homepage
Meera
and when one uploads CSV file..the backend reads the file
Meera
and filterout some rows and thier contents and render a table in a view...with these CSV file data
Meera
is it possibe ?
Meera
thank you
Muhammad
Hello Guys, I am new to python. I've seen too many resources to learn. But none of them can keep you attached to the need of learning. So, Is there any book can you advise me by ??
Sanjay Krishnan
simpleisbetterthancomplex.com
Sanjay Krishnan
For django
Rohan
Maz
Anyone worked with Mezzanine CMS?
Mirco
Anonymous
R
Anyone worked with Mezzanine CMS?
I did, it’s good because everything is built-in and almost doesnt use third party libraries, but it’s a bit outdated and non maintained, if you starting a new project, I would rather suggest checking Wagtail or Django-Cms
Maz
Sergei
Hi fellas !
Is there anybody who has inplemented timer to his/her django website?
Thanx in advance
Sebastian
Hi, I want to test the following situation: I have a view where I put a request in it. In the request is a User I work with in the view function. At the End of the view function I put a context to the template. When I test this view-function, I want to test the context, the view function is creating. I try to test this with RequestFactory(), because with RequestFactory() I have the possibility to put a user in my request. But it seams that I can not get the context, my view function is creating. Is there a way to test this?
I put my case in this document, that you can see what I mean:
https://pastebin.com/25Kp8Jfh
Ard
Hii everyone, my name Subhan. I would like to ask you about parsing .shp file (which is generated by arcgis), how to render .shp file with django ?
Anyone can help me
Mounikesh
guys i just want to know the difference between aynchronous and synchronous frame2ork i know django is synchronous and framework like tornado is async but couldnt figure out the exact difference between both
Mounikesh
can someone sxplain me this with an example to the context of django and tornado or anyother async frameworks
Anonymous
Try a Google search
Anonymous
Or maybe even there is one by author of Django Channels
R
R
Think in that talk he does not speak about aiohttp which is a nice asyncio based framework to consider
Anonymous
how to host django for free