Sanchit
My template is not rendering.. I have installed jinja2 on Pycharm community edition. Should I do any changes in settings. py file in order to use it??
George
George
Official
George
Documentation
George
it is the best
George
Re
George
so
George
ur
George
ce
cj
cj
Sanchit
I have read from official django website about templates and I know the syntax. I have added the directory of template in settings. But in the html file all the stuff inside {%%}
Is coming as white text. For example,it isn't showing block content inside this syntax as coloured. Doesn't this mean that pycharm hasn't recognized it as a tag?
cj
Xavier
Izbash
Xavier
Doragonsureiyā
can u paste the html code using a proper pasting tool
To share code or error tracebacks please use an online pasting service, here is a list of suggested sites:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
cj
Dixit
raven
I'm creating an app in which BookModel have a CommentModel as foreign key
so I'm trying to display comments when i browse book detail but i don't want Comment Form fields to get displayed in my BookModel form
محمد دلشاد
raven
does drf ModelSerializer have that field?
محمد دلشاد
fields = "all"
exclude = ['commentid']
raven
i just want it not be displayed in Form field
Anonymous
How can i set up sqlite database on pythonanywhere,i have the site live already i only need to connect the database for other functions to work please help
Muflone
SQLite Is Just a file
Anonymous
Izbash
How do i connect it
maybe you are download site on pythonanywhere from git rep and it havn't SQLite, cos you added it to gitignore?
Muflone
How do i connect it
Just set it in settings file, sqlite is the Django default until you changed it
George
Do you know what Django is?
Anonymous
Izbash
Xavier
cj
Anonymous
raven
Izbash
saran
Hello guys, i have purchased a sql db for countries, region, cities. I converted it into postgres. I want to add it my existing postgres dB. How can i do that? Load data?? But its format must be in json right? Incase if i loaded will it affect my current migrations?? Please give me some advices in this topic.
David
saran I'm not an expert in Django, if I understood your problem, it occurs to me that in a separate project, you generate the models from the database you bought with inspecdb, having your models, you generate the fixtures in Json with dump_data. And so in your current project you add the info you have in Fixtures.
David
That's assuming that in your original project you only need the information from this purchased database.
saran
saran
Without affecting existing migration and data
saran
David
So yes, that works for you, Project apart, if you have the same models you don't need to inspectdb, you place your models and make a dumpdata to generate the fixtures in Json.
David
https://docs.djangoproject.com/en/3.0/howto/initial-data/#providing-data-with-fixtures
saran
saran
If I want get the model structure of that file?
David
yes, if you already have it in postgres, create a separate project that connects to that database, create an app, and generate the models with inspectdb.
David
https://docs.djangoproject.com/en/3.0/howto/legacy-databases/#auto-generate-the-models
David
Sometimes django won't generate the models as they are in the database, so watch out in case you have to make some manual adjustments by personally checking the purchased database.
saran
David
Don't worry, I've been through similar cases and the first time is usually hopeless. Write to me in private if you need help.
José
Greetings community, has anyone worked with DRF? Specifically with a serializer on a model that has an attribute that is a foreign key to it I got how to do the recursive query in the serializer but I have to control the queryset to be able to do a filter
Akash
Is it safe to have accounts app in my django project if I am planning to use django-allauth as well which uses accounts/ path
I am unable to think of an alternate name for my accounts app
V
I want to make a chat app in android. And use django rest api as backend. How can i do that?
Rohan
Rohan
Sarthak
hello, wanted to know if suppose I want to send request to firebase realtime db to patch a value
and idc if the response comes or not... how can we just send request and continue to next code
Mirco
Sarthak
django 2.2
Sarthak
celery?
Mirco
Django Q is better imho
Sarthak
is it bery hard to setup
Sarthak
very
Mirco
No
Roman
Hi guys, I need to pick one random row from database, I Know I can do like order_by('?')
But I need take the earlier row by date and pick random from this raw and like this
entry = Advertiser.objects.order_by('updated_date')
entry = entry.order_by('?').first()Just takes random anyway
Can you advise how quickly perform such query ?
Bral Bral
Hey. How do you filter columns of nested serializers ? Change nested serializer or do something in view manually ?
saran
python developer
Hi friends
python developer
How to Api json data to HTML code Please Tell me