Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Pipenv installationError: Command "python setup.py egg_info" failed with error code 1 in
I have recently moved over to using pipenv and every now and then I get the following error when trying to install packages: $ pipenv lock --clear --verbose pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in $ pipenv install social-auth-core line 704, in from_line line, extras = _strip_extras(line) TypeError: 'module' object is not callable $ python setup.py egg_info (k, v) for k, v in attrs.items() File "/home/user/.local/share/virtualenvs/django-app-VE-name/lib/python3.6/site-packages/setuptools/dist.py", line 367, in __init__ for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'): AttributeError: module 'pkg_resources' has no attribute 'iter_entry_points' The github pages for the error have not been helpful, thank you -
Serving static content with Django, Gunicorn and Ngnix in shared development environment
I have seen many great answers to this question here on SO, but either I don't understand them or they don't apply to my particular circumstance. I have looked here: Serving static files with Nginx + Gunicorn + Django and many others. I have followed the recommendation in those answers and I still do not have solution that works. I hope that if I explain exactly what I am doing then maybe someone will tell me where I went wrong. I developing in a shared environment with several other teams and we share an ngnix server. I have a Django project on this shared server, sre-dev.example.com. The path to the Django project is /apps/capman/capman_port10001/capman. In my settings.py I have these values set: STATIC_ROOT = '/apps/capman/capman_port10001/capman/static' STATIC_URL = '/static/' INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'corsheaders', 'rest_framework', 'rest_framework.authtoken', ... 'django_db_logger', 'rest_framework_swagger' ] I have created a /etc/nginx/sites-enabled directory and sym link, ln -s /apps/capman/capman_port10001/capman/nginx.conf caasa-dev.example.com I also created alias (CNAME), caasa-dev.example.com in our DNS for sre-dev. And in added a nginx.conf file, /apps/capman/capman_port10001/capman/nginx.conf with the contents of: server { listen 10001; server_name caasa-dev.example.com; location /static { alias /apps/capman/capman_port10001/capman/static/; } } I have executed ... python manage.py collectstatic ... … -
RuntimeError: Model class users.models.User doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS
there I am having trouble searching for the solution for the error posted above for a long time. I looked at several of other similar questions on StackOverFlow but could not figure it out. The exact error is the following: Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10473e840> Traceback (most recent call last): File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run autoreload.raise_last_exception() File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception raise _exception[1] File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute autoreload.check_errors(django.setup)() File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/utils/autoreload.py", line 225, in wrapper fn(*args, **kwargs) File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/apps/registry.py", line 120, in populate app_config.ready() File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 24, in ready self.module.autodiscover() File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover autodiscover_modules('admin', register_to=site) File "~/@Python_project/webservice/venv/lib/python3.6/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules import_module('%s.%s' % (app_config.name, module_to_search)) File "~/@Python_project/webservice/venv/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "~/@Python_project/webservice/applications/users/admin.py", line 1, in <module> from applications.users import models File "~/@Python_project/webservice/applications/users/models.py", line 38, in <module> … -
Django Rest Framework update() with kwargs from validated_data
Can I update instance in one line without specifying all instance fields? For example: def update(self, instance, validated_data): instance.name = validated_data.get('name', instance.name) instance.address = validated_data.get('address', instance.address) instance.save() return instance So imagine if there's many more fields next to name and address. Can I do something extracting kwargs from validated_data? Just like in create() method: def create(self, validated_data): return Person.objects.create(**validated_data) -
Django : array within a query string as foo[]=bar1&foo[]=bar2
I need to prepare a Django microservice that offer the following url pattern : http://<myserver>/getinfo/?foo[]=bar1&foo[]=bar2 it seems to be a very PHP way of doing but i have to mimic it in django ... Is there a standard way in Django for both designing the URL and retrieving the querystring parameter as a list in the View ? -
Adding fields for User in admin page in django
This problem seems to be very simple, yet i can't find solution. I needed to extend my User model (add phone number) in django, and i picked the way of creating another model called UserInfo that is related 1to1 with User model. It works fine, the only problem is that I can't get the UserInfo fields (the phone number) to show up on User page in admin panel. What i tried: from app.models import UserInfo from django.contrib import admin from django.contrib.auth.models import User class UserInfoInline(admin.TabularInline): model = UserInfo class UserAdmin(admin.ModelAdmin): inlines = [UserInfoInline,] admin.site.register(UserInfo) -
Django WebDriverException at /test Message: connection refused
I am using Mozilla Firefox 59.0.2 Ubuntu 18.04 geckodriver 0.23.0 ( 2018-10-04) Selenium '3.141.0' driver = webdriver.Firefox(profile,executable_path="/usr/local/bin/geckodriver", log_path="/home/user/Project/geckodriver.log",firefox_options=firefoxOptions) when I execute it I get the following error message: WebDriverException at /test Message: connection refused -
Can't POST on django admin - Can't concat bytes to string
I'm using Django 2.0.9 and Python 3.4.2 on an apache 1and1 shared hosting. When I make any POST HTTP request to my Djando app, I get the following message: Traceback: File ".../python3.4/site-packages/django/core/handlers/exception.py" in inner 35. response = get_response(request) File ".../python3.4/site-packages/django/core/handlers/base.py" in _get_response 119. response = middleware_method(request, callback, callback_args, callback_kwargs) File ".../python3.4/site-packages/django/middleware/csrf.py" in process_view 289. request_csrf_token = request.POST.get('csrfmiddlewaretoken', '') File ".../python3.4/site-packages/django/core/handlers/wsgi.py" in _get_post 115. self._load_post_and_files() File ".../lib/python3.4/site-packages/django/http/request.py" in _load_post_and_files 302. self._post, self._files = QueryDict(self.body, encoding=self._encoding), MultiValueDict() File ".../python3.4/site-packages/django/http/request.py" in body 263. self._body = self.read() File ".../python3.4/site-packages/django/http/request.py" in read 322. return self._stream.read(*args, **kwargs) File ".../python3.4/site-packages/django/core/handlers/wsgi.py" in read 36. result = self.buffer + self._read_limited() Exception Type: TypeError at /adminlogin/ Exception Value: can't concat bytes to str I posted the trace of admin login page, but it's the same problem with any POST request. Here is my settings.py: #Cookie Domain CSRF_COOKIE_DOMAIN='mydomain.es' SESSION_COOKIE_DOMAIN = ['mydomain.es', 'www.mydomain.es', 'localhost'] BASE_URL='mydomain.es' CSRF_TRUSTED_ORIGINS=['mydomain.es'] ALLOWED_HOSTS = ['localhost', 'mydomain.es', 'www.mydomain.es'] SESSION_EXPIRE_AT_BROWSER_CLOSE=True Application definition INSTALLED_APPS = [ 'myapp.apps.MyAppConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'import_export', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_inlinecss', ] 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.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = 'myapp.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': ['...myappdir/amma/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', ], }, }, … -
When click change password is blank page but password was changed django
I create login page. My problem is with "forgotten password". User enter a mail and django send a message with link. When click on it must change password. When complet click on "Change password" we should move on next page but it is blank. But password was changed. account/urls.py from django.urls import path, reverse_lazy from django.contrib.auth import views as auth_views from . import views app_name = 'account' urlpatterns = [ path('', auth_views.LoginView.as_view(template_name='account/login.html'), name='login'), path('logout/', auth_views.LogoutView. as_view(template_name='registration/logout.html'), name='logout'), path('logout_then_login/', auth_views.logout_then_login, name='logout_then_login'), path('dashboard/', views.dashboard, name='dashboard'), path('password_change/', auth_views.PasswordChangeView. as_view(success_url=reverse_lazy('account:password_change_done')), name='password_change'), path('password_change_done/', auth_views.PasswordChangeDoneView. as_view(template_name='registration/password_change_done.html'), name='password_change_done'), path('password_reset/', auth_views.PasswordResetView. as_view(template_name='registration/password_reset_form.html', html_email_template_name='registration/password_reset_mail.html'), name='password_reset'), path('password_reset/done', auth_views.PasswordResetDoneView. as_view(template_name='registration/password_reset_done.html'), name='password_reset_done'), path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView. as_view(template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'), path('reset/done', auth_views.PasswordResetCompleteView. as_view(template_name='registration/password_reset_complete.html'), name='password_reset_complete') ] password_reset_complete.html {% extends "base.html" %} {% block title %} <p>Password was changed</p> {% endblock %} settings.py LOGIN_REDIRECT_URL = reverse_lazy('account:dashboard') LOGIN_URL = reverse_lazy('account:login') SUCCESS_URL = reverse_lazy('account:password_change_done') -
Trying to pass django-oscar products to custom template
I'm working on a custom template using a forked version of django-oscar apps (to have custom models). I am trying to display a list of all the products in the product table, just to start with. I looked at django-oscar templates but as they rely on a lot of custom tempaltetags I found it too complex to rewrite everything to work with my models. This is what I have in my views.py: def product(request): template = loader.get_template('/home/mysite/django_sites/my_site/main_page/templates/main_page/product.html') prodlist = Product.objects.all() return HttpResponse(template.render({}, request), context={'prodlist': prodlist}) And the code I am using in my template to try and display it {% for instance in prodlist%} <li>{{ instance.name }}</li> {% endfor %} However, this gives me an error TypeError at /product/ __init__() got an unexpected keyword argument 'context' /product corresponds to my product view in my urls.py This was my best guess from following tutorials and looking at other answers. What am I getting wrong? -
Django DB data delete and backup
I have one django project. Some data is restored in the Model database. But in the web, there is some function to delete such data for the new demonstration in the page. However, I don't want to complete delete such data for possible further usage like statistics. How could deal with such issues normally? I can think about transferring such data to another Model database before deleting, but is it too complicated? Or any other suggestion? Thx! -
Display log file on the page using Django
I am new to Django. I'm trying to display a log file which changes its contents dynamically because of background scripts writing into it. Now, I need to display it on my page. I'm using Django. I initially started with displaying a static file but that too isn't working. I am trying to do it using JS and no JQuery. -
Sub Columns in django admin
hH is there any libary or method to make one column and under it sub columns in django admin like on picture. Sub columns -
How to apply save_model() for inline models in Django
I used TabularInline so that I can combine Store and Image models in the same page. The problem is when saving images, the current user is supposed to be stored as a creator, and it works when saving images directly on Image page. However, if I images on Store page which having Image models as inline models, the creator is empty. I think it's because save_model() only for StoreAdmin executed. In this case, how can I apply save_model() for inline models? class ImageInline(admin.TabularInline): model = Image @admin.register(Store) class StoreAdmin(ImportExportModelAdmin, admin.ModelAdmin): form = StoreForm inlines = [ ImageInline, ] ... def save_model(self, request, obj, form, change): if not change: obj.created_by = request.user else: obj.updated_by = request.user obj.save() -
Django Error Uploading Crop Image Using JS Plugin
I wanted to upload the image in Django. I successfully integrate when is used the simple image field <input type="file" name="profile" class="form-control input-field"> But when I am using JS plugin for cropping the image and uploading then the actual field look like this <input type="file" class="form-control input-field"> <input type="hidden" name="profile_image" value="base64_string_of_crop_image"> So I am getting the validation error for a profile_image field. Anyone who can help me with this? -
Restrict API requests to first-party apps
Apologies if this has already been asked and answered, but after looking around a bunch I haven't found exactly what I am looking for. Suppose the following scenario : I have a REST API at https://api.example.com/ using the Django REST framework. I have a web client at https://example.com/ using React. I have an iOS app using React Native. Third-party apps are allowed to request the API thanks to the django-oauth-toolkit (OAuth2). WHAT I WANT : I want my users to login to their account using my web and iOS apps with their username/password pair, not to be redirected to manually authorize the apps as they have to do for third-party apps. PROBLEM : My first thought was: "Ok, I am able to achieve this using a simple token-based authentication. User requests the API with his username/password pair, then the app gets the token and use it for future requests. The django-rest-knox package seems to fit my expectations.". My second thought was: "Only my own apps should be allowed to request the API using the simple token-based authentication method. CORS headers could possibly restrict API requests to my web client but what about my iOS app? I can't hide secrets in … -
Impossible to publish an article in only one language
I am a beginner in django cms and I have recuperated a project in this language and I find a bug without an answer. The site is multilingual (French, English) and same for the blog. When an article is created in French I find myself having the article in French version in the list of articles on the English version of the site (in the list of English articles there are the French articles). I hope I've been clear, do you have any idea what the problem is? -
Django rest framework : POST on many to many items
I have a TransactionType model and I've implemented a viewset method to create transaction type as shown also below. Currently I can only post single credit_account or debit_account items as shown in this payload: {"name":"Repair and Maintenance","credit_account":16,"debit_account":38} I would to post multiple credit_accounts and debit_accounts such that my payload looks something like this: {"name":"Repair and Maintenance","credit_account":[16,4,5],"debit_account":[38,7]} Which is the efficient way of do this? class TransactionType(models.Model): name = models.CharField(max_length=255) organization = models.IntegerField(null=True, blank=False) credit_account = models.ManyToManyField(Account,related_name='credit_account', verbose_name="Account to Credit") debit_account = models.ManyToManyField(Account,related_name='debit_account',verbose_name="Account to Debit") def __str__(self): return '{}'.format(self.name) viewset method def create(self, request, format=None): name = request.data['name'] try: trans_type_obj = TransactionType.objects.create(name=name, credit_account=Account.objects.get(id=request.data['credit_account' ]), debit_account=Account.objects.get(id=request.data['debit_account' ]), organization=get_auth(request)) serializer = CreateTransactionTypeSerializer(trans_type_obj) except Exception, e: raise e return Response(data=serializer.data, status=status.HTTP_201_CREATED) -
Display name instead of id
I created a form with a choice field call membersid which will display the name in the option. My question is: How to display the name of the object but the value shows the id of the object? forms.py membersid = forms.ModelChoiceField(queryset=Member.objects.values_list('id',flat=True),required=True) I've tried this but I get the value and the display name are id. I've inspected the code, the options list is like: <select name="membersid" class="select form-control" required="" id="id_membersid"> <option value="" selected="">---------</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="21">21</option> <option value="82">82</option> </select> -
django-rest-swagger doesn't work properly after applying proxy_pass with nginx
I'm using django-rest-framework and did config my nginx to reverse proxy all outside connections into a sock file which is created by gunicorn for my djnago rest project. Here is my nginx config: upstream django { server unix://tmp/gunicorn.sock; } server { listen 80; server_name my_test_domain.com; location / { include uwsgi_params; proxy_pass http://django/; } } Nginx is working perfectly and all connections to my_test_domain.com will be passed to gunicorn.sock and everything is ok. Problem The problem is when i see swagger api-docs on browser, swagger will not detect the real domain name in requests that it creates, instead it just show the name of my upstream path which is django. so for example my url for test api will be: http://django/test But i want it to be like http://my_test_domain.com/test Any idea how to solve this! -
Adding in forms into django detail view
So I have a model fie, a forms.py file and a views.py file. The views file returns a detail view of a post, now I wish to add a model form of a comments model into the detail view so I can access it in d template as {{ form }}. I can do this with function-based views but finding it difficult to do with class-based views. Here are the code. #models.py from django.db import models from django.contrib.auth.models import User class Post(models.Model): title = models.CharField(max_length=50) content = models.TextField() author = models.ForeignKey(User, on_delete=models.CASCADE) date_posted = models.DateTimeField(default=timezone.now) likes = models.ManyToManyField(User, blank=True, related_name='post_likes') image = models.ImageField(null=False, blank=False, upload_to='post_images') slug = models.SlugField(unique=True) class Comment(models.Model): post = models.ForeignKey(Post, on_delete=models.CASCADE) text = models.CharField(max_length=150) date_commented = models.DateTimeField(auto_now_add=True) comment_by = models.ForeignKey(User, on_delete=models.CASCADE) #forms.py from django import forms from users.models import Profile from Post.models import Comment class CommentForm(forms.ModelForm): class Meta: model = Comment fields = ['text', ] #views.py from django.views.generic import ListView, DetailView class PostDetail(DetailView): model = Post template_name = 'Post/blog-detail.html' Hope my question makes sense Thanks. -
Get DRF paginated endpoint from axios
I have a paginated endpoint in my django-rest-framework API. A response to a list GET request looks like this: { "count": 161, "next": "http://localhost:8000/api/v2/bars/?limit=50&offset=50", "previous": null, "results": [ { "id": 1, "name": "Bar1", "url": "http://localhost:8000/api/v2/bars/1/", "budget": 800000, }, // more items... ] } What is the best approach if I want to fetch from axios all that pages until the end and then dump it to my vuex state? My current code only gets the first page. The axios session request: teams() { return session.get('/bars/') } The vuex action: barsRefresh(context) { api.bars().then((data) => context.commit('setBars', data.results)) } -
Show auto-incremental serial number in html table
I have one django project. In the template html page, I use a table to demonstrate data. In the first row of the table, I want to show the ID of "i". But since the i.0 is the batch_id of the model, it does not increment from 1. How could I change the html of this page to show the serial number in first row starting from 1? <table width="100" border="1" style="table-layout:fixed;position:relative;left:75px;" bordercolor="#E0E0E0"> <tr bgcolor="#F0F0F0"> <th width="55px" style="word-wrap:break-word;"><div class="panel-heading">ID</div></th> <th width="130px" style="word-wrap:break-word;"><div class="panel-heading">Search Content</div></th> </tr> <tr> {% for i in datas %} <td style="word-wrap:break-word;"><div class="panel-body"><small>{{ i.0 }}</small></div></td> <td style="word-wrap:break-word;color: #0066CC"><div class="panel-body"><strong><small>{{ i.2 }}</small></strong></div></td> {% endfor %} </tr> </table> -
(1062, "Duplicate entry '2' for key 'user_id'")
I am trying to update a profile by cropping the image, after cropping the image it is giving me a base64 string which i have to covert it into the image and store on the server as well as its url in the database. I am getting the image on the server but unable to store its url in the database. models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) image = models.FileField(default='default.jpg', upload_to='profile_pics') def __str__(self): return self.user.username def save(self, *args, **kwargs): #super(Profile, self).save(*args, **kwargs) super().save() img = Image.open(self.image.path) if img.height > 300 or img.width > 300: output_size = (300,300) img.thumbnail(output_size) img.save(self.image.path) forms.py class ProfileUpdateForm(forms.ModelForm): class Meta: model = Profile fields = ['image'] views.py #profile view @login_required def profile(request): #if any changes POST data if request.method == 'POST': image_data = request.POST['image'] format12,img = image_data.split(';base64,') ext = format12.split('/')[-1] imageObj = ContentFile(base64.b64decode(img+"==")) file_name = "myphoto."+ext #print(file_name) #Profile.image = data #Profile.save(file_name, data, save=True) #Profile.save() profile = Profile() profile.user_id = request.user.id #profile.image= imageObj u_form = UserUpdateForm(request.POST, instance=request.user) p_form = ProfileUpdateForm(request.POST, request.FILES,instance=request.user.profile) #check if both forms are valid if u_form.is_valid() and p_form.is_valid(): u_form.save() # if yes Save profile.image.save(file_name, imageObj) profile.save() #p_form.save() # if yes save messages.success(request, format('Your Profile has been updated.')) return redirect('profile') else: u_form = UserUpdateForm(instance=request.user)#instance … -
Upgrade Django project to Python3 - migrations fail
I have a Django project which has been developed with Python2.7, it is currently using Django version 1.10. I am now in the process of upgrading - first to Python3, and then afterwards I will do the Django upgrade. When I make Python3 virtual environment and run the tests: venv bash% ./manage.py tests I get a massive traceback: Traceback (most recent call last): File "./manage.py", line 9, in <module> execute_from_command_line( sys.argv ) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/commands/test.py", line 29, in run_from_argv super(Command, self).run_from_argv(argv) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/base.py", line 305, in run_from_argv self.execute(*args, **cmd_options) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute output = self.handle(*args, **options) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/commands/test.py", line 72, in handle failures = test_runner.run_tests(test_labels) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/test/runner.py", line 549, in run_tests old_config = self.setup_databases() File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/test/runner.py", line 499, in setup_databases self.parallel, **kwargs File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/test/runner.py", line 743, in setup_databases serialize=connection.settings_dict.get("TEST", {}).get("SERIALIZE", True), File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/db/backends/base/creation.py", line 70, in create_test_db run_syncdb=True, File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 130, in call_command return command.execute(*args, **defaults) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/base.py", line 356, in execute output = self.handle(*args, **options) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/core/management/commands/migrate.py", line 202, in handle targets, plan, fake=fake, fake_initial=fake_initial File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/db/migrations/executor.py", line 97, in migrate state = self._migrate_all_forwards(plan, full_plan, fake=fake, fake_initial=fake_initial) File "/home/hove/sleipner/venv/lib/python3.5/site-packages/django/db/migrations/executor.py", line 132, in …