Anonymous
Anonymous
Muflone
Migrations must never be deleted.
If you don't want them revert them before deleting them
Anonymous
I see
Anonymous
So fresh start or I change the dB?
Muflone
If you can't restore the deleted migrations, the only choices are to fix the DB manually or recreate it from start
Anonymous
Oh I see
Muflone
And don't ever delete migrations if you haven't reverted them
Anonymous
Thanks for helping me figure out where I was wrong. Appreciate it
Anonymous
Muflone
👏
Anonymous
hi guys
when i run my app i get this error :
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
how can i solve it??????
Jigani
tom
tom
tom
os if u want to use a py file without runserver or other django command u must set django module and startup django
tom
u cat see the manage.py
Anonymous
tom
emmm wait a moment
Alex
drunktimelord
smh.
Alex
tom
startuped a long time ago
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xxx.settings")
import django
django.setup()
# import django moduls
tom
sorry it is setup😂
Rounak
Anyone have done any presentation in django... I mean totally basic one... And have the ppt file... Can you share it
professor
how can I improve my helpers / models to give me true / false instead of returning me invalid token view ? https://dpaste.de/vjzc#L33,58,100
Mihail
Evgeniy
Why parent doesnt have field children??
parent = models.ManyToManyField('self', related_name='children', null=True, blank=True)
Evgeniy
i need to create field children automaticly like foreignkey
Evgeniy
it possible?
Mihail
How can I add django embed_video?
Did everything like in a docs but have an error "No module named 'django.core.context_processors'" when add stroke in settings.py "context_processors"
Ghorz
Rasim
Hello everyone.Could you suggest a book for imroving Python/Django skills?
Rasim
J🤖xes
Hello, intermittently gunicorn gives me 502 when i Make a request to my django rest
J🤖xes
Any ideas ?
J🤖xes
J🤖xes
Ok....i Check all the configuration files...of supervisor, nginx gunicorn ....the Project is in AWS...ALB + ecs fargate....i read so much in internet about this problem...i Put async gunicorn workers but then are something wrong because in the log appears 502 responses...
J🤖xes
I don’t known Why gunicorn reload a worker in the middle of One process
J🤖xes
Sorry mu english is horrible
Luis
@Joxes who is logging http502?
J🤖xes
Before i don’t have nginx ...we connet AWS ALB to the container where inside are gunicorn and django
J🤖xes
Later looking for information...
J🤖xes
https://medium.com/@gabriel.m.troy/aws-alb-docker-uwsgi-502-bad-gateway-16d0a36f6240
J🤖xes
J🤖xes
Thanks for help me
Ismael
i need to create field children automaticly like foreignkey
I think you are asking for related_name parameter on foreignkey field. If you dont assign any value to this it gets by default the name of foreignkeymodel_set. For example:
class A(model):
bfield = ForeignKey...
b = B()
a = A(bfield=b)
you can get A instances from b using "b.a_set" where a is the name of the model (not field) in lowercase.
Or you can set related_name:
class A(..
bfield = ForeignKey (related_name=my_aes)
Then you can get b.my_aes.
Hope this was what you wanted :)
Ismael
Luis
Luis
Are you using load balancing or similar setup?
professor
how to check if token is expired?
RobiN
Page not found 404
Using the URLconf defined in sweetcake.urls
.
.
.
.
Login/ name=['login']
Current path, products.html didn't match any of these
Error ,what to do guys how to fix this?
Orack
is it possible to add an array of images in django model ?
Bjorn
is it possible to add an array of images in django model ?
I've been trying to do it myself but haven't found any sol....
The thing as I understand is, in order to database be consistent, all the possible fields must be well defined already......
So I defined the max no of image field with blank set to true...
But lemme know if u find another solution...'cause its possible ..I just can't find it..
Orack
Orack
but im not getting it
Anonymous
Hi guys any advice on how to unpack a manytomanyfield object in a template ?
Bjorn
but im not getting it
Bummer !
Or maybe you could create a different class for images , with onetomany relationship to the parent class.
But that'll come with it's own set of problems. 😔
Bjorn
Anonymous
Orack
Orack
this might help but how to write its views.py
Nitin
If you like the video, please share and subscribe my channel. Its mainly about python django flask and web development
https://www.youtube.com/channel/UCgo0xUFN4r2fh3judtntwPg
Orack
Nitin
I got it for free, while purchasing my laptop
Nitin
Anders (izzno / gooood) 🇳🇴
Can someone explain or point me to an article as to why Django 3's ORM is not async complient? I dont get that at all...
Anders (izzno / gooood) 🇳🇴
What would you "await" for if not the db...
Anders (izzno / gooood) 🇳🇴
(Not complaining, just want to understand)