Anonymous
But the index.html is a python file right not html file
Dcruz
😳
pino@mastrobirraio ~$
can you share with use the views code?
pino@mastrobirraio ~$
to learn more read this: https://www.tutorialspoint.com/django/django_creating_views.htm
Anonymous
Oh OK maybe I should take a pic of it
pino@mastrobirraio ~$
is not hard
pino@mastrobirraio ~$
go to pastebin.com
pino@mastrobirraio ~$
click on new paste
pino@mastrobirraio ~$
paste the code, choose the synthax, create the pastebin
pino@mastrobirraio ~$
and then share with us the link
Anonymous
Oh OK
pino@mastrobirraio ~$
Anonymous
Joseph
Please can I use the websocket module directly for my django app? If yes please tell me how I can implement that.
I am using hosting that does not provide redid support so channels and django-websocket-redis
Joseph
Вадим
Thx) I already done this)
Anonymous
Help
Anonymous
Help make website using django
Vichu
How to move my code from views to models or any part of project. As code in views looks massive because of my if else logic
Vichu
And I am getting data from request.data so i need to use the requested data in my code too
Anders (izzno / gooood) 🇳🇴
Hot tip:
I have new glasses and a heavy flue, so i was looking for something to "smooth" the eye "pain":
https://darkreader.org/
This is great!
Anders (izzno / gooood) 🇳🇴
If you read alot of articles and i highly reccomend this.
Anonymous
👍
George
George
I have used it for years for everything
Anders (izzno / gooood) 🇳🇴
I just found it, it has a few issues, like toggling and remembering but Im sure its a bit of userError as well ;)
Anders (izzno / gooood) 🇳🇴
But yes, its very nice!
pylance
Anonymous
George
It keeps track of the list of sites you like to switch and automatically does it for you
Ronald
Telegram desktop
Ronald
Copy & Paste
Ronald
(onto dpaste of course)
Grigoriy
Hi, all! Has anobody ever experienced the following error
Login Failed: You can't use Facebook to log into this app or website because there's an issue with its implementation of Facebook Login.
when using django-allauth?
Ghorz
Ghorz
Get you api keys from Facebook first
Ghorz
Add Facebook to app
Ghorz
Log to admin and setup Facebook with the credentials
Grigoriy
I added socialaccount, added secret key and client id but no luck(
Anonymous
Anonymous
I have one doubt, is it a good practice to store user details in session variable. ??
Anonymous
I mean Django User model
Raja
Please give me the django material
Eugene
year = models.PositiveIntegerField()
this is good practice?
cj
I preffer to store it as
.CharField(max_length=4)
because I won't make arithmetical operations with those values
None
Hello. How can I save image field via custom manager ?
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
but i guess you could make one and override the save method
Anders (izzno / gooood) 🇳🇴
just an example from a model i have.
Anders (izzno / gooood) 🇳🇴
All though I am not sure what you want since you did not share any code.
None
None
Anders (izzno / gooood) 🇳🇴
The first thing that comes to mind is , there's got to be a better way of doing this.
Anders (izzno / gooood) 🇳🇴
Im sorry i cant help you...
None
Anders (izzno / gooood) 🇳🇴
Me neither, I dont get what you are trying to do from your code. but now its here, maybe someone else will.
None
Anders (izzno / gooood) 🇳🇴
ok, so you are using signal to start a precess once saved.
What I would do is put this in a separate file, or better yet, use JS to do the work on the client before you save.
Anders (izzno / gooood) 🇳🇴
That will save your server...
Anders (izzno / gooood) 🇳🇴
if you use signal to trigger an imported fumction from a separate file you can import your thumnail models in this file and just pass the files in for .save
None
Anders (izzno / gooood) 🇳🇴
yes?
Anders (izzno / gooood) 🇳🇴
you can pass the base picture instance and create the thumnail instances in the other file
None
Anders (izzno / gooood) 🇳🇴
to keep your models.py clean
Anders (izzno / gooood) 🇳🇴
and you need to use the models created in models.py (thumnails). easier to import them in another file:
from .models import Thumbnail
do your work
Thumnail(your work).save
None
I thought to use custom manager to keep it clean. Just use Tile.objects.my_custom_create(image, *args)
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
but again (I would look in to JS for this to offload your server) if you think you can get some traFIC...
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
I have another question: Why dont you override your models save method and do it there ? Just define your thumnail models before the picture model ?