Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to Reference Variable From Different View (Django)
I would like to use a variable outside of the function in which it is defined. I have only ever passed data to different templates and have not had to reference that data afterwards so I am unsure as to how I should proceed. Any help would be greatly appreciated, I am still new to Django/Python. Thanks! views.py def new_opportunity_company_id(request): company = request.GET.get('selected_company') company_obj = cwObj.get_company(company) company_id = company_obj[0]['id'] return company_id def new_opportunity_location(request): for company_id in new_opportunity_company_id(request): locations = cwObj.get_sites(company_id) context = {'locations': locations} return render(request, 'website/new_opportunity_location.html', context) -
Annotating a queryset with objects from a different "filter" queryset
If you're filtering a queryset using values from a different queryset, what is the best way to annotate the "filter" value onto the original queryset? For example, below I have a simGrants QS that I'm filtering using the simKeys QS. When a match is found, I'd like to append the matching simKeys cosine score to the simGrants object. The database is fairly large so I'm looking to find the most computationally efficient way to do this. Simkeys =similarity_matrix.objects.filter(y_axis__in=profiles).filter(cosine_score__gt=0) simGrants = Grant.objects.filter(indexKey__in=simKeys) -
Django: Creating an intermediate form with radio buttons that redirects the user
I have a Django project in which the user registers (this is the default user registration in use) and after registration I want them to be able to select an option - W or WP (radio buttons). Depending on the button they select, they would be re-directed to an appropriate profile page. (e.g profile-W or profile-WP) The "more info" intermediate page looks like this (html) more-info page showing two radio button options I would like some guidance on the best way to achieve this. Am I correct in thinking the first two steps would be to 1) Create a form for the more-info page 2) Create a view that would re-direct users to a profile. So far, I have this forms.py from django import forms from django.contrib.auth.models import User from django.contrib.auth.forms import UserCreationForm from .models import Profile """ Step 1- Create a More Info form class MoreInfoForm(): choice = forms.ChoiceField(required=True, widget=forms.RadioSelect( attrs={'class': 'Radio'}), choices=(('option1','I am a W'),('option2','I am a WP'),)) """ views.py """ STEP 2 - Create another view def moreinforequest(request): if request.method =='POST': form = UserMoreInfoForm(request.POST) #create a form that has the data that was in request.POST if form.is_valid(): #is the form valid (has something been ticked?) form.save()#this just … -
Django and Nginx (Digital Ocean)
I am finishing my first project in Django and in deployment I'm facing a problem. when I enter the site, I get the Nginx default page. I followed all the steps in the tutorial, read it again, so I don't know what I am missing. Here are the codes: Gunicorn Service Nginx Configuration Path -
It doesn't get the information right
The index.html doesn't show any error but doesn't show the information that it should. When using tags there is no problem but when trying to get the information from the website, it simply doesn't show it. <div class="box"> <article class="media"> <div class="media-left"> <figure class="image is-50x50"> <img src="http://openweathermap.org/img/w/{{ weather.icon }}.png" alt="Image"> </figure> </div> <div class="media-content"> <div class="content"> <p> <span class="title">{{ weather.city }}</span> <br> <span class="subtitle">{{ weather.temperature }}°F </span> <br> {{ weather.description }} </p> </div> </div> </article> There are no errors, just the images not showing up -
deployment django project to cpanel v3
i got cpanel from company but it's not python anywhere or digitalocean and i can't write right settings.py file i need a documentation to upload it and file manager in this cpanel it's not look like another cpanels i can't find python behind file manager , actually someone uplaod his project on it but i can't upload it.. if someone can't understand , please contact me on facebook : https://www.facebook.com/a7med7amed69 -
Django template pass array to input field
I have a hidden input field in my django template where I'm passing as value an array. <form method="post" action="{% url 'flights:flight-selection' %}">{% csrf_token %} <input type="hidden" id="fa_f_ids" name="fa_f_ids" value="{{ value.fa_f_ids }}"> <button type="submit" class="btn btn-light">Select</button> </form> When I submit this form via post request I want to get the value of fa_f_ids as an array but I am getting a string instead when I'd like to get an array. request.POST.get("fa_flight_id") #=> <QueryDict: {'csrfmiddlewaretoken': ['UoYqbTUlNxTEJW5AUEfgsgsLuG63dUsvX88DkwGLUJfbnwJdvcfsFhi75yie5uMX'], 'fa_f_ids': ["['AMX401-1560750900-schedule-0000', 'AMX19-1560782100-schedule-0001']"]}> -
Django Admin: Save formset for TubularInline
I have a tubularInline field in django admin main model is Model1 and the tubularinline model is Model2, say. so admin looks like class Model1Admin(admin.ModelAdmin): model = Model1 inlines = [Model2Inline] def save_formset(self, request, form, formset, change): # whatever I do here, nothing gets saved class Model2Inilne (admin.TabularInilne): model = Model2 I've seen many of the posts about save_formset and nothing works for me. I've tried what Django doc suggests https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset and it doesn't work. Nothing gets saved. I've tried something like In Django, how do I know the currently logged-in user? It doesn't work. Nothing gets saved. I'ev tried Django InlineModelAdmin - set inline field from request on save (set user field automatically) (save_formset vs save_model) which is essentially the same as the doc, nothing gets saved. -
why can't I fetch multiple images django views?(I haven't used django forms)
I am making one website in which I want to upload and fetch multiple images with simple HTML form <div class="row"> <div class="input-field col s12"> <div class="file-field input-field"> <div class="btn #4e342e brown darken-3"> <span>Upload Images</span> <input type="file" name="images" multiple required> </div> <div class="file-path-wrapper"> <input class="file-path validate" type="text" placeholder="please Upload all photos at a time"> </div> </div> </div> </div> -
Django Admin: How to list only filtered values based on another field selected in dropdown?
I'm creating a django admin interface where I have two dropdown lists: user and inventories The inventories list can be quite long and I want to filter by the user selected. The entry will be saved in a model class UserInventories(Model): user = ForeignKey('auth.user') inventory = ForeignKey('inventory.inventories') I made up all the variables and names, so don't worry about syntax Is there a way to modify the queryset based on the user selected? -
Unable to add user through django admin page
I have been using django-admin page to add user to my application. Recently when I tried to add a new user I started getting TypeError. The exact error is :- Exception Type: TypeError at /admin/auth/user/add/ Exception Value: 'float' object is not subscriptable Request information Since I have not changed anything in the code, I am not sure why I am getting this error now. That is why I am at a loss as what to try to solve the issue. I am attaching the traceback here:- File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.7/site-packages/django/contrib/admin/options.py" in wrapper 552. return self.admin_site.admin_view(view)(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view 149. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func 57. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/contrib/admin/sites.py" in inner 224. return view(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper 67. return bound_func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper 76. return view(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in bound_func 63. return func.__get__(self, type(self))(*args2, **kwargs2) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapper 67. return bound_func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in _wrapped_view 149. response = view_func(request, *args, **kwargs) File "/usr/local/lib/python3.7/site-packages/django/utils/decorators.py" in bound_func 63. return … -
How can I use custom User model on my existing Django project?
In my Django app, I've been using OneToOneField to have extra fields for User model. But, I feel like this way doesn't seem to be seamless as I have to access extra fields with extra JOIN by doing like user.profile.address even though I can minimize the number of queries with select_related. users/models.py from django.contrib.auth.models import User from django.db import models class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) phone_number = models.CharField(max_length=20) address = models.CharField(max_length=50) Also, I need to use email instead of username for user authentication. In that regard, I feel like I should use custom User model by doing something like the below. But, I know that this way will have a conflict with the existing user model on my production database. users/models.py class User(AbstractBaseUser, PermissionsMixin): email = models.EmailField(_('email address'), unique=True) first_name = models.CharField(_('first name'), max_length=30, blank=True) last_name = models.CharField(_('last name'), max_length=30, blank=True) date_joined = models.DateTimeField(_('date joined'), auto_now_add=True) is_active = models.BooleanField(_('active'), default=True) ... As it is up and running database, I can't start over. In that point, does anyone know if there's a way to have a custom User model, keeping existing data? -
Passing variables from Django view to template remains empty
I'd like to pass a variable from my Django view to my template, but the below code doesn't work. I don't get any errors, my template just remains blank. view def view_name(request): now = datetime.datetime.now() today = now.strftime("%A, %b %d, %Y") return render(request, "dash.html", {"today": today}) template <div class="row"> <div class="col-3"> <div class="card text-white bg-primary mb-3"> <div class="card-body"> <p class="card-text"> {{ today|safe }}</p> </div> </div> </div> What am I doing wrong? -
internal server error while trying to run django project with uwsgi
I'm trying to deploy a django app in my centos with nginx+uwsgi i created a fresh django app and set the relevant ini files and everything that was needed to get this new project up and running but when i try to get my main django app running with uwsgi i get the following errors : File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 107, in create entry = module.default_app_config AttributeError: module 'ed' has no attribute 'default_app_config' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./restapi/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application django.setup(set_prefix=False) File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/__init__.py", line 24, in setup apps.populate(settings.INSTALLED_APPS) File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/registry.py", line 89, in populate app_config = AppConfig.create(entry) File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 110, in create return cls(entry, module) File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 40, in __init__ self.path = self._path_from_module(app_module) File "/opt/python-virtual-env/demo/lib64/python3.6/site-packages/django/apps/config.py", line 73, in _path_from_module "with a 'path' class attribute." % (module, paths)) django.core.exceptions.ImproperlyConfigured: The app module <module 'ed' (namespace)> has multiple filesystem locations (['/srv/www/restapi/ed', './ed']); you must configure this app with an AppConfig subclass with a 'path' class attribute. unable to load app 0 (mountpoint='') (callable not found or import error) *** no app loaded. going in full dynamic mode *** uWSGI … -
How to make the html file load the specific video
Okay so i'm creating a movie watching site for learning the django framework more, currently i've done that once the user submits their file and title on the django admin panel it will create a folder inside the templates folder where it will copy the movie.html, it will also create a folder named after the title inside the videos folder and then it will move the mp4 into there. Now my issue is actually making the movie.html specifically load that video and have that video title and not other video titles Tried a few things but nothing that made any difference nor that made sense. <body> <header> <div class="container"> <!-- Branding --> <a href="/"><span class="branding">Movies & Other</span></a> <a href="/admin"><span class="adminpanel">Admin panel</span></a> </div> </header> <h1 class="movietitle">Videotitle</h1> <div class="videoDetails"> <video width="700" height="430" controls> <source src="/videos/" type="video/mp4"> </video> </div> </body> </html> class Video(models.Model): title = models.CharField(max_length=40, blank=False) video_file = models.FileField(name="Upload a mp4 file", upload_to=f"uploadvideos/videos", validators=[FileExtensionValidator(['mp4'])], blank=False) def __str__(self): return self.title @receiver(models.signals.post_save, sender=Video) def execute_after_save(sender, instance, created, *args, **kwargs): if created: # Create a directory in html directory. os.mkdir(f'uploadvideos/templates/uploadvideos/{instance.title}') # Make a copy of the movie.html shutil.copy(dst=f'uploadvideos/templates/uploadvideos/{instance.title}', src='uploadvideos/templates/uploadvideos/movie.html') # Create a directory in /videos os.mkdir(f'uploadvideos/videos/{instance.title}') # Move the uploaded video to the directory created … -
Django ManyToMany not stored
I wrote the following code: related_fixture = Fixture.objects.create(home=home, away=away, total_goals=total_goals, total_away_goals=total_goals_away, total_home_goals=total_goals_home, total_fh_goals=(fh_goals_home + fh_goals_away), total_sh_goals=(sh_goals_away + sh_goals_home), total_home_fh_goals=fh_goals_home, total_home_sh_goals=sh_goals_home, total_away_sh_goals=sh_goals_away, total_away_fh_goals=fh_goals_away, no_default_values=all_fields_populated, league=league, date=date) fixture.related_fixtures.add(related_fixture) fixture.save() print(fixture.related_fixtures) Related to the following model defined in models.py: class Fixture(models.Model): flashscore_id = models.CharField(max_length=200) home = models.ForeignKey(Team, on_delete=models.CASCADE, related_name="home") away = models.ForeignKey(Team, on_delete=models.CASCADE, related_name="away") league = models.ForeignKey(League, on_delete=models.CASCADE, blank=True) date = models.DateTimeField() related_fixtures = models.ManyToManyField('self', blank=True) total_goals = models.IntegerField(default=0) total_fh_goals = models.IntegerField(default=0) total_sh_goals = models.IntegerField(default=0) total_home_goals = models.IntegerField(default=0) total_away_goals = models.IntegerField(default=0) total_home_fh_goals = models.IntegerField(default=0) total_home_sh_goals = models.IntegerField(default=0) total_away_fh_goals = models.IntegerField(default=0) total_away_sh_goals = models.IntegerField(default=0) no_default_values = models.BooleanField(default=False) updated_at = models.DateTimeField(auto_now=True) created_at = models.DateTimeField(auto_now_add=True) When I run the code the print statement returns the following: project.Fixture.None Is there any way to fix this? -
How to save formwizard POST request to a database
How do I save the form_data to a database? forms.py class ContactWizard(SessionWizardView): template_name ='fitness/general.html' def done(self, form_list, **kwargs): form_data = process_form_data(form_list) return render_to_response('fitness/general2.html', {'form_data': form_data}) def process_form_data(form_list): form_data = [form.cleaned_data for form in form_list] return form_data -
Why is this Django view being executed twice on post?
I have a Django view that signs a user up to a free trial through Stripe. When the view makes a POST request, it does so twice. I've tried idempotency keys, both after the if request.method == 'POST' line and in the initial rendering of the view. The customer in Stripe always ends up with two identical payment sources and two identical subscriptions to the plan. def start_trial(request): title = 'get started' description = title form = MembershipForm() key = settings.STRIPE_PUBLISHABLE_KEY trial_days = 30 coupon = None custom_message = '' subscription_idempotency = str(uuid.uuid4()) source_idempotency = str(uuid.uuid4()) try: vendor = Vendor.objects.get(user=request.user) custom_message = vendor.message coupon = Coupon.objects.get(vendor.coupon) coupon = coupon.stripe_coupon_id trial_days = vendor.trial_days except Vendor.DoesNotExist: pass try: partner = Partner.objects.get(user=request.user) custom_message = partner.message coupon = Coupon.objects.get(partner.coupon) coupon = coupon.stripe_coupon_id trial_days = partner.trial_days except Partner.DoesNotExist: pass if request.method == 'POST': form = MembershipForm(request.POST) if form.is_valid(): user = request.user plan = Membership.objects.get(type_of=form.cleaned_data['plan']) # stripe needs to attempt to create a customer # TODO what if there's already a membership/subscription? user_membership = UserMembership.objects.get(user=request.user) stripe_subscription = stripe.Subscription.create( customer=user_membership.stripe_customer_id, items=[ {"plan": plan.stripe_plan_id} ], trial_period_days=trial_days, coupon=coupon, idempotency_key=subscription_idempotency, ) subscription = Subscription.objects.create( user_membership=user_membership, stripe_subscription_id=stripe_subscription.id) subscription.save() stripe.Customer.create_source(user_membership.stripe_customer_id, source=request.POST.get('stripeToken'), idempotency_key=source_idempotency) user_membership.membership = plan user_membership.save() user.is_subscriber = True user.save() # if … -
Select in template does not update in edit
I have the following code below, which would be the editing of a form of a request I made here for my work, as I had to change some of the views my update has to be manual, and the select field is not getting the result that I'm bringing it from the db, all fields are working except the select. class EditPedido(View): def get(self, request, venda): data = {} venda = fixa.objects.get(id=venda) data['filial'] = venda.regional return render(request, 'fixa/fixa_update.html', data) <select name="filial" class="select form-control" required="" id="filial"> <option value="" selected="">---------</option> {% for filial in filiais %} <option value="{{ filial.id }}">{{ filial.nome }}</option> {% endfor %} </select> -
Is it possible to change username to email on an existing Django project?
I have an existing Django project which is already running on production server. I recently found that I had to re-configure if I want to use email instead of username that is default in Django by doing Custom User Model. Since I already have a running database on production. That doesn't sound like an option for me anymore as it is gonna have a conflict between the default Django User model and the new custom User model. Without having a conflict with the currently running database on production, is there any way to use email over username for user authentication? -
Paginator in Django ListView does not work with get function
Paginator in Django ListView does not work with get function. The forward and backward button appears on the html page, but in no way divides the data into pages. also tried using page_obj instead of page views.py class LessonListView(ListView): model = Lesson template_name = 'edms/lesson/list.html' success_url = '/lessons' paginate_by = 10 def get(self, request): if request.user.is_authenticated: user = request.user if user.is_department_manager or user.is_assistant_department_manager or user.is_dean_manager: documnets = Requested_Documents.objects.filter( lesson__user=user ).order_by("lesson") lessons = {} all_lessons = Lesson.objects.all() for lesson in all_lessons: lesson_id = str(lesson.id) lessons[lesson_id] = { 'lesson': lesson, 'docs': [] } for doc in documnets: lesson_id = str(doc.lesson.id) lessons[lesson_id]['docs'].append(doc) return render(request, self.template_name, { 'lessons': lessons, }) elif user.is_academician: documnets = Requested_Documents.objects.filter( lesson__user=user ).order_by("lesson") lessons = {} for lesson in Lesson.objects.filter(user=user): lesson_id = str(lesson.id) lessons[lesson_id] = { 'lesson': lesson, 'docs': [] } for doc in documnets: lesson_id = str(doc.lesson.id) lessons[lesson_id]['docs'].append(doc) return render(request, self.template_name, { 'lessons': lessons, }) else: return redirect(reverse('edms:login')) list.html <div class ="pagination"> <span class="step-links"> {% if page_obj.has_previous %} <a href="?page={{ page_obj.previous_page_number }}">Previous</a> {% endif %} <span class="current"> Page {{ page_obj.number }} of {{ page_obj.paginator.num_page_obj }}. </span> {% if page_obj.has_next %} <a href="?page={{ page_obj.next_page_number }}">Next</a> {% endif %} </span> </div> ouput all courses listed and written at the bottom of … -
How to check whether all fiels are filled in django register.html?
I am trying to create blog app with Django.I have a register page in my app to create account.But the problem i face is if i leave all field empty and clicko n register is returns ValueError at /register.I need to display message instead of that.I dont know how to procced? #views.py def register(request): if request.method == "POST": email=request.POST['email'] User_name=request.POST['User_name'] Password1=request.POST['Password1'] Password2=request.POST['Password2'] if Password1 == Password2: if User.objects.filter(username=User_name).exists(): messages.info(request,'Username Taken') return redirect('register') elif User.objects.filter(email=email).exists(): messages.info(request,'Email Taken') return redirect('register') else: user = User.objects.create_user(username=User_name, password=Password1,email=email) user.save(); return redirect('/') else: messages.info(request,'Password Not Matching') else: return render(request,'register.html') -
Serve multiple Django applications from one server
Good morning. I have a dedicated ubuntu server behind my company's firewall. It is using Django, Gunicorn, and Nginx to serve an Intranet application to employees. The original app responds to the URL [server_name]/[original_application_name]. I want to serve additional apps from this server. I have followed this tutorial as I did when setting up the original app. I can run Gunicorn and serve the app, I have created a second systemd service file that appears steady (copied from the original app with paths changed - service runs), same for a new 'sites-available' file in Nginx (copied from original and modified), new .sock file exists, binding appears successful. However, I have yet to hit on the right configuration combination between settings.py [allowed_hosts], [new_app].service, and nginx etc. The original app is running and when I try a URL related to the new app it gives an error saying it cannot find the request in the url.py of the original app. The new app would be used by the IT dept. Ideally, the new URL would be something like: it.[server_name]/[new_application_name]. I have looked through other cases with this problem but most use Apache or are on a public hosting site. I have seen … -
No module named 'django.db.migrations.migration'
recently I pulled from my git the new version of the project, unfortunately I made a mistake and my settings.py file was completly overwrite. I fix it but when I run my apache server and tried to make a request in the logs I found this: [Tue Jun 18 08:47:20.777042 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "<frozen importlib._bootstrap>", line 677, in _load_unlocked [Tue Jun 18 08:47:20.777047 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "<frozen importlib._bootstrap_external>", line 728, in exec_module [Tue Jun 18 08:47:20.777052 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed [Tue Jun 18 08:47:20.777057 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "/home/admin/Mefid/venv/lib/python3.7/site-packages/django/contrib/contenttypes/apps.py", line 9, in <module> [Tue Jun 18 08:47:20.777060 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] from .management import ( [Tue Jun 18 08:47:20.777066 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "/home/admin/Mefid/venv/lib/python3.7/site-packages/django/contrib/contenttypes/management/__init__.py", line 2, in <module> [Tue Jun 18 08:47:20.777069 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] from django.db import DEFAULT_DB_ALIAS, migrations, router, transaction [Tue Jun 18 08:47:20.777074 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] File "/home/admin/Mefid/venv/lib/python3.7/site-packages/django/db/migrations/__init__.py", line 1, in <module> [Tue Jun 18 08:47:20.777077 2019] [wsgi:error] [pid 7542] [remote 200.116.66.129:60805] from .migration import Migration, swappable_dependency # NOQA </br> [Tue Jun 18 08:47:20.777112 2019] [wsgi:error] … -
python3 manage.py makemigrations No changes detected
(fcdjango_venv) Subinui-MacBook-Pro:Impassion_community subin$ python3 manage.py makemigrations No changes detected I'm learning Basic Django right now, and was following the lecture, but got problem. I followed the lecture, so first I typed the code on models.py from django.db import models # Create your models here. class Impassionuser(models.Model): username=models.CharField(max_length=64, verbose_name='사용자명') password = models.CharField(max_length=64, verbose_name='비밀번호') registered_dttm = models.DataTimeField(auto_now_add=True, verbose_name='등록시간') class Meta: db_table = 'Impassion_Impassionuser' and then on Terminal, I typed (fcdjango_venv) Subinui-MacBook-Pro:Impassion_community subin$ python3 manage.py makemigrations but the result was No changes detected In the lecture, after typing python3 manage.py makemigrations it shows Migrations for "User" : user/migrations/0001_initial.py - Create model User how can I get the same result?