Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
password_reset_confirm and password_reset_complete in Django
I have used Django's built-in password reset functionality. everything is working fine but when I open the password reset link from Gmail browser redirects me to Django's built-in "password_reset_confime " template instead of my custom template I don't know where I have done mistake in rendering custom template please help me to do that its really appreciated usrl.py Code app_name="accounts" urlpatterns=[ path('password_reset/',auth_views.PasswordResetView.as_view( template_name='password_reset.html', success_url=reverse_lazy('accounts:password_reset_done')),name='password_reset'), path('password_reset_done/', auth_views.PasswordResetDoneView.as_view(template_name='password_reset_done.html'), name='password_reset_done'), path('password_reset_confirm/<uidb64>/<token>/',auth_views.PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html',success_url=reverse_lazy('accounts:password_reset_complete')),name='password_reset_confirm.html'), path('password_reset_complete/', auth_views.PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'), name='password_reset_complete'), ] And I also want to implement a feature while entering an email id into the input field, I want to check if the user's entered email exists or not, if do not exist I want to show an error message "this email id is not existed" please help me to implement this feature and provide a solution for rendering my custom password_reset_confirm.html and password_reset_complete.html pages -
How to send several fields in the response with a PUT request?
I would like when my PUT request is successful it returns me a response with all the fields in my PlantSerializer because currently the response returns me this: { "id":48, "name":"Jar", "width":"50", "height":"50", "exposure":"None", "qr_code":"", "garden":65, "plant":[ 7 ] } But, I would like the response to return this instead: { "id":48, "name":"Jar", "width":"50", "height":"50", "exposure":"None", "qr_code":"", "garden":65, "plant":[ "id":7, "name":"Artichoke", "image":null ] } How can I achieve this result? Here is my serializers and my model class : class Plot(models.Model): name = models.CharField(max_length=50) garden = models.ForeignKey('perma_gardens.Garden', on_delete=models.CASCADE) width = models.CharField(max_length=50, blank=True, null=True) height = models.CharField(max_length=50, blank=True, null=True) plant = models.ManyToManyField('perma_plants.Plant', related_name='%(class)s_plant', blank=True) # Here is my serializers : class GardenSerializer(serializers.ModelSerializer): class Meta: model = Garden fields = ('id', 'name',) class PlantSerializer(serializers.ModelSerializer): class Meta: model = Plant fields = ('id', 'name', 'image') class ReadPlotSerializer(serializers.ModelSerializer): garden = GardenSerializer(required=True) plant = PlantSerializer(many=True) id = serializers.IntegerField(read_only=True) class Meta: model = Plot fields = '__all__' read_only_fields = [fields] class WritePlotSerializer(serializers.ModelSerializer): class Meta: model = Plot fields = '__all__' And here is my views : class PlotViewSet(viewsets.ModelViewSet): queryset = Plot.objects.all() def create(self, request, *args, **kwargs): serializer = WritePlotSerializer(data=request.data, many=isinstance(request.data, list)) if serializer.is_valid(): serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) else: return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST) def delete(self, request, pk): snippet … -
The easiest way to add attachment in an email - Django
What is the easiest way to add an attachment in a sent e-mail from a model object. If it impossible how look example with EmailMessage. Models.py class File(models.Model): file = models.FileField() Views.py topic = 'Title message' massage = 'Content message' to = ['recipient@example.com', ] attachment = File.objects.last() send_mail(topic, massage, 'bsender@example.com', to, attachment) -
In Django forms I can't use regex validators
Good day. I want to use regex validator for my full_name field in Django 1.11.10. But when I run the below code it doesn't work. How can I fix it? forms.py class CustomerForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(CustomerForm, self).__init__(*args, **kwargs) self.fields['orderorbarcode'].widget.attrs['readonly'] = True self.fields['orderorbarcode'].label = "Order ID or Item Barcode" self.fields['full_name'].label = "Full Name" self.fields['phone_number'].label = "Phone Number" self.fields['full_name'].widget = forms.TextInput(attrs={'placeholder': '*required'}) self.fields['email'].widget = forms.TextInput(attrs={'placeholder': '*required'}) self.fields['phone_number'].widget = forms.TextInput(attrs={'placeholder': '*required'}) class Meta: model = Customer fields = ( 'orderorbarcode','full_name','company','email', 'phone_number','note') AlphanumericValidator = RegexValidator(r'^[0-9a-zA-Z]*$', 'Only alphanumeric characters are allowed.') full_name = forms.CharField(max_length=50, validators=[AlphanumericValidator]) -
Django MIgrations Issues
I'm facing Django migrations problems for a very long time and used to solve that problem using the --fake keyword but then I realized that it's not a good approach and even creates more problems, so after that whenever I faced that issue so I remove the DB and recreate it and then applied migrations and it was working fine but now our data is important and can't remove the DB. The problem is I've created a new Django app in my project and generated the migrations and applied them and working fine at the local but it throws the error I attached below related to migrations. I tried to apply them using the --fake keyword because the feature needs to be at that time but again it was not working I checked the migrations using python manage.py showmigrations and the migrations is there but when I checked django_migrations table in my DB and not a single migration file of that app is not found there, what's the best solution to overcome this issue? error: ProgrammingError at .... column .... does not exist -
django-filter more results when explicitly setting a filter value
I am trying to understand what happens what a field specified in the filterset_fields of the viewset is not specified. My viewset is the following: class DetectionTrainingViewSet( mixins.ListModelMixin, mixins.RetrieveModelMixin, viewsets.GenericViewSet ): queryset = Detection.objects.all() serializer_class = DetectionSerializer filterset_fields = ( 'annotation_set__annotator__id', 'annotation_set__bbox__annotator__id', ) I am making the following GET calls my endpoint http://127.0.0.1:8000/api/v1/detections/: ?annotation_set__annotator__id=2 -> I get 4 results ?annotation_set__annotator__id=2&annotation_set__bbox__annotator__id=2 -> I get 16 results I expected the second call to return a subset of the following one. What's happening here? How can I specify that when a parameter is not explicitly specified any value (if it does not exist) should match the query? -
Static Files not being served with nginx + gunicorn + doker + django
I am making a docker image of a django application with nginx and gunicorn. The configuration files are given below. This server serves static files with ease in development but fails to do so in docker container. What changes do I need to make to serve files in docker? docker-compose.yml version: '3.7' services: segmentation_gunicorn: volumes: - static:/static env_file: - .env build: context: . ports: - "8000:8000" nginx: build: ./nginx volumes: - static:/static ports: - "80:80" depends_on: - segmentation_gunicorn volumes: static: requirements.txt FROM python:3 RUN pip install --upgrade pip COPY ./requirements.txt . RUN pip install -r requirements.txt COPY ./segmentation_site /app WORKDIR /app COPY ./entrypoint.sh / ENTRYPOINT ["sh", "/entrypoint.sh"] requirements.txt DJANGO==4.0.4 gunicorn==20.0.4 tensorflow django-resized pillow==9.1.0 django-crispy-forms==1.14.0 entrypoint.sh python manage.py migrate --no-input python manage.py collectstatic --no-input gunicorn --bind 0.0.0.0:8000 segmentation_site.wsgi:application Dockerfile for nginx FROM nginx:1.19.0-alpine COPY ./default.conf /etc/nginx/conf.d/default.conf default.conf upstream django { server segmentation_gunicorn:8000; } server { listen 80; client_max_body_size 100M; location / { proxy_pass http://django; } location /static/ { alias /static/; } } settings.py STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, "static") -
How to create nested serialization from mutliple models uisng django rest framewrok
I am trying to create nested relationship from more than two models in Django Rest Framework. Thank you in advance for helping me. I succeed with two models but when I'm trying with three models unable to create nested serialization. from django.db import models class Project(models.Model): project_id = models.AutoField(primary_key=True) project_name = models.CharField(max_length=255) def __str__(self): return self.name class Site(models.Model): site_id = models.AutoField(primary_key=True) site_name = models.CharField(max_length=255) project_id= models.ForeignKey(Project, related_name="projectid", on_delete=models.CASCADE) def __str__(self): return self.site_name class Aggin(models.Model): assign_id = models.AutoField(primary_key=True) site_id = Models.ForeginKey(Site, relate_name="siteid", on_delete=models.CASCADE) from rest_framework import serializers from .models import Song, Artist class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = ('__all__') class SiteSerializer(serializers.ModelSerializer): class Meta: model = Site fields = ('__all__') class AggignSerializer(serializers.ModelSerializer) class Meta: model = Aggin fields = ('__all__') -
How Can I develop FaceMask Detecion Using Django FrameWork
I prepared the facemask detection model but I don't know to program and integrate Django with my model???? please help me -
User can only see his data Django
Im building a contract management system, and i want to the user to only the companies, clients and users that he registered, now when i register a new user, he can also see the data companies that other users registered. How can i make it see only his own clients, companies and contracts? views.py # List the companies @login_required def client_company_list(request): clients = ClientCompany.objects.all() pending_payments_total = ClientCompany.objects.aggregate(sum=Sum('pending_payments'))['sum'] or 0 received_payments_total = ClientCompany.objects.aggregate(sum=Sum('received_payments'))['sum'] or 0 client_count = ClientCompany.objects.filter().count() return render(request, 'list_client_company.html', {'clients': clients, 'pending_payments_total': pending_payments_total, 'received_payments_total': received_payments_total, 'client_count': client_count}) # Crate a new company @login_required def new_client_company(request): # Start post add the company to the DB using POST or start a new form using None form = ClientCompanyForm(request.POST, request.FILES, None) # Check if the form is valid if form.is_valid(): form.save() return redirect('companies_list') return render(request, 'client_company_form.html', {'form': form}) models.py # Company client class ClientCompany(models.Model): company_name = models.CharField(max_length=30) company_cnpj = models.IntegerField() phone = models.IntegerField(null=True, blank=True) email = models.EmailField(null=True, blank=True) pending_payments = models.DecimalField(blank=True, null=True, max_digits=12, decimal_places=2) received_payments = models.DecimalField(blank=True, null=True, max_digits=12, decimal_places=2) description = models.TextField(blank=True, null=True) # To return the name of the company on the django admin def __str__(self): return self.company_name class UserManager(BaseUserManager): # Create standard user def create_user(self, email, full_name, password=None, is_active=True, … -
How to serializer data outside of view in Django REST
I am working on a Chat system which utilizes Django-Channels. Therefore, I need to serialize data outside of views, then return this serialized data. Problem occurs where I am getting an error. Method for creating and serializing data: @database_sync_to_async def create_message(self, message, sender, uuid): with tenant_context(sender.company): # Update the chat's updated_on field by saving it self.chat.save() serializer = ChatMessageSerializer(data={ 'message': message, 'sender': sender, 'chat': self.chat }) if serializer.is_valid(): serializer.save() return serializer.data else: raise serializer.errors Error: ERROR: null value in column "chat_id" of relation "discussions_chatmessage" violates not-null constraint It seems that it is not creating the ID for this object. How should I go about creating the serialized object correctly? Thanks in advance! -
Passing data from post form to FileResponde view
I recently started using Django and I managed to create two views, one to submit a form and another to return a FileResponse, separately, they work fine. Now, I need to integrate both, when the client submit the form, I want to redirect to the another view using the fields submitted at the previous form. How can I do that? Here is my form view: def submitForm(request): if 'report' in request.POST: date_start = request.POST.get('date_start') date_end = request.POST.get('date_end') state = request.POST.get('state') return render(request, 'comissao.html') Here is my view that creates a pdf file def createPdf(request): date_start = '20220301' date_end = '20220331' state = 'G00471' body = "some html" options = { 'quiet': '' } pdfkit.from_string(body, options=options) file = open('file.pdf', 'rb') return FileResponse(file) As you can see, I need the information passed at my first view, to use at second view, I tried something like this, but I think I'm mistaking the concept, return reverse('pdf', kwargs={'state':state, 'date_start':date_start, 'date_end':date_end}) -
How to use Nginx + Gunicorn + Django to authenticate Kerberos users?
I refactored my project code, we used apache + Django, and now use Nginx + gunicorn + Django replace But I met an issue, after use "spnego-http-auth-nginx-module"(https://github.com/stnoonan/spnego-http-auth-nginx-module) in Nginx for Kerberos authentication, but after Nginx is authenticated, Django cannot authenticate. display: "Authentication credentials were not provided." I want to use Kerberos user for all authentication. after Nginx authenticated, Django should also be authenticated. Do any guys know how to set Django to accept the Nginx authentication result? -
Getting two values from the same annotation query
I have two related models: class ProductSKUs(BaseModel): STATES = [(1, "New"), (2, "Open Box"), (3, "Refurbished")] shop_id = models.SmallIntegerField(default=1, blank=True, verbose_name="Shop ID") sku = models.IntegerField(verbose_name="SKU") product_id = models.ForeignKey( "Products", on_delete=models.CASCADE, ) state = models.SmallIntegerField(choices=STATES, default=1, null=True, verbose_name="State") featured = models.BooleanField(default=False, blank=True) class ProductOffers(BaseModel): sku = models.ForeignKey( "ProductSKUs", on_delete=models.CASCADE, db_column="product_sku_id", related_name="product_offers", related_query_name="product_offer", ) price = models.FloatField() price_promo = models.FloatField( null=True, blank=True, verbose_name="Promotional Price" ) What I am trying to do is get a ProductSKUs queryset with the correct shop_id, and then also get the price and price_promo from the ProductOffers with the lowestprice_promo value. I have tried the following queryset below, but the issue is that I want the same price and price_promo from the same product offer but it is getting the values from two different objects. featured_product_skus = ( ProductSKUs.objects.filter(shop_id=1, featured=True) .select_related("product_id") .prefetch_related("product_offers") .annotate( min_price_promo=Min("product_offer__price_promo"), min_price=Min("product_offer__price"), ) ) So if one ProductOffer has price = 500 and price_promo = 2000 and the other ProductOffer has price = 100 and price_promo = 3000, it will annotate min_price = 100 and price_promo = 2000, whereas I want price = 100 and price_promo = 3000. How would I go about doing this? -
It is good practice to get all object in RetrieveUpdateDestroy Method?
Why we need to get all object in RetrieveUpdateDestroy Method? In real project can I do it just like this Without fear even if there is large data? -
Nginx Proxy Manager and django with nginx
I have a stack Django+Gunicorn+nginx running in docker containers. It is accessible from outside by domain and Port, like web.example.com:1300 . Also, there is Nginx Proxy Manager (NPM) running (uses ports 80 and 443) and succesfully managing some other resources (for example nextcloud). But it doesn't proxy to my django project at port 1300, shows "502 Bad Gateway". In the Proxy Hosts of NPM I've added config: domain names: web.example.com Forward Hostname / IP: nginx_docker_container_name (this way it works with other resources) Forward Port: 1300 Other settings: tried multiple combinations without success (like with and without SSL certificates etc.) Is it possible to proxy using NPM? Sorry if I missed to write some information, actually I do not know what else to state. -
Invalid syntax with Django manage.py createsuperuser remote Terminal Mac
I'm trying to create a superuser on a remote django server. I am running a Mac. On two separate terminals (not within VSCode or any IDE) I have run the following code using ssh and sftp: cd my_dir/src ls # to confirm manage.py is present python manage.py createsuperuser python3 manage.py createsuperuser sudo python manage.py createsuperuser sudo python3 manage.py createsuperuser On ssh, the python commands result in: File "manage.py", line 16 ) from exc ^ SyntaxError: invalid syntax On ssh, the python3 commands result in: Traceback (most recent call last): File "manage.py", line 10, in main from django.core.management import execute_from_command_line ModuleNotFoundError: No module named 'django' The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 16, in main ) from exc ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment? On sftp, both python and python3 commands result in Invalid command. I have also tried: python manage.py shell (here) sudo -i (here) Any other ideas? Thank you in advance! -
Django - do not validate the second form
I have this code snippet in template. <form method="POST" novalidate> {% csrf_token %} {{ form }} {{ form2.as_p }} <button type="submit" class="btn btn-secondary">Search</button> </form> And in forms.py there are two forms (not ModelForm, but only Form). form searches data in first db and form2 search data in second db and displays the results. The second form has only one field and I'd like to have something like this in a view. if request.method == "POST": if form.is_valid(): # extract data from the first db if form2.is_valid() # extract a few more data from the second db The field in the second form is not required for the user to fill in. If the user fills it in the user gets only more data displayed. I solved it partially with the novalidate in HTML. But what I'd like to have is the validation of the first form and the second form with its one form field can be empty. Is there some django feature to achieve this result? something like this? <form method="POST"> {% csrf_token %} {{ form.novalidate }} {{ form2.as_p }} <button type="submit" class="btn btn-secondary">Search</button> </form> -
How to store large getched dataset from postgres in Django view?
When user open some Django view there is option to choose what data to load from postgres DB. After that click submit and process is started. But when data is fetched and in the same view pressed reload, then all process starts from begining. Fetched time is about ~10min (best solustion to fetched once by opening view and after that just manupulate with data without fetced each reloading) I want to load data once or by button. But how to implement that i don't understand. -
how to put radio buttons from admin.py or models.py?
I have a doubt; what happens is that in my form I want to put radio buttons in the "country" field, only I don't know how to do it because to make this section I'm using admin.py and models.py; Do you know if I can place radio buttons via models or admin? admin.py class CustomUserAdmin(UserAdmin): add_form = UserCreationForm form=UserChangeForm model=CustomUser list_display = ['pk','email','username','first_name','last_name'] add_fieldsets = UserAdmin.add_fieldsets+( (None,{'fields':('alternativeContact','country','address')}), ) fieldsets = UserAdmin.fieldsets+( (None,{'fields':('alternativeContact','country','address')}), ) admin.site.register(CustomUser) models.py COUNTRIES=( ('EUA', ('EUA')), ('Canada', ('Canada')), ('Other', ('Other')), ) class CustomUser(AbstractUser): alternativeContact=models.CharField(max_length=100,default=0) country = models.CharField(max_length=100, default=0,choices=COUNTRIES) address=models.CharField(max_length=100, default=0) html <div class="row mb-3"> <div class="col-md-12"> <div class="mb-3"> <label class="form-label d-block mb-3">Country :</label> {{ form.country }} </div> </div> </div> -
Django - ModuleNotFoundError: No module named 'bootstrap5'
I am trying to run a django app which is made by some other developer. First I got *ModuleNotFoundError: No module named 'django_heroku'*That was solved by pip install django-heroku. Now I am getting this error. ModuleNotFoundError: No module named 'bootstrap5' Then I did this pip install django-bootstrap5 It looks like it installed bootstrap5. But when I try to run again the app I am getting same error.Here is the what it shows. (venv) D:\django\multi-vendor-shop-management-main>python manage.py runserver Watching for file changes with StatReloader Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Python39\lib\threading.py", line 973, in _bootstrap_inner self.run() File "C:\Python39\lib\threading.py", line 910, in run self._target(*self._args, **self._kwargs) File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "D:\django\venv\lib\site-packages\django\core\management\commands\runserver.py", line 125, in inner_run autoreload.raise_last_exception() File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 87, in raise_last_exception raise _exception[1] File "D:\django\venv\lib\site-packages\django\core\management\__init__.py", line 398, in execute autoreload.check_errors(django.setup)() File "D:\django\venv\lib\site-packages\django\utils\autoreload.py", line 64, in wrapper fn(*args, **kwargs) File "D:\django\venv\lib\site-packages\django\__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "D:\django\venv\lib\site-packages\django\apps\registry.py", line 91, in populate app_config = AppConfig.create(entry) File "D:\django\venv\lib\site-packages\django\apps\config.py", line 228, in create import_module(entry) File "C:\Python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked ModuleNotFoundError: No … -
recall class if a condition is met (Python - Django)
I am using Django-rest-framework to create an API. My API is something like: class SampleApi(APIView): def get(self, request): my_var = self.abc(request, firstname) self.xyz(request, lastname) if my_var == 0: **# call the api again** else: # Do other stuff pass @staticmethod def abc(request, firstname): # do some task pass @staticmethod def xyz(request, lastname): # do some task pass I want to call the same api again if my if condition is matched. Can anyone please guide me here. Thanks!! -
Is there a drawback to adding multiple indexes to a model in Django?
I'm working on a django dashboard to display data in a series of charts, and thusly need to set up different dataframes from my models. When I load the dashboard up in production, it takes about 15 seconds for the view to be rendered. Another dashboard takes 40. After analyzing my code, it turns out my queries are very time consuming. I thought they wouldn't be since my Order model has about 600k objects, while the order_date filters should get them down to some 30k at most. Below is my model: class Order(models.Model): order = models.IntegerField(db_index=True, default=0) region = models.CharField(max_length=3, default="") country = models.CharField(db_index=True, max_length=2, default="") order_date = models.DateTimeField(db_index=True, default=datetime.datetime.now) user_name = models.CharField(db_index=True, max_length=256, null=True) order_status = models.CharField(max_length=256, null=True) quote_status = models.CharField(max_length=256, null=True) purchase_status = models.CharField(max_length=256, null=True) q_to_r = models.FloatField(db_index=True, null=True) r_to_p = models.FloatField(db_index=True, null=True) And here is the snippet of code that takes 15 seconds to evaluate: month = [4, 2022] country = ["US", "CA", "UK"] user_list = ["Eric", "Jane", "Mark"] all_objects = Order.objects first_data = all_objects.filter(order_date__month=month[0], order_date__year=month[1], country__in=country, order_status__in=order_status, quote_status__in=quote_status, purchase_status__in=purchase_status, user_name__in=user_list) order_data = first_data.values_list("order", flat=True) country_data = first_data.values_list("country", flat=True) df = pd.DataFrame({"Order": order_data, "Country": country_data}) The df instance in particular is what takes the bulk of the … -
Docker compose creating import errors?
I am trying to run a simple django app on docker-compose I created a docker file and docker compose and when running I get the following. I had two venv folders which I deleted cause they were a mess in GitHub. I also have a submodule import which is some blockchain related stuff but it is just there and doing nothing at the moment within the django app ahmed@Ahmed-PY:~/ssa2$ sudo docker-compose up Recreating ssa2_web_1 ... done Attaching to ssa2_web_1 web_1 | Watching for file changes with StatReloader web_1 | Performing system checks... web_1 | web_1 | System check identified no issues (0 silenced). web_1 | May 17, 2022 - 14:39:40 web_1 | Django version 4.0.2, using settings 'ssfa.settings' web_1 | Starting development server at http://0.0.0.0:8000/ web_1 | Quit the server with CONTROL-C. web_1 | Exception in thread django-main-thread: web_1 | Traceback (most recent call last): web_1 | File "/usr/local/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 46, in get_internal_wsgi_application web_1 | return import_string(app_path) web_1 | File "/usr/local/lib/python3.8/site-packages/django/utils/module_loading.py", line 30, in import_string web_1 | return cached_import(module_path, class_name) web_1 | File "/usr/local/lib/python3.8/site-packages/django/utils/module_loading.py", line 15, in cached_import web_1 | import_module(module_path) web_1 | File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module web_1 | return _bootstrap._gcd_import(name[level:], package, level) web_1 | File "<frozen importlib._bootstrap>", … -
Inability to access Django Admin page on app deployed with Docker on Digital Ocean, and using Traefik as reverse proxy
I have deployed a Django app to a Digital Ocean Droplet with Docker. I am using Traefik for reverse-proxy. I have configured DO's DNS to point my Domain Name wbcdr.com to the Droplet's public IP. Although, I am able to access the site, I get a 404 Error for the Django admin page, i.e. https://www.wbcdr.com/admin. Do I have to add another A record separately for the admin url? Or is it due to Traefik's inability to resolve the Admin url?