Anonymous
Hello guys
Anonymous
Which server are best for django applications?
Anonymous
Okay
Abdulakhad
class Image(models.Model): user_id = models.ForeignKey(User, on_delete=models.CASCADE) url = models.CharField(max_length=255, unique=True) photo = models.ImageField(upload_to='uploads/', blank=True) uploaded_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) Image.photo.save("image.jpg", File(img_temp), save=True) why gives an error type object 'Image' has no attribute 'photo'
Mirco
study python before using django
Abdulakhad
from .models import Image image = Image() image.photo.save("image.jpg", File(img_temp), save=True) image.save is it right to do so?
Mirco
R
Import mysdb as database error come
R
I'm trying to learn django please help about above questions
Batman
Import mysdb as database error come
http://catb.org/~esr/faqs/smart-questions.html
Muflone
hmm, I'll try that out, besides, do you guys use multiple settings.py for local and production environment?
I do, one common for deafult, one for development on which first import the common then override some things, one for testing server and one for production server
Anonymous
In my project .. python manage.py collectstatic command shows error
Anonymous
It gives not a directory error
None
Hello. When I try to generate CSV from my query I get broken strings. My code for i in User.objects.all().exclude(username='admin'): writer.writerow( [str(i.id), str(i.username), str(i.laboratory), str(i.city), str(i.position), str(i.phone), str(i.rate.rate) ] ) what's wrong with unicode?
Anonymous
What is learning time of Django ?
Pushpender
usually mornings
😂😂😂
Rohan
😂😂😂😂
Rohan
usually mornings
I prefer nights, more conducive environment
Rohan
But you have a wifey, so it's different for you
Mitesh
Hello guys.. How to implement comment system like instagram... In django?
AKASH
Please help me . Can i .xls file check and perform operations without saving server
AKASH
Using python
AKASH
Flask
Mirco
Flask
Wrong place
AKASH
😂 I know
AKASH
But anyone know how to make
cj
But anyone know how to make
even that this is not the right place
Денис
Hello guys.. How to implement comment system like instagram... In django?
Read Django By Example, it has a brilliant tutorial on such a case.
@sultandelux
Hey guys, one comparison question: when use better Nodejs and Django, let’s say I wanna do mobile app like Uber
cj
Hey guys, one comparison question: when use better Nodejs and Django, let’s say I wanna do mobile app like Uber
That's like going to a BMW group and asking: "Which one is better, a BMW or an Audi?" 🙄 Do you expect people to tell you: "Yeah, go for an Audi"?
@sultandelux
If you are an expert, why not?
@sultandelux
I’m a newbie in Django btw
Ansab
Django 9.0 Node js 9.1
cj
Django 9.0 Node js 9.1
there's not Django 9.0
Anonymous
omg guys
AFOLABI
Please guys, how do I use model form in forms.py and save it to db
AFOLABI
Any tutorial
Doragonsureiyā
Any tutorial
Go take a look to the official Django tutorial: https://docs.djangoproject.com/en/dev/intro/tutorial01/
AFOLABI
I have it not helping
cj
I have it not helping
if you're asking that thing, that means you didn't learn Django the proper way, go read the tutorial from the beginning again, step by step, don't skip things
cj
You mean the official doc?
yes, the official tutorial that there's in the official docs from the official page
cj
Don't understand this ?
go read the official tutorial first, from the beginning, you'll learn how Django works
Batman
Please guys, how do I use model form in forms.py and save it to db
yes, i got one tutorial for ya, here ya go http://catb.org/~esr/faqs/smart-questions.html
Mirco
Nope, for everything useful to your model
Mirco
Model is a class right ? So you can put into it properties for example, static/class methods and so on So thing about it as a python class because this is what a model is
Mirco
For example you can write a method to retrieve a calculation that u need to use lots of time
Mirco
!yw
Doragonsureiyā
You're welcome! 😊
Ghorz
I've tried to figure out a way to pass arguments to a url in settings.py A use case is LOGIN_REDIRECT_URL = ("users:home", pk=pk, x=z) Shed light if you have a hint please.
Lugano
Between Class based views and Function based views which one should i use,am am a beginner in django for begginers am being taught class based views while in other docs for begineers its function based views,so which one should i use?
ioriYagami
hi, excuse me, how i can export and import database in django with docker ?
ioriYagami
database is in postgres
Mirco
But u need to run the command inside the container
ioriYagami
im used this
ioriYagami
python manage.py dumpdata > dumped_data.json
ioriYagami
for import
ioriYagami
python manage.py loaddata < dumped_data.json
ioriYagami
but have errors
ioriYagami
File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/loaddata.py", line 172, in load_label for obj in objects: File "/usr/local/lib/python3.6/site-packages/django/core/serializers/json.py", line 73, in Deserializer raise DeserializationError() from exc django.core.serializers.base.DeserializationError: Problem installing fixture '/app/dumped_data.json':
Mirco
Use FBV ..
Why ? Lots of repetitive code in some cases
Manik
For beginners its easy to understand n implement
Mirco
For beginners its easy to understand n implement
If he knows python OOP , CBVs will be more comfortable 😊
Manik
Actually we just name the classes but write the methods in it..
ℕo ℕame
Why ? Lots of repetitive code in some cases
I think it's better to use fbv for learning purposes
Mirco
I think it's better to use fbv for learning purposes
Yup, for learning purposes I agree with u
D4RK
Hi how can i create tumbnail from video when user upload video and save tumnnail in model?
Anonymous
Good day. I need the help. In my project at one page i need to have 2 forms, and one formset. Also everyone form from formset have own object. I did it. But i also need to display extra data about it object inside form just as text. How are i can right do it ? My project on github : https://github.com/Hollwill/IMEXstat_shop/tree/master/orders ( I from russia, Sorry for my English)