I want to let the user upload multiple images per post. Similarly to an e-commerce platform with multiple images per product. But till now the images are not sent to the database. That’s my code so far: models.py: forms.py: views.py: project_form.html: settings.py: project urls.py app urls.py Answer Issue: You have made ProjectForm which relates to Project model, but the image
Tag: django-templates
How can i implement Notifications system in django
I created an app where user’s can post a question and get answers from others users. Now I want to implement a notification system, so that when a user answer a question, the author of that question will receive notification. Like social media notifications. The home templates: the models: The views: the home page view: the urls Answer Here is
Django: Refused to apply style from … because its MIME type (‘text/html’) is not a supported stylesheet MIME type
i am trying to connet my style.css in django template using the static files {% static ‘assets/css/style.css’ %} but i keep seeing this error Refused to apply style from ‘http://127.0.0.1:8000/assets/css/style.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.. NOTE: when i copy my css and manually paste it in a
Django forms not saving posts to database
i am trying to create a course from my frontend using django form, everything seems fine but when i hit the create button it just refreshes the page without saving to database or throwing back any error, and that is not what i am expecting. create-course.html models.py forms.py Answer this was fixed by just uploading an image, but i wasnt
How to display the keys of a python dictionary as HTML table headers and values of each key as a row under that table header?
I’m currently working in a django project in which I do some data analysis using pandas library and want to display the data (which is converted into a dictionary) as a HTML table. dictionary that I want to display: I want to display the above dictionary like this table in django template. id product_name value available_qty 1 product1 200 1
Get html link id in django views.py
This is what my template index.html looks like And here is my urls.py file Finally, this is my link view inside of the views.py file Where page() is a function that takes one argument. I want the id of the <a></a> tag of index.html to be that argument. But I have no idea how to access get that id inside
Django get user data in main template
I’m trying to check if user logged in in the main template using this: but it’s not working maybe because main template doesn’t have a view could any one help i don’t know if the question duplicated,but i didn’t find my answer. Answer you could use:
Django dev server no longer reloads on save
I’m developing a simple Django app and things were going great until suddenly the dev server stopped reloading automatically on file change. Now I have to manually restart the server every time I change some Python file, which is pretty annoying. I’ve tried removing my virtual environment and reinstalling Django to no avail so I guess the problem is with
Django – store.models.Customer.MultipleObjectsReturned: get() returned more than one Customer — it returned 2″
I am trying to make an e-commerce website where “AnonymousUser” or Guest user can order and check out products by providing their name, email, and address. But after clicking the “Make Payment” button, my terminal was having an error that says “store.models.Customer.MultipleObjectsReturned: get() returned more than one Customer — it returned 2!” When I try to login and do the
Table order messed in Firefox, but works fine in other browsers
I have a table that I sort by date, it works fine in EDGE and Chrome, but the order is messed in Firefox. A series of rows that should be on top got moved down to the bottom. HTML: View: Any information helps! :) Update: I realized the problem was caused by the jQuery corresponding to the HTML element: Seems