Skip to content
Advertisement

Tag: django

Calling an External API That Fails Randomly

I am using Django server to call a Korean government’s weather API to retrieve weather data for around 1800 locations. However, this weather API results in time out most of the time. I tried giving resting periods. For example, for every request, it will sleep for 0.8 seconds and after every 30 requests, it will sleep for 30 seconds. But

ValueError: Field ‘id’ expected a number but got ‘Die erste Meldung’. after adding an item via console

I’m trying to add an item into db.sqlite3 via command line but got this error: Inside migrations001_initial.py below the field id of contentobject Meldung is declared as auto_created=True, but it seems it’s not working as expected. How can I solve it? expected result Field ‘id’ is generated automated by db.sqlite3 environment Python 3.8.2 Django 3.1.3 models.py migrations001_initial.py Answer The first

parse json object in django view

I have a form than i need to check if the emails on my form are valid or not here is my ajax code : and this is my code in django view: it raises this error : TypeError: the JSON object must be str, bytes or bytearray, not ‘NoneType’ thanks in advance Answer TypeError: the JSON object must be

Django form: phone field not showing

I would like to create a contact form on my Django website. For now, this is my code: models.py: forms.py: views.py: html: I of course installed phonenumber_field and added it in settings.py This is the result, phone field missing: Any help is hugely appreciated! Thanks for your time. Answer You used a model field, whereas for a form, you need

Advertisement