clouded
What are the best libs, frameworks, language to write a front end on Django?
Django does not need a frontend framework/library. What you want to use depends on what you want to achieve.
Stas
Django does not need a frontend framework/library. What you want to use depends on what you want to achieve.
Perhaps he uses django rest framework then he does need a framework for front end
clouded
Perhaps he uses django rest framework then he does need a framework for front end
Yes, but then the question was too imprecise to get a reasonable answer (and saying that it depends on what he wants to achieve would still be correct).
Mr.
Hello guys. I found that in Django model admin form there are three buttons for save the form data. "Save and continue editing" and "Save and add other" for unknown reason my signals on save model method are not triggered, when I hit the button "save" in the same form, signals work though. Did you run through this problem before ?
Habib
Hi there, I have a question I have this user profile_template which displays username and email And I want it included in at least 5 different templates The template is getting data from user_profile model instance that is passed to it as context My question is if I directly passed the user_profile object to the user_profile template and then include it in all the 5 templates will it display the data correctly or will it require all those templates to have passed the same user profile in context too
Habib
So this means that each template would need to be passed the user profile separately
Habib
Ok I have one more question {% extends 'myapp/base.html' %} {% load static %} {% block setting %} <img src="{% static 'myapp/images/sample-image.jpg' %}" alt="Sample Image"> {% endblock %} Will this work
Habib
Provided the static file exists?
George B
I'm trying to build a portfolio website but issues arise when I install requirements.txt using pip on VScode. What should I do to fix this error. It says
George B
It says " Please add the directory containing pg_config to the $PATH or specify the full execution path with the option: python setup.py build_ext --pg-co fig / path/to/pg_config build ...
George B
Or with the pg_config in 'setup.cfg'
Habib
Ok I have one more question {% extends 'myapp/base.html' %} {% load static %} {% block setting %} <img src="{% static 'myapp/images/sample-image.jpg' %}" alt="Sample Image"> {% endblock %} Will this work
Because I Think load static is required only once like here I have it loaded but still the error was " did you forgot to load" Hence I added another load static inside the block
George B
Windows 11
Charly
Windows 11
Do you already installed postgresql?
Habib
Because I Think load static is required only once like here I have it loaded but still the error was " did you forgot to load" Hence I added another load static inside the block
So basically the working version has 2 tags in a single template {% extends 'myapp/base.html' %} {% load static %} {% block setting %} {% load static %} <img src="{% static 'myapp/images/sample-image.jpg' %}" alt="Sample Image"> {% endblock %} Which doesn't make sense to me
Habib
Or does it?
Charly
Or does it?
No, what happens when you delete it?
George B
Charly
No I haven't...
So thats the issue
George B
So thats the issue
Let me do that first. Thanks
Habib
When I remove the inside tag it throws that tag not loaded or registered error
Habib
Same is the case when I remove the outside one
Habib
TemplateSyntaxError at /dashboard/ Invalid block tag on line 19: 'static', expected 'endblock'. Did you forget to register or load this tag? Request Method: GET Request URL: http://127.0.0.1:8000/dashboard/ Django Version: 5.0.8 Exception Type: TemplateSyntaxError Exception Value: Invalid block tag on line 19: 'static', expected 'endblock'. Did you forget to register or load this tag? Exception Location: /home/habib92/testing-clone/arbzoom/backend/venv/lib/python3.10/site-packages/django/template/base.py, line 555, in invalid_block_tag This is what I get when I remove the load static inside the {%block setting %}
Habib
https://dpaste.org/XD4k6#L3,7,8
Habib
looks like you're missing some {% endblock %} in base.html file
I checked but no...the code I have shared is dashboard.html here I am not missing any endblock And I just checked the dashboard-base(which I am extending from) Not missing it there roo
Habib
Yeah actually I did
Habib
But then I see the extend tag displayed as it is...with all the CSS removed
Charly
https://dpaste.org/XD4k6#L3,7,8
Also send 'backendapp/common-templates/dashboard-base.html
Habib
Here https://dpaste.org/EWLXS
Habib
You can find the block setting on line 1183
Charly
The error lines don't coincide
Charly
but not sure whats really happening
Charly
loading multiple times a tag is not harmful but it makes not sense for me
The Inspired
Yeah same thing is bothering me. Anyway thanks
did you manage to solve the error?
Habib
Yeah just a min ago I did
Habib
loading multiple times a tag is not harmful but it makes not sense for me
I did the same thing with a few other templates and it was working( the single tag) And then I noticed that my vscode was Doing something like when I was saving the template {% load static %} I think the "%}" pushed to the newline was creating the confusion of tag not closed I added a comment to put the complete tag to new line and it worked
The TokenTitan
Please what is the opinion on using uuid for primary key, because I am seeing from different post that there might performance issue with using especially where there are ForeignKey relation So what is your advise
Shoyim
Hello, I have a problem with opening pictures and files. Static conf: BASE_DIR = Path(__file__).resolve().parent.parent STATIC_URL = "static/" STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static"), ] STATIC_ROOT = os.path.join(BASE_DIR, 'static') Image tag: {% load static %} <img src="{% static 'admin/img/fvol.svg' %}" alt="header image not found">
Vivek Yadav
I have deleted all the migrations files and dbsqllite file data also , but when I run makemigrations it shows no changes detected
Vivek Yadav
Anyone can help me related to it
The TokenTitan
also, while fetching query is it advisable to use related_name lookup something like chapter = book.book_chapter where book_chapter is the related_name OR I should first query the boon and then query the chapter of the book book = Book.objects.get(id=1) chapters = Chapters.objects.get(book=book) I am talking in term of best practices and performances
Vivek Yadav
you shouldn't have deleted the migrations
Ops chat gpt suggested me I was facing an error
Vivek Yadav
That's why I did that
Maxim
Ops chat gpt suggested me I was facing an error
you shouldn't have gone to ChatGPT
Vivek Yadav
you shouldn't have gone to ChatGPT
So tell me is there any way to solve this ?
The TokenTitan
is it on your local machine, I mean you are just developing it And not on any server
The TokenTitan
Maybe if you can still reclaim it from recycle bin
Vivek Yadav
Oh.
The TokenTitan
OR You might have to drop the database also And then start afresh run python manage.py makemigrations appname for every of the app folder
Maxim
So tell me is there any way to solve this ?
call a professional you've made it almost impossible to solve your problem through chat
Vivek Yadav
Let me do this .. then I will connect back
Maxim
Is there no one professional?
please read my message carefully
The TokenTitan
but try to always fix migrations issues other than deleting it
Vivek Yadav
Please anyone who have a suggesion Thanks
Actually you are right , I think I should start an new project ..
Maxim
and this
just reassemble one new post don't forget to delete the old ones
The TokenTitan
Actually you are right , I think I should start an new project ..
I don't mean starting a new project Just migrations and database Delete that database instance and all the current migration folders It will work
Habib
bruh...💀 prefer disabling extensions or configuring them next time
Will do. Thanks for suggestion Cause can't afford formatting errors on top of Django errors
The Inspired
Will do. Thanks for suggestion Cause can't afford formatting errors on top of Django errors
I do not use formatters when writing django code... but even if you want to use it, use a dedicated django/python formatter instead of a JS-orientrd formatter like prettier. I faced this same problem when using prettier and eventually I had to disable it when writing django.
The Inspired
I have deleted all the migrations files and dbsqllite file data also , but when I run makemigrations it shows no changes detected
this exact same issue has happened with me earlier and I had to take the hard way: delete all migrations, drop entire database (all tables), rerun migrations and migrate. Luckily my Team Lead was fine with it. If you have a team lead, make sure to consult him if you do decide to go this route 💀