Anonymous
@heinekhalwin Is not ncesary to define view function ex handler_404?
Anonymous
I use django 3.0.5
Anonymous
no need for that.. just simply put it in the templates folder
Anonymous
@heinekhalwin with debug false, now no pages are displayed
Anonymous
ok.. try going to a url that doesn't exist.. it should trigger ur custom 404 page
Roman
Hi guys, gettings this in the request:
There is no current event loop in thread 'Thread-1
any idea please?
Anonymous
@heinekhalwin Still blank page
Anonymous
can u access other pages ?
Anonymous
@heinekhalwin no
Anonymous
then obviousfly, there is something wrong with your project
Anonymous
@heinekhalwin with debug true default page appears
Anonymous
@heinekhalwin have any ideas what can be the problem?
Anonymous
do u have any pages other than the default page ?
Anonymous
and the error pages
Anonymous
I have a lot of other pages + 404, 500 pages, all in templates folder(using pycharm)
Anonymous
but currently, u can't access the other pages right ?
Anonymous
With debug=false, yes
Anonymous
do u have any domain or ip addresses specified in allowed hosts, when u do debug=false ?
Anonymous
ALLOWED_HOSTS = ['127.0.0.1:8000']
Gil
Because they are appended to the next request, as by architecture. The default UI isn t realtime.
Anonymous
Anonymous
try '127.0.0.1'
Aman
Anonymous
Doesn't work
Anonymous
@heinekhalwin It throw 500 error
Anonymous
what is the error message ?
Anonymous
[14/Apr/2020 17:34:56] "GET /porumbei/vizualizare/ HTTP/1.1" 500 123
Anonymous
@heinekhalwin Is not a message it appears in pycharm when i access a page
Anonymous
Can u try running the server and check if it's working
Anonymous
System check identified no issues (0 silenced).
Aman
Anonymous
Go to a URL which u have not defined
Anonymous
A server error occurred. Please contact the administrator.
Anonymous
Go to a URL which u had defined
Anonymous
A server error occurred. Please contact the administrator.
Akhil
Guys, im having a weired problem with my django app.
I had declared a url in urls.py and defined it on views.py. i named it as login. But unfortunately it's showing page not found error. When i change url to login1 it renders the page. Sny idea wat happening?😅
Belmo NaTazu
Akhil
Professor
I was doing a project and got this error : ValueError at /admin/blog/post/add/
Professor
anyone familiar with is this error how to get rid of this
Professor
error : invalid literal for int() with base 10: 'F'
Shreehari
hey guys
how can i check number of views of a particular user of a object.
eg: user abc has viewed 3 posts(same/different posts doesnt matter)
L
Hey everyone! Let's say I have a blog app that has two models: Post and Author. What kind of python code should i embed in my template for the AuthorDetailView to see every post this author has published. I know that if, let's say, my author's id was 1, I could get the specific post for this author by passing Post.objects.filter(author_id=1), but what's the name of the pk passed as parameter to the <int:pk> portion of the url? In order for me to extend my detail view to pass in the context all the Post by that author
L
I here share my generic DetailView extended. I use a question mark in the filter in reference to that pk/id variable I can't find its name
L
https://www.codepile.net/pile/Mm7KD7mj
Anonymous
Hi everyone.. I want print report about one object and all relationships
L
R
Hello, guys, I need your help: How I can show error message (such as "You must log in before see this page") when redirecting to login page with login_required?
I'm use class-based views, so I compound this decorator with dispatch method, therefore there is no way to create message before redirecting.
Damron
Hello!
I've got a trouble using drf @action and permisson_classes=[IsAdminUser] on my post view
class UserAPIView(APIView):
@action(detail=True, permisson_classes=[IsAdminUser])
def post(self, request):
print(request.POST)
return Response({'data': 'post'})
The problem is that this method is still working even if I am not authenticated
I really don not know what to do, pls need for help)
Mohit
Anyone whos willing to work on a personal project can dm
Damron
Mirco
Damron
oh, right, it was just copied from source)
Damron
You wrote permisson and not permission
but it still doens't work with AlowAny when I declared
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.TokenAuthentication',
),
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated', )
}
Mirco
It's AllowAny not Alow
Damron
Yes I use it, just mistyped here)
Anonymous
Am getting an error in my django cartridge ecommerce website
Error <class 'main.admin.HomepageAdmin'>: (admin.E012) There are duplicate field(s) in 'fieldsets[0][1]'.
Anonymous
Anonymous
L
Shaun
I have to do a bulk import of data. My models are Django ORM. Sometimes incoming data is unchanged so I do not want to update the model.
Should i create a helper util method to get the model and compare it to the incoming data before writing; or should I override save()? I think i should use the util method since I will have a lot of different logic.
Shaun
I think i wil use the helper method
Anshirk
Anybody invoice generator app in django
Anshirk
Please share with me
Mirco
Anshirk
Problem
Mirco
We don't have a magic ball, explain it
Anshirk
Actually in models I able to add just one bills
Anshirk
In site
Anshirk
When I add second bill it merge with first bill data
SUPER
whats up guys
SUPER
as a beginner in django i just activate the virtual enviroment and take the interpreter path to my IDE but suddenly its tell me this error
SUPER
Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment
SUPER
what i can do .....
SUPER
??
Anshirk
I can teach you Django
Anshirk
Pm me