💢💢
still not working
lucifer
No the thing is that the modules which you installed might be in other python version and the python version you're using for manage.py is diff
💢💢
so what can i do to resolve it
lucifer
Tell me the python versions in your pip
💢💢
python 3.8.8
lucifer
Use python3.8 manage.py runserver
💢💢
not working
💢💢
python3.8 : The term 'python3.8' 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 + python3.8 manage.py runserver + ~~~~~~~~~ + CategoryInfo : ObjectNotFound: (python3.8:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
lucifer
Try python3.8.8
💢💢
same results
kuzmich
same results
What OS? if *nix then run which python which python3.8 echo $PATH
kuzmich
And send the results here
kuzmich
Then forget what I said
lucifer
iam in windows 10
Then go and cry in corner
💢💢
Python 3.8
Roman
How?
js runs thought row td's for biggest price. then get service number from header of this column. then write this service name to last column where should be number of service with highest price. then loop thought another rows. IDK how to deal with it on backend without O(n) requests to DB.
Roman
If you are using DRF then we can do this in serializerMethodField.
Thanks. Someone also point me about subquery's. It can be done with them too.
.
I have made a website using Django for it's backend and now I want to integrate chat functionalities too,how can I achieve this??
....
I have made a website using Django for it's backend and now I want to integrate chat functionalities too,how can I achieve this??
django has official tutorial about that https://channels.readthedocs.io/en/latest/tutorial/part_2.html , i think it worked with websockets . also idk django is the correct way to implement chat server , . i think there is lot of libraries for that . idk correctly , pls wait for another answers ...
....
├── manage.py ├── media │ └── images │ └── backgound.jpeg ├── My_Portfolio │ ├── pycache │ ├── settings.py │ ├── urls.py │ └── wsgi.py ├── app │ ├── views.py │ ├── urls.py ├── README.md └── requirements.txt guys, i have to add the path of background.jpeg in views.py . i tried lot of paths. like "media/images/background.jpeg" , but that's not work, how can i give path to this . .
Anonymous
is that needed.?
Yes Django will look for that directory in your app or project
....
Yes Django will look for that directory in your app or project
"app/static/images/contact_background.jpeg" . i tried like this. but not working . images/contact_background.jpeg also this, but not working .
....
Anonymous
images/contact_background.jpeg Is enough
Anonymous
not working bro
How many apps do you have in your project?
Anonymous
one
Your jpeg should be in app/static/app/images So when you want to call it You should do app/images/contact_background.jpeg and it should work
Roman
https://docs.djangoproject.com/en/3.2/howto/static-files/
Suhaib_0.0
Question How do I change the name "anonymous" when showing names I want the name to be hidden instead of an anonymous appearance.
Suhaib_0.0
it not work 🥲 i tried .
Did you add static file inside the settings file?
....
Did you add static file inside the settings file?
STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, '/static/') STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static/static_files'), )
Anonymous
https://pastebin.com/x2L5MYMM
Anonymous
qs = qs.filter(route_name__routes__start_point__name__icontains = startpoint_query ) here , '__' using this can we ascess multiple foreign key help needed
Karlygach
hello everyone, can you help? I need to implement so that the user can select several colors for one product when ordering, and for each color select the size and quantity of the size? is it possible to do?
Mojo
I have this line in models.py: author = models.ForeignKey(User, on_delete=models.CASCADE) and I have this line in serializers.py: fields = ('id', 'author', 'title', 'body', 'created_at',) I realized that using ForeignKey saves author as author_id in the table, and when I make an api call the field 'author' expects an interger (ie id of the author). Is there a way to make the api field accept the author username instead? I'm new to django and kindly asking for assistance
Mojo
When a user logs in using the dj-rest-auth they receive a key like this: { 'key':550ff.... } is there a way to receive both the key and username's id from the database, ie something like this: { 'key':550ff... 'author_id': 3 }
ꪉꫝꪖꪹᦋꪖꪜ
Login authentication is not redirecting index page even though username, password is correct, is there any solution?
ꪉꫝꪖꪹᦋꪖꪜ
show code
def login(request):     if request.method=='POST':       username=request.POST.get('{{username}}')       password1=request.POST.get('{{password}}')       user=auth.authenticate(username=username,password=password1)         if user is not None:           auth.login(request,user)           return redirect('/index')        else:           messages.error(request,'invalid credentials!')           return redirect('login')     else:         return render(request ,'login.html')
ꪉꫝꪖꪹᦋꪖꪜ
Please help me @AzikDev
Hasan
hi i use ModelViewSet in django rest when i give the view to the router, the router create two URL(list, update) which i can send request with post method to list URL to create object how can i access user in this section? access user in create object
Azizbek Xushnazarov
If I login() a request that came from a react app , next time request.is_authenticated() is returning false. Can someone help me?
Oyatillo
class Dictionary(models.Model): quest = TextField(max_length=100) Dictionary.objects.create(quest="😊") Error: (1366, "Incorrect string value: ...
Azizbek Xushnazarov
you must chek tokens
so basic authentication does not work in my case?
Anonymous
Hello, greetings from Lavanya! New blog about python project and job opportunities for data engineering has been published, Please do check it out by clicking the link. Share your views and comments after reading it. Share and support the article to the maximum...Thanks in advance🙏🏻 https://www.analyticsvidhya.com/blog/2021/08/ml-trained-predictive-model-with-a-django-api/
Devansh
How I can implement the third party search api in a project.
Anonymous
if the data is linked witm 3 foreign keys and i want to filter form the last foreign keys throuh the first one then how can i do that..
Anonymous
within**
Azizbek Xushnazarov
I have removed those {{}} and added [] still having same issue
why the heck you should put signs there? just name it 'username' and 'password'
Anonymous
https://pastebin.com/x2L5MYMM
ꪉꫝꪖꪹᦋꪖꪜ
Do i need to metion table name?