Lugano
Os error : winerror 193] %1 is not a valid win32 application
Андрей
One guy said that he has a chinese symbols in his windows username
Андрей
I'm from Russia and i met this problem before, but with pip install
Андрей
https://github.com/pypa/pipenv/issues/2470
Андрей
This topic
Андрей
Do you have a non-ascii symbols in your user name??
Lugano
i dont have
Андрей
Rename my user
Андрей
Also it the topic
Андрей
python -m pip install --upgrade setuptools wheel
Андрей
python -m pip install --upgrade pipenv
Андрей
And try to install something
Lugano
still its not working
raven
does anyone here knows how can one integrate django with pandas, sklearn and training models?
Akash
How should I cycle the choices. I have a button that toggles the field in database which has some choices. Example: MONTH_CHOICES = ( ('01', 'January'), ('02', 'February'), ('03', 'March')) I want it to change from 1 to 2 to 3 to 1 and so on on each click
ronald
Hey guys im deploying a website on pythonanywhere but am not am not able to install cartridge for mezzanine can you guys help me
ronald
whenever I try to install it says permission denied
Muflone
How do you install?
ronald
pip install -U cartridge
Muflone
Are you inside a virtualenv?
ronald
no i was able to install locally without activating a virtualenv
Muflone
Use a virtualenv in PA, it's supposed every web project lives into a virtualenv (also in every other platform)
ronald
okay let me try that
ronald
how do you activate a virtualenv on pythonanywhere
Muflone
First create it with mkvirtualenv, activate using workon name, then install your stuff into
Muflone
When you're ready set the virtualenv in the web section
ronald
thanks managed
Anonymous
Guys i was working on web site on django. So here is my question: after logging out user how to return current page?
ronald
👍
👍
Gabriel
Does anyone have a master/detail form example?
xarala221
LOGOUT_REDIRECT_URL = 'path_to_page/'
Shiva
django Admin/ page styles not showing for me
conan
👍
conan
Django cookies
Anonymous
LOGOUT_REDIRECT_URL = 'path_to_page/'
What about views.py in logout_request: (i should put parameter to)
Manik
Can anybody help to solve, problem of not able to send post data from html to the python 'register.py' file which is mapped in its url and project URL file.
🅜🅞🅗🅘🅣
Can anybody help me to setup reactjs with django.
xarala221
What about views.py in logout_request: (i should put parameter to)
You don't need that. You can use the built-in logout views. If you wish use your own views you need to redirect the user. Ex : return redirect ('path_to/')
xarala221
Can anybody help me to setup reactjs with django.
What you want to do, serve ReactJs from Django rest , or just Django to ReactJs ?
Anonymous
You don't need that. You can use the built-in logout views. If you wish use your own views you need to redirect the user. Ex : return redirect ('path_to/')
I am using build-in logout and here is piece of code def logout_request(request): logout(request) messages.info(request, "Logged out successfully!") return redirect("/")
Anonymous
It is but redirecting to homepage
Sami
So , I have got Associated data in my database and i want to create a page that's query these information using the primery key in as a search input , and i want to do all this without refresh the page
Денис
xarala221
It is but redirecting to homepage
Change redirect('/') to redirect ('path_to/')
Anonymous
Sami
Use JavaScript for that
can I Associate javascript with my database??
xarala221
Giving 404 page not defined in urls
path_to must be a URL you have in your URLs patterns
xarala221
can I Associate javascript with my database??
You use what technology to do so ?
Sami
what do you mean like
Sami
i mean im using django
xarala221
Yes you can do it with Django as back-end server and JavaScript or jQuery in front-end.
Anonymous
path_to must be a URL you have in your URLs patterns
So then i need to define path_to again in views?
Anonymous
here is url.py path('path_to/', views.path_to, name='path_to'),
xarala221
So then i need to define path_to again in views?
No! Path_to mean you've a page path_to. path_to can be 'posts/' or anything else
xarala221
Anonymous
here is full url from django.urls import path from . import views app_name = 'main' urlpatterns = [ path('', views.homepage, name='homepage'), path('register/', views.register, name='register'), path('logout/', views.logout_request, name='logout'), path('login/', views.login_request, name='login'), path('<single_slug>', views.single_slug, name='single_slug'), path('path_to/', , name='path_to'), ]
xarala221
If the user logged out, what you want to do ? What page do you want to redirect him ?
Anonymous
current page that they are on
xarala221
For that use JavaScript to do it
xarala221
You don't need to refresh the page
Anonymous
But how to do it in django?
xarala221
I mean do that with the frontend is much easier and perform better than do it with Django
xarala221
<li class="nav-item mr-3"> <a href="javascript:{document.getElementById('logout').submit()}" class="nav-link"> Logout </a> <form action="{% url 'logout' %}" method="POST" id="logout"> {% csrf_token %} <input type="hidden"> </form> </li>
xarala221
You're welcome
Anonymous
How to use models instead of forms and perform CRUD directly??
xarala221
How to use models instead of forms and perform CRUD directly??
Create your own views and get data from templates
xarala221
Exemple in views.py
xarala221
def sign_in(request): if request.method == "POST": next_ = request.GET.get('next') next_post = request.POST.get('next') redirect_path = next_ or next_post email = request.POST['email'] password = request.POST['password'] user = authenticate(request, email=email, password=password) if user is not None: login(request, user) messages.success(request, "Welcome") return redirect("/") else: messages.error( request, "Credentiels are incorrects") return redirect('/users/login') else: return render(request, "users/login.html")
xarala221
in login.html
xarala221
<form action="{% url 'login' %}" method="POST"> {% csrf_token %} <div class="form-group"> <label for="email">Email :<span class="text-danger">*</span></label> <input type="email" name="email" class="form-control" placeholder="your email" required> </div> <div class="form-group"> <label for="password">Password :<span class="text-danger">*</span></label> <input type="password" name="password" class="form-control" required> </div> <input type="submit" value="Login" class="btn btn-secondary btn-block"> </form>
🅜🅞🅗🅘🅣
What you think is the problem, can you post your code here ?
I just wanted to render reactjs template rather than simple html pages
🅜🅞🅗🅘🅣
For my frontend