Anonymous
How to start django project?
Anonymous
On terminal ubuntu
Anonymous
Matt
Type in Google this sentence
Anonymous
Ulug'bek | Python Developer
Hi guys. I was working with django rest_auth. This error occurs after an email is sent with the password reset value. Email Backend written. Please help who knows.
Ulug'bek | Python Developer
Ulug'bek | Python Developer
Maxim
@djangoes read the rules and do it properly
bgk
Can Any one explains how to use Django uwsgi with nginx and gunicorn on Windows 10
...
Aman
Does anyone have django handwritten notes??
Can you pls share it
Rohan
Rohan
The official docs are digital handwritten version.
Aman
I am new to django
I need easy to understand study material.
BLESSED
hi guys, i need to save files in different folders for each user, to have path like this "files/16/file.txt"
but how i can get an user id
is this variant usable?
class UserFile(models.Model):
user_id = models.ForeignKey(...)
file = models.FileField(upload_to=f'files/{user_id}/')
Д
Д
then it's clearer
Д
ForeignKey means there can be many. your files can't have many Owners
Д
do you know what I mean? now your UserFile can have many user_id pointing to it
Д
a Folder should have many Files, and each File should have one User, or then the Folder should only have one User
BLESSED
Д
so it must be just a field
https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.OneToOneField this works too
Д
wait am I being stupid
Д
a User can have Many files but a file can have only one User
Д
which way is the ForeignKey
BLESSED
i did not yet understood how to save a file for specific user
Д
BLESSED
BLESSED
files save from admin panel
Д
I haven't solved this problem before. I know it's not very difficult but it's hard to help you without seeing code
Д
maybe somebody else has?
Д
yes
does basic Django (not DRF) have middleware that lets you pull out the logged in User ID from the requests object in the Views?
Д
because in DRF you could just do that
BLESSED
i have a current user, i just search for some way to send data to my model, like
file = models.FileField(upload_to=f'files/{ _get_current_user_id() }', null=True)
but i have already answered to my question i think :)
just the _get_current_user_id uses imported functions from my views where i have the user id (or i can make a separate module for it) and i hope it will work
BLESSED
thanks for help🤝🤝🤝
Mehdi
Hi, I have just started learning Django and am a beginner. I have a project related to cryptocurrency, and it is supposed that the white paper we import through the API will get the price and volume from the desired site (example: coinmarketcap.com), but no matter how much I search, I do not know how to implement this piece. Can you help me?
Егор
I have a question here guys. Why all the beginners go here if they haven’t even read the very first django tutorial?
Егор
Mehdi
Егор
Sure
Farzin
Hi, I have a mixin for my views it's something like this:
class TestCenterMixin:
test_center: TestCenter
def initial(self, request, *args, **kwargs):
.....
self.test_center = get_object_or_404(qs, pk=test_center_id)
Now, when I'm trying to use this mixin in my view, by overriding queryset like this:
class GetTestView(TestCenterMixin, generics.RetrieveAPIView):
.....
def get_queryset(self) -> QuerySet[Test]:
return Test.objects.filter(test_center=test_center)
it works correctly, but first time that want to run sever and loading swagger api page, I'm getting this error in console, how I can prevent this:
AttributeError: 'GetTestView' object has no attribute 'test_center'
Strauss21
Why is it a pain in the ass to see my Css change in django they told me to use python manage.py collectstatic and to open my browser in incognito mode which I did and it's worked for 10 minutes and now I'm again unable to see my css change
Enes
Enes
I am doing py manage.py runserver 8047
Enes
You can use a different port number in every change of your css file
Enes
First I am designing the frontend after uploading to Django project this is the better way
Strauss21
Anonymous
is there some free hosting websites for django like heroku
Matt
Kshitij
my postman is giving responses on login and register while i am not able to integrate …any resources to study
Raul
Hello there, how create dynamic models? Is possible with data of another model?
kam
why django is not sending emails from localhost?
the output is there in the console, but cannot see it in gmail.
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER ='myaccount@gmail.com'
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
I know that i can use Gmail API for that. But if SMTP is still working it is easier and faster.
Do I really need an administrator account for this to configure or not? To do this I need my Google Workspace, and to do that i need a subscription and domen if not mistaken.
Alda
Med
Guys who can explain this issue i just used a simple jwt with Abstractuser class as custom User
But it doesn't work why ?
Vicente
Hi,
We're working with Django in a project and want to create a Mobile app. We're reviewing Flutter, What do you thing about Flutter for an Android and IOS app?
Marlon
alguém que manja de datamigration no django pra dar uma força ?? preciso tirar umas duvidas que surgiram...
Hossein.A
Hossein.A
Hossein.A
Hossein.A
Hossein.A
Artur
Hi. I want to make multiple image upload in django admin. I have 2 models. Product and ProductImage (with foreignkey to Product). I want to uploads images of Product when i create a new Product in django admin. What is the best way to do it?
Neo
Hirbod;
kam
kam
i actually did not do that. I cannot find it in my google account Manage third-party access. setting
Fredy
Hello group, how can I add integer data columns, filtered by the title to which it belongs?
This is my query
Load.objects.filter(title='Python').aggregate(Sum('hours__hour_1'), Sum('hours__hour_2'))
Currently I have this output, it is adding me well, now how do I get a total of the data (Expected result 6)
{'hours__hour_1__sum': 4,
'hours__hour_2__sum': 2
}
Mehdi
Hi, Can you introduce me to an article or video tutorial so I can use the API of other sites in my project django ?
#django #api
Klepshydra
hi everyone! How to add changelog to a django project?
Strauss21
Hello everyone so I'm still facing a problem with my application having hard times showing me the css change.
My static file config in settings.py
/
STATIC_URL='static/'
STATICFILES_DIRS=[
os.path.join(BASE_DIR,"static")
]
when I run ./manage.py collectstatic I get the following error :
raise ImproperConfigured(
Sir
Please, help me! I don't how to add request.FILES Яin CreateView