Skip to content
Advertisement

Tag: django

“django.core.exceptions.AppRegistryNotReady: Apps aren’t loaded yet” when trying to load data into my model

I am developing an app in Django. I want to load data inside my model, that is glossary_entry, but the data is stored inside an xlsx file, that is dati_prova.xlsx. In order to achieve this, I have developed the following script: But when I run it from Anaconda prompt, I get File “load_glossary.py”, line 7, in module … raise AppRegistryNotReady(“Apps

Django Unit Test – IDs of created objects

Sample models.py models.py Suppose that I have written unit test/s: I was wondering if it’s safe to assume that the id’s of the created objects in setUp() method will always start at id 1 and so on and so forth? If not, is there a specific reason why if the test database is always destroyed after running all tests? Answer

Django Haystack – No module named ‘haystack.backends.elasticsearch5_backend’

Im following the install instructions as per the haystack documentation http://docs.haystacksearch.org/en/master/tutorial.html#installation and the search engine installation https://django-haystack.readthedocs.io/en/master/installing_search_engines.html#elasticsearch I have installed Elasticsearch 5.1.16 which is listed as compatible and have put the settings in, the installation guide only has examples for Elasticsearch versions 1 and 2 but states that 5 is supported. so I changed to version 5 in the settings

How to export excel file in django

I need help with exporting data using a template. I installed django-import-export and added it to admin panel, now I can only export data from the admin panel. I want to know how can i export excel file using template. Answer This should get you started:

ImportError: Could not import ‘rest_framework_simplejwt.authentication.JWTAuthentication’

I am trying to deploy a django app on GCP but when i try to make migrations it gives me this error: ImportError: Could not import ‘rest_framework_simplejwt.authentication.JWTAuthentication’ for API setting ‘DEFAULT_AUTHENTICATION_CLASSES’. ModuleNotFoundError: No module named ‘rest_framework_simplejwt’. Settings.py requirements.txt What is it that I am missing ? UPDATE I installed rest_framework_simplejwt and now the error shifted to : No module named

Display image in dropdown list in django [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago. Improve this question I’m currently working on a project and my task is to build a feature for users to rate different countries

Capturing values from url in post request in Django

I want to capture url values from a url into my views in a post request. My urls.py looks like below from django.urls import path from . import views as projects_views and I want to capture the value project_id in my ListCreateAPIView. Get call works fine. My views.py looks like below How can this be done? Answer Use self.kwargs[“project_id”] to

Advertisement