Skip to content
Advertisement

Tag: django

Storing images in sqlite – Django

I’m new to Django and databases. Django used the sqlite database as it’s default database. Is it possible to store images in the sqlite database and display it on my webpage? I can’t find any documentation on the official Django website for it. Answer Django’s ImageField and FileField are both just links to the location where the file is actually

I want to know why secret_key is wrong

I’m making website using Python Framework of ‘Django’. I have some problems with Django about secret_key . When I set a secret_key in .env file on private and change settings.py, there is problem. I’m trying to solve it by myself, but its so difficult. When I runserver on django, It errors contain: settings.py contains: .env contains: Answer if your .env

Order of Operations Django Templates

I have a float variable mynumber in Django templates, and I need to round it to the nearest integer without third party filters, so I’m following this logic: In Django templates I can do this: But the problem, as you can see, is that there is no order of operations, so I get a different number than the expected, how

Image is not updating in Django

Please help me. I am trying to update the profile in which username and email are updated but the image dose not. My code is…. profile.html views.py forms.py Answer I believe your issue lies in views.py. Firstly, you are checking to see if the method for retrieving the view is POST. If it is not, you are initializing a form

Problem loading background image from external css (django)

I’m having trouble loading an image via external CSS on Django. It works fine using inline CSS but I want to understand why it doesn’t work using external one. Any help would be appreciated: My tree: CSS: HTML: settings.py: P.S I’m using localhost and image does load via URL: http://127.0.0.1:8000/static/website/img/Racoon.jpg Answer replace: with ../means parent directory. you first go back

Format decimal on definition in Admin Panel Django

I create a definition to get the percentage of completed tasks associated with a project. I want to eliminate the decimals and transform it into whole numbers Finally, the idea is that if all the tasks are completed, the project status should go to finished Answer You can round the value you obtain when retrieving the percentage:

Advertisement