Mirco
Anonymous
Hello guys
Anonymous
Which server are best for django applications?
drunktimelord
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
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
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 ?
cj
Pushpender
Rohan
😂😂😂😂
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
AKASH
😂 I know
AKASH
But anyone know how to make
raven
Денис
@sultandelux
Hey guys, one comparison question: when use better Nodejs and Django, let’s say I wanna do mobile app like Uber
@sultandelux
If you are an expert, why not?
@sultandelux
I’m a newbie in Django btw
Ansab
Ansab
Django 9.0 Node js 9.1
ℕo ℕame
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
AFOLABI
AFOLABI
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 ?
Gourav
ioriYagami
database is in postgres
Mirco
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':
Manik
Mirco
Use FBV ..
Why ? Lots of repetitive code in some cases
Manik
For beginners its easy to understand n implement
Manik
Actually we just name the classes but write the methods in it..
Mirco
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)