Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Python scripting for Bitbucket server API access
Anyone know how to access branch related operations pull,push,clone and also take backup of branch,repository as zip or tar file etc of Atlassian Bitbucket server 4.14 installed on local machine using python script I tried bitbucket-api module of python but it supports only Cloud REST API of Bitbucket...? -
Store two types of value in single Django model field
I am learning django by creating a polling application. For starters I have three models User, Question and Choices. class User(....): .... Questions_voted = models.ManyToManyField(Question) .... this means that a user to vote for as many questions as he wants. Next is The Question Model which is simple and just store question text and number of people voted for it. class Question(models.Model): question_text = models.CharField(max_length=500) vote_count = models.IntegerField(...) next is Choices which have a choice_text and refers to the question it belongs to. class Choice(models.Models): choice_text = models.CharField(models.Model) question = models.ForeignKey(Question,...) Now I want to store information about what choice a user selected for a question. It is very clear when you think of it but I am stuck because of lack of knowledge of types of fields in django models. -
Deploying Django, Gunicorn, Nginx, Virtualenv on Digital ocean gives me 502 Bad Gateway & Gunicorn can't read Secret Key
I've been trying to deploy for 2 days now and It seems like I can't get it to work even though I went through many articles, StackOverflow questions, and Digital Ocean Tutorials. My main tutorial is this one: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04?comment=47694#create-and-configure-a-new-django-project when I bind my gunicorn file (see command below) and go to my_ip_address:8001 everything works fine gunicorn --bind 0.0.0.0:8001 vp.wsgi:application But at the part where I created and edited my gunicorn.service file: sudo nano /etc/systemd/system/gunicorn.service [Unit] Description=gunicorn daemon After=network.target [Service] User=tony Group=www-data WorkingDirectory=/home/tony/vp/vp/ ExecStart=/home/tony/vp/vpenv/bin/gunicorn --workers 3 --bind unix:/home/tony/vp/vp/vp.sock vp.wsgi:application [Install] WantedBy=multi-user.target And my nginx file (I replaced my ip address with my_ip_address for privacy) sudo nano /etc/nginx/sites-available/vp server { listen 80; server_name my_ip_address; location = /facivon.ico { access_log off; log_not_found off; } location /static/ { root /home/tony/vp; } location / { include proxy_params; proxy_pass http://unix:/home/tony/vp/vp/vp.sock; } } I get a bad gateway 502 error. Even after reloading everything: (vpenv) ~/vp/vp$ sudo systemctl daemon-reload (vpenv) ~/vp/vp$ sudo systemctl start gunicorn (vpenv) ~/vp/vp$ sudo systemctl enable gunicorn (vpenv) ~/vp/vp$ sudo systemctl restart nginx So I checked the status of gunicorn: (vpenv) ~/vp/vp$ sudo systemctl status gunicorn And get the error: gunicorn.service - gunicorn daemon Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset: enabled) Active: failed β¦ -
UnboundLocalError at / local variable 'instance' referenced before assignment
I'm making a simple django form that will take a tweet by its id, and print out the corresponding tweet. I cannot figure out why it is giving me this error. form = TweetForm(request.POST or None) if form.is_valid(): instance = form.save(commit = False) instance.save() print instance.tweet_id tweet = api.get_status(instance.tweet_id) print tweet.text tweet_text = tweet.text -
Prevent Django from logout through url before hitting enter
So I have created a Django-app with a login form and using login(request, user) in my view.py to login the user. This is the main page and has the location mypage.com. I also created another function in my view.py called log_out: def log_out(request): logout(request) return redirect('/') This function is used to log out a user using the url: mysite.com/logout as defined in my url.py: url(r'^logout/', views.log_out, name='log_out'), This is working to log out the user, however the user is being logged out as I'm typing in the logout-url into the address-field of my browser, and before hitting enter to go to that endpoint. I would like it to not log out the user when typing in the url, and wait until I'm "entering" the site. Can anyone help me with this one? -
Django ManyToMany relationship details
I want to build a website in which users can send words to each other using Django. When a user deletes a word, that word will be deleted for only that user. I have a working website; the only problem is when a word is deleted, it is deleted for all users. How can I fix this problem, is it a problem which is related to ManyToMany relationships? Django word model: from django.db import models from datetime import datetime from django.contrib.auth.models import User class Word(models.Model): definition = models.CharField(max_length=350) turkish = models.CharField(max_length=50) english = models.CharField(max_length=50) users = models.ManyToManyField(User) creator = models.CharField(max_length=50) def __str__(self): return self.english def summary(self): return self.definition[:50] + "..." The share view function: @login_required def send(request): users_list = User.objects.all().exclude(username=request.user.username) user = request.user small = user.username.title() send_to_str = request.POST['user'] sent_word_str = request.POST['word'] send_to = User.objects.get(username=send_to_str) sent_word = Word.objects.get(id=sent_word_str) if not users_list: sendmessage = 'You have no friends' else: sendmessage = '' sent_word.users.add(send_to) words = Word.objects.filter(users=user).order_by('-english') return render(request, 'intro.html', {'sendmessage': sendmessage, 'words': words, 'small' : small}) The delete view function: @login_required def delete(request): if request.method == 'POST': current_id = request.POST['word_id'] current_word = Word.objects.get(id=current_id) current_word.delete() messages.add_message(request, messages.INFO, 'Succesfully deleted.') return redirect('translater:home') else: return render(request, 'intro.html', {'message': 'there is a problem'}) Redirected to β¦ -
Efficient way in Django Models to store Items Purchased in a Transaction for a Commerce Store
I've created two simple Django Models. One model simply holds the bill details. The other one holds the list of items purchased in that Bill, linked through a foreign key relation. I'm stuck at a problem of creating a very large database with this implementation. Model Classes : class Bill(models.Model): seller_id = models.ForeignKey(User , related_name = 'bill') amount = models.DecimalField(max_digits = 7 , decimal_places = 2) customer_id = models.ForeignKey(User , related_name = 'bill') and class BillItems(models.Model): bill = models.ForeignKey(Bill , related_name = 'items') product = models.ForeignKey(Product , related_name = 'items') quantity = models.DecimalField(max_digits = 6 , decimal_places = 3) Now as I see it , after some time my database(MySql) would have a very large number of Bill Items' instances. Is there a better way to implement such a structure? OR Is there a way to optimize this structure? Thanks and Regards. -
How to change βtrue/falseβ checkboxes in Django ModelForm
Hello again friends, I added checkboxes to the model. How to change βtrue/falseβ to βyes/noβ? I do not want to Radio buttons or select option. models.py class Order(models.Model): paid = models.BooleanField(default=False) forms.py from django import forms from .models import Order class OrderCreateForm(forms.ModelForm): class Meta: model = Order fields = ['paid'] It's important to me, even though it's a little thing, I would appreciate your help. -
Djano Rest Framework - Extra Data at Save on Update
I am experiencing some strange behaviour using the .save(field = 'value') on the perform_update event using Django Rest Framework inside view.py. I am updating a specific field, adding logic and adding additional data to the serializer before saving data in the model/database based on a the customer's response/api call. Each time I test by setting an PUT (update) as 'yes' and then 'no', the .save() randomly works. I think sometimes the save() happens before the variable gets set and passed to .save(). I am fairly new to Django and Python so I may not be doing this correctly. I have also tried declaring variables and then passing those variables into .save(field='created variable') but I still get the same strange behaviour. Here is my code: def perform_update(self, serializer): # Change depending on customer's repsonse. # customer_acceptance is "yes" or "no" from front end print(serializer.instance.customer_acceptance) if serializer.instance.customer_acceptance == 'yes': serializer.instance.creditor_status = 'accepted' serializer.instance.agreement_acceptance = 'yes' if serializer.instance.customer_acceptance == 'no': serializer.instance.creditor_status = 'customer_rejected' serializer.instance.agreement_acceptance = 'no' if serializer.is_valid(): print(serializer.instance.creditor_status) serializer.save( customer_response_date = datetime.datetime.now() ) -
Django recursive query on non-symmetrical Many-to-Many to the same model
I'm offering services to companies (many-to-many between Service and Company). To structure my services, I use a tree-like structure using Django's many-to-many field. So, a service can contain multiple other services. The question: how can I retrieve all services a company has? Using company.services, I only get the services directly related to that company. I need the directly related ones + included_services (in a recursive way). class Company(models.Model): services = models.ManyToManyField(Service) class Service(models.Model): name = models.CharField(max_length=255) included_services = models.ManyToManyField("self", blank=True, symmetrical=False) -
Autogenerate seats in django mode
I'm developing a bus reservation website using Django. I have two model files in different Django apps. One of the model class is Bus and another one is seats. There is capacity integerfield in bus class. I want that when a bus is created in the database, automatically a loop runs and creates the seats equal to the capacity in the bus class. Maybe you'll get a clearer view after looking at my models files. \src\book\models.py from django.db import models from django.contrib.auth.models import User from web.models import Bus, Route class Booking(models.Model): class Meta: verbose_name_plural = "Booking" user = models.ForeignKey(User) #session = models.ForeignKey(sessions.Sessions) name = models.CharField(max_length=50) gender = models.CharField(max_length=10, choices=(('Mr', 'mr'), ('Mrs', 'mrs'), ('Ms', 'ms'),)) age = models.IntegerField() email = models.EmailField() phone = models.IntegerField() bus = models.ForeignKey(Bus, default='') def __str__(self): return self.name class Seat(models.Model): class Meta: verbose_name_plural = "Seat" for seats in range(1,int(float(Bus.capacity)+1.0)): id = models.AutoField(primary_key=True) bus = models.ForeignKey(Bus) def __str__(self): return str(self.id) class Ticket(models.Model): class Meta: verbose_name_plural = "Ticket" seat = models.ForeignKey(Seat) bus = models.ForeignKey(Bus) route = models.ForeignKey(Route, default='') def __str__(self): return str(self.id) \src\web\models.py from django.db import models from django.core.exceptions import ValidationError class Route(models.Model): class Meta: verbose_name_plural = "Routes" BUSFROM = ( ('Delhi', 'Delhi'), ('Jaipur', 'Jaipur'), ('Ajmer', 'Ajmer'), ) BUSTO β¦ -
django-rest-auth registration/verify-email/ not working
I just download demo from official dhango-rest-auth site and tried to use but some API endpoint not working. I successfully signup (register) user with restful API, i get key in response: `{"key":"e96496ecb7fbe85d5ab60fe5d5f9a15b33a967fe"}` and user exists (when i check in database) and i also get email with verification link, but when i try to verify its email with rest api: `curl -X POST http://127.0.0.1:9003/rest-auth/registration/verify-email/ -d "key=e96496ecb7fbe85d5ab60fe5d5f9a15b33a967fe"` i am getting: `{"detail":"Not found."}` Where i am making mistake. This is just demo i didn't do anything just install, set sending email, host and run server. Also when i click on link in email it opens page with confirm button and when i click on confirm i get: `Using the URLconf defined in demo.urls, Django tried these URL patterns, in this order: ^$ [name='home'] ^signup/$ [name='signup'] ^email-verification/$ [name='email-verification'] ^login/$ [name='login'] ^logout/$ [name='logout'] ^password-reset/$ [name='password-reset'] ^password-reset/confirm/$ [name='password-reset-confirm'] ^user-details/$ [name='user-details'] ^password-change/$ [name='password-change'] ^password-reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$ [name='password_reset_confirm'] ^rest-auth/ ^rest-auth/registration/ ^account/ ^admin/ ^accounts/profile/$ [name='profile-redirect'] ^docs/$ [name='api_docs'] The current path, accounts/login/, didn't match any of these.` Why this also doesn't work? This is demo where i am making mistake? Please help! -
Django generate page with components
I have one idea but I don't know figure out how this should work. I have page class: class Page(object): title = None slug = None inMenu = False parent = None # place for register parent page # array of components in page # { componentName: 'carousel', htmlConent: '', images: ['slide_01.jpg', 'slude_02.jpg'] } #(from carousel model) components = [] template = Template ('index.html') I have the components now as a templateTags in django what I need is render page class with all components and args. For example: {% extends 'base.html' %} {% block content %} {% for component in page.components %} {% render_component component%} {% endfor %} {% endblock %} have you try something like that? I don't know how exactly render the templateTags from the array with args. Could someone help me with this?. -
In Django, how can I change the settings variable dynamically by taking the value from the database?
I am using the google smtp server to send mail.For that I need to set two variables EMAIL_HOST_USER and EMAIL_HOST_PASSWORD in settings.py file. I want to take the values for both of the variables from the database to allow the user to enter the email id from the web. -
Create custom abstract view class inheried from APIView
I am working in DJango with DJango REST Framework module. For each model I make, I have a view: class CustomAPIView(APIView): renderer_classes = (JSONRenderer, ) permission_classes = (IsAuthenticated, ) @csrf_exempt def post(self, request): raw_data = serializers.SearchStateSerializer(data=request.data) if raw_data.is_valid(): searched_data = serializers.ShowStateSerializer(data=serializers.State.objects.extra(where=raw_data.data['where'], order_by=raw_data.data['order_by']), many=True) return JsonResponse(paginate_data(searched_data=searched_data, request_data=raw_data), status=status.HTTP_202_ACCEPTED) else: return JsonResponse(raw_data.errors, status=status.HTTP_400_BAD_REQUEST) In this code, there are 3 constraints that change: SearchStateSerializer ShowStateSerializer State(Model) So I want to create an abstract in which I only specify these 3 things and the view works. How can I do this? I searched a lot but with no luck. It is must that these 3 constraints are supplied or it will throw error. -
Mocking forms in view unit tests
I can't seem to be able to mock the behaviour of a form when unit testing views. My form is a simple ModelForm and resides in profiles.forms. The view is (again) a simple view that checks whether the form is valid and then redirects. views.py from django.http import HttpResponseRedirect from django.shortcuts import render from django.urls import reverse from profiles.forms import ProfileForm def home(request): form = ProfileForm() if request.method == 'POST': form = ProfileForm(request.POST) if form.is_valid(): profile = form.save() return HttpResponseRedirect(reverse("thanks")) My test looks like this: class TestViewHomePost(TestCase): def setUp(self): self.factory = RequestFactory() def test_form(self): with mock.patch('profiles.views.ProfileForm') as mock_profile_form: mock_profile_form.is_valid.return_value = True request = self.factory.post(reverse("home"), data={}) response = home(request) logger.debug(mock_profile_form.is_valid.call_count) # "0" is_valid is not being called on the mock, which means ProfileForm is not patched. Where did I make a mistake? -
Django - implementation of select2 with url
I've added a select2 field to my webpage and I want to load the records into it using ajax. So I've declared a url field. $(document).ready(function() { $("#field_id").select2({ placeholder: "Search...", ajax: { url: '{{ url }}', dataType: 'json', ... templateResult: formatItem, This url points to a method, that should return the matching products, but I don't have any idea how to serialize them so that it works. This is my method: def get_ajax(self, request, *args, **kwargs): query = request.GET.get('q', None) if query: products = Product.objects.filter(name__icontains=query) return JsonResponse(items, safe=False) else: return JsonResponse(data={'success': False, 'errors': 'No mathing items found'}) But I get only undefined values. My JS formatItem() method looks like this: function formatItem (item) { console.log(item); if (item.loading) return item.name || item.text; var markup = '<div class="clearfix">' + '<div class="col-sm-12">' + item.name + '</div>' + '</div>'; return markup; } What am I doing wrong? Thanks in advance. -
How do you use python-decouple to load a .env file outside the expected paths?
I'm forced to keep my .env file in a non-standard path outside the root of my project (in a separate directory altogether). Let's say I have my Django project in /var/projects/my_project, though I have my .env file in /opt/envs/my-project/.env where my SECRET_KEY is stored. In my settings.py file, I'd like to explicitly use the .env file at that path so that I can still do this: from decouple import config secret_key = config('SECRET_KEY') -
Getting error while deploying Django app in the Heroku
I have a Django project and I was trying for the first time to deploy in the Heroku cloud. The project structure is as following, # Project structure: .\Project folder\ - | |- .\env\ (Virtual enviroment ) | |- .\src\ - | | | |- .\main\ - | | | | | |- admin.py (Output tables data in to admin dashboard) | | |- models.py (Classes os DB tables) | | |- serializers.py (Serializing of data output in API) | | |- views.py (Custome API views) | | |- ... | | | |- .\users_groups\ - | | | | | |- settings.py (Project settings) | | |- urls.py ( file with URL's reg. ex. patterns) | | |- wsgi.py | | | |- .\templates\ | | | |- manage.py | |- db.sqlite3 | |- .\app-messages | |- ReadMe.txt | |- requirements.txt (file with list of all dependencies for app) My project is here and I followed this tutorial. I was in the .\Project folder\ and in the time of pushing in the master, I get some error. I use the command to push, git push heroku master I get the error message, To https://git.heroku.com/i2x-team-app.git ! [remote rejected] master -> β¦ -
Uncaught ReferenceError: $ is not defined - error in console
I'm getting this error in my console, and it relates to a js script i'm using (Trumbowyg WYSIWYG: http://alex-d.github.io/Trumbowyg/) Here's a picture of the browser console with the error: https://i.imgur.com/etk5VJf.png When I click on (index):166, it shows this in the source: https://i.imgur.com/Pj4yC9p.png id_content is the id for the WSYIWYG editor, and this is the required function in my js file to make it work: $('#id_content').trumbowyg({ }); I've looked at other solutions and they say to load the jquery script before every other js script, but I'm already doing that and it doesn't solve anything. Does anyone have any idea what the problem is? By the way, I'm using this package to integrate it with django: https://github.com/sandino/django-trumbowyg, not sure if that changes anything. I just load the widget in my forms like this: class PostForm(forms.ModelForm): content = forms.CharField(widget=TrumbowygWidget(), required=False) -
Django WebSocket Tutorial
I'm developing a simple online game In Django. I've searched a lot, but was not able to find an step by step tutorial on how to use WebSockets in Django. I'll appreciate it if you suggest me a tutorial. -
Django shortcuts.redirect NoReverseMatch
I'm getting NoReverseMatch from the below view: def new_room(request): label="test" return redirect(chat_room, label=label) # this didn't work either: # return redirect('chat_room', label=label) def chat_room(request, label): ... My urls.py looks like this: from django.conf.urls import url, include from messaging import views app_name="messaging" urlpatterns = [ url(r'^$', views.index, name='index'), url(r'^new/$', views.new_room, name='new_room'), url(r'^(?P<label>[\w-]{,50})/', views.chat_room, name='chat_room'), ] Going straight to messaging/test/ will load the page correctly. It's only the redirect that is causing the issue. Full stacktrace: Environment: Request Method: GET Request URL: http://127.0.0.1:8000/messages/new/ Django Version: 1.10.5 Python Version: 3.5.2 Installed Applications: ['messaging', 'dal', 'dal_select2', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles',, 'channels'] 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.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware'] Traceback: File "g:\Python\lib\site-packages\django\core\handlers\exception.py" in inner 39. response = get_response(request) File "g:\Python\lib\site-packages\django\core\handlers\base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "g:\Python\lib\site-packages\channels\handler.py" in process_exception_by_middleware 240. return super(AsgiHandler, self).process_exception_by_middleware(exception, request) File "g:\Python\lib\site-packages\django\core\handlers\base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "g:\Git\Jam\messaging\views.py" in new_room 26. return redirect('chat_room', label=label) File "g:\Python\lib\site-packages\django\shortcuts.py" in redirect 56. return redirect_class(resolve_url(to, *args, **kwargs)) File "g:\Python\lib\site-packages\django\shortcuts.py" in resolve_url 147. return reverse(to, args=args, kwargs=kwargs) File "g:\Python\lib\site-packages\django\urls\base.py" in reverse 91. return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs))) File "g:\Python\lib\site-packages\django\urls\resolvers.py" in _reverse_with_prefix 392. (lookup_view_s, args, kwargs, len(patterns), patterns) Exception Type: NoReverseMatch at /messages/new/ Exception Value: Reverse for β¦ -
DJANGO how to handle two forms in one form tag
I have two form Postform and Fileform and i am placing both forms in one tag. but when i press submit button nothing happens. and i also made file field not required but it is still not working. but when i give input to both forms only then it work. i want if file is not present it should work and just save post form. form.py class PostForm(forms.ModelForm): choice = ( ('post','post'), ('anouncement','anouncement'), ('question', 'question') ) title = forms.CharField(widget=forms.TextInput(attrs={'class':'mdl-textfield__input','id':'s1'})) content = forms.CharField(widget=forms.Textarea(attrs={'class':'mdl-textfield__input','id':'sample5','rows':'3'})) post_type = forms.ChoiceField(choices = choice, widget = forms.Select(attrs={'class':'mdl-selectfield__select', 'id':'post_type'})) class Meta: model = Post fields = [ "title", "content", "post_type", ] class FileForm(forms.ModelForm): file = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True,'class':'none','id':'file_input_file','required':'False'}), required = False ) class Meta: model = file fields = [ "file" ] def __init__(self, *args, **kwargs): # first call parent's constructor super(FileForm, self).__init__(*args, **kwargs) # there's a `fields` property now self.fields['file'].required = False views.py: form = PostForm(request.POST or None) fileForm = FileForm(request.POST or None, request.FILES or None) context.update({'form':form, 'fileform':fileForm}) print(fileForm.is_valid()) if form.is_valid() and fileForm.is_valid(): instance = form.save(commit=False) instance.user = request.user slug = create_slug(instance) instance.slug = slug instance.save() print(request.FILES) if request.FILES : for f in request.FILES.getlist('file'): print(f) file.objects.create(Post = instance, file=f) return HttpResponseRedirect('/%s/post/%s/'%(request.user.username,slug)) template: <form enctype="multipart/form-data" action="" method="POST"> {% csrf_token β¦ -
How to Synchronize Game Clients in Django?
I am developing an online Knapsack game in Django that dynamically groups clients into groups of players, then randomly takes pairs from each group to compete on solving a visual Knapsack problem. A single-player version of my game is available here. In the multiplayer version, I have difficulty synchronizing pairs of players, i.e., when one of them starts the game, the other one starts after one or two seconds. I was wondering if there is any library that can help me with synchronizing the players. -
Adding a mixin causes LookupError while making migrations
Djanto 1.11 Could you help me understand what is going on here. When I comment the mixin out (see below - working subtitle), everything works. I mean: python manage.py makemigrations Adding a mixin seems to ruin everything. tree . β βββ frame_person β βββ frame_person β β βββ admin.py β β βββ apps.py β β βββ __init__.py β β βββ migrations β β β βββ __init__.py β β β βββ __pycache__ β β β βββ __init__.cpython-36.pyc settings INSTALLED_APPS = [ 'frame_person.frame_person', ] Working: class FramePerson(#CommonUrlMethodsMixin, models.Model): dd = models.CharField(max_length=100) Not working class FramePerson(CommonUrlMethodsMixin, models.Model): foo = models.CharField(max_length=100) Traceback: Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line utility.execute() File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/core/management/__init__.py", line 355, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/core/management/base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/core/management/base.py", line 330, in execute output = self.handle(*args, **options) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py", line 177, in handle migration_name=self.migration_name, File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 47, in changes changes = self._detect_changes(convert_apps, graph) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 152, in _detect_changes model = self.new_apps.get_model(al, mn) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/apps/registry.py", line 205, in get_model return app_config.get_model(model_name, require_ready=require_ready) File "/home/michael/workspace/venv/photoarchive/lib/python3.6/site-packages/django/apps/config.py", line 172, in get_model "App '%s' doesn't have a '%s' model." % (self.label, model_name)) LookupError: App 'frame_person' doesn't have a β¦