Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Use login_required decorator in Django 2.1
I have a basic requirement, I have a login page, where after a user logs in, it redirects to a page. If the user is not logged in, and he opens that url, he gets redirected to the login page and after successful login, he is redirected to the url he opened. Login : http://127.0.0.1:8000/w_dashboard/login/ Another page : http://127.0.0.1:8000/w_dashboard/roaster/ I have an app named w_dashboard . Now in setting page, I have declared Settings.py STATIC_URL = '/static/' LOGIN_URL = '/w_dashboard/login/' Login.html <div class="login"> <form action='{% url "login" %}' method="POST"> {% csrf_token %} <input type="text" placeholder="username" name="user" id="user"><br> <input type="password" placeholder="password" name="password" id="pwd"><br> <input type="submit" value="Login"> </form> <!-- Categories: success (green), info (blue), warning (yellow), danger (red) --> {% for message in messages %} <div class="alert alert-{{ category }} alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button> <!-- <strong>Title</strong> --> {{ message }} </div> {% endfor %} </div> w_dashboard's URL file : from django.urls import path from . import views from django.conf.urls import url urlpatterns = [ #url(r'^$', views.HomePageView.as_view()), url(r'^$', views.LoginPageView.as_view()), url(r'^login/$', views.LoginPageView.as_view(), name = 'login'), url(r'^roaster/$', views.RoasterPageView.as_view(), name="roaster"), url(r'^manual_login/$', views.RoasterPageView.as_view(), name="mLogin"), ] Now, w_dashboard views.py : class LoginPageView(TemplateView): def get(self, request, *args, **kwargs): if request.method == 'GET': print("Get request") return … -
Django cannot makemigrations for a nested app
I am trying to create a nested app in my django project, but makemigrations is not detecting it. I have the following directory structure: myproject/ myproject/manage.py myproject/myproject/ myproject/myproject/__init__.py myproject/myproject/settings.py myproject/myproject/urls.py myproject/myproject/wsgi.py myproject/parentapp/ myproject/parentapp/__init__.py myproject/parentapp/apps.py myproject/parentapp/models.py myproject/parentapp/childapp/ myproject/parentapp/childapp/__init__.py myproject/parentapp/childapp/apps.py myproject/parentapp/childapp/models.py And here is some relevant code: myproject/myproject/settings.py: INSTALLED_APPS = [ ... 'parentapp', 'parentapp.childapp', ] myproject/parentapp/childapp/__init__.py: default_app_config = "parentapp.childapp.apps.ChildAppConfig" myproject/parentapp/childapp/apps.py: from django.apps import AppConfig class ChildAppConfig(AppConfig): name = 'parentapp.childapp' myproject/parentapp/childapp/models.py: from django.db import models class Child(models.Model): class Meta: app_label = "parentapp.childapp" name = models.CharField(max_length=100) I see the following behavior when trying to make migrations: $ myproject/manage.py makemigrations No changes detected $ myproject/manage.py makemigrations childapp No changes detected in app 'childapp' $ myproject/manage.py makemigrations parentapp.childapp 'parentapp.childapp' is not a valid app label. Did you mean 'childapp'? What am I doing wrong? I see loads of other reusable apps that have nested apps (django-allauth, for example). -
Memory usage of Python interpreter: psutil vs /proc/self/status
I am doing this import django django.setup() import os import psutil process = psutil.Process(os.getpid()) print(process.memory_info_ex().vms/1024**2) print(open("/proc/self/status").read())' on one line: python -c 'import django; django.setup(); import os; import psutil; process = psutil.Process(os.getpid()); print(process.memory_info_ex().vms/1024**2); print(open("/proc/self/status").read())' to see how much memory gets used by django.setup(). Output: from psutil: 575 from /proc/self/status: Name: python -c impor State: R (running) Pid: 5045 PPid: 2970 VmPeak: 589104 kB VmSize: 589104 kB VmLck: 0 kB VmPin: 0 kB VmHWM: 142764 kB VmRSS: 142764 kB RssAnon: 113524 kB RssFile: 29240 kB RssShmem: 0 kB VmData: 238676 kB VmStk: 132 kB VmExe: 3104 kB VmLib: 78912 kB VmPTE: 876 kB VmSwap: 0 kB HugetlbPages: 0 kB Threads: 4 voluntary_ctxt_switches: 2855 nonvoluntary_ctxt_switches: 1622 Which value from /proc/self/status does 575 from psutil belong to? -
How to make an auto field using django class based view?
So I want the publisher field to be auto filled with the username of the member who post the service .. How can I do this using Class Based View ? models.py class Service(models.Model): serviceTitle = models.CharField(max_length=100, primary_key=True) deadlineDate = models.DateField(null=True, help_text='please Enter the date in the format : year-month-day') price = models.DecimalField(max_digits=10, decimal_places=3, null=True, default=10.00) serviceDescription = models.CharField(max_length=600, null=True, default='Descripe your service') category = models.ForeignKey(Category, related_name='categories', on_delete=models.CASCADE, null=False, default='Engineering') publisher = models.ForeignKey(User_Model, on_delete=models.CASCADE, null=True) def __str__(self): return self.serviceTitle def get_absolute_url(self): return reverse('serviceDetails', kwargs={'pk':self.pk}) views.py class CreateService(CreateView): model = models.Service fields = ('serviceTitle', 'serviceDescription', 'category', 'deadlineDate', 'price', 'publisher') template_name = 'postNewService.html' -
resources to master python and django for backend development
I've just started to learn python for my next internship, which about python and django coding. please are there any detailed resources to learn these 2 technologies. I'm studying a python coding course on Udemy. But I'm not it doesn't go into details. Thank you -
How to pass variable or values from HTML drop down form with options to Django views
How to pass variable or values from HTML drop down form with options to Django views. i tried below methods but unable to get the values of form in views. my concern here is using class type "button" instead of "submit" can anyone help me on this. i tried request.POST.get('name', '') but i am getting None or null only. index.html: <html> <head> <style> .button { background-color:orange; /* Green */ border: none; color:blue; padding: 15px 32px; text-align: center; text-decoration:blue; display: inline-block; font-size: 14px; margin: 3px 1px; cursor: pointer; } .button { color: white; } </style> <title>my TOOL</title> </head> <body> <tr> <td colspan=2><center><font size=4><b><font color="blue">my TOOL</b></font></center></td> </tr> <form action="/index.html" > <table width="40%" bgcolor="#37a5dd" align="center"> <tr> <td>Name:</td> <td><select name="Nane"> <option value="1">vivek</option> <option value="2">vihaan</option> <option value="3">siri</option> <option value="4">na</option> </select></td> </tr> <tr> <td>age:</td> <td><select name="age"> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> </select></td> </tr> <tr> <td> <td><input type="button" class="button" button onclick="location.href='/submit/';" align="center" value="ok" /></td> </td> <tr> </table> </form> </body> </html> ws views.py : # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect,HttpResponse,render_to_response from django.template.response import TemplateResponse from fota.models import SourceBuild from django import forms import sys,os import set1 from django.template.loader import render_to_string # Create your views here. import json … -
How to run django remotely?
I'm running Yang Explorer in my remote Ubuntu Server. I run it using start.sh in the repository. Activating virtualenv .. Starting YangExplorer server .. Use http://localhost:8088/static/YangExplorer.html Performing system checks... System check identified no issues (0 silenced). January 31, 2019 - 08:35:31 Django version 1.8.3, using settings 'server.settings' Starting development server at http://localhost:8088/ I would like to open the application in my browser using my machine. The IP address given for the server is 152.66.xx.xx -
Adding skills using ForiegnKey, ('+' sign) in skill_group, It is reflecting in dropdown immediately in django1.9 but not in django1.11
I integrate my code from django1.9 to django1.11. In this, my every ForiegnKey admin scree is not working as expected. Adding group while creating single entity by press '+' sign is not reflecting immediately in dropdown in django1.11 but same action is working fine in dajngo1.9. Both codes are same. Model.py: class Skill(CustomModel): """ Class representing a Skill. """ name = models.CharField(_('Name'), max_length=72, null=False, blank=False, db_column='name', help_text=_('Enter name of skill.\ 64 characters max.'), validators=[ValidateData("name", True), MaxLengthValidator(64)],) """ Maximum 64 characters are allowed and it can not be null """ skill_group = models.ForeignKey('SkillGroup', db_column='skill_group_id', verbose_name=_('Skill Group'), related_name='skill_set', limit_choices_to={'status':'A'}, help_text=_("Represents skill group to\ which this skill is associated.") ) View.py: class AddSkill(View): """Class based view to add new Skill""" @method_decorator(has_perms_to('AddSkill-get')) def get(self, request, skill_group_id): """ **Type:** Public. **Arguments:** - request: Http request object. - skill_group_id: Two character id of skill_group. **Returns:** Render the AddSkill form. **Raises:** Nothing. This methods handles http get request. Following steps are performed in this method: - Return rendered form template by passing AddSkill form. """ skill_group = get_object_or_404(SkillGroup, pk=skill_group_id) form = SkillForm(request=request) return render(request, 'skill_repo/add_skill.html', {'form': form, 'skill_group':skill_group, 'value':True}) @method_decorator(has_perms_to('AddSkill-post')) def post(self, request, skill_group_id): """ **Type:** Public. **Arguments:** - request: Http request object. - app_code: Two character … -
How to enable python setup application on cPanel?
I need to deploy a django application on cPanel so I found some tutorials that I can follow but the problem is that I'am stuck in the first step because under SOFTWARE I couldn't find python setup application So I am wondering how can I enable or add this software -
How to order_by ini views.py Django by user.first_name
I have the model which has an attribute called user. user = models.OneToOneField(User) Then, I want to sort my views order_by user.first_name. For Example: group = Generus.objects.filter(klp='Marbar').order_by('jenis_kelamin','user.first_name') It is working if just to order_by('jenis_kelamin','user'), but not for order_by('jenis_kelamin','user.first_name'). Is there any solutions? -
Get input prompt from client on live server - Django Python
I came across a situation where i am finding no solution to escape. I am using a chrome web driver to scrape data from a social site in Django Python. The point on which i got stuck is when that site is demanding two step verification.I am getting the verification code in an input prompt like this: vrfctnCode = input('Please enter verification code:') and passing it to the chrome driver. Everything is running fine on my localhost but problem occurs when i am going to deploy this site. It's giving me Exception because no terminal is appeared to get the input from the user: Exception Type: EOFError Exception Value: EOF when reading a line What i want that it should get the input from the client same as alert box input alert box. I have tried tkinter and easygui to solve the problem but it comes up with No Display found I cannot get the code by using an input form on the front end because chrome driver will quit or restart in case of page redirect. -
How can I sort a model that contains user as a foreign key to a page that shows every user's data?
I want to make my homepage main that shows every user's information. on Models.py (simplified, not actual code): class User(models.Model): name = models.CharField() level = models.IntegerField() class History(models.Model): name = models.ForeignKey('User', on_delete = models.CASCADE) history = models.CharField() on HTML: {% for user in users %} <p>{{ user.name }}</p> {% for history in histories.objects.filter(name__exact=User.id) %} <p> {{ history }} </p>//sorted history that contains 'user' as ForeignKey {% endear %} <p>{{ user.level }}</p> {% endfor %} Showing an information in User model was successful, using above method, but I couldn't sort History model for 'user'. How can I show this model, getting key from 'user' and sort it? I'm now using the latest version of Django, 2.1, and I already tried to get pk value from 'user', and send it to the views.py, but it was not helpful. Expected: <p>User 01</p> //Name <p>Changed name user01 to User 01</p> <p>Level increased to 25</p> <p>Level increased to 26</p> //History <p>LV 26</p> //Level <p>User 02</p> //Name <p>Level increased to 32</p> <p>Changed name user02 to User 02</p> <p>Level increased to 33</p> //History <p>LV 33</p> //Level Actual: <p>User 01</p> <p></p> <p>Lv 26</p> <p>User 02</p> <p></p> <p>Lv 33</p> -
passing context into ModelSerializer gives none in Django
How to pass context={'request'=request} into a ModelSerializer nested with a HyperlinkedModel Serializer field ? When I'm trying request.get('view').request.FILES I get a Nonetype attribute error -
Django Authentication through API
I want to provide some API such as login and logout through ReactJS interface. I see the Django document here that accounts/ provides some urls such as login and logout. Is that possible that I just leverage the login and logout api under accounts/ without creating template and try them out in Postman? I tried with POST request: { "username": "admin", "password": "admin" } and cookie with csrfmiddlewaretoken and csrftoken but got the error Forbidden (CSRF token missing or incorrect.): /accounts/login/ -
A problem with 'manage.py migrate' it gives me an error
I made a variable 'user' in the class 'Service' in 'models.py' which is a foreign key of another class then I gave it an attribute 'default='None'' .. I run 'manage.py makemigrations' then 'manage.py migrate' but it gave me the error like this: packages\django\db\models\fields\__init__.py", line 965, in get_prep_value return int(value) ValueError: invalid literal for int() with base 10: 'None' .. so I deleted the variable 'user' but it still gave me the same error! I tried to show migrations and it is like this: services [X] 0001_initial [X] 0002_auto_20190126_1417 [X] 0003_auto_20190126_1423 [X] 0004_auto_20190126_1425 [X] 0005_auto_20190126_1436 [X] 0006_auto_20190127_1434 [X] 0007_auto_20190128_0915 [X] 0008_service_user [ ] 0009_auto_20190130_1855 [ ] 0010_auto_20190130_1856 [ ] 0011_auto_20190130_1926 [ ] 0012_auto_20190130_1928 [ ] 0013_service_user [ ] 0014_remove_service_user [ ] 0015_service_publisher I tried to delete the variable and make another one called it 'publisher' gave it attribute 'null=True' but it didn't work models.py from django.db import models from django.urls import reverse_lazy, reverse from firstapp.models import User_Model class Category(models.Model): categoryName = models.CharField(max_length=150, primary_key=True) def __str__(self): return self.categoryName class Service(models.Model): serviceTitle = models.CharField(max_length=100, primary_key=True) deadlineDate = models.DateField(null=True, help_text='please Enter the date in the format : year-month-day') price = models.DecimalField(max_digits=10, decimal_places=3, null=True, default=10.00) serviceDescription = models.CharField(max_length=600, null=True, default='Descripe your service') category = models.ForeignKey(Category, … -
A solution for combinations of elements types, when any of the types can have zero elements
I have 3 Models/Entities, A,B,C (backend is django). On front-end I have 3 empty boxes, where I need to add instances of A,B,C. The number of instances for A,B,C available can be 0 to infinite. Ideally, I should show 1 of A, 1 of B and 1 of C, but sometimes any of the Entities can have no instances. Can be none, one or multiple with no instances. My base approach is to use ifs but it is not efficient, see just one of the branches in pseudo-code: if not C: if A: if not B: show up to 3 of A if they are available elif B: if at least 2 of A: show 2 of A and 1 Of B if 1 of A: show 1 of A and up to 2 of B elif not A: show up to 3 of B if exist Besides being tens of ifs on all branches, it doesn't scale, for example if I add a new Entity and/or box in the future. So, I'm looking for an algorithm that can scale. I'm using Python,django, PostgreSQL. I extract the data, simple: A.objects.all().order_by('-id')[:3] -
csrf token working on chromium (ubuntu) but not on chrome (windows)
I have this snippet of jquery code that's supposed to get the csrf-token so ajax request works with django. /*CSRF Code */ function csrfSafeMethod(method) { // these HTTP methods do not require CSRF protection return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method)); } function sameOrigin(url) { // test that a given url is a same-origin URL // url could be relative or scheme relative or absolute var host = document.location.host; // host + port var protocol = document.location.protocol; var sr_origin = '//' + host; var origin = protocol + sr_origin; // Allow absolute or scheme relative URLs to same origin return (url == origin || url.slice(0, origin.length + 1) == origin + '/') || (url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') || // or any other URL that isn't scheme relative or absolute i.e relative. !(/^(\/\/|http:|https:).*/.test(url)); } /* End CSRF Code */ $(document).ready(function() { var username_ok = false; var email_ok = false; var csrftoken = $.cookie('csrftoken'); $('.signin-btn').click(function(event) { var username = $('#username-2').val(); var password = $('#password').val(); if (username && password) { event.preventDefault(); var data = {username, password}; $.ajax({ url: "/signin-ajax", type: "POST", dataType: 'json', beforeSend: function(xhr, settings) { if (!csrfSafeMethod(settings.type) && sameOrigin(settings.url)) { // Send the token to same-origin, relative URLs … -
Reset Postgres Database on Heroku in Deploy Time
I've got a Django website with PostgreSQL backend and I'm using gitlab ci/cd to test and deploy it on Heroku. I do lots of new changes in models every time and I want the database to be cleaned before Heroku runs: python manage.py migrate on it. I know that I can run heroku pg: reset DATABASE from my computer each time, but I am searching for a way to do this automatically as a step in deployment. This is the content of my .giltab-ci.yml file: image: python:3.6.5 services: - postgres:latest variables: POSTGRES_DB: asdproject POSTGRES_USER: postgres POSTGRES_PASSWORD: asdpassword test: script: - whoami - export PGPASSWORD=$POSTGRES_PASSWORD - apt-get update -qy - apt-get install -y python-dev python-pip - pip install -r requirements.txt - python manage.py test --settings=backend_settings.gitlab_runner_settings production: type: deploy script: - apt-get update -qy - apt-get install -y ruby-dev - gem install dpl - dpl --provider=heroku --app=asd-g7 --api-key=$HEROKU_PRODUCTION_API_KEY only: - master Where should I put the reset command? and how? -
How do I filter based on instance type when using Django-Polymorphic package?
I'm a bit stuck on having to create a Django query to filter based on instance type when using django-polymorphic. from polymorphic.models import PolymorphicModel class ClassA(models.Model): project = select2.fields.ForeignKey(Project, related_name="class_a") some_value = models.FloatField(default=0.0) class Project(PolymorphicModel): topic = models.CharField(max_length=30) class ArtProject(Project): artist = models.CharField(max_length=30) class ResearchProject(Project): supervisor = models.CharField(max_length=30) How do I go about filtering ClassA objects where its' project is a "ArtProject"? ClassA.objects.filter( ...? ).update(some_value=0.0) I've tried breaking it up by going: art_set = ArtProject.objects.all().values_list("project__id", flat=True) ClassA.objects.filter(id__in=art_set).update(some_value=0.0) Error: "You can't specify target table 'ClassA' for update in FROM clause" Thanks in advance! -
NoReverseMatch at /students/viewdata/
i'm editing data to edit my gr_register table but it is not working its giving me error editgr with argument '('',)' not found Reverse for 'editgr' with arguments '('',)' not found. 1 pattern(s) tried: ['students/editgr/\(\?P(?P[^/]+)\\d\+\)$'] views.py def edit_gr(request, pk): grno = get_object_or_404(gr_register, pk=pk) form = gr_registerForm(request.POST or None, instance=grno) if request.method == "POST": if form.is_valid(): form.save() return redirect('home') else: form = gr_registerForm(instance=grno) return render(request, 'students/editgr.html', {'form': form}) editgr.html {% extends 'authenticate/base.html' %} {% block body %} <div class="container"> <form method="POST"> <br/> {% csrf_token %} <h4>Editing Gr</h4> <hr/> {% for field in form %} <div class="form-group row"> <label for="id_{{ field.name }}" class="col-2 col-form-label">{{ field.label }}</label> <div class="col-10"> {{ field }} {{ field.errors }} </div> </div> {% endfor %} <button type="submit" class="btn btn-primary" name="button">Edit GR-Table</button> </form> </div> {% endblock %} urls.py path('editgr/(?P<pk>\d+)', views.edit_gr, name='editgr'), kindly give me any the suggestion about this issue or tell me what is the correct method to do this -
Not allowing images small than certain dimensions
I have a model that saves user profile images. If the image that is uploaded is greater than 200x200 pixels, then we resize to 200x200. If the image is right at 200x200, then we return that image. What I want now is to throw an error to the user saying that this image is too small and is not allowed. Here's what I have: class Profile(models.Model): GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female'), ) user = models.OneToOneField(User, null=True, on_delete=models.CASCADE) bio = models.CharField(max_length=200, null=True) avatar = models.ImageField(upload_to="img/path") gender = models.CharField(max_length=1, choices=GENDER_CHOICES, null=True) def save(self, *args, **kwargs): super(Profile, self).save(*args, **kwargs) if self.avatar: image = Image.open(self.avatar) height, width = image.size if height == 200 and width == 200: image.close() return if height < 200 or width < 200: return ValidationError("Image size must be greater than 200") image = image.resize((200, 200), Image.ANTIALIAS) image.save(self.avatar.path) image.close() When an image is smaller than 200px in width or height, the image should not be uploaded. However, the image is being uploaded. How can I stop this from happening? -
Django 2 Implement a communication system between authenticated user
I'm working on a project to build a freelancing site something like Fiverr, I have implemented a Gig Model, so users can create Gigs and can orders Gigs from other users. I'm facing a very confusing issues for me as: How Can I implement a communication system for user, when a user will make an order for a gig then he should be able to chat with the seller mean the Gig owner OR it should be similar to Fiverr communication. Here's my model: class Gig(models.Model): CATEGORY_CHOICES = ( ('GD', 'Graphic & Design'), ('DM', 'Digital Marketing'), ('WT', 'Writing & Translation'), ('VA', 'Video & Animation'), ('MA', 'Music & Audio'), ('PT', 'Programming & Tech'), ('FL', 'Fun & Lifestyle'), ) title = models.CharField(max_length=500) category = models.CharField(max_length=255, choices=CATEGORY_CHOICES) description = models.CharField(max_length=1000) price = models.IntegerField(blank=False) photo = models.FileField(upload_to='gigs') status = models.BooleanField(default=True) user = models.ForeignKey(User, on_delete=models.CASCADE) created_at = models.DateTimeField(default=timezone.now) def __str__(self): return self.title Any resource, links and help will be very appreciated. Thank You! -
Dynamic query Django build
create dynamic query set using Django query this case performs "AND" operation. but some time value is blank or NULL. example:- user model have name, age, and city three columns. and perform operation filter but this and query is dynamic some time 3 fields available or sometimes one or maybe two how to write a dynamic query. -
how to clear the 'The joined path is located outside of the base path component'?
i am try to add the static fills in python manage.py collectstatic but doesn't work settings.py STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'yuvaraj/static/') ] STATIC_ROOT = os.path.join(BASE_DIR, 'static') STATIC_URL = '/static/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/' urls.py urlpatterns = [ path('admin/', admin.site.urls), path('', jobs.views.home, name='home'), path('blogs/', include('blogs.urls')), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -
not able to run manage.py
I am a student using Ubuntu 18.04. I have only just started learning django and mysql. When I type 'python manage.py runserver', I get an error message saying django.db.utils.OPerationalError:(1045,"Access denied for user 'root'@'localhost'(using password: No)") Please also check the detailed error message in below: System check identified no issues (0 silenced). Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x7f2d36e7a7b8> Traceback (most recent call last): File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/backends/base/base.py", line 216, in ensure_connection self.connect() File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/backends/base/base.py", line 194, in connect self.connection = self.get_new_connection(conn_params) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/backends/mysql/base.py", line 227, in get_new_connection return Database.connect(**conn_params) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/MySQLdb/__init__.py", line 84, in Connect return Connection(*args, **kwargs) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/MySQLdb/connections.py", line 164, in __init__ super(Connection, self).__init__(*args, **kwargs2) MySQLdb._exceptions.OperationalError: (1045, "Access denied for user 'root'@'localhost' (using password: NO)") The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 120, in inner_run self.check_migrations() File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/core/management/base.py", line 442, in check_migrations executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/migrations/executor.py", line 18, in __init__ self.loader = MigrationLoader(self.connection) File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/migrations/loader.py", line 49, in __init__ self.build_graph() File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/migrations/loader.py", line 212, in build_graph self.applied_migrations = recorder.applied_migrations() File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 61, in applied_migrations if self.has_table(): File "/home/edwardkim/syseng/venv/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 44, in has_table return self.Migration._meta.db_table in …