cj
and, OK guys, we already know Django 4 was released, so please stop coming here every 5 minutes saying that, it's gonna be considered SPAM and you'll be warned/banned
Mohamad Reza
Have you tried {{num}} +1
No I don't want to just display it
Saikat
I want To add Google map location in my django website but not able to do that any kind of help is appreciated!
Unique@pp++
Hey id
Unique@pp++
I m also and I'm looking for python learning partner
Unique@pp++
If u wanna then we can do
Unique@pp++
And start learning
SHAH Kar
hi everyone. which django course is good for me ? l am beginer.
SHAH Kar
Official tutorial
is it django site or movie on YouTube?
Charly
is it django site or movie on YouTube?
Djangosd official tutorial is on Django website of course
Doragonsureiyā
hi everyone. which django course is good for me ? l am beginer.
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Anonymous
Couldnʼt find way to deploy django on cpanel. Thereʼs no python in applications list. What should I do brothers
Anonymous
Charly
Sloth
Hi I want to store a class instance(object) in one of the columns in my table, which field should i use?
Sloth
Don't do that, use a model and foreing key
I want to store an instance directly because the instance might not exist in its orignal table
Michael the wolf 🐺
serialize data
Sloth
I want to store an instance directly because the instance might not exist in its orignal table
This is the actual problem lets say there is a row update on a table , i need both old and new instance to be stored some where so that a cron job compares both and generates a change log
Sloth
So i am looking for a field that stores the object
Ghorz
In django post_save receiver, I keep getting check constraint failed when I update a northern model and save in the post_save
Ghorz
What could be the issue
ms tk
how can i use Single authentication for multiple django projects
Michael the wolf 🐺
make authenticationi as a seperate service
Aziz
hi! i got this kind of error and i have no idea how to solve this. After googling i think it is related with url path names, but i dont see any mistakes... Error: File "C:\Users\Aziz\AppData\Local\Programs\Python\Python310\lib\sre_parse.py", line 831, in _parse raise source.error(err.msg, len(name) + 1) from None re.error: redefinition of group name 'pk' as group 2; was group 1 at position 20 Repo: https://github.com/AzizNadirov/azepug
Aziz
all url names are unique
ms tk
make authenticationi as a seperate service
how can i relate (FK) user in model for other project
Charly
how can i relate (FK) user in model for other project
you don't, that's not how authentication should work
ms tk
you don't, that's not how authentication should work
so the way of storing user should be with the decoded jwt, right?
Eli
Hi guys Is there any third party library for monitoring whole django apps ?
Eli
Monitoring what?
I need sth that help me to better understanding that about Query's performance Time's query Every request pass which path ,etc
Eli
I hope ,I explained it understandable 😶
H &
Hey guys. I need a suggestion. I need to create an app for making appointments only for available time, I’ve created 3 models(may be shortened to 2): 1 for available days with the counter field(how many available time records are linked to this day), 1 for available time with foreign key to days and boolean “is_available”, and 1 for appointment itself with foreign key to time model. I have 3 Model forms to proceed the information step by step and make queryselection based on data I receive. But I can’t access this data properly, coz when django redirects user from one form to another, http method is GET What is the best practice for appointment creation? Haven’t found any attractive solution in the internet Pm me If you need my code
Rami
does anybody know how to deploy two django project in the same server? I getting this error from ngix "failed (2: No such file or directory) in /etc/nginx/nginx.conf:62" when I add a second site (with its own gunicorn service and socket). Any blog post would help a lot, thank you!
Кодиров
How to connect Django to external DB without migration ???
Maxim
How to connect Django to external DB without migration ???
If the structure of the database corresponds to the code, migrations may not be used
213
You can generate the models of an existing db python manage.py inspectdb > models.py
213
A'd adding a class meta
213
class Meta: managed = False
ᶰᵃᵇʳᵒˡᵉᵒᶰ
In a Django project am working on, I need to have 2 user types. One is an Owner and the other is a Reseller The superuser creates owners, and the owners create resellers under them. I want to keep track of which Resellers are registered under which Owner by connecting Owners and Resellers table via a Foreign Key. So no reseller can create an account by themselves, their owners should do that for them. How can I accomplish this? you can find what I have tried so far in the link below https://www.reddit.com/r/django/comments/rd9o9u/how_to_let_one_type_of_users_create_another_type/
Anonymous
Can you tell me more about the "better" options
Create a user manager (superuser, owner, reseller) and a user model, assign permissions to each user. That's all I can think of.
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Create a user manager (superuser, owner, reseller) and a user model, assign permissions to each user. That's all I can think of.
The thing is, Superuser creates Owners and the Owners create as many resellers as they want under them,, how can i track which resellers are under which owners,, how will the foreign key relationship be,,?
Anonymous
So the owner creates the reseller. Alright model; Reseller (...): owner = models.ForeignKey(User, on_delete=models.CASCADE)
Anonymous
Just like user=request.user on the views panel
Anonymous
Then for the owner; Owner = models.manytomany(Reseller)
Anonymous
Then for the owner; Owner (...): Owner = models.manytomany(Reseller)
ᶰᵃᵇʳᵒˡᵉᵒᶰ
ᶰᵃᵇʳᵒˡᵉᵒᶰ
class User(AbstractBaseUser, PermissionsMixin): # ...list of other fields is_owner = models.BooleanField(default=False) is_reseller = models.BooleanField(default=False) # ...list of other fields USERNAME_FIELD = 'tg_username' objects = UserManager() class Owner(models.Model): user = models.OneToOneField( User, on_delete=models.CASCADE) class Reseller(models.Model): user = models.OneToOneField( User, on_delete=models.CASCADE) owner = models.ForeignKey( Owner, related_name="resellers", on_delete=models.CASCADE)
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Yes, but do not forget to add an owner class and reseller class to the User manager, so they can be recognized as user roles
how do i do that ? do i add a create_reseller and create_owner, the same way i override the built in create_user method
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Yup
Thanks but, what do I do inside the create_reseller and create_owner methods?
Anonymous
Thanks but, what do I do inside the create_reseller and create_owner methods?
Alright, maybe you should check this out; https://stackoverflow.com/questions/57507250/how-to-implement-multiple-user-types-with-different-roles-and-permissions-in-dja
Charly
What?
Ilya
i need documentation with django syntax. where i can read him?
Charly
Template?
Ilya
rules for writing code. how what works and why, what should follow what, etc
Ilya
where exactly?
Fardin
rules for writing code. how what works and why, what should follow what, etc
hello i think this is good for you https://www.fullstackpython.com/django.html
Anonymous
Guys
Anonymous
Who can explain me, why django supported hosting is more expensive than php hosting?
Doragonsureiyā
where exactly?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Ilya
all's not that :/
Azamat
all's not that :/
Official doc, what do u need more?
Ilya
i need clarification why in (example): path('<int:question_id>/', views.detail, name='detail'), exactly this order, why the first <int:question_id>/ second views.detail third name='detail, and not vice versa. only with other parts of the code and, in principle, an explanation of what is responsible for what