Anonymous
If they don't match then you changed something externally
I deleted some migrations but that’s it
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
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??????
Anonymous
Your settings.py is probably missing
Problems accessing the settings file? If yes, which section refers to the settings file?
Anonymous
are u run a .py file not manage.py runserver?
actually i got this error when import models in cmd. like : from polls.models import Choice, Question
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
oh you must startup django first
startuped a long time ago
tom
emmm wait a moment
drunktimelord
startuped a long time ago
wow startup is a verb now, english is weird
drunktimelord
Adverb: startuply
that's an adverb
drunktimelord
smh.
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
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"
Rasim
Hello everyone.Could you suggest a book for imroving Python/Django skills?
Doragonsureiyā
Hello everyone.Could you suggest a book for imroving Python/Django skills?
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Doragonsureiyā
Hello everyone.Could you suggest a book for imroving Python/Django skills?
Check out PythonRes, a channel for Python resources (links to help you out).
J🤖xes
Hello, intermittently gunicorn gives me 502 when i Make a request to my django rest
J🤖xes
Any ideas ?
cj
Any ideas ?
read the logs
Anonymous
read the logs
The most helpful guy right here
J🤖xes
read the logs
Jajaja...
cj
The most helpful guy right here
ok, so, you read his mind and help him 🤷🏻‍♂
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
@Joxes who is logging http502?
Now logging the error nginx
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 :)
Luis
Now logging the error nginx
Ok, any error message on supervisord or gunicorn log?
Ismael
Why parent doesnt have field children?? parent = models.ManyToManyField('self', related_name='children', null=True, blank=True)
And i think this is a bad use of manytomanyfield unless you parent model is called "self" which has no sense
Luis
Ok, any error message on supervisord or gunicorn log?
Or what is the url accesed before the 502?
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
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. 😔
Orack
this might help but how to write its views.py
Bjorn
https://github.com/insung151/drf-nested-serializer
I'll have to check it out, but right now I don't have the time...... I've my exams this week... I'll let you know if I find something.😊
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
Nitin
I got it for free, while purchasing my laptop
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)