Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Django Like Button with AJAX Request
I'm trying to create an AJAX request in Django to update a Like Button. I'm getting an Error from the AJAX call. Not sure how to troubleshoot it. Can anybody point me in the right direction? .script $(".vote-form").submit(function(e) { e.preventDefault(); let poopfact_id = $(this).attr("id"); const voteCount = $(`.voteCount${poopfact_id}`).text(); let url = $(this).attr('action'); $.ajax({ type: 'POST', url: url, data: { 'csrfmiddlewaretoken': $('input[name=csrfmiddlewaretoken]').val(), 'poopfact_id': poopfact_id, }, success: function(response) { document.getElementById("vote_count").innerHtml = response['total_votes'] console.log('success', response) }, error: function(response) { console.log('error', response), }, }); .views def vote(request, poopfact_id): if request.method=="POST": if user.is_authenticated: if "upvote" in request.POST: post.upvote.remove(request.user) total_votes = post.upvote.count() - post.downvote.count() data = {"total_votes": total_votes} return JsonResponse(data, safe=False) .html <form action="{% url 'vote' poopfact.id %}" style="display: inline-block" method="POST" class="vote-form" id="{{poopfact.id}}"> ... <div class="voteCount{{poopfact.id}}" id="vote_count">{{ poopfact.total_votes }}</div> <button type="submit" name="upvote" class="btn btn-primary"><i class="fa-solid fa-up-long"></i></i></button> ... -
How do i run django-channels + nginx + gunicorn + redis in docker?
I am trying run an django asgi app with nginx + gunicorn + redis in docker.so far my wsgi application is running by gunicorn smoothly but somehow my django channels consumers are not connecting. Docker-Compose version: '3.9' services: db: image: postgres volumes: - ./data/db:/var/lib/postgresql/data environment: - POSTGRES_DB=LiveSafer - POSTGRES_USER=postgres - POSTGRES_PASSWORD=demo1234 ports: - "5432:5432" web: build: . command: > bash -c " python manage.py makemigrations && python manage.py migrate && gunicorn --bind 0.0.0.0:8000 LiveSafer.wsgi && daphne -b 0.0.0.0 -p 8001 LiveSafer.routing:application " volumes: - .:/app - static_files:/app/static expose: - 8000 ports: - 8001:8001 links: - redis depends_on: - db nginx: build: ./nginx/ ports: - 80:80 volumes: - ./nginx/conf.d/:/etc/nginx/conf.d/ - static_files:/home/app/static depends_on: - web # database controller adminer: image: adminer:latest restart: always environment: - ADMINER_DEFAULT_SERVER=db - ADMINER_DESIGN=flat - ADMINER_PLUGINS=tables-filter ports: - 8080:8080 redis: image: redis:latest command: ["redis-server", "--bind", "redis", "--port", "6379"] volumes: static_files: db: nginx upstream django{ server web:8000; } upstream channels-backend { server 127.0.0.1:8001; } server { listen 80; client_max_body_size 60M; location / { proxy_pass http://django; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header HOST $host; } location /ws/ { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_redirect off; proxy_pass http://127.0.0.1:8001; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Host $server_name; … -
/bin/sh: mysql_config: not found while making docker image in django app
Collecting mysqlclient==2.1.1 Downloading mysqlclient-2.1.1.tar.gz (88 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.1/88.1 kB 6.3 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'error' error: subprocess-exited-with-error × python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [16 lines of output] mysql_config --version /bin/sh: mysql_config: not found mariadb_config --version /bin/sh: mariadb_config: not found mysql_config --libs I just run docker build . -t docker-django-v0.0 and encountered above issue. -
Create page urlpatterns in admin panel Django
i am need help to django urlpatterns in urls.py. I am needs in create pages in admin panel need heelp pls in create page django in djanfo admin panel -
I am new to Vue Please help me to how I post file in vue. I am using django rest framework in backend. My response is ok
I am new to Vue Please help me to how I post file in vue. I am using django rest framework in backend. My response is ok. Here is my code I am new to Vue Please help me to how I post file in vue. I am using django rest framework in backend. My response is ok. Here is my code <template> <div class="tasks_container"> <div class="create_data"> <form @submit.prevent="createData" enctype="multipart/form-data"> <div class="form-group"> <label for="title">Name</label> <input type="text" class="form-control" id="name" v-model="name"> </div> <div class="form-group"> <label for="image">Image</label> <input type="file" ref="pic" class="form-control"> </div> <div class="form-group"> <button type="submit">Create Data</button> </div> </form> </div> </div> </template> <script type="text/javascript"> export default { data() { return { // student data students: [''], name: '', pic: '' } }, methods: { async createData(){ try { // Send a POST request to the API const response = await this.$http.post('http://localhost:8000/create/', { name: this.name, pic: this.pic, completed: false }); // Append the returned data to the tasks array this.students.push(response.data); // Reset the title and description field values. this.name = ''; this.pic = ''; } catch (error) { // Log the error console.log(error); } }, } </script> Please help me to resolve my problem. I am new to Vue Please help me to how … -
Why this error showing while created a form to upload image
Error raised is here enter code here This is the view to addpost and inherited from CreateView. views.py class PostAddView(CreateView): template_name="add_post.html" form_class=PostForm model=AddPost success_url=reverse_lazy("index") context_object_name="posts" models.py class AddPost(models.Model): post=models.ImageField(upload_to="postimages",null=True) caption=models.CharField(max_length=200) user=models.ForeignKey(MyUser,on_delete=models.CASCADE) created_date=models.DateTimeField(auto_now_add=True) Here MyUser is a abstract user forms.py class PostForm(forms.ModelForm): class Meta: model=AddPost fields=["post","caption"] widget={ "post":forms.FileInput(attrs={"class":"form-control"}), "caption":forms.Textarea(attrs={"class":"form-control","rows":3}) } template given to render the form. (add_post.html) <!DOCTYPE HTML> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <div class="container"> <div class="row"> <div class="col-2"></div> <div class="col-3"> <form action="" method="post" enctype="multipart/form-data"> {%csrf_token%} {{form.as_p}} <input type="submit" value="Post"> </form> </div> <div class="col-2"></div> </div> </div> </body> </html> -
Solutions to handle thousand or million socket connections
currently I have deployed a Django project on EC2 server which has a RAM of about 2GB using Gunicorn and Ngnix, I have also WebSocket's using Django channels on same server, so as of now we have around 200 active users. currently each user will have 5 active WebSocket connections/consumers (for chat, notification, etc.) open so currently around 1000 open connections are present at a time. As of now WebSocket's are working fine but in future we are expecting a growth in user so as the active WebSocket connections will grow, and at some point, due to excessive load, the server will start throwing issues regarding socket connections my question is how to solve this situation. is moving socket clients to another server a good solution? or should I increase my current servers RAM? basically i don't know what to do to solve this issue if this occurs in future -
Django test error: django.db.utils.ProgrammingError: relation "auth_group" does not exist
I have a django app which has not been tested lately. I have to run a custom command. I have written a test for it and run all migrations. I was able to successfully run all migrations. When I tried to run the test then the following error was thrown. python manage.py test Creating test database for alias 'default'... Got an error creating the test database: database "test_ILIDD_db" already exists Type 'yes' if you would like to try deleting the test database 'test_ILIDD_db', or 'no' to cancel: yes Destroying old test database for alias 'default'... Traceback (most recent call last): File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\db\backends\utils.py", line 86, in _execute return self.cursor.execute(sql, params) psycopg2.errors.UndefinedTable: relation "auth_group" does not exist The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 39, in <module> execute_from_command_line(sys.argv) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_line utility.execute() File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\__init__.py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\commands\test.py", line 23, in run_from_argv super().run_from_argv(argv) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv self.execute(*args, **cmd_options) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\base.py", line 369, in execute output = self.handle(*args, **options) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\test_without_migrations\management\commands\_base.py", line 78, in handle super(CommandMixin, self).handle(*test_labels, **options) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\core\management\commands\test.py", line 53, in handle failures = test_runner.run_tests(test_labels) File "C:\Anaconda3\envs\nlp-ilidd-processor\lib\site-packages\django\test\runner.py", line 684, in … -
How to change google places autocomplete URL form data
I have configured the Google places autocomplete and after selecting search I am getting URL form data like so: http://127.0.0.1:8000/location/?term=1+York+Street%2C+Sydney+NSW%2C+Australia. I would like to get it configured so that it returns multiple name/value pairs like so: http://127.0.0.1:8000/location/?inputNumber=1&inputStreet=York+Street&inputCity=Sydney&inputState=NSW&inputZip=2000 This is required as I am using a Django and would like to use the name/value pairs to help with retrieving data from the model. This what I have configured in my script tags: <script> function initMap() { var input = document.getElementById('search_term'); const options = { types: ["address"], }; var autocomplete = new google.maps.places.Autocomplete(input); autocomplete.setComponentRestrictions({ country: ["au"], }); } </script> <script async src="https://maps.googleapis.com/maps/api/js?key=xxxxxx&libraries=places&callback=initMap"> </script> Any help would be appreciated? -
Creating a simple multiple user types in Django
So I've created 3 different users: admins, developers, and project managers. When I use the individual signup forms for each of these users and logout, it works, but then I when try to use the login form, it seems to me that its acting like the signup form. Because when I input the same user details of the one I just created into the login form, it throws up the built-in error message, 'A user with that user name already exists' I'm not sure how to proceed from here. Here's what I have so far. models.py class CustomUser(AbstractUser): ACCOUNT_TYPE_CHOICES = ( ('admin', 'Admin'), ('developer', 'Developer'), ('project_manager', 'Project Manager') ) account_type = models.CharField(max_length=20, choices=ACCOUNT_TYPE_CHOICES) login and signupviews class LoginView(View): def get(self, request): # Render the login form form = LoginForm() return render(request, 'users/login.html', {'form': form}) def post(self, request): # Get the form data from the request form = LoginForm(request.POST) # Validate the form data if form.is_valid(): # Get the username and password from the form username = form.cleaned_data['username'] password = form.cleaned_data['password'] # Authenticate the user user = authenticate(request, username=username, password=password) # If the user is authenticated, log them in and redirect to the homepage if user is not None: login(request, user) … -
Creating relationship between Student and Class in Django
I am trying to create models where I can have relationship between Students and ClassName tables so that I can get all users using using ClassName.objects.get() and ClassName using Student.objects.get() method? I am completely stuck here. Should I add more fields to Student model? from django.contrib.auth.models import AbstractUser from django.db import models # Create your models here. class User(AbstractUser): pass class ClassName(models.Model): grade = models.IntegerField() section = models.CharField(max_length=1) def __str__(self): return f"{self.grade} - {self.section}" class Student(models.Model): first_name = models.CharField(max_length=124, null=False) middle_name = models.CharField(max_length=124, default='') last_name = models.CharField(max_length=124, null=False) name = models.CharField(max_length=124, default=f"{first_name} {middle_name} {last_name}") father_name = models.CharField(max_length=124, null=False) phone_number = models.CharField(max_length=20, null=False) date_of_birth = models.DateField() national_id= models.CharField(max_length=15, null=False) student_class = models.ForeignKey(ClassName, on_delete=models.DO_NOTHING) def __str__(self): return f"{self.first_name} {self.middle_name} {self.last_name}" I am trying to find a method to get all users using using ClassName.objects.get() and ClassName using Student.objects.get() method? -
What is .pyi in django?
What is .pyi file in Django? For example stubs>django-stubs>db>models>expression.pyi ? -
How to import a function or variable from a sibling of the current parent app 5 levels upper of the current app in Django?
I want to import some functions a constants variables from 5 levels upper of the current app of Django application. My problem is that the package that I want to import from, is outside of the Django application, so Django isn't aware of it. project structure: ├── lawcrawler │ ├── get_all_amended_laws_urls.py # import a function from this file │ ├── lawcrawler │ │ └── spiders │ │ └── settings.py # import variables from this file │ │ ├── project │ ├── apps │ │ ├── laws │ │ ├── management │ │ ├── commands │ │ ├── add_list_of_amended_laws.py # import function and variables to this file │ ├── manage.py I have tried relative import like this: from .......lawcrawler.lawcrawler.spiders.settings import SPARQL_ENDPOINT, AMENDED_URL_FILE_PATH, get_law_amendment_query and this: from .....lawcrawler import get_all_amended_urls but got this error: ImportError: attempted relative import with no known parent package How to import the functions and variables or solve this issue? -
Is there a chance that emails are sent in parallel and thus `mail.outbox.clear()` doesn't really clear outbox in my django tests?
I have written django tests to check my outbox emails as shown below class TestX(TestCase): def setUp(self): # Clear outbox. mail.outbox.clear() super().setUp() def tearDown(self): # Clear outbox. mail.outbox.clear() super().tearDown() however, performing assertions e.g self.assertEqual(len(mail.outbox), 1) fails with the len(mail.outbox) showing a large number as compared to the emails I've sent using send mail. I know there are other apps also sending emails so I'm wondering if the emails are being sent in parallel and thus my clear isn't effective or what might be the issue? -
Is it possible to sort queryset without hitting the db again?
Is there any approach to avoid hitting db when the queryset needs to be returned in a specific order? If a queryset would be returned when a page is loaded qs = Student.objects.all()[start:end] But it also provides UI for users to view the query in ascending or descending order. So, at Django server. Queries should be performed qs = Student.objects.all()[start:end] qs2 = Student.objects.filter(id__in=qs).order_by("-id") To reduce the db hitting, is there any other better approach to avoid frequent query and db hit? I wonder I would store the query result in browser and return the results but it looks so complex... -
Difference between render( ) and redirect( ) in django?
what is exactly the difference between render( ) and redirect( ) in django? I know redirect will send another request to the URL and render will render the template with the given context. But still something makes me not fully understand it. Maybe anyone can explain it well can help me a lot. Do I have to first render the template before using redirect function. For eg: I have two templates home.html and signin.html. def home(request): return render(request, 'home.html') def logout(request): return redirect('signin') or without writing def home can I redirect to home.html like below def logout(request): return redirect('signin') -
Trying to Resolve a "Direct assignment to the forward side of a many-to-many set is prohibited. Use category.set() instead." error
I am a student working on a project for my coding bootcamp and I'm having to resolve an issue with a many to many field. The theme of the project is app that lets users post screenshots from various video game and label them bases on category, 3rd party editing and capture tools. I'm trying to write code for POST and PUT requests that will allow a user to select several objects in a React.js form. I'd also try and test whatever solution I get in postman. I've added fixtures into my database and the fixtures work, but when attempting to test by using raw JSON in the body like this: ` "category": 1, or "category": [ 1, 2, 3 ] ` I get the error show in the title of this post. I'm using Python 3.9.10 and Django 4.14. my model looks like this: screenshot.py ` from django.db import models from .archer import Archer from .editingtool import EditingTool from .capturetool import CaptureTool from .category import Category class Screenshot(models.Model): archer = models.ForeignKey (Archer, on_delete=models.CASCADE) image = models.CharField(max_length=255, null=True) content = models.TextField() captureTool = models.ForeignKey (CaptureTool, on_delete=models.CASCADE) editingTool = models.ForeignKey (EditingTool, on_delete=models.CASCADE) category = models.ManyToManyField ('Category', through='ScreenshotCategory') timestamp = models.DateField(auto_now_add=True) ` … -
django celery database transaction auto commit
I use celery group feature to group my async tasks, like job_flow = group( tasks.init_a.si(id, data), tasks.init_b.si(id, data) ) res = job_flow() In init_a function, I have some code ta = tablea.objects.get(id=id) ta.desc = 'done' ta.save() Then in init_b(), I will to check the ta.desc is done or not, but I can not get the ta.desc to done. But I use ./manage shell to check the ta.desc value is changed to done. Why I can not in init_b() to get the real ta.desc value? Django (1.5.6) celery (3.1.23) -
Passing Django request object into script to build absolute URI?
I am trying to build a one time script by passing in a django request in order to build an absolute URI. I am using the HttpRequest() method as follows... request = HttpRequest() And passing it into the function that I am calling when running my script. I keep running into a KeyError My script that is being ran is as follows, from django.http import HttpRequest for form in forms: form_data = get_data(form) for user in User.objects.all(): request = HttpRequest() config_user_forms(request, user) Errors out with the following, File "config_user_forms.py", line 65, in <module> redeploy_form(request, user) File "/tmp/8dae22604556cc2/users/admin/users.py", line 654, in redeploy_form build_url = request.build_absolute_uri( File "/tmp/8dae22604556cc2/antenv/lib/python3.8/site-packages/django/http/request.py", line 223, in build_url location = self._current_scheme_host + location File "/tmp/8dae22604556cc2/antenv/lib/python3.8/site-packages/django/utils/functional.py", line 45, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/tmp/8dae22604556cc2/antenv/lib/python3.8/site-packages/django/http/request.py", line 240, in _current_scheme_host return "{}://{}".format(self.scheme, self.get_host()) File "/tmp/8dae22604556cc2/antenv/lib/python3.8/site-packages/django/http/request.py", line 121, in get_host host = self._get_raw_host() File "/tmp/8dae22604556cc2/antenv/lib/python3.8/site-packages/django/http/request.py", line 111, in _get_raw_host host = self.META["SERVER_NAME"] KeyError: 'SERVER_NAME' I am a bit stumped on a work around, and appreciate any help in advance! -
How to run "SELECT FOR UPDATE" for the default "Delete selected" in Django Admin Actions?
I have Person model as shown below: # "store/models.py" from django.db import models class Person(models.Model): name = models.CharField(max_length=30) And, this is Person admin below: # "store/admin.py" from django.contrib import admin from .models import Person @admin.register(Person) class PersonAdmin(admin.ModelAdmin): pass Then, when clicking Go to go to delete the selected persons as shown below: Then, clicking Yes I'm sure to delete the selected persons: Only DELETE query is run in transaction as shown below: Now, how can I run SELECT FOR UPDATE for the default "Delete selected" in Django Admin Actions? -
Cannot generate instances of abstract factory UserFactory ( Factory boy)
factory.errors.FactoryError: Cannot generate instances of abstract factory UserFactory; Ensure UserFactory.Meta.model is set and UserFactory.Meta.abstract is either not set or False. Im using factory boy library To test my functions my class UserFactory Here enter image description here Here Model User I'm inheritance from class abstract user enter image description here I added class meta abstract and still not working I added class meta abstract and still not working -
How can I use Date Range with Sum and Order By in Django
I am working on a project where I have an Income Model with description among other fields as shown below. The description is a choice field and I want to use Date Range to Sum by each description. i.e. I would want to sum all amount for each description and display their total in HTML Template. Below is what I have tried but I am getting error which says too many values to unpack (expected 2). Models code: CATEGORY_INCOME = ( ('Photocopy', 'Photocopy'), ('Type & Print', 'Type & Print'), ('Normal Print', 'Normal Print'), ('Color Print', 'Color Print'), ('Passport', 'Passport'), ('Graphic Design', 'Graphic Design'), ('Admission Check', 'Admission Check'), ('Lamination', 'Lamination'), ('Document Scan', 'Document Scan'), ('Email Creation', 'Email Creation'), ('Email Check', 'Email Check'), ('Online Application', 'Online Application'), ('Agreement Form', 'Agreement Form'), ('Envelope / Binding Film', 'Envelope / Binding Film'), ('Web Development ', 'Web Development'), ) class Income(models.Model): description = models.CharField(max_length=100, choices=CATEGORY_INCOME, null=True) staff = models.ForeignKey(User, on_delete=models.CASCADE, null=True) amount = models.PositiveIntegerField(null=False) date = models.DateField(auto_now_add=False, auto_now=False, null=False) addedDate = models.DateTimeField(auto_now_add=True) class Meta: verbose_name_plural = 'Income Sources' def __str__(self): return self.description Views Code def generate_reports(request): searchForm = IncomeSearchForm(request.POST or None) searchExpensesForm = ExpensesSearchForm(request.POST or None) if request.method == "POST" and searchForm.is_valid() and searchExpensesForm.is_valid(): listIncome = … -
Raise Error 404 using django-hosts in Django
I have the following problem. I'm using django-hosts for subdomains like blog.example.com, es.example.com. The problem is that there are urls where I manage id, such as: blog.example.com/url/id And suppose the user doesn't touch anything, because everything is an OK 200 but if the user goes from clever and touches the id to one that doesn't exist, the site returns a 404. But here comes the problem, when using django-hosts if I do a handler404 in the urls of the subdomain. It throws me an Error 500 and if I then do a handler500 in the urls of the subdomain, literally, it breaks the server, since then apache tells me that there is a problem in the server. Here I leave my url.py of the subdomain. from django.urls import path from django.views.generic.base import TemplateView from django.conf.urls import handler404, handler500 from django.conf import settings from django.conf.urls.static import static from django.contrib.sitemaps.views import sitemap # MODULO PROPIO from . import views from .sitemaps import MapaDeSitio sitemaps = { 'blog': MapaDeSitio } urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + [ # SITIO path('', views.indexView, name='IndexView'), path('articulo/<str:url>/<int:id>', views.ArticuloView, name="ArticuloView"), # SEO path('robots.txt', views.RobotsView.as_view()), path('BingSiteAuth.xml', TemplateView.as_view(template_name="blog/BingSiteAuth.xml", content_type="text/xml")), path('sitemap.xml', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'), ] # MANEJO DE ERRORES HTTP handler404 … -
Query M2M from Django template language
This might be a rookie problem but I cannot find a way around it. I am trying to implement add recipe to favourites. The view and model work properly as when I hit the button once it sends the request and adds the recipe to the user's favourites. Then when clicked again it removes it correctly from the database. Alas now when i try to make visible on the template I ran into trouble with the template language. I cannot find a way to check if the current user's profile has liked the paginated recipe. I have the following class based list view class Home(ListView): model = Recipe template_name = 'home.html' cloudinary_name = settings.CLOUDINARY_STORAGE.get('CLOUD_NAME') extra_context = { 'cloudinary_name': cloudinary_name, } paginate_by = 2 def get_queryset(self): return Recipe.objects.order_by('id').prefetch_related('profile__recipecomment_set__recipe') and the following Recipe model class Recipe(models.Model): title = models.CharField( max_length=TITLE_MAX_LENGTH, validators=( MaxLengthValidator(TITLE_MAX_LENGTH), MinLengthValidator(TITLE_MIN_LENGTH), ), null=False, blank=False, ) profile = models.ForeignKey( Profile, on_delete=models.RESTRICT, null=False, blank=True, editable=False, ) favourites = models.ManyToManyField( Profile, related_name='favourite', default=None, blank=True, ) the template.html is as follows {% for recipe in page_obj %} {% if request.user.profile.id in recipe.favorites %} <button>Recipe added to favourites</button> {% else %} <button>Add to favourites</button> {% endif %} {% endfor %} the pagination works, everything else … -
I am trying to edit basic crud command with basic application using python django
I can create an obj just find. I want to pre load the form have a user make a change and update/save it in the db. After an edit is made it adds " ", (), [[[enter image description here](https://i.stack.imgur.com/Tan5A.png)](https://i.stack.imgur.com/jGJsK.png)](https://i.stack.imgur.com/WKowu.png)marks and commas after everything. I have tried to use the replace function to remove the ""'s, still doesnt do any good? I just want to edit and save without adding characters to my data. I tried value={{task.reminder}} and it shows fine on my page, after I check the edit it will show "Take trash out", All I need is Take trash out. Thank you!!!!!!!! the photos showed what I tried, however, I have no idea how to fix. Thank you.