Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
making user field visible depending on the group a user belongs to
There is an app where teachers can register lessons they have with individual pupils. If a teacher adds a new lesson then he is automatically registered as a teacher who taught this lesson. So in a form there is no such a field as 'Teacher' because the request.user is used for this data. But I also would like an administrator to register a lesson for a teacher. Then this form should have a 'Teacher' field as well. What is the right way to do it? in models.py: class Lesson(models.Model): pupil = models.ForeignKey(Pupil, on_delete=models.CASCADE) teacher = models.ForeignKey("auth.User", limit_choices_to={'groups__name': "teachers"}) in views.py: class LessonCreate(PermissionRequiredMixin, CreateView, ): model = Lesson fields = ['pupil', 'subject', ] permission_required = 'foreigntest.add_lesson' def form_valid(self, form): obj = form.save(commit=False) obj.teacher = self.request.user obj.save() so I guess I have to add 'Teacher' to the fields list if the user belongs to admin types, right? -
angular 2 build is not working in django application
I have created build with npm run build this build, i want to use in django. I have configured it as per github repository as given in the link: https://github.com/jheloper9102/django-with-angular2 When i run django on localhost:8000 it doesn't show anything. But When i use the github repository as given in the link ./ it works fine. I don't know what is going wrong in my build. What can be the possible solutions? can you please suggest -
Django admin raw_id_fields description is not changing
In my admin site I have a model: class PatientMedAdmin(admin.ModelAdmin): raw_id_fields = ( 'icd_10', ) And it appears this way: When I change the value using the magnifying glass the ID is changing but the description is not. The description is changing only when I save me form. I have installed these additional apps: admin_view_permission, django_extensions. Is it possible to change this behavior? -
Django custom user model rename username colum
I'm trying to implementing a custom Django user model. Below is my user model. My problem is that in my application I use the email field as the username. But it doesn't work as I would when I use the model I get the following error. "Unknown column 'users.username' in 'field list'" class usersManager(BaseUserManager): pass def myoverridenmeta(name, bases, adict): newClass = type(name, bases, adict) for field in newClass._meta.fields: if field.attname == 'last_login': field.column = 'lastlogin' field.db_column = 'lastlogin' return newClass class users(AbstractUser): REQUIRED_FIELDS = ('ID', 'emal', 'password', 'salt', 'subscriptionID') USERNAME_FIELD = 'email' is_anonymous = False is_authenticated = True ID = models.AutoField(primary_key=True) email = models.CharField(max_length=254, unique=True) password = models.CharField(max_length=64) salt = models.CharField(max_length=32) lang = models.CharField(max_length=2, default='EN') regDate = models.DateField(auto_now_add=True) orgID = models.PositiveIntegerField(default=0) subscriptionID = models.CharField(max_length=18) activated = models.BooleanField(default=0) orgConfirmed = models.BooleanField(default=0) deleted = models.BooleanField(default=0) lastLogin = models.DateTimeField() objects = usersManager() class Meta: verbose_name = 'user' verbose_name_plural = 'users' db_table = 'users' def __str__(self): return self.email def get_short_name(self): return self.email def get_full_name(self): return self.email __metaclass__ = myoverridenmeta -
Long content is hiding usign django-easy_pdf package on django, not generate multiple pages
I'm trying to display content on multiple pages using the django-easy_pdf package, but, when the content is very long, this content is hiding, only the first page is displayed ( without the content ), I can't display the content on multiple pages. If the content is short, then, this is displayed without problems, but, only display one page. what is wrong ? This is my code: Base template ( called pdf_base.html, this is my custom base layout ), see: [1]: https://pastebin.com/W0JH6NsT "See base layout" This is my custom view ( called: pdf.html ), see: [1]: https://pastebin.com/7GeX8XZT "See Template" This is my view, see: [1]: https://pastebin.com/GTFscUDS "See view" This is my url, see: [1]: https://pastebin.com/dyVwwwLu "See url declaration" thanks!. -
ImportError : cannot import name loading
I have installed Django 1.10. I need to import the loafing but not able to import it. I am trying to connect my django app with elasticsearch using Haystack and wanted to build index. The code I want to run is python manage.py rebuild_index The error I get is: base ---dir /Manish/Projects/Spark/ad-tracking-django-env/ad-tracking-django Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/core/management/__init__.py", line 341, in execute django.setup() File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/__init__.py", line 27, in setup apps.populate(settings.INSTALLED_APPS) File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/apps/registry.py", line 108, in populate app_config.import_models(all_models) File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/django/apps/config.py", line 199, in import_models self.models_module = import_module(models_module_name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/catalog/models.py", line 3, in <module> from catalog.utils import connected_models, get_q_filters File "/Manish/Projects/Spark/ad-tracking-django-env/lib/python2.7/site-packages/catalog/utils.py", line 2, in <module> from django.db.models import loading, Q ImportError: cannot import name loading The main error is: ImportError: cannot import name loading -
Django - Dynamically get the appropriate data based on the dropdown selection
I have a template where I have a dropdown. I would like to display some data based on the dropdown value selected. The data is fetched from the DB. As I have no idea about ajax or jquery, I need help here to dynamically display the content based on the dropdown selected. Example: Say my dropdown is [1,2,3,4]. When user selected 1, it should display ONE in my HTML, if user selected 2 then it should display TWO and so on. Can some please share me the HTML code for the above example (with ajax or jquery)? -
Update search query with Javascript
I currently have a Javascript function to update facets. See code: function onFacetChangeApplied(){ var url = window.location.href.split("?")[0]; var search_query = getParameterByName('q'); var url_with_search_query = url + '?q=' + search_query $('input:checkbox.facet').each(function () { var sThisVal = (this.checked ? $(this).val() : null); var sThisName = (this.checked ? $(this).attr('name') : null); if(sThisVal !== null){ url_with_search_query += '&'+encodeURIComponent(sThisName)+'='+encodeURIComponent(sThisVal); } }); location.href = url_with_search_query; return true; Next I have some filters that sort products in A-Z and Price Low to High. How can I create an 'onchange' script to update the search query. At this moment, any new filters are overwriting to existing search query, I want it to add on to it. HTML: <div class="tab-filter"> <select class="selectpicker" data-style="btn-select" data-width="auto" onchange="getQueryParams();"> <option>Sort by</option> <option value="?q={{ query }}&amp;sort=0 ">Price: Low - High </option> <option value="?q={{ query }}&amp;sort=1 ">Price: High - Low </option> <option value="?q={{ query }}&amp;sort=2 ">Retailer: A-Z</option> <option value="?q={{ query }}&amp;sort=3 ">Retailer: Z-A</option> </select> -
start-stop-daemon spawning 2 processes
trying to make my django site as service. Here is the code: DIR=/home/karonator/pk-akr DAEMON=$DIR/manage.py DAEMON_NAME=somename DAEMON_OPTS="runserver 0.0.0.0:7777" DAEMON_USER=karonator PIDFILE=/var/run/$DAEMON_NAME.pid . /lib/lsb/init-functions do_start () { log_daemon_msg "Starting system $DAEMON_NAME daemon" start-stop-daemon --start --background --pidfile $PIDFILE --make-pidfile --user $DAEMON_USER --chuid $DAEMON_USER --exec /usr/bin/python $DAEMON -- $DAEMON_OPTS log_end_msg $? } This works but start-stop-daemon spawning two processes: Any ideas how to fix it? As the result the stop and restart functions not works correctly. -
UWSGI socket changes group and refused connection, resulting in 502 bad gateway
I'm running a Django app with NGINX/UWSGI. I call uwsgi : /home/rootadmin/.virtualenvs/data_collection/bin/uwsgi --ini /etc/uwsgi/sites/data_collection_project.ini data_collection_project.ini: [uwsgi] project = data_collection_project base = /data_nfs/data_collection_project chdir = %(base) home = /home/rootadmin/.virtualenvs/data_collection module = data_collection_project.wsgi:application master = true processes = 2 socket = /data_nfs/data_collection_project/%(project).sock chmod-socket = 666 As a result, a .sock is created. Using ls -l I see the socket as srw-rw-rw- 1 rootadmin rootadmin 0 Jul 30 12:24 data_collection_project.sock At this point, my site works fine. At some point, which I've been unable to pinpoint, my website starts retuning 502 bad gateway to each request. At this point, i found that the group of the .sock changed to www-data srw-rw-rw- 1 rootadmin www-data 0 Jul 30 12:25 data_collection_project.sock At this point, my nginx error.log also raises this error: 2017/07/30 12:25:34 [error] 1940#0: *652 connect() to unix:///data_nfs/data_collection_project/data_collection_project.sock failed (111: Connection refused) while connecting to upstream, client: client_ip, server: my_ip, request: "GET /admin/binaryQuestionApp/point/ HTTP/1.1", upstream: "uwsgi://unix:///data_nfs/data_collection_project/data_collection_project.sock:", host: "my_website_", referrer: "https://my_website/admin/binaryQuestionApp/" I do not know why/ from where this change happens. My website used to run fine for the month i've been using it. Yet, today, i ran a sudo reboot for the first time and ever since this happens. How to fix this? -
Pass data from DB to React component
I'm trying to code the UI for our comments app, (project repo https://github.com/Lv-246Python/myTrip) and i just can't get how i should structure my React components and what's the flow for getting real comments from DB to be rendered. I know i have to use 'axios' but how do i code that "this is field is going to be filled with what 'axios' gives you"? Here's my code below and if you need more my current branch is (33-comment-react-component), thanks. comment.js import React from 'react'; import Paper from 'material-ui/Paper'; import Divider from 'material-ui/Divider'; import List from 'material-ui/List/List'; import {CommentItem} from './comment_item'; import {CommentForm} from './comment_form'; const styles = { paper: { paddingLeft: 15, paddingRight: 15, paddingBottom: 15, marginLeft: 15, marginRight: 15, marginBottom: 15 }, divider: { backgroundColor: 'grey' } }; export default class Comment extends React.Component { render() { return ( <Paper zDepth={5} rounded={false} style={styles.paper}> <div> <List> <CommentItem/> <CommentItem/> </List> <Divider style={styles.divider}/> <CommentForm/> </div> </Paper> ); } } comment_item.js import React from 'react'; import {Card, CardActions, CardHeader, CardText} from 'material-ui/Card'; import Avatar from 'material-ui/Avatar'; import FlatButton from 'material-ui/FlatButton'; import ListItem from 'material-ui/List/ListItem'; const styles = { avatar: { marginRight: 10, marginBottom: 10 }, commentText: { fontSize: 20 }, }; export class … -
Django 'str' object has no attribute 'values' in rest_framework
When I use rest_framework to implement the api models.py: class Store(models.Model): name = models.CharField(max_length=20) notes = models.TextField(blank=True, default='') def __str__(self): return self.name myapp/api.py: class StoreSerializer(serializers.ModelSerializer): class Meta: model = Store class StoreViewSet(viewsets.ModelViewSet): queryset = Store.objects.all() serializer_class = StoreSerializer permission_classes = (permissions.IsAuthenticatedOrReadOnly,) project/api.py v1 = routers.DefaultRouter() v1.register('store',StoreViewSet) v1.register('stores/menu_item',MenuItemViewSet) urls.py urlpatterns = [ url(r'^api/v1/', include(v1.urls)), ] I met the following traceback AssertionError at /api/v1/store/ ("Creating a ModelSerializer without either the 'fields' attribute or the 'exclude' attribute has been deprecated since 3.3.0, and is now disallowed. Add an explicit fields = 'all' to the StoreSerializer serializer.",) So I add the fields = '__all__' to fix this error class StoreSerializer(serializers.ModelSerializer): fields = '__all__' class Meta: model = Store But next I met this traceback Based on that traceback I don't know whch part is I missed. Thanks. -
How to fix?"django.db.utils.OperationalError"
File "C:\Users\User\git_projects\work\e-resources\ve\lib\site-packages\django\db\backends\postgresql\base.py", line 176, in get_new_connection connection = Database.connect(**conn_params) File "C:\Users\User\git_projects\work\e-resources\ve\lib\site-packages\psycopg2__init__.py", line 164, in connect conn = _connect(dsn, connection_factory=connection_factory, async=async) django.db.utils.OperationalError: ┬└╞═╬: яюы№чютрЄхы№ "eresources" эх яЁю°╕ы яЁютхЁъє яюфышээюёЄш (яю ярЁюы■) -
How to tell if a django DB-based session has expired in browser?
I'm presently using the default database-backed sessions model in my django application. The front end is an SPA that interfaces with a REST API, and has an asynchronous login so that the user doesn't lose their page when their session times out. I'm trying to detect when the session has timed out in the browser, so that the login modal may be shown. However: If the User is no longer authorized to perform an API request because they're no longer logged in, they get a HTTP403. If the User tries to access object instances that belong to other Users, they also get a HTTP403. So I need to distinguish between the two 403s. My immediate instinct was to compare the expiry of the sessionid cookie and now, but: The cookie is httpOnly The expiry is not set Hence my question: how can I tell, in the browser, if my django session has expired? -
How to get path of sub directory of a temporary directory in Python Django
I need to pass path of subdirectory of a temporary directory to another function. Real scenario: User will upload a zip or tar archive then it will be extracted inside a temporary directory, now I need the path of that extracted directory. is there a way to get path of a subdirectory in case we couldn't known the name of that directory? Help me, please! Thanks in Advance! -
Python & mongoDB: Monitor database changes and push changes to clients via websocket
Im writing the backend of an app using Django 1.10 and mongoDB. The mongoDB database is populated by an external program (not Django). Django accepts websockets, and when a mongoDB change is registered, the websocket should push the new data to clients via websockets. Question: Is it possible for Django to get notified when a mongoDB database is changed (insert, update, delete)? I have looked at this lib, and if this is the answer I would love to see a working example. I can imaging the approach would look something like this: @channel_session def ws_receive(message): # If message == 'subscribe' and channel == 'mongoDB' # Listen for mongoDB changes and push changes to client -
Django: How to update specific fields in extended model of User?
I'm relatively new to Django and am stuck on this. I've been trying to create a website where users can create their accounts, view their and other member's profile pages. models.py class UserProfileInfo(models.Model): """docstring for ClassName""" user = models.OneToOneField(User) status = models.TextField(blank = True) desc = models.TextField(blank = True) portfolio_site = models.URLField(blank = True) profilepic = models.ImageField(blank = True, null = True, upload_to = 'profile_pics') def __str__(self): return self.user.username forms.py class UserForm(forms.ModelForm): password = forms.CharField(widget = forms.PasswordInput()) class Meta(): model = User fields = ('username', 'email', 'password') class UserProfileInfoForm(forms.ModelForm): class Meta(): model = UserProfileInfo fields = ('desc', 'portfolio_site', 'status', 'profilepic') So, I want the user to be able to update their status from their homepage by typing into a text box. index.html (the homepage from where the user can update their status) <form method="POST" action="{% url 'app5:user_status' user.username %}"> {% csrf_token %} <div class="form-group"> <label for="inputlg"></label> <input class="form-control input-lg" id="inputlg" type="text" name='status' placeholder="How are you feeling?"> </div><center> <input type="submit" name='submitbtn' value='Add Status'> </center> </form> Here's what my function to update the status in views.py looks like: def user_status(request,username): if request.method == 'POST': mystatus = request.POST.get('status') user = User.objects.get(username=username) user.userprofileinfo.status= mystatus user.save() return redirect('app5:profilepage',username=username) However, it does not work. If I … -
Django - validating input without form class
So basically i am trying to validate data from request.POST and then use it. I know how to do this if i would have used a form class but i have an issue with that since the form class needs to be populated with a key from an iteration in the template. Also i can't seem to find a way to make a class instance in the view and then populate it with the request.POST info. So basically what i am looking for is a way to either make a formclass that i can assign the value of a field too during a for x in model: loop in template or a way to make a similar class form instance in the view then populate it with request.POST so i can validate the info. The goal is to validate the information but i have to be able to to assign values to the form in template during a iteration. Anyone knows how to go about this problem? -
Django unique combination is duplicate
django.db.utils.IntegrityError: (1062, "Duplicate entry 'Restauarant' for key 'restaurants_restaurant_name_address_id_e074fa2e_uniq'") Above is the error. As shown in the model for a restaurant I have defined that the address and name should be unique together. Though when I create a restaurant, if the combination of name and address are unique but either of them are the same as another restaurant object then this fails. E.G. "Restaurant" at "10 Something Street" would fail if there were an existing object like "Restaurant" at "35 Something Else Street." Any suggestions would be great, thanks. class Restaurant(models.Model): user = models.ForeignKey(User) name = models.CharField(max_length=128) street_number = models.CharField(max_length=10) route = models.CharField(max_length=128) locality = models.CharField(max_length=116) # 2* 58 (longest place name) administrative_area_level_1 = models.CharField(max_length=116, default=None) postal_code = models.CharField(max_length=12) country = CountryField() slug = models.SlugField(max_length=128) profile_image = models.ImageField(upload_to='profile_images', blank=True) menu = models.ManyToManyField(Menu) favourites = models.IntegerField(default=0, editable=False) is_active = models.BooleanField(default=True) class Meta: # ensures unique combination, prevents duplicate 'restaurants' unique_together = (( 'name', 'street_number', 'route', 'locality', 'administrative_area_level_1', 'postal_code', 'country' )) -
Django class decorators. Viewset context params
Sentry decorator file: import logging from django.utils.decorators import method_decorator def class_decorator(decorator): def inner(cls): orig_dispatch = cls.dispatch @method_decorator(decorator) def new_dispatch(self, request, *args, **kwargs): print(type(request)) <-- <class 'django.core.handlers.wsgi.WSGIRequest'> return orig_dispatch(self, request, *args, **kwargs) cls.dispatch = new_dispatch return cls return inner def sentry_logger1(func): def sentry_log_fn(self, request): print(type(request)) logging.getLogger(__name__).error(func.__qualname__, exc_info=True, extra={ 'request': { 'body': request.body if (request and request.body) else {}, 'params': request.query_params if (request and request.query_params) else {} } }) return func(self, request) return sentry_log_fn def sentry_logger2(func): def sentry_log_fn(self, request=None): //Change print(type(request)) logging.getLogger(__name__).error(func.__qualname__, exc_info=True, extra={ 'request': { 'body': request.body if (request and request.body) else {}, 'params': request.query_params if (request and request.query_params) else {} } }) return func(self) //Change return sentry_log_fn Viewset.py: @class_decorator(sentry_logger1) class AppointmentViewSet(viewsets.GenericViewSet): queryset = Appointment.objects() serializer_class = AppointmentSerializer #@sentry_logger1 <-- This (when uncommented) works just fine to log unhandled exceptions (explicit 1/0 for example) in sentry UI def create(self, request): 1/0 #@sentry_logger1 <-- This (when uncommented) works just fine to log unhandled exceptions (explicit 2/0 for example) in sentry UI def list(self, request): 2/0 Using @class_decorator(sentry_logger1) throws following stack trace : Internal Server Error: /appointment Traceback (most recent call last): File "/Users/devenwalia/Downloads/docon/lib/python3.6/site-packages/django/core/handlers/exception.py", line 39, in inner response = get_response(request) File "/Users/devenwalia/Downloads/docon/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/Users/devenwalia/Downloads/docon/lib/python3.6/site-packages/django/core/handlers/base.py", … -
Django - Queryset to get all related details to a Model
I have a Book model which has multiple authors, genres. Here are the models which have all the ForeignKey relations. models.py class Book(models.Model): title = models.CharField(max_length=200) class Author(models.Model): name = models.CharField(max_length=100) class Genre(models.Model): genre_name = models.CharField(max_length=50) class Book_author(models.Model): book = models.ForeignKey(Book) author = models.ForeignKey(Author) class Book_genre(models.Model): book = models.ForeignKey(Book) genre = models.ForeignKey(Genre) view.py def book_detail(request, book_id): book = Book.objects.get(pk=book_id) # how can i get iterated multiple authors, books attached to book dictionary return render(request, 'detail.html', {'book': book}) book object example: book = { title: 'some title', authors: [ { id: 1, name: 'name1' }, { id: 2, name: 'name2' } ], genres: [ { id: 1, genre_name: 'somegenre1' }, { id: 1, genre_name: 'somegenre2' } ] } How can i get the proper book dictionary from my detail_view... -
Django writing a custom decorator
I am building a forum. When processing urls there is a board id and a board name. The name is for readability and the id is what fetches the board. This means if the name is wrong or has changed I want to redirect the user to the proper url. Some searching has led me to decorators but I cannot find any resource teaching me how to use them. # urls.py ... url(r'^boards/(?P<board_id>\d+)/(?P<board_name>[^/]+)/$', views.board, name='board'), ... # views.py @redirect_if_wrong_boardname def board(request, board_id, board_name): ... return render(request, 'forums/board.html', {'board': board}) How would I implement the following logic in a decorator? board = Board.objects.all().get(pk=pk) if (board.name != name): return redirect(request.get_full_path().replace(name, board.name, 1)) -
Django - Angular2 Integration
Seeking a Full Zero to Hero tutorial in Django(1.11) - Angular2 integration. Google return Angularjs integrations only. Kindly help out. -
Amazon EC2 instance pinging but django server is not accessible from outside
I have my django application on ec2 instance. I am able run it on ec2 instance on localhost:8000. When I try to access that django application from outside of that ec2 instance, it doesn't show me "this site can't be reached". It is pining -
Django column wagtailcore_page.draft_title does not exist
Django==1.11.3, wagtail==1.11.1 I did a backup of my PostgreSQL on remote server and did a restore on my local server so I can get an exact copy of all the changes. I've done it this way for a long long time and its always worked like a charm. But this time, I did the restore and got the error below: column wagtailcore_page.draft_title does not exist LINE 1: ...ore_page"."numchild", "wagtailcore_page"."title", "wagtailco... I deleted my database and restored fresh but that did nothing. I deleted all migrations, did the --fake migration to try and reset, but nothing; still getting the error. I am at a loss on this one and could use some feedback. Thank you. Here's my trace file: Environment: Request Method: GET Request URL: http://127.0.0.1:8001/ Django Version: 1.11.3 Python Version: 3.5.0 Installed Applications: ['app', 'home', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.sites', 'django_summernote', 'rest_framework', 'wagtail.contrib.settings', 'wagtail.contrib.modeladmin', 'wagtail.wagtailcore', 'wagtail.wagtailadmin', 'wagtail.wagtaildocs', 'wagtail.wagtailsnippets', 'wagtail.wagtailusers', 'wagtail.wagtailimages', 'wagtail.wagtailembeds', 'wagtail.wagtailsearch', 'wagtail.wagtailsites', 'wagtail.wagtailredirects', 'wagtail.wagtailforms', 'wagtail.contrib.wagtailsitemaps', 'wagtail.contrib.wagtailroutablepage', 'wagtail.contrib.wagtailstyleguide', 'wagtailmenus', 'compressor', 'taggit', 'modelcluster', 'docs', 'wagtail.contrib.table_block'] Installed Middleware: ['django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'wagtail.wagtailcore.middleware.SiteMiddleware', 'wagtail.wagtailredirects.middleware.RedirectMiddleware'] Traceback: File "/Users/rooster/.pyenv/versions/3.5.0/envs/alpha_omega/lib/python3.5/site-packages/django/db/backends/utils.py" in execute 65. return self.cursor.execute(sql, params) The above exception (column wagtailcore_page.draft_title does not exist LINE 1: ...ore_page"."numchild", "wagtailcore_page"."title", "wagtailco... …