Manish
Anyone from your suggestion.
Anonymous
Hi guys! Here i am stuck with one exception: NoReverseMatch Could any one conribute to fix it Thanks
Anonymous
here it is
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
https://dpaste.de/wWNW
You can find that source code in your curriculum at harrvard
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
And like the man said, wee need the error as well ;)
๏ธŽ
Hello, I'm going to start a project which uses django as a backend. I want to use a cms that controls a public blog, and in the same project provide an API for mobile. So I picked wagtail but don't know how to implement the api app beside wagtail! how the project structure would be like? Thanks for everyone
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
cant find the sourse code
http://cdn.cs50.net/web/2018/spring/lectures/7/src7.zip
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
You could serialize your blog, not much work. Follow the official DRE totu and youll be all set.
Anonymous
And like the man said, wee need the error as well ;)
https://dpaste.de/89SN#L here it is ;)
Mirco
https://dpaste.de/wWNW
fix kwargs with kwargs = { 'flight_id' : flight_id } You can also use redirect() shortcut
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
👍
Manish
Can this help ya ?
Actually not. But thnxx
Manish
Can this help ya ?
@iFlare3G this gave me idea to do. What i want.
Anonymous
How to trigger event when specific element is shown on users browser .. through waypoint.js
Anonymous
Hi guys i have some problem I use this tag <form class="login-form" method="post" action="{% url 'login_and_registration:user_login' %}"> And i get this error : NoReverseMatch at "/login" How can i fix it?
Doug
Paste your urls for the app and your project
Anonymous
Paste your urls for the app and your project
url(r'login',user_login), url(r'registred/',registred_page), url(r'sucsse/',sucsse_page), url(r'logout/',logout_page),
Anonymous
And i add to setting LOGIN_URL = Login_and_registration/loging
inchidi
url(r'login',user_login), url(r'registred/',registred_page), url(r'sucsse/',sucsse_page), url(r'logout/',logout_page),
you should pass name to your url() reverse doesnt lookup your view name, but url name
Mirco
you should pass name to your url() reverse doesnt lookup your view name, but url name
โ˜๏ธโ˜๏ธโ˜๏ธโ˜๏ธ🔝
inchidi
lol
Mirco
Kek 😂
Eugene
name="user_login" as third parameter
inchidi
url(r'login/',user_login, name='user_login') and call it with {% url 'user_login' %}
Anonymous
In my terminal : django.urls.exceptions.NoReverseMatch: 'login_and_registration' is not a registered namespace
Anonymous
And it work turly Thank you much both of you @iFlare3G @Inchidi
inchidi
you're welcome
Anonymous
Gusy i trying make loging with defult user modle but i can login in it
Anonymous
def user_login(request): if request.method == "POST": email=request.POST.get('email') password=request.POST.get('password') user=authenticate(Email=email,password=password) print(user) if user: if user.is_active: login(request,user) return HttpResponseRedirect(reverse('sucsse')) else: return HttpResponse("ACCOUNT NOY ACTIVE") else: return render(request,'../templates/registration/login.html') print("someone login failed") else: return render(request,'../templates/registration/login.html')
Anonymous
Use pastebin please
Sry dude Pastebin is limited in my location
Anonymous
I have no acsess to it
Anonymous
I want authenticate with emil and password
Anonymous
How can i fix my code? :(
Anonymous
I can send my views as file
Anonymous
Use pastebin please
http://dpaste.com/3C8WEEQ
Anonymous
Dpaste ?
http://dpaste.com/3C8WEEQ
Anonymous
Dpaste ?
It was good thank you
inchidi
http://dpaste.com/3C8WEEQ
if you come across this kind of issue, since you are using django, troubleshooting it actually really easy. just open your django shell, import authenticate() and print(user) from user=authenticate(Email=email,password=password)
inchidi
that means the user data doesnt exists, are you sure its Email not username or email ?
inchidi
it should be username if you dont specify custom auth backend
Anonymous
How can i do it?
Anonymous
I most loging with email and pass
inchidi
I most loging with email and pass
https://docs.djangoproject.com/en/2.1/topics/auth/customizing/#customizing-authentication-in-django
inchidi
all you need to do is make new class with def authenticate(self, request, email=None, password=None, **kwargs) and add it in AUTHENTICATION_BACKENDS inside settings.py
_
How can i split fields and methods in django models, add repositories?
_
To separate logic and data or sth like that
Mirco
To separate logic and data or sth like that
Yep but models are py classes so it's normal to put fields and methods related to that class inside its file And as pydanny says inside 2 Scoops of Django book, try to make models "fat"
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
funfact: Linux mindset... I allways thougt Gunicorn was named "GNUnicorn" until i used it today...
Mirco
😂
Trev
Heyo. Would this be an OK place to ask a wagtail question?
Anders (izzno / gooood) ๐Ÿ‡ณ๐Ÿ‡ด
Heyo. Would this be an OK place to ask a wagtail question?
Its a django module so i would assume thats fine ;)
Trev
Its a django module so i would assume thats fine ;)
Thanks you :) - I know that Wagtail uses the Django Rest Framework for its API feature. I was wondering off-hand if anyone had tried creating an app for a rest api endpoint to do non-wagtail specific stuff such as an email API endpoint for an Ajax powered front end form.