Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
registers same email which is alreday registerd Django Login Signup Project
I have a Django project login and signup it gives error when a new user enters same username which is already registered but accept the email which is already registered , how to avoid email if it is already registred ??? Can someone help in this issue? I AM USING CRUD AND LOGIN SIGNUP IN SAME PROJECT . My views.py code def signup_page(request): # try: if request.method == 'POST': uname = request.POST.get('username') email = request.POST.get('email') pass2 = request.POST.get('password2') pass1 = request.POST.get('password1') if pass1 != pass2: return HttpResponse("Your password and confirm password are not Same!!") else: my_user = User.objects.create_user(uname,email,pass1) my_user.save() messages.info(request,"Signup is Succesfully") return redirect(reverse('login_page')); return render (request,'registartion.html') # except Exception as e: # raise ValueError("Account With this Username or Email is already registered") def login_page(request): try: if request.method == 'POST': username = request.POST.get('username') pass1 = request.POST.get('pass') user = authenticate(request,username=username,password=pass1) if user is not None: login(request,user) messages.add_message(request,messages.INFO,"Succesfully Login") return redirect(reverse('dashboard_page')) else: return HttpResponse ("INCORRECT USERNAME OR PASSWORD") return render (request,'login.html') except Exception as e: raise ValueError("Incorrect Username Or Password !!!") MY MODELS.PY class Members(models.Model): GENDER_CHOICEs =( ('Male','Male'), ('Female','Female') ) user = models.ForeignKey(User,on_delete=models.CASCADE) name = models.CharField(max_length=20,null=True,blank=False) email = models.EmailField(null=True,blank=False,unique=True) phone = models.CharField(null=True,blank=False,max_length=10) gender = models.CharField(choices=GENDER_CHOICEs, max_length=10) role = models.CharField(max_length=10) is_deleted = models.BooleanField(default=False) … -
How to Integrate a Standalone Django Live Chat App into Main Website Views?
I'm currently learning Django and have an existing website built in HTML, CSS, JS with a Java Spring backend. I am in the process of migrating it to Django. I've successfully migrated the site and now want to add a new feature: live chat groups between users. I have implemented the live chat functionality as a standalone Django app using Django Channels and Redis, following multiple tutorials. The chat app works as expected when isolated. The issue I'm facing is how to integrate this chat functionality into the main views of my existing website. Specifically, I want the chat to appear in a small window at the bottom right corner of the screen, similar to how chat features work on Facebook or other social media sites. I tried using Django's {% include ... %} tag to include the chat functionality in base.html, thinking it would behave similarly to other globally-included elements like the navigation bar. However, this approach doesn't seem to work, and there appears to be some form of communication issue between the two apps. Here is a Gist containing my project structure, base.html, room.html, and index.html for context. -
how to process Django form?
i have an app and i need to process an image that send from the user. my image is stored in the database and linked with django form. i need to get the image name that uploaded by the user with the format of the image example: (image.png) view.py def img_upscaler(request): if request.method == 'POST': form = ImageForm(request.POST, request.FILES) if form.is_valid(): form.save() return redirect('imgupscaler.html') else: form = ImageForm() return render(request, "upsc_main.html",{'form': form}) forms.py from django import forms from .models import imgUpscalling class ImageForm(forms.ModelForm): class Meta: model = imgUpscalling fields = ('Image',) model.py from django.db import models class imgUpscalling(models.Model): Image = models.ImageField(upload_to='images/' thank you. -
Unable to write data to AWS RDS PostgreSQL database?
In my Django application, I'm utilizing AWS RDS PostgreSQL as my database backend. I've encountered an issue when attempting to send a POST request to store data in the database. After a period of loading, I receive a '502 Bad Gateway' error. Interestingly, I can successfully read data from the database. I also have a mobile app and a separate front-end application developed in Vue.js. When making POST requests from the mobile app, all operations work flawlessly, except for the one related to OTP, which also gives a '502' error. Other CRUD operations from the app are functioning as expected. In addition, reading and writing data works properly from the Django admin panel and the dashboard, both of which are built in Django. Within the front-end application, I can write data successfully, but I encounter a '502' error when attempting to write. This issue specifically occurs when I add CNAME of Application Load Balancer's DNS point to the domain. However, if I use an IP address in the A record to point to the domain, everything functions as expected. What could be the source of this issue and how can it be resolved? -
Is the FCM module in fcm-django removed in the latest version version 2.0.0?
Is the FCM module in fcm-django removed? I could use the fcm_send_message and fcm_send_bulk_message functions upto version 0.3.11 of fcm-django but in the latest versions the 'fcm' module is missing. This is my import statement that had been working fine upto versions 0.3.11 of fcm-django: from fcm_django.fcm import fcm_send_message How to use those functions in the new versions of fcm-django? Please help as this is an urgent requirement, thanks! -
In HTMX making an image clickable to delete itself (issue with created URL interference)
I have a page that under this URL http://localhost:8000/dashboard/myobjects/ shows me the products that I have. For each product I have a button that takes me to a page where I can change the pictures (deleting them or upload them) It takes me to this URL http://localhost:8000/dashboard/changepictures/5/built/ where 5 is the row number of the products table and built is a field header that defines the category. So far so good. Then I have this HTMX snippet that would delete the picture upon clicking: <div class="grid-wrapper"> {% for x in all_pictures_of_a_property %} <div class="grid-item"> {% if x.images %} <img src='{{x.images.url}}' width="200" height="100" name="pictures" hx-post="{% url 'deletepicture' x.id 'built' %}" hx-trigger="click" hx-target="this"> <a href="{% url 'deletepicture' id=x.id property='built' %}" class="btn btn-primary">Delete</a> {% endif %} </div> {% endfor %} </div> It would delete it and would be clickable when I click on the href link BUT this creates me two problems: a) It changes the URL of my browser page to something like this: http://localhost:8000/dashboard/deletepictures/37/built/ where 37 is the id of the picture, it of course changes to 37, 38 etc depending on which picture I hover. b) Because on the same page I have an upload button to add more pictures, … -
Textarea adding whitespaces when I use it again after I submit it
I have a form with textarea and everytime I click the submit button and use it again, it adds whitespaces. EDIT PAGE This is the edit page where the textarea is located. {% extends "encyclopedia/layout.html" %} {% block title %} {{ title }} {% endblock %} {% block body %} <h1>Edit Page</h1> <form method="POST" action="{% url 'edit' title=title %}"> {% csrf_token %} <div id="title"> <label>Title:</label> <textarea name="title" class="form-control" style="width: 600px; height: 50px;">{{ title }}</textarea> </div> <div id="body"> <label>Body:</label> <textarea name="content" class="form-control" rows="5" style="width: 600px; height: 400px;">{{ content }}</textarea> </div> <input type="submit" class="btn btn-primary" value="Edit" style="margin-left: 546px; margin-top: 10px;"> </form> {% endblock %} TEMPLATE {% load static %} <!DOCTYPE html> <html lang="en"> <head> <title>{% block title %}{% endblock %}</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link href="{% static 'encyclopedia/styles.css' %}" rel="stylesheet"> </head> <body> <div class="row"> <div class="sidebar col-lg-2 col-md-3"> <h2>Wiki</h2> <form action="{% url 'search' %}" method="POST"> {% csrf_token %} <input class="search" type="text" name="q" placeholder="Search Encyclopedia"> </form> <div> <a href="{% url 'index' %}">Home</a> </div> <div> <a href="{% url 'create' %}">Create New Page</a> </div> <div> Random Page </div> {% block nav %} {% endblock %} </div> <div class="main col-lg-10 col-md-9"> {% block body %}{% endblock %} </div> </div> </body> </html> VIEWS This is my … -
How to Customize Styling of Django Validation Messages
I have a Django project that has a contact us form. I want to Change Styling of errors like "this field is required" from UL style to bootstrap alert style. Please Help me... I Only Can change the message of errors but I wan to change style of those, too -
Django F-expression transform output value
I'm using an F-expression to get a foreign key object's date value. But it returns a datetime object as the date. How can I transform it to 'YYYY-MM-DD' format? from django.db.models import F PendingRequest.objects.all().values('id', creation_date=F('agreement__created_at__date')) output: <QuerySet [ {'id': 1, 'creation_date': datetime.date(2022, 10, 16)}, {'id': 2, 'creation_date': datetime.date(2022, 10, 16)}, ... -
Django app for loop through list containing a single dictionary
I am creating a Django app to use json to parse data from the internet using an API. The Result is displayed in the form a a list containing a dictionary as follows The following is the code used in the views page def home(request): import requests import json #### api_request=requests.get("xyz...URL") try: api=json.loads(api_request.content) except Exception as e: api="Error" return render(request, 'home.html',{"api": api}) I am using the following code to render api on the home page. It renders flawlessly {% extends 'base.html' %} {% block content %} <h1>Hello World!</h1> {{api.values}} {% endblock %} The output is in the form of a list containing a dictionary as follows [{'A': 53875881, 'B': 'cl', 'CH': -0.38, 'CHP': -0.00216, 'CLP': 175.46}] I would like to get these values as follows A : 53875881 B : 'cl' CH : -0.38 CHP: -0.00216 CLP: 175.46 I have tried the following code to loop through the dictionary contained in a list.I am not getting any output. Just an empty webpage {% extends 'base.html' %} {% block content %} {% if api %} {% if api == "Error..." %} check your ticker symbol {% elif api != "Error..." %} {% for element in api %} {% for key, value … -
How does celery task rate_limit and expires works
I am working with Celery in a Python application, and I have a specific requirement for one of my tasks. I've defined a Celery task as follows: @app.task(rate_limit="1/m") # The task should execute once every minute def task_test(): print("Hello") I invoke this task in my code like this: from celery import Celery from flask import Response from http import HTTPStatus celery = Celery(__name__) celery.config_from_object('celeryconfig') def execute_task(): task_test.apply_async(expires=5) # I would like the task to be revoked if it hasn't executed within 5 seconds return Response(status=HTTPStatus.OK) The issue I've encountered is that after triggering the execution of the first task and waiting for one minute, I attempted to trigger the second task. However, the second task failed to execute. The second task should be execued -
PythonAnywhere Gitpull Erased Database
I recently uploaded my django website to pythonanywhere (here). I made changes to my code on my local computer and pushed it to Github, then I pull it into my pythonanywhere website. But when I tried logging into the 'admin' console, I couldn't and all other created user accounts couldn't login. I figured the database was deleted and luckily, I used the create superuser command to regain access, but I lost all the users that previously logged in, and I don't wanna have this issue again. Any recommendations for how to pull without changing the database? ..................... -
how to revealed Views in my page by Django?
I tried to be revealed Views in my web page by Django. but I couldn't. even I tried several solutions that suggested by ChatGPT. theses are my codes models.py class PostView(models.Model): question = models.ForeignKey(Question, on_delete=models.CASCADE) views = models.PositiveIntegerField(default=0) def __str__(self): return f'Views for Post: {self.question}' it's my code for create views for each question 1-1. models.py class Question(models.Model): author = models.ForeignKey(User, on_delete=models.CASCADE, related_name='author_question') subject = models.CharField(max_length=200) content = models.TextField() create_date = models.DateTimeField() modify_date = models.DateTimeField(null=True, blank=True) voter = models.ManyToManyField(User, related_name='voter_question') category = models.ForeignKey(Category, on_delete=models.CASCADE, related_name='category_question') def __str__(self): return self.subject and it's Question model that is established the connection with PostView model. and after I wrote this code. I ran 'makemigrations' and 'migrate' base_views.py def view_question(request, question_id): question = get_object_or_404(Question, pk=question_id) post_views, created = PostView.objects.get_or_create(question=question) post_views.views += 1 post_views.save() context = {'question': question, 'post_views': post_views} return render(request, 'pybo/question_detail.html', context) url.py path('question/list/',base_views.index, name='index'), path('quesiton/list/<str:category_name>/', base_views.index, name='index'), path('question/detail/<int:question_id>/', base_views.detail, name='detail'), path('question/detail/<int:question_id>/', base_views.view_question, name='views_question'), template {% if question_list %} {% for question in question_list %} <tr class="text-center"> <td>{{question_list.paginator.count|sub:question_list.start_index|sub:forloop.counter0|add:1 }}</td> <td> {% if question.voter.all.count > 0 %} <span class="badge badge-warning px-2 py-1"> {{ question.voter.all.count}} </span> {% endif %} </td> <td class="text-left"> <a href="{% url 'pybo:detail' question.id %}"> {{ question.subject }} </a> {% if question.answer_set.count > … -
How to create a tournament bracket in Python (Django)?
How to create a tournament bracket in Django if I do have these models. I want to create a tournament bracket in single elimination format. Let's say we have 5 players in certain Tournament: [p1, p2, p3, p4, p5]. Then I have to add null to players until it reaches the next power of two, in this case, it would be 8. [p1, p2, p3, p4, p5, null, null, null]. Level = 1 Level = 2 Level = 3 p1 - null winner of (p1 - null vs p2 - null) the winner of (p1 - null vs p2 - null) vs winner of (p3 - null vs p4 - p5) p2 - null winner of (p3 - null vs p4 - p5) p3 - null p4 - p5 I also need all of this to be pre-generated, so it means that if one of the pair of the Match is a null, then it needs to qualify to the next round, but if there exists both of the players then the winner of that pair will be chosen manually, only then the winner should go to the parent_match class Tournament(models.Model): name = models.CharField(max_length=100) class Player(models.Model): first_name = models.CharField(max_length=50) last_name … -
Django Model subset of database table
All of my models are not managed as they are based on a legacy database. There is a Partner master table holds amongst other things an ID, Code, Name and a PartnerTypeID which is a ForeignKey relationship with a PartnerType Table. The type of Partner can be a client, bank, etc. and each Type has a unique IDentity column, plus an Alpha Code and Name for list boxes and alike. We then have Views that provide the rest of the system with simplified views of the Partner Data based on the Type. Therefore, we have a Client View, Bank View etc. This was done as most Partner attributes are similar across all of the various Partner types. I can set up admin interface over the Partner table with filters etc to help data entry etc. But I would like to know if it is possible to have a separate Django Model reflecting each partner type. Therefore, have a Client Model that only allows creation and modification of a Client Partner. I have no intention of introducing any extra attributes but simply have the Client Model only deal with Partners with a TypeID = 1, and the Bank Model only deal … -
iam getting an error in postman while performing login through api : { "non_field_errors": [ "Unable to log in with provided credentials." ] }
** here is my models.py** from django.db import models from django.contrib.auth.models import AbstractUser from .manager import CustomUserManager STATE_CHOICES = ( ('Odisha', 'Odisha'), ('Karnataka', 'Karnataka') ) ROLES = ( ('admin', 'admin'), ('customer', 'customer'), ('seller', 'seller'), ) class User_role(models.Model): role = models.CharField(max_length=50, blank=True) class User_Profile(AbstractUser): email = models.EmailField(unique=True) username = models.CharField(max_length=100) password = models.CharField(max_length=50) # role = models.CharField(choices=ROLES, max_length=50) role = models.ForeignKey(User_role, on_delete=models.CASCADE) def __str__(self): return self.email USERNAME_FIELD = 'email' REQUIRED_FIELDS = ['username'] objects = CustomUserManager() class Product(models.Model): title = models.CharField(max_length=100) selling_price = models.FloatField() discount_price = models.FloatField() description = models.TextField() productImg = models.ImageField(upload_to="productImages") class Cart(models.Model): user_profile = models.ForeignKey(User_Profile, on_delete=models.CASCADE) product = models.ForeignKey(Product, on_delete=models.CASCADE) quantity = models.PositiveIntegerField(default=1) class Order_Placed(models.Model): user_profile = models.ForeignKey(User_Profile, on_delete=models.CASCADE) product = models.ForeignKey(Product, on_delete=models.CASCADE) quantity = models.PositiveIntegerField(default=1) order_date = models.DateTimeField(auto_now_add=True) status = models.CharField(max_length=50) managers.py from django.contrib.auth.models import BaseUserManager class CustomUserManager(BaseUserManager): def create_user(self, email, username, password=None, role=None, **extra_fields): if not email: raise ValueError('The Email field must be set') email = self.normalize_email(email) user = self.model(email=email, username=username, role=role, **extra_fields) user.set_password(password) user.save(using=self._db) return user def create_superuser(self, email, username, password=None, role=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_superuser', True) # Assign a default role for superusers if role is None: # role = 'admin' from .models import User_role role = User_role.objects.get(role='admin') return self.create_user(email, username, password, role, **extra_fields) here … -
why i am getting a error like no module found
[enter image description hereenter image description here](https://i.stack.imgur.com/fST8f.png) when i am trying to migrate this file i am getting the module error how must i needd to remove that error from the vs code and run properly,This error is even occuring after i have done pip install. -
Migrations not working on azure and django
i'm facing some problems with Django on my azure resource group. The main page of my landing is working fine, but when i try to log in, it does not work, and i get the error that it has ben caused by the "Accounts application" Error: relation "accounts_user" does not exist LINE 1: ...s_user"."admin", "accounts_user"."timestamp" FROM "accounts_... I've performed the migrations on the SSH, but i think that they are not being properly migrated, since even when i "Create a superuser" the user that i've just created does not work to log in and throw the same error. Although it the variables for the database seem to be sent correctly, as i can see on the local variables on the error: ignored_wrapper_args (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x7a01ddf85cc0>, 'cursor': <django.db.backends.postgresql.base.CursorDebugWrapper object at 0x7a01d58667a0>}) params ('USER EMAIL',) self <django.db.backends.postgresql.base.CursorDebugWrapper object at 0x7a01d58667a0> sql ('SELECT "accounts_user"."id", "accounts_user"."password", ' '"accounts_user"."last_login", "accounts_user"."email", ' '"accounts_user"."full_name", "accounts_user"."active", ' '"accounts_user"."staff", "accounts_user"."admin", ' '"accounts_user"."timestamp" FROM "accounts_user" WHERE ' '"accounts_user"."email" = %s LIMIT 21') And: DATABASES {'default': {'ATOMIC_REQUESTS': False, 'AUTOCOMMIT': True, 'CONN_MAX_AGE': 0, 'ENGINE': 'django.db.backends.postgresql', 'HOST': 'MY HOST NAME.postgres.database.azure.com', 'NAME': 'MY DATABASE NAME', 'OPTIONS': {}, 'PASSWORD': '********************', 'PORT': '', 'TEST': {'CHARSET': None, 'COLLATION': None, 'MIGRATE': True, 'MIRROR': None, 'NAME': … -
JWT Refresh token is not generating on Login
I am doing a django project, using dj-rest-auth, and jwt token. When registering a user, the program generates a refresh token along with access token, but when logging in, it only generates access token and refresh token is an empty string "". I cannot find a similar problem, nor any solution to this. Here is my settings.py: """ Django settings for backend project. Generated by 'django-admin startproject' using Django 4.2.1. For more information on this file, see https://docs.djangoproject.com/en/4.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.2/ref/settings/ """ from pathlib import Path from datetime import timedelta # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-$!z5s1dryft$&tjajmulo+kb7^vi$mfujnzor$_zi(7qv9jxwj' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', #3rd Party 'rest_framework', 'rest_framework_simplejwt', 'dj_rest_auth', 'allauth', 'allauth.account', 'allauth.socialaccount', 'dj_rest_auth.registration', 'corsheaders', #local 'accounts.apps.AccountsConfig', ] SITE_ID = 1 MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', "corsheaders.middleware.CorsMiddleware", 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'backend.urls' TEMPLATES = … -
torch cuda memory not realeasing
i want to clean up gpu memory using deallocate_memory function. It works atexit function but when I call deallocate_memory function, the memory is not released. def ready(self): # self.deallocate_gpu_memory() # Register resource cleanup for application exit atexit.register(self.cleanup_resources) #works self.deallocate_memory() #does not work def cleanup_resources(self): self.deallocate_gpu_memory() def deallocate_gpu_memory(self): if torch.cuda.is_available(): device = torch.device('cuda:0') # Allocate a small amount of GPU memory dummy_tensor = torch.tensor([0.0], device=device) # Delete the dummy tensor del dummy_tensor # Empty the cache to release memory torch.cuda.empty_cache() print('GPU memory released') -
Django Redirect Urls.py errors
I would like to create a registration form, which then sends more data to another form. My user chooses his username and password on the first form that redirect to the second form where he fills in information such as his city, favorite sport...etc. These two steps work perfectly on their own. Only then I would like to send on a third form on which the user fills in the data of his dogs, which is in another app. For this I use the urls.py of the project, and I include the urls.py of the apps. From there it no longer works. If I only use the users form, and its urls, it works, but if I import the urls.py then I cannot access the second form without a "NoReverseMatch at /signup/ Reverse for 'additional_details_main_user' not found. 'additional_details_main_user' is not a valid view function or pattern name.NoReverseMatch at /signup/." This error happens after the first form, which is only username and password. I cannot even access to the other one of the user. This is my code structure: robert (main app) urls.py userProfile folders : templates, static...etc urls.py dogProfile folders : templates, static...etc urls.py urls.py from robert: from django.contrib import … -
Forbidden (403) CSRF check failed. Order cancelled. Djnago - python
Proibido (403) Verificação CSRF falhou. Pedido cancelado. Help Reason given for failure: Origin checking failed - https://dashboardequiuniemp.fly.dev does not match any trusted origins. In general, this can occur when there is a genuine Cross Site Request Forgery, or when Django’s CSRF mechanism has not been used correctly. For POST forms, you need to ensure: Your browser is accepting cookies. The view function passes a request to the template’s render method. In the template, there is a {% csrf_token %} template tag inside each POST form that targets an internal URL. If you are not using CsrfViewMiddleware, then you must use csrf_protect on any views that use the csrf_token template tag, as well as those that accept the POST data. The form has a valid CSRF token. After logging in in another browser tab or hitting the back button after a login, you may need to reload the page with the form, because the token is rotated after a login. You’re seeing the help section of this page because you have DEBUG = True in your Django settings file. Change that to False, and only the initial error message will be displayed. You can customize this page using the CSRF_FAILURE_VIEW setting. … -
class not seing it's properties
my class from django.db import models from django.contrib.auth.models import User class Task(models.Model): id: models.UUIDField(unique=True, auto_created=True) content: models.CharField(default="") deadline: models.IntegerField(default=None) creationDate: models.DateField(auto_now_add=True) author: models.ForeignKey(User, on_delete=models.CASCADE) def __str__(self) -> str: return str(self.id) + str(self.content) my error: File "/Users/ironside/Documents/Python/PythonDjango-Project/api/models.py", line 13, in str return str(self.id) + str(self.content) AttributeError: 'Task' object has no attribute 'content' I tested, and all other properties give the same error ('content' changes to property name). It's as if it only sees id as valid property. I'd like to be able to print the id + content or any other property -
django.core.exceptions.ImproperlyConfigured Django 4.2.6
So, I started refactoring my project, but I also deleted my migrations folder (which I just learned is a no-no.) Now I can't run the server or tests. I only get the error below. File "C:\Users\Documents\projects\venv\Lib\site-packages\django\urls\resolvers.py", line 237, in _compile raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: "^users\.(?P<format>[a-z0-9]+)/?\.(?P<format>[a-z0-9]+)/?$" is not a valid regular expression: redefinition of group name 'format' as group 2; was group 1 at position 37 I tried starting the project again in a separate folder with a new db, copying and pasting the necessary code, then running makemigrations and migrate, but the same error keeps appearing. I don't want to have to start from scratch again, so if there's a way to fix it, please let me know. I still have the migrations table and info in my first db, if that helps. -
How to add element class in ckeditor on django?
I'm trying add default element class in ckeditor on Django website like. <ul class="sm-circle"></ul>