Johnnybrand
Who are do deploy project with crontab ?
Use Linux follow online tutorial
Jasur
Use Linux follow online tutorial
I use it on reg.ru host
Aritra
in Django suppose I want to do some job after returning a request... suppose this is a lengthy job, and the outcome of this job has nothing to do with what I will return... if we start doing this job before returning, it will take minutes... we can't make the user wait that long... specially when he/she doesn't need the outcome of that job
Mirco
Celery
or Django Q
Software Engineer
Same result
Krishnajith US
How i supposed to differentiate the users in django rest.. Here i am using react frontend end and django jwt for authentication.I have two users.One normal user and one freelancer user..can anyone suggest any docs or tutorial
Smile
hello i have func with property in my model. How to call it in ClassView ? class FeedBackView(SingleObjectMixin, FormView): template_name = 'single-project.html' model = Project form_class = ReviewForm login_url = '/login' model.get_vote_count # property
Georg
hello. How can I remove annotated fields after Entity.objects.annotate(fld=..).filter(fld=..), to get distinct() of original entities ?
Georg
again?
Georg
to make two queries?
Maxim
again?
as you wish
Georg
I wish not to do overhead of queries
Doragonsureiyā
Georg
haha
Maxim
OK. I need to "deannotate" fld after filter()? Is there any way to do that?
If you're talking about some complicated case where you want to combine annotation with aggregation, it's worth telling us so we don't try to read your mind
Georg
nope, no any aggregations. I have two models: Entity and Sub (for example). I need to join Entity and Sub, filter by some kind of computed field of Sub, then get a pure Entity records (without duplicates, so Sub is a detail model)
ꜱᴀᴇᴇᴅ
Hello friends I want to model the products Read the products that are similar to one of the products from the database Now I want to add an item to each of these products that can be found to identify whether the logged in user has been liked or not. And the information related to the likes of products is in another model whose fields are user and product Is it possible to do something like this?
Aritra
Hi! I have a model with an imageField in django. It is actually the Profile Picture of an User. Whenever a user signs up (we don't ask him for the picture), we generate a random image (by an API call) and want to put that as his Profile Picture. Here is my Profile Model: class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) dp = models.ImageField(...) ... Here is a part of my views.py profile = Profile( user = user, # dp = the random image, ) profile.save() Suppose I have a function get_random_dp() to get the url of the random profile image
Manoj
I have a problem
Manoj
fm.cleaned_data['name']
Manoj
is returning an error
Manoj
object has no attribute 'cleaned_data'
Manoj
'StudentRegistration' object has no attribute 'cleaned_data'
Sarvar
'StudentRegistration' object has no attribute 'cleaned_data'
Is it serializer, or can you send us the screenshot of the code ?
Uzmanium
Hi Everbody, I have set up a project called userServices with Microservices architecture, Django, Rest Framework, SimpleJWT, Dj-Rest-Auth and AllAuth and it's working. I have to keep the User Database somewhere else. (by law - GDPR) The other two teams programmed the product and content microservices with Django. These are using the same database. I also looked at session sharing but it doesn't work in api calls due to Token check. How should I go about the common Api Auth of other django projects?
Uzmanium
I will try solution by setting up custom OAuth service. https://django-oauth-toolkit.readthedocs.io/en/latest/index.html
Sebastian
Hello community, I am designing a SAAS system but I have the question of how to limit the space in the cloud for each user. In other words, I would like to separate it by plans, the more you pay, the more memory. Is the limit and separation of these done directly with the service provider, for example aws, azure, Google or is it programmed directly into the software? Thank you
Daniel
Guys, how do i add more than one item to a FK?
Guys, how do i add more than one item to a FK?
You should use m2m relation instead of FK
sports_lover.
hello, guys,I am using django as backend I am sending the custom token to the frontend through the login data's response,Because of sending in response that token shows me in network tab after inspect function. If the token appears in the Network tab, what can be the problem with security? Or what secret path could I take to send the token?
sports_lover.
Guys, how do i add more than one item to a FK?
I think you should try this:- def str(self): return self.name+self.email+.......
Gaurav
File "C:\Users\HP\Desktop\celery\env\lib\site-packages\redis\connection.py", line 599, in <lambda> lambda: self._connect(), lambda error: self.disconnect(error) TypeError: Channel._connparams.<locals>.Connection.disconnect() takes 1 positional argument but 2 were given
Gaurav
getting this error while settuping celery with django
K
I am python developer I have 6 years good experience in django..so any good work for me so plzz message me...
🧚‍♂️
Hello, I tried to deploy on the railway, gives this error
🧚‍♂️
Application Error Is your app correctly listening on $PORT?
🧚‍♂️
web: build: . ports: - "8000:8000" command: sh -c "python manage.py migrate && python manage.py collectstatic --noinput && python manage.py runserver 0.0.0.0:$PORT"
Anurag
how to solve iterable problem... i have passed a queryset but it is not iterating in template for loop
Jaanleva
Hello Everyone, I'm facing an issue while downloading blob from the azure storage. Please check https://stackoverflow.com/questions/74832025/downloding-blob-from-azure-storage-taking-too-much-time Any help would be highly appreciated.
.
how to solve iterable problem... i have passed a queryset but it is not iterating in template for loop
How do you iterate it in the template? Are you using {% for item in qs %} correctly? You can use a code pasting website and share your the views that generate the qs, and your template that’s supposed to iterate through it.
Georg
is there any way to do unique constraint with condition on a model if this model is an inherited model and fields for to unique is in the last model of hierarchy but a constraint field is in the parent model?
Georg
I think that RDBMS can't do that.. but maybe it is possible in django engine level
Georg
oh.. It seems I got it. A trigger
Eliphaz
Application Error Is your app correctly listening on $PORT?
Hi you should add PORT in environmental variables of railway
Eliphaz
Yes , I did it
You get same error?
Georg
Hi, is django-suit alive for django 4.1?
Fathullo
hi guys who knows how to fix this problem
Fathullo
hi guys who knows how to fix this problem
PS C:\Users\angren\Desktop\Django-lessons\test> pipenv install django pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pipenv install django + ~~~~~~ + CategoryInfo : ObjectNotFound: (pipenv:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Eliphaz
Hi, is django-suit alive for django 4.1?
Hum I have never use it but after I've read there GitHub repo I don't thinks so
Eliphaz
Perhaps you can try to find a fork who support Django 4.1
Fathullo
yes i using pipenv to create django project
Fathullo
i ware leaning django on youtube with. Programing with mosh
Eliphaz
yes i using pipenv to create django project
Oh okay . do you already activate the virtual environment?
Fathullo
Oh okay . do you already activate the virtual environment?
not yet i ware installing django but it gets wrong
Eliphaz
To activate the virtual environment make : pipenv shell
Eliphaz
Or run directly by: pipenv run <command>
Eliphaz
But you should ensure you if pipenv is correctly installed on your system
Fathullo
To activate the virtual environment make : pipenv shell
i know how to activate it but firstly you have to install django and so when itrying to install django its not working
🧚‍♂️
Eliphaz
Yes
You see this error because railway don't find this environment variable $PORT. You should ensure you if you have good added PORT environment variable https://docs.railway.app/develop/variables
Eliphaz
how to add it
Ok check this to do it : https://www.pythontutorial.net/python-basics/install-pipenv-windows/
His
PS C:\Users\angren\Desktop\Django-lessons\test> pipenv install django pipenv : The term 'pipenv' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + pipenv install django + ~~~~~~ + CategoryInfo : ObjectNotFound: (pipenv:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
First of all ensure python is installed, then navigate to desired directory via the terminal Type in>>> Python -m venv name_of_my_directory. Then navigate into the directory and type>>> Scripts\activate You should see (name_of_my_directory) at the beginning of the new line, Then after then you can pip install Django
talha
I cannot use {% load static %} in external css file, in order to reverse static files I have to use it inline css but I don't want that. is there any proper fix for this?
talha
Use whitenoise
I'll look into it, thanks
Krunal
How to use django_apscheduler in windows server with MS SQL server? or any other alternative to schedule django task in windoes server.
Kinder #pupu
Hi all. Maybe someone faced such a problem. I am using ArrayField. And it doesn't translate the item limit exceeded message. That is, despite the localization settings, it writes in English. Writing your message is somehow strange, since localization is what it is for.