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??
Xavier
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??
the information is too little to get idea of what's going on so first check official django site and check the steps how to get your first page set up, then come here
George
Official
George
Documentation
George
it is the best
George
Re
George
so
George
ur
George
ce
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?
Sanchit
did u runserver it? dont become too depended on the IDE
Yes. I did that. An error page is coming. 'Invaid block tag on line 1: 'extend' .Did you forget to register or load this tag? '
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
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
Sanchit
because it's not extend it's extends
Oh yea.that solved the issue.Sorry for wasting everyone's time
cj
Oh yea.that solved the issue.Sorry for wasting everyone's time
but ... but... but... you said you read the documentation and you knew the syntax...
raven
does drf ModelSerializer have that field?
محمد دلشاد
fields = "all" exclude = ['commentid']
raven
i just want it not be displayed in Form field
محمد دلشاد
does drf ModelSerializer have that field?
its on ModelForm but i am not quite sure about this
Sanchit
but ... but... but... you said you read the documentation and you knew the syntax...
I'm extremely sorry. In my ide it was showing a typo for 'endblock' in {% endblock %} so I thought that something with the setting was wrong. Sorry. Won't happen again.
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
SQLite Is Just a file
How do i connect it
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?
Izbash
I did not i uploaded the site
You mean someone else uploaded site or how you have live site?
Anonymous
You mean someone else uploaded site or how you have live site?
Bro is my project i did not use the common github method i do it manually myself do you know how the sqlite db can be connected or i dont need to connect it
Xavier
Bro is my project i did not use the common github method i do it manually myself do you know how the sqlite db can be connected or i dont need to connect it
u need to follow the official docs first the 1st tutorial in the official docs is literally about how to connect db and all
cj
Bro is my project i did not use the common github method i do it manually myself do you know how the sqlite db can be connected or i dont need to connect it
if you're using SQLite as default, the first time you run migrate the database file will be created, you don't have to do anything else 🤷🏻‍♂️
cj
So you mean i should run migrate on pythonanywhere console??
🤷🏻‍♂️ I don't use pythonanywhere so I don't know how it works, neither I know if it has a console or anything else... but if you're using SQLite as default, the first time you run migrate, the database file will be created
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
Without affecting existing migration and data
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
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.
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?
V
Stop cross posting same question everywhere
It is more relevant here but that group have more members. Thats why..
Rohan
It is more relevant here but that group have more members. Thats why..
It sure is more relevant here but your question is half baked
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
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 ?
python developer
Hi friends
python developer
How to Api json data to HTML code Please Tell me