Category "django"

Add a link to custom django admin view

I've created a custom admin view as documented here. class MyAdmin(admin.ModelAdmin): def get_urls(self): urls = super().get_urls() my_urls

TypeError: SET_NULL() missing 4 required positional arguments: 'collector', 'field', 'sub_objs', and 'using'

How do i solve the above error which shows up not during the makemigrations but during migrate in Django. class Comment(models.Model): #comment_id=models.I

How to fill form fields since HTML

I have been looking for information on the web about how set values in forms of django but it has been really difficult. I need to put "Inicio" in the field "Or

How can I delete a request.session variable inside the Django HTML template?

Code: {% if request.session.message %} <div class="alert alert-warning alert-dismissible fade show" role="alert"> <i class="bi bi-check2-circle">

Django | CKEditor - Image Upload option not showing in App

In admin all CKEditor option is showing and working properly. I can upload image in main admin dashboard. But in App in Image "Uoload" option is not showing. Pl

trying to make django load environment vars from a .env.local file using django-environ from within a venv

I keep getting this traceback (pythonApp) D:\task_trackv2>python manage.py makemigrations D:\task_trackv2\apps_config\settings.py D:\pythonApp\lib\site-pack

How to enable django admin sidebar navigation in a custom view?

I have a view inheriting from LoginRequiredMixin, TemplateView, which renders some data using the admin/base_site.html template as the base. I treat it as a par

DJango deployment on Apache24 not working

I am new to web frameworks and I have designed small website using DJango-3.1.7. I am trying to deploy DJango website on Apache server in Windows 10 platform bu

Django shell_plus: How to access Jupyter notebook in Docker Container

I am trying to access a Jupyter Notebook created with the shell_plus command from django-extensions in a Docker container. docker-compose -f local.yml run --rm

Make User email unique django

How can I make a Django User email unique when a user is signing up? forms.py class SignUpForm(UserCreationForm): email = forms.EmailField(required=True)

enabling pylint_django plugin in vscode, pylint stop working

That's my user settings in vscode { "python.pythonPath": "/Users/cristiano/miniconda3/envs/django-rest-2/bin/python", "python.linting.pylintEnabled": true,

TypeError: cannot unpack non-iterable int object in Django views function

Following is my code in URL.py, views.py and HTML page. However, it returns me the error: TypeError: cannot unpack non-iterable int object. urlpatterns = [

Extract only values without key from QuerySet and save them to list

I have problem with getting only values from QuerySet. I have my table: class Temperature(models.Model): id = models.IntegerField(primary_key=True) # AutoF

How can I use Validator in perform_create to limit image upload size for Django Rest Framework?

In my view, I'm able to restrict an image's resolution to a specific range of width and height, but I don't know how to use this very method to also restrict an

pipenv: Pipfile.lock file shows different version than whats installed

I have django installed using pipenv install django I check the version of Django installed using python -m django --version 3.0.3 So its 3.0.3 I have done

Where can I deposit PayPal funds?

I'm developing an iOS application that allows the user to purchase coins with In-App Purchase and send them to other users. Users who receive coins can withdraw

DRF Error: Cannot assign must be a instance

I'm working on an app that lets you track your expenses and I'm trying to create an 'balnace' object when the user registers, but when I try so I get an Error:

Can't call / pass data from django database onto website using built in auth model and a model I created, which is the one I cant query

Any help would be appreciated, basically I am a beginner and I'm struggling to pull data from my database. I used the built in auth method from django, which s

error: Unable to find trailer dictionary while recovering damaged file

PyPDF2 fail sometimes with decryption of some PDF files, and I am trying do decrypt them with pikepdf but I am getting this error: Unable to find trailer dictio

Django Exception: 'TemplateDoesNotExist at /'

I'm new to Django and trying to convert a HTML template to Django project. This is my directory structure: . └── MyProject ├─&