007
Have you read the link I shared with you ?
Yes.. but not understood much
Mirco
Yes.. but not understood much
STATIC_ROOT is the folder where after running collectstatic command will be all of your static files And on production , it's the folder that you will serve via a web server like nginx ( for example )
Mirco
Try to specify a STATIC_ROOT and run manage.py collectstatic
Mirco
See the results and you will understand
007
Try to specify a STATIC_ROOT and run manage.py collectstatic
I had run that comment all static code related to program stored in folder
007
One more question how to request api and store that result or display on template
Mirco
Ok... But in my code i want to access style.css which is inside static directory
Yep, but when you don't serve static files via web server , you need to tell Django to use its static app to serve them So you need to specify STATIC_ROOT for using static() inside urls.py
007
What kind of API ?
Rest api in django
007
What kind of API ?
Or https://restcountries.eu/rest/v2/all for example purpose
007
You can call it via JavaScript
Like :- response = requests.get('url/') geodata = response.json()
Mirco
Like :- response = requests.get('url/') geodata = response.json()
You can do that into a view, but if you just need to fetch it inside a template you can just use javascript to fetch it and put the results into the DOM
Mirco
Study how to fetch APIs
007
Study how to fetch APIs
Ok.I'll.. thanks✌️✌️😇😇
Krunal
Static files are not loading after deploy on iis.
Krunal
Why I need to add root static path
Anders (izzno / gooood) 🇳🇴
Mirco
You cant do that...
Why not ? https://www.revsys.com/tidbits/tips-using-djangos-manytomanyfield/
Anders (izzno / gooood) 🇳🇴
Wait a sec
Mirco
Wait a sec
Instead of *_set you can specify the related_name
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
Theproblem is not the relation, the problem is the related object "not" following the "rules"
Anders (izzno / gooood) 🇳🇴
to access the related object "Cart.objects.get(id=pk, user=request.user).items.all()" and not "Cart.objects.get(id=pk, user=request.user).items.objects.all()"
Anders (izzno / gooood) 🇳🇴
the latter would be logical.
Anders (izzno / gooood) 🇳🇴
a model is a model is a model ? ;)
Anders (izzno / gooood) 🇳🇴
Sure
Anders (izzno / gooood) 🇳🇴
But then I would expect the items to "answer" to objects.all() not all(). It's not a problem now that it know.....
POKOK BELIAN
Top Python Web Development Frameworks to Learn in 2019 https://hackernoon.com/top-python-web-development-frameworks-to-learn-in-2019-21c646a09a9a
Vijayakumar
Hi guys
Vijayakumar
I was created one text area In my HTML page
Vijayakumar
And I also created one model training in python and saved as a pickle file
Vijayakumar
I just want to whenever i type a comment in textarea and click the predict button .it need to load the pickle file and predict the result in same page
Vijayakumar
What is the steps I need to follow to do this.
Vijayakumar
In django
Vijayakumar
Could you help me guys
Vijayakumar
My project name realtime Anomaly Detection in social media
Black Sand
Hey, My template is not rendering , Please someone help me.....
Shubham
Hi all, I am documenting my rest APIs using swagger. I follow the steps of first installation , placed in installed apps, create the swagger URL, it still showing me No operations defined in spec!. Please help me if some have an idea.
Black Sand
What's the error shown?
The thing is, it is not showing any error but only tex is appearing no images no styles no js and no links are working
Anonymous
In the python console there should be some error shown
Black Sand
It shows so many thingsn not found but they are all there
SO
Use Machine Learning to filter messages in the browser Article on filtering messages during #Twitch streaming with #tensorflow. Link: https://dev.to/embiem/use-machine-learning-to-filter-messages-in-the-browser-4i19 #DL #NN #NLP #tensorflowjs
Vijayakumar
How to deploy machine learning model in django
Vijayakumar
Any one knows about it
Sencer
Hello people.
Sencer
Can an abstract model triggers the post save?
Sencer
Or should I write post save for inherited model?
Black Sand
Im using django 3.7 and getting a page not found 404
Black Sand
Im using django 3.7 and getting a page not found 404
There are solutions for lower versions like 3.5 and lower.. but I cant get a solution for mine
.
Or should I write post save for inherited model?
https://stackoverflow.com/questions/2692551/how-do-i-use-django-signals-with-an-abstract-model
Black Sand
django 3.7?
Sorry python 3.7
Anonymous
Can u pls send me Durga soft python material pld
.
do you think that this is becouse of 3.7?
Anonymous
Krish: Can u pls send me Durga soft python material Pls
Black Sand
do you think that this is becouse of 3.7?
No, but the solutions only talk about previous versions and that solutions doesnt work in 3.7
.
why do you think that it won't work?
.
django has good compatibility between python versions
Black Sand
why do you think that it won't work?
Because I tried that solutions and didnt work out
.
so may be you found wrong solution
.
send code
.
which case?
.
Because I tried that solutions and didnt work out
you can run your app under python 3.5 and check that
Modou-dev
I want to launch to commande using thread and retrieve them?
Black Sand
send code
urlpatterns= [ path (' ' ,views.index,name='index'), path ('cucca/teachers/',views.syllabi,name='syllabi') ]
Anonymous
hello everyone I can host django web app on hostkey anyone have experience please
Anonymous
in which server do you want to host
Anonymous
your django application
Anonymous
in which server do you want to host
all I know is the website host on host key and use wordpress only
Anonymous
there is way to know more information about the website
Anonymous
Hi I have designed a blog and want to return all the entries in the db via an api call. I have created the api using django rest framework but I want to know how to cache this query set and delete the cached entry when a entry is made.
Anonymous
Via admin panel to the db.
Ashik
How can I store QR code to db