Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Can a failed transaction using Psycopg2 in a Django database cause SQL constraints to stop behaving as deferred?
I have a Python script that uses the Psycopg2 library to insert data in a Postgres database. The tables were created using Django migrations. Although the database is used by Django, it is part of a data analysis system and it will also be accessed and manipulated using Psycopg2. Everything is running on Ubuntu. A simplified version of the database is presented below. Simplified database structure Django receives zip files via POST requests and adds the corresponding entries to the Upload table. Each entry has the zip file location. Inside each Upload zip, there are Session zips, which in turn have CSV files inside with the relevant data. The Session zips and CSV files have no references in the database, but its information is inserted using the aforementioned script. Although there are 3 data tables there are 4 CSV files - one of them contains session metadata. The cycle of the script and an excerpt from it are presented below, just for explanatory purposes. Script cycle try: # open a new database connection connection = psycopg2.connect(database='database',user='user') cursor = connection.cursor() # First insert the Session metadata file -> Link entry to Upload entry (upload_zip_id) insert_csv(session_info_file_path, upload_zip_id) # Then insert Data1, Data2 … -
No reverse match error on django while adding a like | unlike button
I have been trying to add a like | unlike button to the following code but everytime I run the server, a reverse match error apears, I think the problem is on the html because I am suposed to use a {% url %} tag but I am using a {{ }} tag on the href, the thing is I dont know how to transform what I am using to what I am suposed to be using. urls.py urlpatterns = [ url(r'^(?P<slug>[\W-]+)/like/$', PostLikeToggle.as_view(), name='like-toggle'), url(r'^api/(?P<slug>[\W-]+)/like/$', PostLikeAPIToggle.as_view(), name='like-api-toggle'), ] models.py class Post(models.Model): text = models.CharField(max_length=200) posti = models.ImageField(upload_to='media/images', null=True, blank="True") video = models.FileField(upload_to='media/images', null=True, blank="True") user = models.ForeignKey(User, related_name='imageuser', on_delete=models.CASCADE, default='username') slug = models.SlugField(unique=True, blank=True) likes = models.ManyToManyField(User, blank=True, related_name='post_likes') def get_like_url(self): return reverse('like-toggle', kwargs={"slug": self.slug}) def get_api_like_url(self): return reverse('like-api-toggle', kwargs={"slug": self.slug}) imagelist.html ( the problem might be here ) <p>likes: {{image.likes.count }} <a class='like-btn' data-likes='{{ image.likes.count }}' data-href='{{ image.get_api_like_url }}' href='{{ image.get_like_url }}'>Like</a></p> views.py class PostLikeToggle(RedirectView): def get_redirect_url(slef, *args, **kwargs): slug = self.kwargs.get("slug") print(slug) obj = get_object_or_404(Post, slug=slug) url_ = obj.get_redirect_url() user = self.request.user if user.is_authenticated(): if user in obj.likes.all(): obj.likes.remove(user) else: obj.likes.add(user) return url_ from rest_framework.views import APIView from rest_framework.response import Response from rest_framework import authentication, permissions class PostLikeAPIToggle(APIView): … -
React native upload image file to django backend
Hi i want to post photo to the django backend. I can easily post with postman. But i cant do it with react native. Here is my post request: handleSubmit(photoUri){ let formData = new FormData(); formData.append('file',photoUri); formData.append('name', 'a'); fetch('http://localhost:8000/test/', { method: 'POST', body:formData, }).then(res => res.json()) .then((data) => { console.log(data); }) .catch(err => console.log(err)); } In this post django serializer is like that: FileSerializer(data=<QueryDict: {'file': ['file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540anonymous%252Ftez2-1599e0c7-8863-4da6-b20f-5e6e94be9342/Camera/b2116349-cdfb-4309-8d6e-51c9a36be4fb .jpg'], 'name': ['a']}>): but with postman it is like this: FileSerializer(data=<QueryDict: {'name': ['a'], 'file': [<InMemoryUploadedFile: a.jpg (image/jpeg)>]}>): I think issue is something with InMemoryUploadedFile i cant upload file in this form with react native. How can i do it ? -
how to make django filters and permissions on rest api
i have model called question and model called review that the user can make the review for the questions how to make filter or permission restrict the question author to make review for his question the others only can make that hint i'm using in the views class based view -
Django datatables master-detail table
I want to do master-detail table. But details shows on another table when i clicked a row of master table. My models, views, templates and scripts like below. Do i need to get data with ajax. If i need to how can i get it to table and how to trigger detail table to load data while select row from master table? Models class VatandasTalep(models.Model): Vatandas = models.ForeignKey(Vatandas, on_delete=models.CASCADE,verbose_name="Vatandaş") BasvuruTarihi = models.DateField(verbose_name="Başvuru Tarihi") BitisTarihi = models.DateField(verbose_name="Bitiş Tarihi") class VatandasTalepHareket(models.Model): Durum = models.ForeignKey(Durumlar, on_delete=models.CASCADE,verbose_name="Durum") VatandasTalep = models.ForeignKey(VatandasTalep, on_delete=models.CASCADE,verbose_name="Vatandaş Talep") SıraNo = models.IntegerField(null=True,blank=True,verbose_name="Talep Ücreti") GonderenBirim = models.ForeignKey(Birimler, on_delete=models.CASCADE,null=True,blank=True,related_name="GonderenBirim") AlanBirim = models.ForeignKey(Birimler, on_delete=models.CASCADE,null=True,blank=True,related_name="AlanBirim") views.py def VatandasTalepleri(request): vtd = VatandasTalep.objects.all() vtdh = VatandasTalepHareket.objects.all() return render(request,'vatandas_talep.html',{'vtd':vtd,'vtdh':vtdh}) template {% if vtd %} <div class="table-responsive"> <table class="table table-bordered display" id="VatandasTalep"> <thead class="thead-light"> <tr> <th style="display:none;"></th> <th class="text-gray-900" >Vatandaş</th> <th class="text-gray-900" >Başvuru Tarihi</th> <th class="text-gray-900" >Bitiş Tarihi</th> <th class="text-gray-900" >Güncelle</th> <th class="text-gray-900" >Gönder</th> <th class="text-gray-900" >Sil</th> </tr> </thead> <tbody> <tr> {% for qvtd in vtd %} <td style="display:none;">{{qvtd.id}}</td> <td class="text-gray-900" >{{qvtd.Vatandas}}</td> <td class="text-gray-900" >{{qvtd.BasvuruTarihi|date:"d/m/Y"}}</td> <td class="text-gray-900" >{{qvtd.BitisTarihi|date:"d/m/Y"}}</td> <td class="text-gray-900"><a href="{% url 'modules:VatandasTalepGuncelle' qvtd.id %}" class="btn btn-success" role="button" name="update">Güncelle</a></td> <td class="text-gray-900"><a href="{% url 'modules:VatandasTalepSil' qvtd.id %}" class="btn btn-info" role="button" name="delete" onclick="return confirm('Kaydı silmek istediğinizden emin misiniz?');">Gönder</a></td> <td class="text-gray-900"><a href="{% … -
Cant Get POST Unit Test To Update Data Working
I am trying to make a unit test in Selenium to check that my POST works on my user profile page (users are able to update their profile information). My problem is that I cant get it to work (I cant get the unit test to update the users email) - I've tried many things but cant get it right. This test returns: AssertionError: 'user@example.com' != 'update@example.com' views.py @login_required def update_profile(request): if request.method == 'POST': u_form = UserUpdateForm(request.POST, instance=request.user) p_form = ProfileUpdateForm(request.POST, request.FILES, instance=request.user.profile) if u_form.is_valid() and p_form.is_valid(): u_form.save() p_form.save() messages.success(request, f'Your account has been updated') return redirect('update_profile') else: u_form = UserUpdateForm(instance=request.user) p_form = ProfileUpdateForm(instance=request.user.profile) context = { 'u_form' : u_form, 'p_form' : p_form } return render(request, 'users/update_profile.html', context) form.py class UserUpdateForm(forms.ModelForm): email = forms.EmailField() class Meta: model = User fields = ['username', 'email'] test.py def test_update_works(self): user = User.objects.create(username='testuser', email='user@example.com') self.client.force_login(user) self.client.post('/profile/update_profile',{'email': 'updated@example.com'},) self.assertEqual(user.email, 'updated@example.com') Thank you. -
How to upload a bytes object to Google Cloud Storage?
I'm trying to take a base64-encoded PNG, decode it, then upload it to Google Cloud Storage and get its public URL. I can do it locally by saving the PNG to file and then uploading it with blob.upload_from_file('picture.png'), but App Engine doesn't allow write access to its file structure. This code works locally but not in Google App Engine, where it fails at with open(... import base64 from google.cloud import storage def handler(request): pic = request.POST.get('signature') #Object like 'data:image/png;base64,iVBORw0KGgoAAAAN…' data = pic[22:] png = base64.b64decode(data) filename = "pic.png" with open(filename, "wb") as f: f.write(png) client = storage.Client.from_service_account_json(os.path.abspath('credentials.json')) bucket = client.get_bucket('mybucket') blob = bucket.blob(filename) #create destination uri in bucket blob.upload_from_file(filename) image_url = "https://storage.googleapis.com/mybucket/" + filename The GCS docs say to Use the Blob.upload_from_file(), Blob.upload_from_filename(), or Blob.upload_from_string() method to upload an object. However none of those methods work for this situation because there is no file, just an encoded PNG object. How can I upload it to gcloud storage? I'm surely missing something obvious. Any ideas would be much appreciated. -
Wechat mobile Signup Django
I am trying to apply Oauth using Wechat. All authentication through the client side is done. For the backend, I am using below package: https://github.com/Xavier-Lam/wechat-django I have followed all the docs, added 'wechat_django' to installed apps, and run the migrations, but I can't seem to implement it. As far as I can see, the issue is with the below code snippet: from wechat_django.models import WeChatApp app = WeChatApp.objects.get_by_name("your app name") user, data = app.auth(code) WeChatApp.objects.get_by_name, is returning nothing. For app name, I am using the 'application name' on developer console at open.weixin.qq.com. Can this get the app info, just with the application's name? Anyone familiar with this package, or Authentication with Django in general. Appreciate your help. -
Why djangocms Application Hook messes the template selection?
I'm trying to integrate an app in a djangocms page. Everything works as expected locally but on the server I get a strange behavior. The same python environment has been deployed on the server. (django-cms 3.7.2) Behavior on the server: I create a new djangocms page and select a template. After I configure the hook: the application content is displayed but the whole Page menu disappears from the admin toolbar the page is displayed using the first template defined in CMS_TEMPLATES It looks like the page jumps into a non-CMS managed state. Local / expected behavior: The apphook configuration doesn't affect the Pages menu nor the selected template. My analysis: The app templates are defined so that they extend the template chosen in the django-cms page. They use: {% extends CMS_TEMPLATE %} According to the djangocms documentation: CMS_TEMPLATE is a context variable available in the context; it contains the template path for CMS pages and application using apphooks, and the default template (i.e.: the first template in CMS_TEMPLATES) for non-CMS managed URLs. The second part of this specs maps on the behavior I get: the app page is displayed using the first template defined in CMS_TEMPLATES. This made me think … -
Is there a way to make the timezone correlate to the user's timezone
As of now I have the timezone set to my own timezone, but is there a way to make the timezone change based on the user that is browsing the site? Thanks in advance for any help. -
Django - How to pull data that has been added to the SQLite database on a different branch
I'm very new to Django so please be patient with me and sorry if it is a dumb question. I am working with a partner on a Django project with a Django admin and we are using SQLite for our database. We both work on our own branches and have been each putting in lookup table values and dummy data. How can I pull the data that my partner has been adding so I can see it on my own branch? The SQLite file is not in gitignore. For some reason though even when he pushes his changes to master and I pull the changes onto my own branch, I can't see the data he has put in my own branch and can only see it when switching over to the master branch or his branch. Thank you in advance! -
Failure instance: No route found for path in django channels error
First of all let me say that I know that there is a very similar question already asked about this, but none of the solutions under that post solved the issue for me. I am trying to get my first ever websocket working with django channels (which has proven to be quite a difficult task actually) and am now stuck on this error: [Failure instance: Traceback: <class 'ValueError'>: No route found for path 'dashboard/'. This is my project routing: from channels.routing import ProtocolTypeRouter, URLRouter from django.conf.urls import url from channels.auth import AuthMiddlewareStack from channels.security.websocket import AllowedHostsOriginValidator, OriginValidator import problemdashboard.routing application = ProtocolTypeRouter({ 'websocket': AllowedHostsOriginValidator( AuthMiddlewareStack( URLRouter( problemdashboard.routing.websocket_urlpatterns ) ) ) }) This is my app (problemdashboard) routing: from django.urls import path from . import consumers websocket_urlpatterns = [ path("", consumers.FirstConsumer) ] This is my javascript websocket: var loc = window.location var wsStart = 'ws://' if (loc.protocol == 'https:'){ wsStart = 'wss://' } var endpoint = wsStart + loc.host + loc.pathname console.log(endpoint) var socket = new WebSocket(endpoint) socket.onmessage = function(e) { console.log("message", e) } socket.onopen = function(e) { console.log("open", e) } socket.onerror = function(e) { console.log("error", e) } socket.onclose = function(e) { console.log("close", e) } And finally this is my consumer(copied … -
How can Idisplay the data recieved from the backend in a more readable way?I use react for the Frontend
Here is my model: class Festival(models.Model): name = models.CharField(max_length=100) start_date = models.DateTimeField(blank=True, null=True, default=None) end_date = models.DateTimeField(blank=True, null=True, default=None) number_of_tickets = models.IntegerField(default=50000) location = JSONField(blank=True, null=True) created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) def __str__(self): return self.name def format_start_date(self): return self.start_date.strftime("The Festival will start on: %d %b %Y at: %H:%M:%S") def format_end_date(self): return self.end_date.strftime("The Festival will end on: %d %b %Y at: %H:%M:%S") I try to display the output from format_start_date() function using the frontend. how could i do that? At the moment, in List.Item.Meta i access the item.start_date, but it displays the date in an unwanted way. I want it to be more readable, by using format_start_date() function from Festival model. Is it possible? if it isn't, what is the right way to do that: ex: if the date retrieved is "2020-06-12T12:00:00Z", i want to desplay in description : ""The Festival will start on: 12 06 2020 at: 12:00:00". const IconText = ({ icon, text }) => ( <Space> {React.createElement(icon)} {text} </Space> ); const Festivals = (props) => { return( <List itemLayout="vertical" size="large" pagination={{ onChange: page => { console.log(page); }, pageSize: 3, }} dataSource={props.data} footer={ <div> <b>ant design</b> footer part </div> } renderItem={item => ( <List.Item key={item.title} actions={[ <IconText icon={StarOutlined} … -
Jobs scheduling in Django
I want to create Jobs scheduling. I used this command : python manage.py create_jobs app_name but I get : Unknown command: 'create_jobs' -
Filter objects by distance
I work on a code that notifies users when a new place is added to a database. Users can save up to 3 custom filters and I want to notify them about the new places that match their filters only. Let say I have following models: class Address(models.Model): country = models.ForeignKey(...) post_code = models.CharField(...) city = models.CharField(...) location = models.PointField() class Place(models.Model): name = ... type = ... something = ... address = models.ForeignKey(Address, ...) class UserFilter(models.Model): name = ... type = ... something = ... location = models.PointField() distance = models.DecimalField(...) API allows to filter Place queryset using request parameters. Users can send lat, long and distance params to get places in given range only: distance = float(request.query_params.get('distance', None)) ref_location = Point( float(request.query_params.get('lat', None)), float(request.query_params.get('long', None)) ) filters &= Q(order__shipping__address__location__distance_lte=(ref_location, D(km=distance))) But now, when I create a new Place, I want to filter UserFilter queryset to find the filters which location (including distance) "covers" the new Place location. The problem is the distance I need is a field in a model I filter. Is there some neat way to solve this? -
How to save and validate objects correctly using django rest framework
I'm learning django rest framework and I have found problems validating and saving objects correctly. When I receive a request to create a dialog, I first need to create a dialog, and then to add participants to it. This is code of Dialog model: class DialogManager(models.Manager): def create_dialog(self, name): max_length(name, 30) dialog = self.model(name=name) dialog.save() return dialog class Dialog(models.Model): name = models.CharField(null=False) created_at = models.DateTimeField(auto_now_add=True) objects = DialogManager() my Participant model: class ParticipantManager(models.Manager): def create_participant(self, dialog, user, role="user"): if role not in ["user", "admin"]: raise ValueError('Incorrect role for the user') max_length(role, 30) participant = Participant(role=role, dialog=dialog, user=user) participant.save() return participant class Participant(models.Model): role = models.CharField(null=False) dialog = models.ForeignKey(Dialog, on_delete=models.CASCADE) user = models.ForeignKey(CustomUser, on_delete=models.CASCADE) objects = ParticipantManager() class Meta: unique_together = ('dialog', 'user',) and Dialog set: class DialogSet(viewsets.ModelViewSet): queryset = Dialog.objects.all() serializer_class = DialogSerializer pagination_class = DialogSetPagination def create(self, request): data = request.data users = CustomUser.objects.filter(pk__in=data['ids']) dialog_serializer = DialogSerializer(data=data) if not dialog_serializer.is_valid(): return Response(dialog_serializer.errors, status.HTTP_400_BAD_REQUEST) with transaction.atomic(): dialog = dialog_serializer.save() i = 0 for user in users: participant_serializer = ParticipantSerializer(data={'dialog': dialog.pk, 'user': user.pk, 'role': 'user'}) if not participant_serializer.is_valid(): return Response(participant_serializer.errors, status.HTTP_400_BAD_REQUEST) i += 1 return Response(dialog, status.HTTP_201_CREATED) The problem is that I can save an object of Dialog, and then validate … -
How to get token from vk auth django
I log in to the django web app using Vkontakte (the social_auth library) and I need to display the list of friends and the nickname of the logged-in person. As far as I understand, this requires a token. Tried to get this string settings.VK_ACCESS_TOKEN failed. My code: session = vk.Session(token=settings.VK_ACCESS_TOKEN) vk_api = vk.API(session) friends = vk_api.friends.get(user_id=0, order='hints') I would be grateful for examples of practical implementation -
How to set translation after Allauth login?
I have created a site that is translated in two languages currently. I have followed Django tutorial (and another one on YT) to do the translation and everything seems to be working as expected; I have a form in the Settings page for a particular user which is logged in, where the user can update the language preference. The preference is saved in database as language code (i.e. "en") and in the same time the translation is activated with the same language code (fetched from the same entry field). Up to this point, everything is working fine. This is the code I have used to achieve that: userprofile = UserProfile.objects.get(user_id=request.user.id) localizationForm = settingsLocalization(instance=userprofile) if request.method == 'POST' and 'settingsLocalization' in request.POST: localizationForm = settingsLocalization(data=request.POST, instance=userprofile) if localizationForm.is_valid(): localizationForm = localizationForm.save(commit=False) user_language = localizationForm.language localizationForm.save() translation.activate(user_language) request.session[translation.LANGUAGE_SESSION_KEY] = user_language return redirect('{}?tab=localization'.format(reverse('settings'))) else: return redirect('dashboard') else: localizationForm = settingsLocalization(instance=userprofile) However, the updated language preference do not persist when the user is logged out and the browser / session is closed and logged in again, although the language preference field in the form is with the correct selection. I have tried to use Allauth built in signal allauth.account.signals.user_logged_in(request, user) in order to provide … -
Django Invalid http_host
I am trying to host a django server over lan, but I keep getting Invalid HTTP_HOST header: '192.168.1.9:8000'. You may need to add '192.168.1.9' to ALLOWED_HOSTS. The website functions when I use local host site. Both local host and my local ip are set as allowed hosts in my settings file. I am running the server using python manage.py runserver 0.0.0.0:8000 -
What is the purpose of "_private.py" file when making custom management commands in Django?
Hi guys I have been trying to find a reason for the existence of the _private.py file when you are declaring custom management commands. I tried to look on many pages and forums and I did not find anything relevant. The most explicit documentation about this file that I found, is on the official documentation which states the following: The _private.py module will not be available as a management command. However that really does not give us so much information about what is the purpose of that file, or why would I really need to declare that, does any one of you guys know? -
is there any way to add button to django admin?
i want a button to call a view function from django admin. i want my button here my django admin panel When i click on that button , it calls a specified view. -
Adding item to the cart when quantity = 1
I have a problem with my function dealing with adding items to the cart: if item.quantity >= 1: if item.quantity > order_item.quantity: It works fine when item.quantity is more than 1, but when it's exactly one I cant add it to the cart because it doesn't pass the second if statement. When I change it to if item.quantity >= order_item.quantity , then I can add items with quantity 1 and over, but then order_item.quantity goes over one in item.quantity. Let's say that item quantity is 1 and I can add 2 to the cart. Any ideas how to make it so it would allow adding items with item.quantity >= 1, but the order_item.quantity can't go over item.quantity. -
How to create a jQuery validation to Django environment?
I've been looking for a solution for this problem of mine but I didn't find a final solution because they don't even work/run on the project I am doing. I found some stuff abou jQuery validation plugin and followed a tutorial in https://www.sitepoint.com/basic-jquery-form-validation-tutorial/ but it doesn't work for the project I am doing. I would like some help! form.html <head> <title>Sign In Page</title> {% load static %} <link rel="stylesheet" type="text/css" href="https://www.w3schools.com/w3css/4/w3.css" /> <link rel="stylesheet" type="text/css" href="{% static 'cursoOnline/logInSignIn.css' %}"/> <script src="{% static 'validation.js' %}"></script> </head> <body> <image src="{% static 'cursoOnline/Books.jpg' %}" height="730"></image> <div> <form action="" name="registration" method="POST"> {% csrf_token %} </br></br> Nome:<input type="text" name="nome"/></br> Senha:<input type="text" name="senha"/></br></br> <input class="button" type="submit" value="Sign in"> </form> <a href="{% url 'cursoOnline:index' %}">Back to Homepage</a> </div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.1/jquery.validate.min.js"></script> </body> validation.js $(validation() { $("form[name='registration']").validate({ rules: { nome: "required", senha: "required", }, nome: { required: true, minlength: 3 } senha: { required: true, minlength: 5 } }, messages: { nome: { required: "Please enter your name" minlength: "Your name must be at least 3 characters long" }, senha: { required: "Please enter your password", minlength: "Your password must be at least 5 characters long" }, }, submitHandler: validation(form) { form.submit(); } }); }); -
Why does Django not recognize my imported model?
I have an app called feeder which itself has the files models.py and feeder.py. Now I would like to import the models stocksInfo and stocksPrice into feeder.py in order to update my database with the fetched data. Somehow it doesn't import the models and throws an error. Where is the missing piece? Error: C:\Users\Jonas\AppData\Local\Programs\Python\Python38-32\python.exe C:/Users/Jonas/Desktop/CFD/CFD/feeder/feeder.py Traceback (most recent call last): File "C:/Users/Jonas/Desktop/CFD/CFD/feeder/feeder.py", line 50, in <module> stocksInfo(); File "C:/Users/Jonas/Desktop/CFD/CFD/feeder/feeder.py", line 34, in stocksInfo obj, created = stocksInfo.objects.update_or_create( AttributeError: 'dict' object has no attribute 'objects' feeder.py import requests # import the required models does not work, they are greyed out + underlined red in IDE from feeder.models import stocksInfo, stocksPrice # Define stocksInfo Query Function def stocksInfo(): # Query stocksInfo and populate it to the database stocksInfo = requests.get('https://finnhub.io/api/v1/stock/profile2?symbol=AAPL&token=###############') stocksInfo = stocksInfo.json() # Assign data to variables symbol = 'APPL' country = stocksInfo['country'] exchange = stocksInfo['exchange'] name = stocksInfo['name'] ticker = stocksInfo['ticker'] ipoDate = stocksInfo['ipo'] marketCapitalization = stocksInfo['marketCapitalization'] shareOutstanding = stocksInfo['shareOutstanding'] logo = stocksInfo['logo'] url = stocksInfo['weburl'] industry = stocksInfo['finnhubIndustry'] # create object and update database obj, created = stocksInfo.objects.update_or_create( symbol=symbol, defaults={ 'country': country, 'exchange': exchange, 'name': name, 'ticker': ticker, 'ipoDate': ipoDate, 'marketCapitalization': marketCapitalization, 'shareOutstanding': shareOutstanding, 'logo': logo, 'url': url, 'industry': … -
How to use a base.html for default Wagtail Page instance?
Wagtail starts new projects with a single welcome template. However, this template does not inherit from any parent template, such as a base.html. In our project, we have previously defined a base.html containing global HTML tags and CSS/JavaScript includes. How can we tell the default Wagtail Page model to display in a template that extends base.html?