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
Roy
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
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
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>
Qwerty
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>
For logout u need to send the post request, but u send get
Qwerty
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>
Replace <a> tag to form
Qwerty
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
Vitaly
khaled
Progressive
hey how i can add multi image field on django please help
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
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
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…
Progressive
Progressive
Doragonsureiyā
A
How to create project on food ordering system. By using django
A
A
Hello guys, i need help Running a Shell Script within Django, has anyone done this, please ?
David
What do you need?
David
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
Qwerty
For work with mongodb use pymongo driver and his syntax
Nerd
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
Taras
Qwerty
Qwerty
Nerd
Any arguments?
this might be helpful
https://medium.com/@dennisivy/read-this-before-using-mongodb-with-django-879927ce1ef
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
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?
Qwerty
Qwerty
Amir.M
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?
Qwerty
Mehda
I have a problem i don 't know who's the responsible on api the backend developer -or frontend developer