Category "django"

Django: ImportError: No module named doc

here is the traceback System check identified 1 issue (0 silenced). September 10, 2018 - 13:01:31 Django version 1.8, using settings 'settings' Starting devel

Navbar fixed left - Bootstrap

I am trying to make navbar in bootstrap to be fixed left, like on this link. Anyway, it is working, but when I add block content of the leaflet map, my navbar i

Save multiple objects serializers only if both of them are valid

I have multiple serializers objects that comes from the request as json file. I want to store them inside databases only if they are Valid (all of them must be

Local Variable 'X' Referenced Before Assignment in Django Views

I am working with Django and trying to create two forms on one page which I am struggling with. I would like to know why I am getting the error "local variable

django get the value enside formvalid

I am trying to obtain the value of the val variable that is inside form_valid but I cannot obtain it. Does anyone have any idea what I'm doing wrong? class Coti

Django cannot import login from django.contrib.auth.views

I try to build a login function for my page. To edit the urls.py as followed, it keeps printing this: cannot import name 'login' from 'django.contrib.auth.view

Django. How to save serialized and validated data?

I have a Car model with name, model and serial number fields. In which the combination of the name and model fields must be unique. I am using serializers.Model

How to filter in a table column contains list in django

I have a table column A=['1','2','3'] and I want filter from the table if the filter value is exist in the list. eg: id='1' Models.objects.filter(A=id)

Python QuickBooks API

I have a problem working with python-quickbooks package, I try to follow the docs: https://pypi.org/project/python-quickbooks/ Here is my code: from django.co

django annotate whether exists or not

I have a query I'm using: people = Person.objects.all().annotate(num_pets=Count('pets')) for p in people: print(p.name, p.num_pets == 0) (Pet is ManyToO

Error "Connection refused Is the server running on host "127.0.0.1" and accepting TCP/IP connections on port 5432?" in postgresql on docer

I have Django application with postgresql on docker. I tried to insert data like this: import psycopg2 try: connection = psycopg2.connect(user="postgres",

Error message: "'NoneType' object is not callable". - received from zappa deployed django application on AWS Lambda

I'm running into an error after deploying my django app to lambda using zappa. This is the error: {'message': 'An uncaught exception happened while servicing th

django-crispy-forms ModuleNotFoundError but can import in console

i've been trying to get crispy forms working for 3 hours now it's driving me nuts, please help! (or suggest another/better way to style forms in django?!) i hav

How to run Django in Python?

I am trying to install django in python. This is my code. conda create -n djangoenv python=3.8.5 anaconda conda activate djangoenv conda install -c anaconda

Static file doesn't exist and html-file doesn't work properly

output: 'static' in the STATICFILES_DIRS setting does not exist. I've tried os.path.join(BASE_DIR, '/static'), but it is doesn't work. I didn't have this probl

GeoDjango: Move a coordinate a fixed distance in a given direction (e.g. move a point east by one mile)

Given a Point (django.contrib.gis.geos.Point) how do I find another point 1 mile east from that Point object? (A) ---[ 1 mile ]---> (B) My failed attempt

how to use django-redis hset operation in redis cache

I am using django 3.0.4 and python 3.6.9. I have to use hset operation to set some values in redis cache. My try: from django.core.cache import caches cache.s

How to make static directory in Django

I created static directory which included css and image files in my Django project. When I run my project the css do display("GET /static/website/barber.css HTT

Django - WSGI script cannot be loaded as Python module

This is a well-known issue it seems but I have spent 8 hours trying to fix the issue without any success. I have been running a Django project with Apache2 on t

adding active class in django according to anchor in url

I want to create one page site with navbar links which redirect to some part of the page. How add class "active" to a link if url is based on anchor (#)? <