Divakar
Hi guys
Divakar
I have installed django
Abduxalil
I have installed django
👍👍👍👏👏👏
Divakar
When i am running python manage py runserver then it show path not found
Divakar
How i will set virtual environment if I have already installed django
Divakar
Please reply
Divakar
Hey guys you are online please reply
Mirco
Hey guys you are online please reply
Could u please stop asking it ?
Mirco
How i will set virtual environment if I have already installed django
Study python before Django if you don't know how to manage venvs
Divakar
Study python before Django if you don't know how to manage venvs
If you don't know answer then don't suggest me ok
Divakar
I can setup venv
kunmi_od
👋hi I'm a Django amateur......i use to Code with Django without a virtual env, my projects got messed up.....so I started using Virtual env but after activating the VENV , when I use the "python manage.py runserver" nothing happens, the CMD just goes to the next line......... Someone help me please
Anonymous
Ahahaha
Divakar
You don't understand what am I asking how to activate venv in django
Divakar
You guys only maked group but not want to help beginner
Anonymous
in which OS are you working?
Divakar
Window
Anonymous
Ok, let me see
Anonymous
working on CMD or PowerShell?
Divakar
Cmd
Anonymous
<venv>\Scripts\activate.bat try that command
Divakar
I installed django without setting venv
Anonymous
oh
Divakar
I want to navigate to venv
Anonymous
How can i add url who gave id or slug in LOGIN_EXEMPT_URL for middlewares?
Anonymous
I want to navigate to venv
Your question isn't clear.. Is it that you have already created a virtual environment and you want to navigate to it's directory?
Mirco
If you don't know answer then don't suggest me ok
If I wanted to help u, now you can proceed by yourself 😁
Mirco
!job
Doragonsureiyā
Rule 🔟: Job offers are only allowed in the offtopic chat - @PythonOfftopic. To avoid being marked as spam, make your offer include skillset/techstack, salary/reward, contact information and a brief description of what work you want done.
Aditya
I want to navigate to venv
source bin/activate
Anonymous
source bin/activate
If linux work
Divakar
source bin/activate
Which activate file there is 3or 4 activate file
Anonymous
but in windows is another command
Mirco
I want to navigate to venv
This explains clearly you don't know how to work with venvs so please could u study it a bit a then come back here if you keep being stuck ?
Divakar
Aditya
Which activate file there is 3or 4 activate file
Cd into the directory you have virtual env installed
Aditya
Ok go on
Divakar
I created python -m venv Virtualenv
Aditya
Ok look for folder namef Virtualenv
Aditya
Cd into the same and use the command provided earlier
Mirco
You can use pipenv
Don't add more stuff please, he can use pipenv once he learns what a venv is and how to work with it
Mirco
I created python -m venv Virtualenv
https://programwithus.com/learn/python/pip-virtualenv-windows Could u please follow this guide ? And after understanding you will able by yourself to install Django
Akash
My login request contains a resquest.auth param but when I call logout API request.auth is None. Where can be the evil cause ? I am passing Autherization Token in both API calls
albert
AttributeError: module 'sys' has no attribute 'platlibdir'. I have been trying to use pip but every time i try to install something this error occurs. Anyone with the solution to that problem can help me.
Mirco
I don't remember Django source code but for sure the LogoutView sets it to None
Akash
You are logging out so you don't need auth object
I actually do need, I order to set my Auth Token expiry to now().
Mirco
I actually do need, I order to set my Auth Token expiry to now().
You can configure it in Django settings and not on Logout
Aditya
Token expiry must be configuration in settings.py and for anything you do while logout perform where you inyiate that event in views.py
Akash
You can configure it in Django settings and not on Logout
I can't find any documentation for same. Can you share some reference ?
Mirco
Akash
Token expiry must be configuration in settings.py and for anything you do while logout perform where you inyiate that event in views.py
I guess you are suggesting about Token default expiry time. I want to expire token on logout .
Akash
My login request contains a resquest.auth param but when I call logout API request.auth is None. Where can be the evil cause ? I am passing Autherization Token in both API calls
@method_decorator(never_cache, name='dispatch') class UserLogoutView(generics.ListAPIView): permission_classes = [AllowAny] def get(self, request, *args, **kwargs): print("Auth ",request.auth) try: try: del request.session['actor_id'] except KeyError: pass logout(request) return Response(status=status.HTTP_200_OK) except Exception: return Response(status=status.HTTP_400_BAD_REQUEST)
Mirco
I mean the Token authentication when you logout will delete the token for that user
Mirco
And it will generate a new one when login again
Akash
I mean the Token authentication when you logout will delete the token for that user
I have shared my Logout code above. It doesn't logout by its own, I have checked that. I am using JWT token.
Mirco
This code implementation inherits just generics.ListAPIVIew so I am clueless why request.auth is none
but you don't have to inherits from that view you should inherit from the LogoutView of the package u'r using for JWT
Mirco
to customise its behaviour if needed
Akash
but you don't have to inherits from that view you should inherit from the LogoutView of the package u'r using for JWT
mmm... basically I am overriding rest_framework.authentication.TokenAuthenticaiton and it doesn't have a Logout behaviour
Arbeit
is django even designed to use such threaded tasks?
Akash
My REST_FRAMEWORK auth looks as follow ``` REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'RMS.authentication.JWTAuthentication', # it inherits rest_framework.authentication.TokenAuthenticaiton 'rest_framework.authentication.TokenAuthentication', )} ```
Mirco
mmm... basically I am overriding rest_framework.authentication.TokenAuthenticaiton and it doesn't have a Logout behaviour
mmm if u need to use JWT, it's better to use some packages suggested by DRF docs https://www.django-rest-framework.org/api-guide/authentication/#json-web-token-authentication
Anonymous
How i can publish my website created using django to host like byehost
Mirco
How i can publish my website created using django to host like byehost
have a look at Deployment section of Django official doc
Artyom
Can anyone check https://stackoverflow.com/questions/66099993/django-request-with-annotate-and-count?noredirect=1#comment116864303_66099993? Thanks
Mirco
you have link for that
https://docs.djangoproject.com/en/3.1/howto/deployment/
Naman
I made a YouTube video downloader in which when the file is downloaded on the server side audio and video both are downloaded and merged and then sent to the users email ID. I want to show the progress of merging on the server side to the user. However I can't separate the the progress bar between multiple users. So what happens is when user one is trying to use the website then he is able to see the progress bar and when user two uses the website then the progress bar of user 1 is replaced by the progress bar of user two however in the background both processes are running separately. It would be nice if someone can message me on personal so that I can discuss the challenge in detail.
Anonymous
How can I send a token via email to verify email? In drf