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 ~$
Oh OK maybe I should take a pic of it
can you share the code using pastebin or similar
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
Anonymous
Like how can I display templates on django. I followed all the instructions but it still gives me the TemplateDoesNotExist error
Go to your settings.py, under TEMPLATES, there is a DIRS:[ ]....Make sure to include template in the DIRS, I.e.DIRS:['templates']
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
Вадим
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
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!
Anonymous
George
I just found it, it has a few issues, like toggling and remembering but Im sure its a bit of userError as well ;)
You got to set up your key combination, and being toggle on/off rather than the extention and it will work perfectly. I bind it to control+q
George
It keeps track of the list of sites you like to switch and automatically does it for you
Ronald
That's the easy way to show the code rather than typing.
making it hard for the people you’re asking help for in the process.
Ronald
Telegram desktop
Ronald
Copy & Paste
Ronald
(onto dpaste of course)
cj
That's the easy way to show the code rather than typing.
easy for you, but hard for the rest to read and try to help you 🤷🏻‍♂️
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
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
I have one doubt, is it a good practice to store user details in session variable. ??
Anonymous
I mean Django User model
Grigoriy
Log to admin and setup Facebook with the credentials
did that, no change. Could you, please, provide more info?
Raja
Please give me the django material
cj
Please give me the django material
Let me 🦆 DuckDuckGo that for you: 🔎 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) 🇳🇴
Hello. How can I save image field via custom manager ?
managers are made to retrieve, not save
Anders (izzno / gooood) 🇳🇴
but i guess you could make one and override the save method
Anders (izzno / gooood) 🇳🇴
but i guess you could make one and override the save method
` def save(self, *args, **kwargs): self.short_name = self.short_name.upper() super(Currency, self).save(*args, **kwargs) `
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.
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...
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
Me neither, I dont get what you are trying to do from your code. but now its here, maybe someone else will.
1) save image to model 2) crop that image to many 3) save each cropped image to other model
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
Anders (izzno / gooood) 🇳🇴
yes?
Anders (izzno / gooood) 🇳🇴
you can pass the base picture instance and create the thumnail instances in the other file
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) 🇳🇴
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 ?
None
and its not critic, i just dont get the manager idea ;)
Okay. Than how can I write save method for MODEL? not for instance