Category "django"

How to disable "django login" hyperlink while accessing swagger ui in drf-yasg?

I'm using drf-yasg to add swagger auto schema to my endpoints. The swagger-ui is being visible at /api/v1/swagger/ At my local setup this link is working fine a

Django: one of the hex, bytes, bytes_le, fields, or int arguments must be given

I am trying to filter data on based of UUIDAutoField in an API using Django. I am using PostgreSQL but while sending data from mobile app I have a string and th

TypeError: 'BasePermissionMetaclass' object is not iterable in django rest framework

i looked at other questions regarding this issue and their problems were in the REST_FRAMEWORK = ... values in settings.py file . is there any error in mine ? I

Adding custom QuerySet to UserModel causes makemigrations exception

I would like to create a custom queryset for my User model. However, I cannot simply use objects = UserQuerySet.as_manager() since the standard Django User mode

trouble showing desired checkbox validation state w/ bootstrap5 for django model form w/ m2m field and checkboxselectmultiple widget

I have a checkboxselectmultiple on an m2m model field in an ModelForm that is required - meaning at least one of the choices must be selected. I am using the b

Django NoReverseMatch: Reverse for 'add_continue' with arguments '('',)'

Anyone know what could be causing this error I'm getting? Most of the other code, which works the exact same way, works perfectly. However, this button doesn't

How to display items in a row of 4 across using Django, HTML, and Python

This is my code. I want the items to be displayed horizontally. I've tried changing the col-md-3 and still no luck. <title>Document</title> <

how to make custom form without database - DJANGO

So i want to upload file but only sent to locals storage NOT DATABASE too. But i don't know how to make custom forms. suddenly, here's my models.py : from djang

How to use validator in Django depending on the database data?

I'm making a web app that keeps tracks of a small business. For that purpose I have two models designed in my app. One of which is all the storage information a

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,