prasanth_reddy™
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
Mirco
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.
Charly
Anonymous
Couldnʼt find way to deploy django on cpanel. Thereʼs no python in applications list. What should I do brothers
Charly
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?
Charly
Michael the wolf 🐺
serialize data
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
Eli
Hi guys
Is there any third party library for monitoring whole django apps ?
Charly
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
Eli
I hope ,I explained it understandable 😶
Rutherford
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
Ghorz
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 ???
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
ᶰᵃᵇʳᵒˡᵉᵒᶰ
ᶰᵃᵇʳᵒˡᵉᵒᶰ
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)
Anonymous
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Anonymous
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Yup
Thanks but,
what do I do inside the create_reseller and create_owner methods?
ᶰᵃᵇʳᵒˡᵉᵒᶰ
Anonymous
Charly
What?
Ilya
i need documentation with django syntax. where i can read him?
Charly
Charly
Template?
Ilya
rules for writing code. how what works and why, what should follow what, etc
Charly
Ilya
where exactly?
Anonymous
Guys
Anonymous
Who can explain me, why django supported hosting is more expensive than php hosting?
Azamat
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 :/
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