Isaías
Mirco
And your serializer ?
Isaías
https://pastebin.com/EtH79XKL
Mirco
And your model has 'field' as attribute ?
Isaías
yes
Mirco
Mmm one thing could be try to log your self.queryset when u request the endpoint and check if it's as u expect it
Isaías
ok
Isaías
thank you @iFlare3G
Mirco
Yw 😀
Anders (izzno / gooood) 🇳🇴
I am having trouble getting this to work: https://www.django-rest-framework.org/api-guide/schemas/#the-get_schema_view-shortcut
Could this be broken in 3.7.1
Anders (izzno / gooood) 🇳🇴
getting: AttributeError: Request object has no attribute accepted_renderer schemas
Anders (izzno / gooood) 🇳🇴
I am only using the code in urls.py
inchidi
already install coreapi?
Anders (izzno / gooood) 🇳🇴
yes
Anders (izzno / gooood) 🇳🇴
:)
Anders (izzno / gooood) 🇳🇴
Do i need to add it to apps ? The tuto does not say
Anders (izzno / gooood) 🇳🇴
The only difference i see is url('^schema$', schema_view), i replaced with path
George
My runserver tells me that /admin is repeated and maybe it could not reverse urls correctly. But i got /admin only once. /admin url is not declared implicitly right?
Rajjix
Rajjix
probably have a regex url or something similar that takes in admin as a url pattern other than the original admin
George
I have no regex :(
George
Only absolute
Anders (izzno / gooood) 🇳🇴
/admin or "admin/" ?
Anders (izzno / gooood) 🇳🇴
Anders (izzno / gooood) 🇳🇴
Just did not say that specifically
Rajjix
Does that include an app’s urls? If so check those
George
from django.urls import path
from django.conf.urls import re_path,url,include
from . import views
from annotation_web import views
from django.contrib import admin
urlpatterns = [
path('admin/',admin.site.urls),
path('', views.index, name='index'),
path('photos/ir/', views.infraredImage.as_view()),
path('photos/vi/<int:pk>/', views.visibleImage.as_view()),
path('photos/info/<int:pk>/', views.imageInfo.as_view()),
path('powerplant/', views.pPlant.as_view()),
path('datacols/', views.load_datacol, name='load_datacols'),
path('kind/ir', views.load_failures, name='load_failures'),
#path('render/pdf/', views.Pdf.as_view()),
]
George
Im on the phone rn
George
Rajjix
Try and change the name of the empty path url
Name not pattern 🤔
George
Mmmmm should i give admin a name?
Rajjix
No
Admin already admin:index as a name
George
Mmmmmmm
George
/ should be named 'homepage' (?)
Rajjix
Anything
George
Something logic 😂
Rajjix
‘home’
George
Home is nice and short tnk you
George
Ill try when i continue working
George
Thank you and the rest of the community :)
George
Also @Inchidi ty
Rajjix
and also try keeping the empty path as your last path
George
Why
Rajjix
Here it’s okay, but for future practices
George
Its better to stack right?
George
FILO
Rajjix
yes
Rajjix
longest top smallest bottom and be more creative not keeping them similar, just best practices stuff i follow to avoid annoying errors like this
George
For big ass websites
George
Ok :)
Anonymous
help
AttributeError at /blog/2018/10/27/teste
'Post' object has no attribute 'filter'
https://pastebin.com/GbB7XtXQ
Mirco
Pradeep
Hii
Pradeep
I am facing a problem in a basic app I was creating
Pradeep
Django redirects to login page even after logging in
Pradeep
Views. py code:
Anonymous
Anonymous
Anonymous
what’s Django fastest in
Anonymous
Pypy?
Pradeep
The problem is whenever I request login URL even after logged in it execute get request and sends blank login form
Anonymous
https://lincolnloop.com/blog/faster-django-sites-pypy/
Anonymous
Anonymous
https://falconframework.org
Pradeep
Please suggest me ho to procees
Pradeep
Proceed*
Gabriel
Pradeep, In my opinion, better you create a new function, try to use the redirect and render functions more simple and increase the level step by step
Pradeep
New function for what
Gabriel
On that function it’s simple and fast for me to understand.. But, you need to train your eyes on.. Try to do it slowly
Gabriel
Redirecting*
Pradeep
How can we check if it is logged in at start of any request
Gabriel
If you use the django auth’s..
If user.is_authenticated:
redirect httpResponde(“Right here”)
Gabriel
Let me send you a basic check in private.. Right?
Pradeep
Yes please
DevilAstra
Guys i am trying to integrate payment portal into my project. Not finding any proper documentation or guide for it