Raghava
Hi, I am trying to print something during my migrations and nothing is being printed except applying that migration. Is there a way to print something during migrations?
Michael
Hi, guys! I have a question. Can I create a project into another django project? Or am I crazy? jajaja
Raghava
Eventhough I gave a print statement in the function nothing is being printed when I run migrations
Guillermo
use pastebin or something, dude
Raghava
https://pastebin.com/rWVTW2z1
inchidi
Hi, guys! I have a question. Can I create a project into another django project? Or am I crazy? jajaja
maybe what you need is "new app"? or maybe explain what you really want to do to avoid xy problem
Michael
what are you trying to do?
well, I'm creating a accounting web. Each business login with your user and password, but each one should have your own database.
Guillermo
well, I'm creating a accounting web. Each business login with your user and password, but each one should have your own database.
Check this and see if it suits your problem: https://django-tenant-schemas.readthedocs.io/en/latest/
Guillermo
use stdout instead
I just tried with print and it worked...🤔
Michael
thanks, I'll look it
Guillermo
inside migration file?
yes, https://pastebin.com/2VVDA5uU
Raghava
I just tried with print and it worked...🤔
Does it print when we do python manage.py migrate?
inchidi
oh then prolly your function not called
Raghava
Raghava
I am calling my function in operations inside Migrations class
inchidi
I am calling my function in operations inside Migrations class
try this all_streams = Stream.objects.all() print('all streams=', all_streams)
Raghava
oh then prolly your function not called
I did it after reffering to https://docs.djangoproject.com/en/2.1/howto/writing-migrations/#migrations-that-add-unique-fields
inchidi
maybe your all_streams empty
Raghava
maybe your all_streams empty
I am sure I have data in all_streams. I am just trying to modify one of it's fields
inchidi
hmm thats weird, how about change to print(streams.first_message_id, streams.first_message_id) ?
inchidi
maybe its already printed but all None
Guillermo
maybe its already printed but all None
print(None) prints None, tried that too
inchidi
oh yeah thats true 🤔
Raghava
I think my function is not being called since when I gave print in migrations function it printed it
inchidi
11 Streams
b-but you said you can see its 11 steams 🧐
Raghava
When I am running it I was able to see there are 11 streams
inchidi
well, what i mean is put that code inside your migration files not shell tho
007
url(r'(?<pk>\d+))$, ) how to convert this url into django path
007
Thanks 😊
Mirco
Thanks 😊
👍👍👍
007
Path(' ?p<int:pk>/ ', views.----)
007
👍👍👍
Is this correct way
Mirco
Why ? What kind of path do you want ?
Mirco
For DetailView ?
007
Yes...
Mirco
?p is not necessary
007
p tag i have used for html
007
<a href= "{{school.id}}"> some_text </a>
007
?p is not necessary
For this i want to use path
inchidi
For this i want to use path
explain more, avoid xy problem
007
explain more, avoid xy problem
I forgot to print complete path.. 😅😅
007
?p is not necessary
Yes... You are right. Thank you very much
d.l.c
Can anyone suggest me the Best books for Django begginers?
MK-47
Hi guys am new in this group
MK-47
is there anyone who has this book... django for beginners by william
MK-47
😂 was asking to see if anyone has a copy to assist
Mirco
😂 was asking to see if anyone has a copy to assist
I know but William always does a great job by giving us good stuff , so by buying his book, you will thank you for all his hard work 😁
MK-47
I understand. thanks
Mirco
Sampreeth
Where can I learn middleware in django Any suggestions???
Disekurity
I have spent a lot time to find how to use cookiecutter-django with docker but nothing useful... I still have issues with environment variable setup Any help ???
Sampreeth
Official docs
Ok Any videos suggestions for middleware
sahil
I'm looking for internship in Django
Rammanoj
do with transaction.atomic() lock the rows in the transaction, or do we need to lock them seperately ?
Idiris
Hi everyone
Idiris
I am django beginner
Anonymous
Hi I am Suraj I am new to Django
Idiris
I am too
Rajeshkanna
I am new to Django
Anonymous
/
Anonymous
So start dive in django
Ooha
If webcam is opened by default, how to close it in cv2??
Anonymous
If webcam is opened by default, how to close it in cv2??
You can change by giving 0 to 1 in cv2