Charly
I saw it youtube...it is 5 years old
No, official material is not in YouTube
Roy
I have some doubts regarding database connection with django . Django uses sqlite3 as it's default database . If I am using postgressql or MySQL with django . Does it stay same like we used to design the mvt structure or creating the database tables or does it varry depends on database to database ?
shahin
I have some doubts regarding database connection with django . Django uses sqlite3 as it's default database . If I am using postgressql or MySQL with django . Does it stay same like we used to design the mvt structure or creating the database tables or does it varry depends on database to database ?
The structure remains the same. But you have to configure your databae settings in base settings file if you want to switch to postgres. And of course you have to use a database adapter (psycopg for postgres)
Doragonsureiyā
• Use a backtick (`) on both ends of your single line: `print("hello world")` • For more lines, use three backticks (```) before the first line, and after the last (and add the language you're using, Telegram now supports it): ```python def hello(name): print(f"hello {name}") ``` • You can also select text when typing, and select markdown formatting.
D🌷
Hi ,How to log in and log out to register to my website in the template
Vitaly
Hi ,How to log in and log out to register to my website in the template
If you are asking about django admin - you should create superuser and login via /admin path at your website. If you are asking about users - you should create login view. Django has User model out-of-box
D🌷
ok thank you i need to register from log in and log out to register from my website not from admin
D🌷
I have the frontend code ready, I don't know how to connect it, if anyone in the group knows how to connect, please help
D🌷
yeah
John
Is there a URL already to access the registration page?
Django has default logout and login function to use ...
John
from django.contrib.auth import login,logout
Igbojionu
Hi what is the easiest way to create and manage roles in template on the front end instead of Django Admin ?
-𝐟𝐚𝐫𝐡𝐚𝐝『𝟙𝟡:𝟝𝟘』
When using PolymorphicProxySerializer in drf-spectecular, like in the response dict for one status code, is that supposed to show all the serializers in the list we provide? Because when i use it it only shows the first one in the serializers list. Im using it in this way: @extend_schema( responses={ 200: serial200, 404: PolymorphicProxySerializer("test", serializers=[serial1, serial2], resource_type_field_name=None } ) class view(): ... I can use something like OpenApiExample but using polymorphic will make things easier but i don't know if im using it correctly.
Ssv
Can anyoneplease help me regards Django How can i save the data into django and it should be downloaded as csv file
S
i am getting 405 when logging out this is is the code This is the url from django.contrib.auth.views import LoginView, LogoutView from leads.views import SignupView urlpatterns = [ path('admin/', admin.site.urls), path('', include('leads.urls')), path('login', LoginView.as_view(), name='login'), # path('logout/', LogoutView.as_view(), name='logout'), path('logout/', LogoutView.as_view(), name='logout'), path('signup', SignupView.as_view(), name='signup'), ] this is the template {% if request.user.is_authenticated %} Logged in as: {{ request.user.username }} <a href="{% url 'logout' %}" class="ml-3 items-center bg-gray-100 border-0 py-1 px-3 focus:outline-none hover:bg-gray-200 rounded text-base mt-4 md:mt-0"> Logout <svg fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" class="w-4 h-4 ml-1" viewBox="0 0 24 24"> <path d="M5 12h14M12 5l7 7-7 7"></path> </svg> </a>
S
For logout u need to send the post request, but u send get
Yeah. I am using django.contrib.auth.views I don't know how where is get coming from
S
Replace <a> tag to form
I have tried it is not working the method was post
Qwerty
I have tried it is not working the method was post
Do u know how to create the form into html file?
Flam
Can anyoneplease help me regards Django How can i save the data into django and it should be downloaded as csv file
Create django views to export CSV, create url patterns for the view, and then create template for the CSV download button. https://www.google.com/amp/s/studygyaan.com/django/how-to-export-csv-file-with-django%3famp=1
S
Do u know how to create the form into html file?
the problem was that i was using href instead of action in the form. Thank you.
AbdElrahman
Do you know how to import data from stores like amazon by django ??
khaled
can anyone help me I want to backup my postgres database and I am using Docker too
Progressive
hey how i can add multi image field on django please help
David
hey how i can add multi image field on django please help
You can use a JSON field and save only url, use a serializer to handle the images
Aditya
How can I create group chat in django
David
How can I create group chat in django
You need use django channels to chat and you can register group of users, then give them permissions to use the chat functionality and add them
David
How can I create group chat in django
https://www.tutorialspoint.com/realtime-chat-app-using-django
Aditya
Thankyou so much
A
Projectworlds > Python Projects with source code > Python Django Online Food ordering System Python Django Online Food ordering System with complete source code
Progressive
David
how i can select multiple images and save them on json
Use js to parse img to base 64 and send to Django as array, in Django parse base 64 in a logic from serializer or form, save img in aws or your hosting and finally save relative url in the model. Other way is a model for a image and has relation with your main model, foreingkey…
David
if you have done it in your projects pliz share with me
In this momento i cant. but in a few hours i could help you. I will write you to privately
A
How to create project on food ordering system. By using django
Mohammad
How to create project on food ordering system. By using django
First specify your models such as food, custom user, order and so on then think of how you want to handle each order, I recommend for starters, receive each order in a form and save the data for each order like that
A
Hello guys, i need help Running a Shell Script within Django, has anyone done this, please ?
David
What do you need?
Giovanny J.
Hello there, I'm using channels with Daphne at localhost, but when I try connect to the server from Javascript the output shows "HANDSHAKING" then "DISCONNECT" and in the browser just print "connection failed". This is not my only consumer but is the only which fail. I attach My code: https://nekobin.com/lipixucito
Vijay
Need help: (vr) d:\folder> pipenv install django Profile.lock not found, creating... Locking failed! What to do? Runtime error: filed to lock pipfile.lock
Doragonsureiyā
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
A
What do you need?
I need to access a database through the browser but the script I have ready was written in Shell
MUHAMMED
I am using django with mongodb. I am checking email already present. But it not working User.objects.filter(email= email).exist() not working.
Qwerty
For work with mongodb use pymongo driver and his syntax
Nerd
For work with mongodb use pymongo driver and his syntax
why will you want to use django with mongo?
MUHAMMED
Just for trying. Mongodb is structure less right. So just looking how's it possible with django
MUHAMMED
I have done using pymongo and defined custom functions using mongodb queries for crud ops
Qwerty
why will you want to use django with mongo?
The data model is determined by the structure of the constant relationship between data entities and many others. That's why sometimes mongoDB may be preferable for work.
Nerd
it still seems like a bad idea for me, I would have gone in for JSONFields
Nerd
Any arguments?
this might be helpful https://medium.com/@dennisivy/read-this-before-using-mongodb-with-django-879927ce1ef
Doragonsureiyā
I am using django with mongodb. I am checking email already present. But it not working User.objects.filter(email= email).exist() not working.
Do you want to use Django with MongoDB? Then you shouldn't Please read this article: https://daniel.feldroy.com/when-to-use-mongodb-with-django.html
Amir.M
Hello my friends, if I want to write a signal that a certain field of a model has changed, how should I define this issue?
Qwerty
this might be helpful https://medium.com/@dennisivy/read-this-before-using-mongodb-with-django-879927ce1ef
The main part of the article is about the Djongo package. The only downside is the lack of an admin panel. No orm - pymongo also has a fairly simple syntax for queries in collections. There are no migrations - for projects with frequently changing schemas this will be a plus, and there is also a library that can create something similar to a “scheme for writing”, just like in the rel DB
Qwerty
Personally, I didn't work with mongodb + Django, but I worked on other frameworks and was satisfied
Sushil
Hi guys I want to make a project using django and api ? Can anybody help me in that?
Sushil
U can use Django Rest Framework for this
Ok how can I start with making a food delivery app . Can you provide some roadmap and what functionality could be there
Qwerty
Hello my friends, if I want to write a signal that a certain field of a model has changed, how should I define this issue?
The only option I see now is to use pre_save and check if the field in the signal itself has changed
Amir.M
The only option I see now is to use pre_save and check if the field in the signal itself has changed
If I want a session in this signal, can I access the request from kwargs? In fact, this signal changes the price in the shopping cart when the admin changes the price
Qwerty
If I want a session in this signal, can I access the request from kwargs? In fact, this signal changes the price in the shopping cart when the admin changes the price
I don't think there's access to the session, but I just looked, kwargs has access to the update_fields key, that is, you can check for an update of a particular field.
Qwerty
So what do you think is the solution to this scenario?
For me - pre_save with checking for the required field in the list of changed fields. I just didn't really understand why you have access to the session in the signal in this use case. To authorise the request?
Amir.M
For me - pre_save with checking for the required field in the list of changed fields. I just didn't really understand why you have access to the session in the signal in this use case. To authorise the request?
I want to change the price of a product when the admin changes the price of a product in the Django admin, in the shopping cart of the store where the user has added that product, the shopping cart is created in the session, so I need to change the shopping cart and I need a fix to access.
Mehda
I have a problem i don 't know who's the responsible on api the backend developer -or frontend developer
Doragonsureiyā
I have a problem i don 't know who's the responsible on api the backend developer -or frontend developer
This is not a Django specific question, please delete your offtopic message. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.