Mirco
https://hastebin.com/share/naqumapoxu.python
Share also your project's tree
nyctophile
Mirco
Yes, project's files tree
nyctophile
Yes, project's files tree
https://ibb.co/5198cpg
Mirco
https://ibb.co/5198cpg
So I think you can easily understand that you don't have any products module 😅
nyctophile
So I think you can easily understand that you don't have any products module 😅
yeah but why am i getting this error I have a module it is "Product"
Mirco
yeah but why am i getting this error I have a module it is "Product"
You don't have any file called products.py or package called products
Mirco
You cannot do products.urls as u did
Mirco
path('api/products/',include('products.urls')) This is the root of your error You can do only main.urls
nyctophile
path('api/products/',include('products.urls')) This is the root of your error You can do only main.urls
oh now I get it . In tutorial it was product app and I named mine main so.. Thanks a lot
Ali
Hi what's difference between urlpatterns (urls.py) and websocket_urlpatterns (routing.py) in django channels?
Mirco
Mirco
Where /ws should be put in websocket url?
I don't think I'm sure I got your question
Mirco
Wait pls
https://blog.logrocket.com/django-channels-and-websockets/ Read and study this one, it should help you clarify it
Ali
I don't think I'm sure I got your question
As the documentation: For example my index url is http://localhost/chat/index .but it add ws at first for websocket url like this http://localhost/ws/chat/index
Mirco
As the documentation: For example my index url is http://localhost/chat/index .but it add ws at first for websocket url like this http://localhost/ws/chat/index
Because you need the http one for rendering the view that can show you the template etc And then you need the ws endpoint to connect and send real time data
ABULQOSIM
python manage.py makemessages -l en CommandError: Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed. hello guys why it is not working
Mirco
Why ws is at first of url? Is it possible to put it any place? ex: http://localhost/chat/ws/index
You don't need the ws at any place if the view is not for consumers The tutorial tells you is a good practice for consumers urls Study better the tutorial, especially the Consumer in part 2
Ali
I dont understand ?
My index url is http://localhost/chat/index And as the documentation the websocket url is http://localhost/ws/chat/index My question is if I have any http url in urls.py , What should I write for websocket url in routing.py or in New Websocket() method in js
Mirco
I studied it but I don't understand what should I write for websocket url?
You can write whatever you wanna The best practise is to mention inside the URL : ws just to easily get it's a websocket endpoint ws/chat/index ws/blabla/blabla Etc etc It's like api prefix when you create rest APIs
Ali
No
OK But as document it just write ws/ for path not full url in routing.py. what is this?
꧁ད ʍɿkeՎ ཌ꧂
Hello everyone, can i use mysql without models?
꧁ད ʍɿkeՎ ཌ꧂
Muflone
Python Anywhere error message demonstrates it uses Django
ali
Hi guys, How can i send context of view to js files?
꧁ད ʍɿkeՎ ཌ꧂
you can... but why?
i think will be comfortable 😅 looks like to php queries (sorry for my english mistakes i'm learning)
cj
i think will be comfortable 😅 looks like to php queries (sorry for my english mistakes i'm learning)
that's what models are for... to be comfortable coding your project with django and not touching raw SQL (specially like in PHP where they're vulnerable to SQLi)
Rishav
{% if user.is_authenticated %} <h2>Hello! {{fname}}</h2><br> <h3>Successfully Logged in</h3> <a href="/list"><button type="submit">View employee list</button></a> This is my logic after signin I'm able to see the fname but when Im using href to go back to home from list.html I'm see only Hello and no name. Please help.
Papy
Don't use templates fr
Charly
Doragonsureiyā
Don't use templates fr
Why? Seriously... Why? 🤔
Shin
Hi everybody, I am beginner to django and working with mongodb database using djongo. I'm facing a problem while making migration in django models. The error is --- This version of djongo does not support "schema validation using CONSTRAINT" fully. and This version of djongo does not support "NULL, NOT NULL column validation check" Django: 4.1.9 Djongo: 1.3.6 Pymongo: 3.12.1 Sqlparse: 0.2.4 Please help me to solve this error
Papy
Why such advice?
Separation of concerns, one of the main factor big companies consider before hiring youn stuff
Charly
Separation of concerns, one of the main factor big companies consider before hiring youn stuff
And how using a template to show the user name is against separation of concerns?
Papy
And how using a template to show the user name is against separation of concerns?
Well django is for back-end and displaying something is a concern of Front-End. Plus what if u want to build mobile apps in the future?
Charly
Well django is for back-end and displaying something is a concern of Front-End. Plus what if u want to build mobile apps in the future?
Django is not for backend (as you said) only that's why it has a template engine but it does proper separation of concerns using a MVT model. Regarding the other thing, have you ever heard of YAGNI?
Lords
Hey,everyone when i am trying to delete record getting django.db.utils.IntegrityError: FOREIGN KEY constraint failed. how to resolve these error thank you in advance
Prashant Kumar
Guys I have faced some problem in making song history api can you help to resolve this
Doragonsureiyā
Prashant Kumar
How I share my code to you
Doragonsureiyā
How I share my code to you
To share code or error tracebacks, use a pasting service, like: - https://dpaste.org - https://hastebin.com - https://nekobin.com - https://bin.kv2.dev
Prashant Kumar
The code will be pasted or not
Lords
Charly please check https://dpaste.org/Qmzgr
Lords
Charly please check https://dpaste.org/Qmzgr
I tried to delete listing record in that time i got the error
Lords
is there any error with my model and foreign key
Prashant Kumar
https://dpaste.org/L7Tzo
Prashant Kumar
Guys please help to resolve it
Charly
Nope
Nope what?
Papy
I haven't heard of it. What's it?
Papy
Google it
Just googled it, it doesn't make sense in this context. Can you explain pls?
Charly
Just googled it, it doesn't make sense in this context. Can you explain pls?
That not everyone wants or needs a mobile app so it makes no sense to take that decision based on a remote possibility
Prashant Kumar
Can I contact directly to you
Charly
Can I contact directly to you
No, help is provided here only.
M.Ahmadi
Hello, I have a question, please answer me if you have time How can I do something in Django that I can't directly use the custom permission that I wrote myself? permission_classes = [CustomPermission] If I write like above, it will give me an error and I can only use the following method to give it a permian permission_classes = [CustomPermission.get_instance()] I have already defined this get_instance function to create an example, and now only the second method can be used with this function, and the first method does not work, but it does not give me an error when I use it, and I want it to give an error. I used the new function, but the problem is that it gives an error only with this method of use permission_classes = [CustomPermission()] But I want to fault this too permission_classes = [CustomPermission] I stopped creating the sample inside the new function, but the error is not raised on the second method