Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Solution for MS SQL databse
We are in django 2.1 and thinkg about upgrade to django 2.2. But we currently using django-azure-pyodbc to connect to the MS SQL database, I see django-azure-pyodbc only support django 2.1. Is there a replacement plugin for django 2.2 or any other solutions? -
Django custom reverse manager using a through model
I have a set of models where a Student is assigned multiple Classes via another model, ClassStudentMapping, which has a field where I can set which classes a student has on a particular day. models.py class Student (models.Model): ... class Class(models.Model): ... students = models.ManyToManyField(Student, related_name='classes', through="ClassStudentMapping") class QuestionMemberMapping(models.Model): class = models.ForeignKey(Class) student = models.ForeignKey(Student) DAYS_OF_THE_WEEK = [ ('0', 'Monday'), ('1', 'Tuesday'), ('2', 'Wednesday'), ('3', 'Thursday'), ('4', 'Friday'), ('5', 'Saturday'), ('6', 'Sunday'), ] days = ArrayField(models.CharField(max_length=1, choices=DAYS_OF_THE_WEEK), size=20, default=list(range(0,7))) So if this_student is an instance of Student, then I can obviously get all the classes a student has via student.classes.all(). I want to be able to use a custom manager to call a custom query to get all the classes a student has on the current day. class ClassTodayManager(models.Manager): def get_queryset(self): return super().get_queryset().filter(classstudentmapping__days__contains=[str(datetime.today().weekday())]) But I can't figure out where to put this manager so that I can invoke it via something like student.today_classes.all(). Following the Django docs rather naively, I tried: class Class(models.Model): today_classes = ClassTodayManager() But that resulted in, "AttributeError: 'Student' object has no attribute 'today_classes'. I realized I needed a custom reverse manager, and tried student.classes(manager='today_classes'). But weirdly that is returning multiples of every result -- two for … -
How to access Roles and permissions to generic views
I am very new to Django. Right now I am working on Roles and Permission with Django rest framwork. I have discovered https://django-role-permissions.readthedocs.io/en/stable/setup.html By using this I can check roles and permission. But when going in generic views like generics.RetrieveUpdateDestroyAPIView I don't want to override the three methods. Is any way can I implement with DRY principle or any best practice. Is any way URL restrictions based on user roles and permission or any before action for views? -
How can I query using two keys in django-model
I have following tables in the models ACCOUNT_MSTR with ACCOUNT_ID as Primary Key EXPERIMENT_MSTR with ID AS Primary Key, a Foreign Key ACCOUNT_ID Reference to ACCOUNT_MSTR, and another Foreign Key TEST_ID refer to TEST_MSTR class Experiments_Mstr(models.Model): ID = models.AutoField(primary_key=True) EXPERIMENT_ID = models.IntegerField() ACCOUNT_ID = models.ForeignKey(to='login.Account_Mstr', to_field='ACCOUNT_ID', on_delete=models.CASCADE) USER_ID = models.ForeignKey(to='login.User_Mstr', to_field='USER_ID', on_delete=models.CASCADE) TEST_ID = models.ForeignKey(to='ml.Test_Mstr', to_field='ID', on_delete=models.CASCADE) STATUS = models.CharField(max_length=10, default='ACTIVE', blank=False) TOTAL_TIME = models.IntegerField(default=700, blank=False) FIRST_DROP = models.IntegerField(default=310, blank=False) SECOND_DROP = models.IntegerField(default=510, blank=False) DATAFILE_PATH = models.CharField(max_length=256, default='/tmp', blank=False) CREATED_AT = models.DateTimeField(auto_now=True, blank=False) CREATED_BY = models.CharField(max_length=10, default='SYSTEM', blank=False) MODIFIED_AT = models.DateTimeField(auto_now=True, blank=False) MODIFIED_BY = models.CharField(max_length=10, default='SYSTEM', blank=False) TEST MSTR with ID as Primary Key, a Foreign Key ACCOUNT_ID Reference to ACCOUNT_MSTR class Test_Mstr(models.Model): ID = models.AutoField(primary_key=True) ACCOUNT_ID = models.ForeignKey(to='login.Account_Mstr', to_field='ACCOUNT_ID', on_delete=models.CASCADE) TEST_NAME = models.CharField(max_length=256, null=False, blank=False) TEST_SHORT_NAME = models.CharField(max_length=10, null=False, blank=False) TEST_DESCRIPTION = models.TextField() CREATED_AT = models.DateTimeField(auto_now=True, blank=False) CREATED_BY = models.CharField(max_length=10, default='SYSTEM', blank=False) MODIFIED_AT = models.DateTimeField(auto_now=True, blank=False) MODIFIED_BY = models.CharField(max_length=10, default='SYSTEM', blank=False) and also a Table: class ExperimentsTable(tables.Table): EXPERIMENT_ID = tables.LinkColumn('experimentDetails', args=[tables.A('EXPERIMENT_ID')]) TEST_ID = tables.Column(accessor='TEST_ID.TEST_SHORT_NAME') SELECTION = tables.CheckBoxColumn(verbose_name=('SELECTION'), accessor='ID', attrs={ "th__input": {"onclick": "toggle(this)"}}) class Meta: model = models.Experiments_Mstr exclude = ('ID', 'ACCOUNT_ID', 'USER_ID', 'DATAFILE_PATH', 'TOTAL_TIME', 'FIRST_DROP', 'SECOND_DROP', 'STATUS', 'MODIFIED_AT', 'MODIFIED_BY',) attrs = {'class': 'table'} What I am doing now is … -
When I fetch all the data in Object in Django, get the error like ''str' object has no attribute 'values'"
I want to get the all the values inside the object, obj.values() method and I got the error like ''str' object has no attribute 'values'" **Views.py** def upload_list(request): pdf = Client_files.objects.all() if request.method == 'POST': obj = request.POST.get('btSelectItem') print(obj.values()) return render(request, 'uploadpdf.html', {'pdf' : pdf,}) -
No value for argument 'on_delete'
I am trying to run some python code, using django, but it is returning that "No value for argument 'on_delete' in constructor call". from django.db import models from django.contrib.auth.models import User class Game(models.Model): first_player = models.ForeignKey(User, related_name="games_first_player") second_player = models.ForeignKey(User, related_name="games_second_player") start_time = models.DateTimeField(auto_now_add=True) last_active = models.DateTimeField(auto_now=True) class Move(models.Model): x = models.IntegerField() y = models.IntegerField() comment = models.CharField(max_length=300, blank=True) by_first_player = models.BooleanField() game = models.ForeignKey(Game, on_delete=models.CASCADE) -
How to fix "no such table: PurchaseHistory_purchasehistory" on Django / Why is there nothing to migrate?
I receive the error no such table: PurchaseHistory_purchasehistory I have tried makemigrations and migrate and cleared pycache and deleted migrations to no avail. Is there some way I could possibly nuke all past migrations and run makemigrations from scratch again? models.py class PurchaseHistory(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="purchase_history") is_one_invested = models.BooleanField(default=False) def __str__(self): return self.user.username class Meta: app_label = 'PurchaseHistory' payments/views.py def charge(request): if request.method == 'POST': charge = stripe.Charge.create( amount=500, currency='usd', description='A Django charge', source=request.POST['stripeToken'] ) if request.user.is_authenticated: if PurchaseHistory.objects.filter(user=request.user).exists(): request.user.purchase_history.is_one_invested = True request.user.purchase_history.save() return render(request, 'charge.html') It should be making a change to my database but it appears to me that my migrations are not adding my model correctly. I know I'm doing something wrong and I'd like someone to show me how to fix this. I viewed many similar questions and tried many answers and nothing is working. -
Psycopg2 invalid json when returning postgres query
I am using Django to access a stored function in my postgres DB. When I execute the function inside of Postgres, it returns doublequotes and valid json. However, when I call the function from Django (which uses psycopg2) the doublequotes are removed and single quotes replace them. It seems psycopg2 is doing some type of conversion to lists / dictionary in the background. However, I need to keep the json. Any ideas how to resolve this? -
Django-filter field name is a python builtin keyword
I'm trying to rebuild a legacy API with DRF and django-filter. One of the field names is from, but from = DateTimeFilter(field_name="created_dt", lookup_expr="gte") is not valid Python. Can I name the variable from_ = DateTimeFilter(...) but still expose the API parameter as ?from= to users? -
How to import and edit variable from model associated with currently logged in user
I want to import a variable from a model associated with the currently logged in user. My model uses a one to one relationship with the built in User model. After importing the variable I want to change it to True for whatever user is currently logged in. I've tried messing with my import statement and got it to work correctly It's giving me "PurchaseHistory() got an unexpected keyword argument 'id'" when trying to edit the variable. I know this is my misunderstanding of a code snippet I found online, and I would just like someone to help me fix it. #models.py class PurchaseHistory(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) InvestingOne = models.BooleanField(default=False) def __str__(self): return self.user.username class Meta: abstract = True app_label = 'PurchaseHistory' #payments/views.py def charge(request): if request.method == 'POST': charge = stripe.Charge.create( amount=500, currency='usd', description='A Django charge', source=request.POST['stripeToken'] ) post = PurchaseHistory(id=InvestingOne) post.InvestingOne = True post.save() return render(request, 'charge.html') I believe I provided good information to help me fix this. Let me know if there's any additional details I should provide. Thank you. -
Django ORM individual query raw SQLs are different when they are bound with OR
I apologize for formatting eyesores in advance. Feel free to edit my question for better readability. I have four models: class Datasets(models.Model): name = models.CharField(max_length=150) description = models.TextField() class Assay(models.Model): dataset = models.ForeignKey(Datasets) name = models.CharField(max_length=150) class = models.CharField(max_length=150) class Compounds(models.Model): dataset = models.ForeignKey(Datasets) name = models.TextField() deleted = models.BooleanField(default=False) class Assays(models.Model): compound = models.ForeignKey(Compounds) assay = models.ForeignKey(Assay) value = models.DecimalField(max_digits=30, decimal_places=16) deleted = models.BooleanField(default=False) I am building queries with user input depending on the Assay picked. I am using JOINs to filter results based on reverse relations. User picks the Assay and I filter the returned compounds based on the selection. Users can also pick 'No Assay' option, which should return the compounds with no registered assays (i.e. no entries in Assays model for that compound). selected_assay_id = 5 # Received from frontend no_assay_option_selected = True/False # Received from frontend dataset_id = 1 filter_query = Q() filter_query.add(Q(**{ 'assays__assay__id': selected_assay_id, 'assays__compound__id': F('id'), 'assays__deleted': False }), Q.OR) if no_assay_option_selected: filter_query.add(~Q(**{ 'assays__deleted': False, 'assays__compound__id': F('id') }), Q.OR) compounds = Compounds.objects.filter(filter_query, dataset__id=dataset_id).distinct() When I pick an assay, it works great. When I pick 'No Assay', it works great. But when I pick an assay and also 'No Assay', all the compounds are returned … -
Django - Bokeh Graph
First time I use bokeh and the graph does not show up. Just a blank html page views.py def home(request): plot = figure() # x coord y coord plot.circle([1,10,35,27],[0,0,0,0],size=20,color="blue") script,div = components(plot) return render(request,"bokeh/home.html",{'script':script,'div':div}) home.html <div class="container text-center"> <h1>HELLO</h1> {{div| safe}} </div> Am I missing something? Thanks -
How can I integrate PayPal with my django application, using Django Rest Framework?
I'm trying to use PayPal with Django Rest Framework, but I don't know how to start with this, any idea how to do it? -
Changing a button depending on whether a user has liked a post or not
I am creating a social media website where users can like each others posts. So far, I have implemented most of this, however I am missing one vital part. This is changing the text within a button, depending on if a user has liked a post or not. The 'tuser' variable finds a user within the many to many field named 'likes' which is on the Post class. Depending on whether it exists or not. I pass a variable through to my 'home' template, which then if it exists, display certain text in a button. models.py: class Post(models.Model): file = models.ImageField(upload_to='images/') summary = models.TextField(max_length=600) pub_date = models.DateTimeField(auto_now=True) user = models.ForeignKey(User, on_delete=models.CASCADE) likes = models.ManyToManyField(User, through='Like', related_name='likes') def __str__(self): return self.user.username def pub_date_pretty(self): return self.pub_date.strftime('%b %e %Y') def summary_pretty(self): return self.summary[:50] @property def total_likes(self): return self.likes.count() class Like(models.Model): status = models.BooleanField() post = models.ForeignKey(Post, on_delete=models.CASCADE) user = models.ForeignKey(User, on_delete=models.CASCADE) views.py def likepost(request, post_id): if request.method == 'POST': post = get_object_or_404(Post, pk=post_id) user = request.user if post.likes.filter(id=user.id).exists(): tuser = post.likes.filter(id=user.id) post.likes.remove(user) if tuser: return redirect('home', {'tuser': tuser}) else: return redirect('home') else: like = Like() like.post = post like.user = user like.status = False like.save() post.likes.add(user) return redirect('home') template code: {% if tuser … -
Django's urls file interpretes twice
I spotted a really weird behavior in my Django project. My urls.py just gets interpreted twice for some reason, which is unfortunately causing a lot of trouble. For debugging, I put these two lines import traceback tracebak.print_stack() into my urls.py file. This is the output I get when I do ./manage.py runserver: File "/usr/lib/python3.7/threading.py", line 890, in _bootstrap self._bootstrap_inner() File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner self.run() File "/usr/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/user/project/venv/lib/python3.7/site-packages/django/utils/autoreload.py", line 54, in wrapper fn(*args, **kwargs) File "/home/user/project/venv/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run self.check(display_num_errors=True) File "/home/user/project/venv/lib/python3.7/site-packages/django/core/management/base.py", line 390, in check include_deployment_checks=include_deployment_checks, File "/home/user/project/venv/lib/python3.7/site-packages/django/core/management/base.py", line 377, in _run_checks return checks.run_checks(**kwargs) File "/home/user/project/venv/lib/python3.7/site-packages/django/core/checks/registry.py", line 72, in run_checks new_errors = check(app_configs=app_configs) File "/home/user/project/venv/lib/python3.7/site-packages/django/core/checks/urls.py", line 13, in check_url_config return check_resolver(resolver) File "/home/user/project/venv/lib/python3.7/site-packages/django/core/checks/urls.py", line 23, in check_resolver return check_method() File "/home/user/project/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 398, in check for pattern in self.url_patterns: File "/home/user/project/venv/lib/python3.7/site-packages/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/user/project/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 579, in url_patterns patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module) File "/home/user/project/venv/lib/python3.7/site-packages/django/utils/functional.py", line 80, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/home/user/project/venv/lib/python3.7/site-packages/django/urls/resolvers.py", line 572, in urlconf_module return import_module(self.urlconf_name) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", … -
ignore csv column python/django
I am importing a csv into my django web app and get_or_creating new objects per row. However, I would like to skip a row if one of its columns does not contain one of a few approved phone numbers. Code below, what can I add to achieve the desired result? csv_file = request.FILES['file'] if not csv_file.name.endswith('.csv'): message.error(request, 'this is not a csv file') data_set = csv_file.read().decode('UTF-8') io_string = io.StringIO(data_set) next(io_string) for column in csv.reader(io_string, delimiter=",", quotechar='"', quoting=csv.QUOTE_ALL, skipinitialspace=True): _, created = Call.objects.get_or_create( name=column[0], phone_number=column[1], etc... ) context = {} -
What should return custom authenticate_header that extend BaseAuthentication of DRF
I'm working in a Django-Python project, and have a class ApiAuthentication that extend of rest_framework.authentication.BaseAuthentication. This Class have the method authenticate_header(self, request). In this method I get the auth token from the header and make multiple checks; now at the end, after making sure that the token it's valid and get the user related to the request, what should return this method?. In the code of BaseAuthentication say: """ Return a string to be used as the value of the `WWW-Authenticate` header in a `401 Unauthenticated` response, or `None` if the authentication scheme should return `403 Permission Denied` responses. """ which string?, I need an example, I try multiple values and always receive {"status":401,"type":"api-error","description":"Authentication credentials were not provided.","error":"NotAuthenticated"} By other side, the method Authenticate works fine and return a two-tuple (user, token), I would like to return something like this un authenticate_header. -
Django admin templates looks different between server and local
When I deployed my app on heroku, it looked different from what I have on local server. It just displayed basic html, no css at all. I was trying to add local admin templates to my new template folder. But still didn't work. TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'main/templates/')], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] How can I make it work. What other information should I provide? Thanks. -
i cant seem to get object from my detail view to appear in template
i wanted to have two pks in the url of my detail view but the template doesn't seem to get the object from the view: class DetailBook(generic.DetailView): model=Book template_name='./subject/bookdetail.html' def get_object(self, pk, pk_2): subject_obj = Subject.objects.filter(subject_name=pk).first() obj = Book.objects.filter(subject=subject_obj,book_name=pk_2).first() return obj def get(self, request, pk, pk_2): self.object = self.get_object(pk, pk_2) context = self.get_context_data(object=self.object) return self.render_to_response(context) enter code here path('subject/<int:pk>/book/<int:pk_2>/detail', views.detailBook.as_view(),name='detailbook'), -
Migration during heroku deployment fails
I have done this tutorial from Realpython on building a location-based app. I am now deploying to Heroku. The app was created and pushed to Heroku successfully. The problem now arises when I run heroku run python manage.py migrate. I get the error below in my terminal: File "manage.py", line 16 ) from exc ^ SyntaxError: invalid syntax I have installed gdal to Heroku by following this: heroku-buildpack-apt Another problem I have noted is that when I run heroku run python --version it shows that Heroku is using python 2 for my app while I have set python 3 in the runtime.txt file (I suspect its because of the Aptfile I added to install gdal) Please help. Consider me a beginner. -
Request.user as initial data don't work in django forms
I have a model named Porumbei, a form named AdaugaPorumbel and I want as initial data to be request.user. #My model class Porumbei(models.Model): COMPARTIMENTE = [ ('Matcă', 'Matcă'), ('Tineret', 'Tineret'), ('Zburători', 'Zburători'), ('Decedați', 'Decedați') ] SEXE = [ ('Mascul', 'Mascul'), ('Femelă', 'Femelă'), ('Pui', 'Pui') ] id_porumbel = models.AutoField(primary_key=True) data_adaugare = models.DateTimeField(default=timezone.now, null=True, blank=True) crescator = models.ForeignKey(get_user_model(), on_delete=models.CASCADE, null=True, blank=True) serie_inel = models.CharField(max_length=25, null=False, blank=False, unique=True, help_text="Seria de pe inel. Ex: RO 123456") #My form class AdaugaPorumbel(forms.ModelForm): class Meta: model = Porumbei fields = ['data_adaugare', 'serie_inel', 'anul', 'culoare', 'culoare_ochi', 'sex', 'ecloziune', 'rasa', 'linie', 'nume', 'tata', 'mama', 'compartiment', 'status', 'data', 'vaccinat', 'info', 'imagine', 'imagine_ochi'] widgets = { 'ecloziune': forms.DateInput(format='%d/%m/%Y', attrs={'class': 'form-control', 'type': 'date'}), 'data': forms.DateInput(format='%d/%m/%Y', attrs={'class': 'form-control', 'type': 'date'}), 'vaccinat': forms.DateInput(format='%d/%m/%Y', attrs={'class': 'form-control', 'type': 'date'}), 'info': forms.Textarea(attrs={'class': 'form-control mt-15', 'rows': '3', 'placeholder': 'Vor apărea în pedigree'}), } error_messages = { 'serie_inel': { 'required': 'Introduceţi seria inelului!', 'unique': 'Porumbelul este deja adăugat în baza de date!', }, } #My view @login_required(login_url='/auth/login/') def porumbelnou(request): if request.method == "POST": form = AdaugaPorumbel(request.POST, request.FILES) if form.is_valid(): obj = form.save(commit=False) obj.crescator = request.user obj.save() return HttpResponseRedirect('/porumbei/vizualizare') else: form = AdaugaPorumbel() context = { 'form': form, } template = loader.get_template("adaugare-porumbel.html") return HttpResponse(template.render(context, request)) With these configuration, the crescator … -
Django - serializer returns update data but don't modify db
I have following serializer: class ProfileSerializer(serializers.ModelSerializer): user = UserSerializer() class Meta: model = Profile fields = ( 'pk', 'user', 'isAdmin', 'isAccountant', 'isAuditor', 'isManager' ) def update(self, instance, validated_data): instance.isAdmin = validated_data['isAdmin'] instance.isAccountant = validated_data['isAccountant'] instance.isAuditor = validated_data['isAuditor'] instance.isManager = validated_data['isManager'] user = validated_data.pop('user') u = User.objects.get(email=user['email']) u.first_name = user['first_name'] u.last_name = user['last_name'] u.username = user['email'] u.email = user['email'] u.save() return instance when I send PUT request, in response I get updated data. But in database it remains the same. What am I doing wrong ? -
Django Object Filter
I have a simple filter where a user enters a string, term, which is compared against the column companyId in my local database. If there is a match, the appropriate record/s are then rendered in a table within my template. However, no data is being rendered in the template, only rows of empty fields matching the number of records for a particular query. I have similar logic used for displaying these records unfiltered which works fine. views.py def opportunity_dashboard(request): try: term = request.GET.get('search_query') if term: filtered_objects = Opportunity.objects.filter(companyId__icontains=term) filtered_local_zip = zip(filtered_objects) context = { 'term': term, 'filtered_local_zip': filtered_local_zip, 'filtered_connectwise_zip': filtered_connectwise_zip } return render(request, 'website/opportunity_dashboard.html', context) template.html {% if term %} {% for object in filtered_local_zip %} <tr> <th style="text-align: center;"> <a href="https://solutions.byteworks.com/new_opportunity/new_opportunity_review?id={{ object.id }}">&#9998;</a> </th> <td> <div class="select"> <select disabled id="bw_status" name="status"> <option value="{{ object.status }}">{{ object.status }}</option> </select> </div> </td> <td> <a{{ object.opportunityName }}</a> </td> <td>{{ object.companyId }}</td> <td> <div class="select"> <select id="bw_account_manager" name="account_manager"> <option value="{{ object.accountManager }}">{{ object.accountManager }}</option> </select> </div> </td> -
I'm trying to retrieve data from Template using the foreign key related tables. But not working
I'm trying to retrieve data from template level which is connected with foreign key to the derived class. But not working. Models: class School(models.Model): name = models.CharField(max_length = 256) principal = models.CharField(max_length = 256) location = models.CharField(max_length = 256) class Student(models.Model): name = models.CharField(max_length = 256) age = models.PositiveIntegerField() school = models.ForeignKey(School, related_name='students', on_delete = models.CASCADE) Views: class SchoolListView(ListView): context_object_name = 'schools' model = models.School template_name = 'basic_app/School_list.html' class SchoolListView(ListView): context_object_name = 'schools' model = models.School template_name = 'basic_app/School_list.html' Template <div class="jumbotron"> <h1>Welcome to School Detail page</h1> <h2>School Details:</h2> <p>Name: {{ school_detail.name}} </p> <p>Principal: {{ school_detail.principal}} </p> <p>Location: {{ school_detail.location}} </p> <h3> Students:</h3> {% for student in school_detail.students.all %} <p>{{ student.name }} who is {{ student.age }} years old.</p> {% endfor %} Cannot retrieve student data from the student table from the template. -
How to deploy angular 8 ssr and django rest framework separately on the same server (heroku or digitalocean) )
Most of the tutorials say that you have to integrate angular into django but I do not want to do that. I want to deploy both on the same server with angular using node-express and django using gunicorn. But I do not know how to do it. I know how to deploy angular ssr only and django alone but not both on the same server. Thanks in advance