Black_J08
{% if user.is_authenticated %} is not working for me
also I am getting this error "GET /drawer.css.map HTTP/1.1" 404 2359 Not Found: /drawer.css.map
#!/bin/sh Inَactive
{% if user.is_authenticated %} is not working for me
did you try request.user.is_authenticated
#!/bin/sh Inَactive
yes i did
show your template code
Black_J08
show your template code
https://del.dog/exukimetip
#!/bin/sh Inَactive
https://del.dog/exukimetip
did you provide user object in your view context?
#!/bin/sh Inَactive
no
just using {% if request.user.is_authenticated %} should work fine
#!/bin/sh Inَactive
i tried but its not working
what happens? does it show user logged in in any case?
#!/bin/sh Inَactive
also I am getting this error "GET /drawer.css.map HTTP/1.1" 404 2359 Not Found: /drawer.css.map
if this is what you mean by it's not working then this has nothing to do with this
#!/bin/sh Inَactive
also I am getting this error "GET /drawer.css.map HTTP/1.1" 404 2359 Not Found: /drawer.css.map
this 404 coming from your css asset which looking for drawer.css.map file
Black_J08
what happens? does it show user logged in in any case?
yes it does...when i remove those if and endif statements
Black_J08
if this is what you mean by it's not working then this has nothing to do with this
no i am not using any css...and i am not a front end dev...so i didn't if this has anything to do with the user.is_authenticated error
#!/bin/sh Inَactive
yes it does...when i remove those if and endif statements
can you try in another browser maybe you are logged in already and you don't know
Black_J08
can you try in another browser maybe you are logged in already and you don't know
i cleared site's data and added an else statement...now it is working thank you bro for helping so much
Black_J08
Hmm maybe in your base.html?
if possible can you help me in this too... here is base.html https://del.dog/ollughymer
Black_J08
there is no css here either
yes...and this error is occuring on every route
Sai
How to slove this error Student_profile matching query doest not exist
Because student does not exist in your db. Use try catch
Lugano
How can i display a defalut page,when someone enters an incorrect url? How can i capture incorrect url
Ghorz
How to use catch method
try: ...... except Exception as e .......
Anonymous
Can we use xhtml2pdf module in django2 and python 3
Anonymous
can we return values in a loop in django? code for reference- def get(): some_list=[1,2,3] for i in some_list: value = i return Response(value) It will only return last value-3. Can we return all values?
Anonymous
just return the full list
that is understood but if we want to return a list then how to do? Or only we can return a list?
Mirco
What you wanna do with that list ?
⚜️
Hi guys! How to convert output queryset format to normal string? I'm getting value from database and I have to pass that value to template, however template shows inappropriate format
⚜️
https://dpaste.org/ZoXW
⚜️
<TreeQuerySet [{'name': 'Hotel Lux'}]> ———> to normal format
Anonymous
What you wanna do with that list ?
pls have a look into it https://pastebin.com/M9E1hNn3 here I have one for loop which will return some value
Anonymous
For every id some value will be there but when I'm returning that value ...only value for last I'd is being return
Anonymous
One way is to store them(values) in list and then return
Anonymous
Every value will be returned but that will be in list format. My question is can we return them without storing in list?
Јован
Hey guys, I have created a docker-compose along with dockerfile to setup a Django project if you guys are interested. Checkout my Github Gist here for it: https://gist.github.com/mjovanc/4681f3b2bcb870f7ae6fc28b29a2b613 Tell me what you think and/or if it needs to be changed etc. Thanks!
Anonymous
Hey guys, I am reading a blog that talks about asgi.py Does it mean that asgi can make Django perform like node JS in responding to multiple requests at a time in an asynchronous matter?
Root
Hello. Can we develop admin panel of Django by Angular? Only the admin panel
Alex
and in the compose command block only left python manage.py runserver 0.0.0.0:8000 without any bash -c and other trash
Alex
Why is that better? Just curious.
For example here is my entrypoint for a simple django oscar shop. Are you going to place such amount of code in a simple statement? https://pastebin.com/d826a6W8
Mirco
and in the compose command block only left python manage.py runserver 0.0.0.0:8000 without any bash -c and other trash
You can add more customization in a proper entrypoint file without making docker compose too much verbose for example
Anonymous
Is there someone who can help me with my flask application deployment?
Anonymous
I'm deploying my flask application on aws ec2 engine. I created a default vm and ssh'ed into it. Firstly I disabled all incoming traffic Then I allowed ssh on port 22 and http on port 80. I downloaded my code from github. Downloaded all packages required. And ran the flask app with debug ttrue for development testing. The app ran successfully there's no error, but on visiting the public ip the page isn't loading neither the debug is showing the get request made.
Sai
Hey hope you all good I want to know how the deployed django frontend code is get updated on user side without refreshing page. If I talk about app we show the simple popup that please update you app.
Baggy ️️
I was using Aws ec2 free tier
Baggy ️️
I terminated some of my instances
Baggy ️️
Now when I am creating a new instance
Baggy ️️
It's days your account is blocked
Baggy ️️
Any idea what to do?
Baggy ️️
*says
Sai
study better what a deploy is in 2020 era
I have studied this and I do deployment of backend only. I need to know about front end
Mirco
I have studied this and I do deployment of backend only. I need to know about front end
your frontend is decoupled ? or are u using Django templates ?
Sai
Decoupled
Mirco
Decoupled
and your frontend is made in ?
Lugano
Hi, i made a blog that perfoms CRUD operations,the problem is whenever i write stuffs and publish space is being ignored Eg John Doe Will result to John Doe
Lugano
How can i solve this :|
Mirco
Javascript
Surely 😛
Ghorz
How can i solve this :|
Remember, html ignore extra white space
Sadra
Wdym?
To verify that the data you are pushing is completely right before the creating statement.
Lugano
Remember, html ignore extra white space
Yah i know,so when i write a post i should use <pre> </pre> bt they would be intepreted as english words not html elements