Anonymous
Thanks for support hope you guys are doing well...😊😊😊
Ali
I want to run a python script when a button is clicked, how do I do that
Shubham
Write the script inside a def of your views.py
Shubham
And call that def
Shubham
On btn click
Anonymous
sagir
First of all you have to import UserCreationForm
sagir
Then that email field you are taking
sagir
You no need to take it before Meta class
sagir
sagir
Come to the new line after that fields variable
sagir
Then give backspace
sagir
Then take the both fields username and email as you was taking before the meta class
Anonymous
How to count number of download for each music in django
Ali
make a counter inside the function
Ali
oh for each song
Ali
u need a database that get the url for each song that's getting downloaded
Ali
if the id is unique then id.counter =+ 1 for that id
Ali
else insert new id to database
Future
help please
Future
RelatedField.to_representation() must be implemented for field .
Anonymous
else insert new id to database
Matthew Amstutz
Music=music .objects.get(id=id)
Song=music.object.all()
Download ={}
For song in song:
If not download.has_key(music.item.id)
Download ['music.item.id']=
{
'item':item.id
'Count':1
}
Else:
Download[music.item.id]['count'] =+1
Anonymous
Will it work
Anonymous
sagir
José
Has anyone worked a middleware with decorators in Django?
Mirco
Doragonsureiyā
Has anyone worked a middleware with decorators in Django?
Please don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello I need help on $z"
Just ask about your problem directly! With 56k+ people the probability that someone will help is pretty high.
Also please read: http://catb.org/~esr/faqs/smart-questions.html
Anonymous
Kushal
I created an API.
How to call API in android app witj display the data?
Anonymous
This project, I clone it from a repository, it is already working in production, the problem is that when I clone it and make configurations from my local, the static do not load me, do you know what the problem is?
Nitish
Amit
Anonymous
Amit
Anonymous
Working on it
I have not getting any error
Just it doesn't work
If you find solution please also tell me
Amit
Okay
Anonymous
I m facing Merge conflicts because of requirement.txt file
Anonymous
Any help available
Dhruva
When I verify the user I get the token but I want to display the user details how to get
Anonymous
sagir
?
I am getting warning for this question. M sry
Mahdi
any one know this (cannot import name 'RemovedInDjango30Warning)
Mahdi
i finde many answer for this but no one of that solved my problem..
Mahdi
this is complatis of error : django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'django.contrib.admin.templatetags.admin_static': cannot import name 'RemovedInDjango30Warning'
Shubham
Hello guys I have a basic query
Shubham
https://dpaste.org/2kSr
Shubham
How do I check when a particualr method of viewset is being called?
Shubham
lets just say def create_user_api(self, validated_data): when it will get called
Shubham
router.register('create-user', CreateEmailUserViewSet, base_name='create-user')
Shubham
this is just an endpoint
Ali
this is just an endpoint
Make a counter inside it,
If counter =1,
Then it's called and rest the counter back to 0
Ali
How to display database record differently from what it's originally saved?
Let's say 'name' for id=1, is John676,
And I want to display it as "jj676".
Ç
Ç
Venv could be a better way to build env
Shaun
Is there a good way to run scheduled jobs on a django site. I have to pull some orders in from a REST API. How do i run something like that every 5 minutes?
Mirco
Shaun
Use django-q or celery
Ok - since this is a new django site I can just use django-cookiecutter and use the celery setup from there.
Mirco
Shaun
i just like that it has docker and all that setup already
Mirco
Anyway my suggestion is go for django-q if you still have to choose what to use for scheduling tasks
Shaun
ok! thank you @pyflare
Dhruva
ObtainAuthToken is not defined
Антон
Django and MS SQL Server. How connect. And yes, I know this is a bad couple, but...
Mirco
Ali
I've a table as follows :
college — departments
coeng — arch
coeng — elec
coeng — civil
Ali
I want to display arch as architecture
Ali
in the admin panel
Dhruva
Imported in urls*
Mirco
share the code using code sharing tool
Tejas
Does anyone have idea about django-friendship package?
Means how can I use it. I couldn't find any content on internet related to it..
cj