Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to save nested data via django rest
JSON object: { "MajorUnitHeaderId": 10793322, "Parts": [ { "DealerId": "", "Description": "BATTERY 6 VOLT", "SetupInstall": "S", "Qty": 4, "Cost": 174.95, "Price": 0.0 }, { "DealerId": "", "Description": "1400/1000/185 BATTERY", "SetupInstall": "S", "Qty": 2, "Cost": 189.95, "Price": 0.0 } ] } Serializers: class MajorUnitPartSerializer(serializers.ModelSerializer): class Meta: model = MajorUnitPart fields = '__all__' class MajorUnitSerializer(serializers.ModelSerializer): parts = MajorUnitPartSerializer(many=True) class Meta: model = MajorUnit fields = '__all__' def create(self, validated_data): pdb.set_trace() parts_data = validated_data.pop('Parts') unit = MajorUnit.objects.create(**validated_data) for part_data in parts_data: MajorUnitPart.objects.create(unit=unit, **part_data) return unit Views: @api_view(['GET','POST']) def majorunitapilist(request): query = '76179602?$top=1&$skip=0' api_majorunit_list = get_majorunit(query) for unit in api_majorunit_list: pk = unit.get('MajorUnitHeaderId') try: obj = MajorUnit.objects.get(Cmf=pk) serializer = MajorUnitSerializer(instance=obj, data=unit) if serializer.is_valid(): serializer.save() except: serializer = MajorUnitSerializer(data=unit) if serializer.is_valid(): serializer.save() else: print(serializer.errors) return Response(serializer.data) Errors: {'parts': [ErrorDetail(string='This field is required.', code='required')], 'Parts': [ErrorDetail(string='Incorrect type. Expected pk value, received list.', code='incorrect_type')]} [09/Oct/2020 12:40:59] "GET /api/majorunit-apilist/ HTTP/1.1" 200 7605 -
When would you use Client Side Rendering VS. Server Side Rendering?
I am new to React and wondering when someone would use: 1. Server Side Rendering 2. Client Side Rendering With React and Django Rest Framework. What causes something to be better with one or the other? Thanks! -
Use a decorator to add in a variable to request
I know the suggested way to do this is middleware, but I'd like to implement the following to add in an env variable so that my view can access it: @api_wrapper def my_view(request): print env # this is the variable I want, such as request.env And the decorator: def api_wrapper(func): def api_inner(request): request.env = 'something' return func(request) return api_inner What's the best way to do this? I have about 100 functions to wrap so I don't want to add in a new parameter for every function but would just like to use the simplest approach to pass that 'env' variable. How should I do it. -
Do I need to learn django to implement tensorflow into my webapp
i am a college student studying my first semester in BCA(BAchelor in Computer Applications) and i'm still in the process of learning mern stack for web development , and yeah like everyone i got hella interested in machine learning and i came across some frameworks such as tensorflow and tensorflow.js, so the problem is i have spent a lot of time learning express to build the backend of webapps and i dont want to end up spending time on more courses, do i have to take a course on django as well in order to implement tensorflow into my websites, i dont want to use tensorflow.js since its much slower and heard a lot of people saying tensorflow is better another question will it be wise to buy a book to learn tensorflow, i seriously want to get into web development and machine learning, ive seen a book on amazon with the title:( Hands-On Machine Learning with Scikit-Learn, Keras and Tensor Flow: Concepts, Tools and Techniques to Build Intelligent Systems (Colour Edition)) will it be good enough And yes I need to post these types of questions on other places like reddit or Quora but I find stack overflow answers … -
Associate AJAX Image Uploads to Post During Post Creation (generic CreateView)
I have a typical Post model: models.py class Post(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) title = models.CharField(max_length=100) content = models.TextField(blank=True) ... My content area uses Editor.MD. EditorMD has user image upload capabilities. The post form is rendered from a typical CreateView class-based view. views.py (the gist) class CustomCreateView(LoginRequiredMixin, CreateView): model = Post form_class = AddNewPostForm template_name = 'myapp/post_create.html' success_url = None ... class UploadView(View): result = { 'success': 0, 'message': 'Image upload failed.', 'url': '', } # processing # goal is to return that result.url of where the image lives return JsonResponse(self.result) When these images are uploaded during the creation of a new post, they are essentially "unattached" or not related to the Post instance itself. I would like these uploaded images to ultimately and eventually have a relation to the post being created. The problem is, when a user is in the process of creating / writing the post, there is no Post ID to attach these images to since it hasn't been created yet. So here are my questions: How can I relate these user-uploaded images to the current post that hasn't been submitted yet? How should I manage user-uploaded images in the content area that the user adds, … -
How can we get more than two users from the database randomly in Django?
Well I am creating profile of every new user with signals and I am trying to add some default followers in the new user profile. I am trying with the following code and that is actually doing quite fine but not exactly that thing which i am wishing to do. Well with the following code. first 2 users with pk=1,pk=2 are becoming default followers of every new profile. I wish i could give some random users as a followers to every new user. For example: first user created new account and get two users following by default with pk=1 ,pk=2 than second user created new account and get two users following by default with different primary key such as pk=2 , pk = 4. Code: With the following code every new user is getting the same two 2 users with pk=1,pk=2, I dont want that. How can do that things which i have explained with example. Please help cause i need in this case. I shall be very thankful to you. if more detail or code is needed than tell me. I will share that with you. def create_profile(sender, created,instance,**kwargs): if created: userprofile = UserProfile.objects.create(user=instance) default_user_profile = UserProfile.objects.get_or_create(user__pk=1)[0] default_user_profile.follower.add(instance) userprofile.follower.add(default_user_profile.user) … -
How to get a file using post request on Django - upload file via HTML
I have a model called ImageFile, with a field Image = models.IamgeField() and I have this on my template: <form action="." method="POST> <label for="img">Select image:</label> <input type="file" id="img" name="img" accept="image/*"> <input type="submit"> </form> How can I save this image which I get from the template? -
Angular 8: Unable to set autorization and responseType in the headers of GET REQUEST (i want to download pdf from my backend API with authorization)
I wanted to download pdf using httpClient servie of Angular 8 and using django as a backEnd API, first problem that i face is i not able to set response Type and authorization on headers. and i m getting these errors. Errors if Accept is set to 'application/pdf': Could not satisfy the request Accept header if i ommit Accept from header error: SyntaxError: Unexpected token % in JSON at position 0 at JSON.parse (<anonymous>) at XMLHtt… Front end Code const HEADERS = { headers: { Authorization: "Token " + this.authService.token, Accept: 'application/pdf', responseType: 'blob', }, }; this.http.get<Blob>(SERVER_URL, HEADERS) .subscribe(response => { console.log(response); }, error => { console.log(error); }) Back end Code class ModelView(viewsets.ModelViewSet): queryset = Model.objects.all() serializer_class = ModelSerializer authentication_classes = (TokenAuthentication,) permission_classes = (IsAuthenticated,) def retrieve(self, request, pk=None): print(request.headers) file = Model.objects.get(id=pk) file_path = "media/" + str(file.file) try: return FileResponse(open(file_path, 'rb'), filename=file_path[10:]) except IOError: return Response("file not found") -
Associating a Microsoft Account with an existing user in Django using Oauth2
I want to be able to allow a user do the following: Register an account using a traditional email/password flow, or sign up with a Microsoft account Sign in a existing user with either email/password flow or a Microsoft account After registering an account the traditional way, allow a user to link/ associate their account with a Microsoft account. To do this I created a MicrosoftConnection model to hold the users microsoft data, and token from the OAuth2Session. I have had no problem with the tokens, creating a new connection & User (for register) or verifying the expected state. The problem I am having is that when I attempt to associate an existing account with a new MicrosoftConnection (the user is currently signed in at this point) or sign in an existing user using the microsoft signin, I loose all references to the authenticated user as soon as I get the callback from Microsoft. I can find no way to just grab the token without overriding this user. These are the sign_in and callback views which are pretty standard as far as Oauth goes. I was going to try and use the session var in sign_in to help with creating … -
NameError: Python name 'BASE_DIR' is not defined How To Fix?
I am trying to deploy my website and the images wont load because I am having this error this is causing my images not to load on my website any help is appreciated thank you! NameError: name 'BASE_DIR' is not defined my settings.py """ Django settings for mysite project. Generated by 'django-admin startproject' using Django 3.1.1. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ import os from pathlib import Path # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'a49c&2is^-d$y8ycdycbenh*@dm3$3phszrs_72c*fh-ti1449' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False # remember to change to false ALLOWED_HOSTS = ['anim3-domain.herokuapp.com'] # 'https://anime-domain.herokuapp.com/' # Application definition INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'main.apps.MainConfig', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', '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 = 'mysite.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], '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', ], }, }, ] WSGI_APPLICATION = 'mysite.wsgi.application' … -
cant run a django project
just starting with django, it is a bit too much for me reading this error log. if anyone has any opinions it would be much appreciated. thanks in advance. Traceback (most recent call last): File "c:\users\deanpc\appdata\local\programs\python\python39\lib\runpy.py", line 197, in run_module_as_main return run_code(code, main_globals, None, File "c:\users\deanpc\appdata\local\programs\python\python39\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\deanPC\AppData\Local\Programs\Python\Python39\Scripts\django-admin.exe_main.py", line 7, in File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management_init .py", line 401, in execute_from_command_line utility.execute() File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management_init .py", line 395, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management\base.py" , line 330, in run_from_argv self.execute(*args, **cmd_options) File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management\commands \runserver.py", line 61, in execute super().execute(*args, **options) File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management\base.py" , line 371, in execute output = self.handle(*args, **options) File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\core\management\commands \runserver.py", line 68, in handle if not settings.DEBUG and not settings.ALLOWED_HOSTS: File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\conf_init_.py", line 83, in getattr self.setup(name) File "c:\users\deanpc\appdata\local\programs\python\python39\lib\site-packages\django\conf_init.py", line 64, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing sett ings. -
text editor and font style for blog in django
I would like to know how I could make a text field that has font styles, sizes, and other options for text editing for django if anyone has an idea or example I would be super grateful -
Use direct SQL Queries to access database in Django
I have an app that was built in Django. And I want to use direct SQL Queries to access my MySQL Database. So far, this are my codes models.py class FillWeight(models.Model): weight_description = models.CharField(max_length=100, blank=True, null=True) filler_operator = models.CharField(max_length=100, blank=True, null=True) weight_date = models.DateField(auto_now_add= False, blank=True, null=True) start_time = models.TimeField(auto_now_add = False, blank=True, null=True) finish_time = models.TimeField(auto_now_add = False,blank=True, null=True) class Meta: db_table = 'fill_weight' views.py def show_list_of_info(request): template_name = 'oof_ord/homepage.html' list = FillWeight.objects.raw('SELECT * FROM fill_weight WHERE id = 1') context = { 'list':list } return render(request, template_name, context) It works really fine but is there any way that I can access database and do some process Like SELECT , UPDATE or DELETE without using my models.py ? -
Staff users don't have permission to access admin site without explicitly assigning them
I'm using Django 3.1.2 and staff users added by superuser in the admin site can't access the same admin site after login. All pages in /admin/ return 403 forbidden error. I'm using Windows 10, Python 3.8.5, inside a virtual environment (venv). My commands were made in Git Bash. It first happened in other project, so i created a new one to try. It's the same error in Firefox, Edge and Chrome. Exactly what i did: Git Bash: $ mkdir test_staff $ cd test_staff/ $ python -m venv venv_dev $ source venv_dev/Scripts/activate $ pip install Django==3.1.2 $ pip list Package Version ---------- ------- asgiref 3.2.10 Django 3.1.2 pip 20.1.1 pytz 2020.1 setuptools 47.1.0 sqlparse 0.4.1 $ django-admin startproject mysite $ cd mysite/ $ python manage.py migrate $ winpty python manage.py createsuperuser username: admin password: 12345 $ python manage.py runserver Browser: Login with "admin" user: http://localhost:8000/admin/login Add staff user: http://localhost:8000/admin/auth/user/add/ username: staff_user password: Ax47y](U[1fpw;8H2?}) > Save and continue editing staff status = True > Save Logout: http://localhost:8000/admin/logout/ Login with "staff_user": http://localhost:8000/admin/login Result: Git Bash: [09/Oct/2020 12:49:39] "GET /admin/ HTTP/1.1" 200 2282 Other URL: Git Bash: Forbidden (Permission denied): /admin/auth/user/ Traceback (most recent call last): File "C:\Users\DELL\Documents\github\test_staff\venv_dev\lib\site-packages\django\core\handlers\exception.py", line 47, in inner response = … -
I am trying to create a custom user in my Django application but I am facing some Unknown problem when I tried my custom user please somebody help me
##My django codes are: from django.contrib import admin from django import forms from django.contrib.auth.models import Group from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.forms import ReadOnlyPasswordHashField from django.core.exceptions import ValidationError from django.contrib.auth import get_user_model # Register your models here. from .models import MyUser class UserCreationForm(forms.ModelForm): password1 = forms.CharField(label="password", widget=forms.PasswordInput) password2 = forms.CharField( label="password confirmation", widget=forms.PasswordInput) class Meta: model = MyUser fields = ('username', "email", "first_name", "last_name", "gender", "date_of_birth") def clean_password2(self): password1 = self.cleaned_data.get("password1") password2 = self.cleaned_data.get("password2") if password1 and password2 and password1 != password2: raise ValidationError("Password don't match") return password2 def save(self, commit=True): user = super().save(commit=False) user.set_password(self.cleaned_data["password1"]) if commit: user.save() return user class UserChangeForm(forms.ModelForm): passwrod = ReadOnlyPasswordHashField() class Meta: model = MyUser fields = ('username', "email", "first_name", "last_name", "gender", "date_of_birth", 'is_active', "is_admin") def clean_password(self): return self.initial["password"] class UserAdmin(BaseUserAdmin): form = UserChangeForm add_form = UserCreationForm list_display = ('username', 'email', 'first_name', 'last_name', 'is_admin', 'is_active') list_filter = ('is_admin',) fieldsets = ( (None, { "fields": ('username', 'email', 'first_name', 'last_name', 'is_admin', 'is_active', 'password', 'date_of_birth', 'gender'), }), ) add_fieldsets = ( (None, { "fields": ('username', 'email', 'first_name', 'last_name', 'is_admin', 'is_active', 'password1', 'password2', 'date_of_birth', 'gender'), }), ) search_fields = ('email',) ordering = ('email',) filter_horizontal = () User = get_user_model() admin.site.register(User, UserAdmin) ##my models.py from django.db import models … -
Get NGINX ip address in docker in Django settings.py for Django-debug-toolbar
I have a dockerized DRF project with installed NGINX in it. All works fine except one thing: Django debug toolbar requires INTERNAL_IPS parameter to be specified in settings.py. For docker I use this one: hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS = [ip[:-1] + "1" for ip in ips] It also works fine but not with NGINX as NGINX use it’s own ip dynamically(probably?) definded inside or assigned by docker or anything else. I can get this ip from server logs: 172.19.0.8 - - [09/Oct/2020:17:10:40 +0000] "GET /admin/ HTTP/1.0" 200 6166 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 OPR/71.0.3770.228" and add it to setting.py: hostname, _, ips = socket.gethostbyname_ex(socket.gethostname()) INTERNAL_IPS = [ip[:-1] + "1" for ip in ips] INTERNAL_IPS.append('172.18.0.8') but I expect that this ip might be different on different machines etc, so it is not reliable enough. So that question is -is it possible somehow to get NGINX docker ip in settings.py dynamically or fix docker-compose somehow??? docker-compose: version: '3.8' volumes: postgres_data: redis_data: static_volume: media_volume: services: web: build: . #command: python /code/manage.py runserver 0.0.0.0:8000 command: gunicorn series.wsgi:application --config ./gunicorn.conf.py env_file: - ./series/.env volumes: - .:/code - static_volume:/home/app/web/staticfiles - media_volume:/home/app/web/mediafiles # ports: # - 8000:8000 … -
Python(Django) how to sort a list of objects by timestamp attribute
I have a list of objects 'posts' that I create with this python function, and I need to sort this list by timestamp attribute. def following(request): posts=[] follows=Follow.objects.all() for follow in follows: if follow.follower==request.user: posts_user=Post.objects.filter(user=follow.user) for post in posts_user: posts.append(post) return render(request, "network/following.html",{ "posts":posts }) If this was a QuerySet, I would have sorted by using this function: posts = posts.order_by("-timestamp").all() But this is a list so I cant use this function, it gives me this error: 'list' object has no attribute 'order_by' How can I sort this list by the timestamp so that the most recent post is the first? This is the Post class in models.py class Post(models.Model): user = models.ForeignKey("User", on_delete=models.CASCADE, related_name="user_post") text=models.TextField(blank=True) timestamp = models.DateTimeField(auto_now_add=True) likes=models.IntegerField(default=0) My idea was to convert the list to a QuerySet, but I don't know how to do it. Thank you! -
How can I make Django to save users using DynamoDB?
I can't find a way to configure DynamoDB as the database for my application, apparently there is no built-in way to configure DynamoDB as the ENGINE for the project, is there a solution to bring my users to a DynamoDB table? I'm looking for a way to authenticate users and superusers withouth having to implement an authentication system to do this. -
Django - how to find out which ForeinKey object made an instance appear in the filter's result
Imaging I have two models like this: class ExportProfile(Model): name = CharField() other_fields = ... class ExportFile(Model): exported_by = ForeignKey(ExportProfile) file_type = CharField() other_fields = .... e1 = Export(name='export1', ...) ef1 = ExportFile(exported_by=e1, file_type='zip', ...) ef2 = ExportFile(exported_by=e1, file_type='zip', ...) ef3 = ExportFile(exported_by=e1, file_type='zip', ...) I'm filtering it like this and I will receive 3 ExportProfile's objects(because I don't want it to be distincted): ExportProfile.objects.filter(exported_by__file_type='zip') The question is, how can I know which one of these objects belongs to which ExportFile? I want to write a serializer for ExportProfile model, so I need to know the exact ExportFile that caused this ExportProfile to be appeared in the filter result. -
Elasticsearch + django: Unknown mimetype, unable to deserialize: text/html
I have browsed for this error on Stackoverflow and elsewhere, but nothing helps. I have installed django-elasticsearch-dsl and added it to my INSTALLED_APPS. In my settings, I have: ELASTICSEARCH_DSL={ 'default': { 'hosts': 'localhost:9200' }, } Next, I have a 'documents.py' file where the logic for Elastic search resides. When I try running python manage.py search_index --rebuild, I get this error: elasticsearch.exceptions.SerializationError: Unknown mimetype, unable to deserialize: text/html I don't know if I understand correctly how to run the ES server. I have tried to run the local server on port 9200 but the issue persists. -
Displaying 404 error handling page using django
I am trying to handle a 404 http response error on the site. I want my 404.html content to be displayed, but for some reason when I run my local host I do get the response displayed, but my site doesn't look the same as in my contents aren't being displayed as they should. I don't know why this is happening, but I want to make sure I am properly calling in my handler. Any suggestions would be appreciated. My views.py def handler404(request, exception): return render(request, 'webpage/404.html') My 404.html {% extends "webpage/base.html" %} {% block content %} {% load static %} <h1>404 Error</h1> {% endblock %} My Url.py urlpatterns = [ path('admin/', admin.site.urls), path('', include('webpage.urls')), ] handler404 = views.handler404 -
Datatable Jquery AJAX with Django Paginator
I would like to use DataTable Jquery, with order and search options, from a Django table with Paginator. I had this error: Page or contactstruckerCharge is not a JSON serializable. It is my Django View: charges_asign=TruckerCharge.objects. paginator = Paginator(charges_asign, 30) page = request.GET.get('page') try: contactstruckerCharge = paginator.page(page) except PageNotAnInteger: contactstruckerCharge = paginator.page(1) except EmptyPage: contactstruckerCharge = paginator.page(paginator.num_pages) return HttpResponse(json.dump(list(contactstruckerCharge)), content_type='application/json') I tried with the next code, however it not working because get_json() is not a object valid for item return HttpResponse(json.dumps([item.get_json() for item in contactstruckerCharge.object_list]) , content_type='application/json') It is the frontend: $('#charges_table').DataTable({ "scrollY": "500px", "scrollCollapse": true, "order": [[ 0, "desc" ]], rowReorder: { selector: ':last-child' }, "ajax": { url: "/charge/myChargesAssingAJAX/", method: 'post', data: function(args) { return { "args": JSON.stringify(args), 'csrfmiddlewaretoken': '{{ csrf_token }}' }; } }, "search": "Buscar:" } }); $('.dataTables_length').addClass('bs-select'); }); Anyway, I do not know if is the correct way to do it. Thanks. -
Objects not being displayed in Django Admin when Foreign key is Null
I have a Model "Item" that has a field "req_item", that's a nullable foreign key. Everything seems to working fine, but when the "req_item" field is null, the object is not displayed in django admin altogether. Here's the image for reference: All the "req_item" filed values are null in DB at the moment, so none of the objects are displayed. If I assign a valid req_item value to an object in the DB, then only that object is displayed. How can I fix this issue. Here's my admin.py -
How to remove extra whitespaces on django rest serializers
I have this problem atm where you serializer an object in django and it appears something like that. {"title": " remove all spaces "} Within the serializer you can set extra_kwargs to trim fields. The results is the next {"title": "remove all spaces"} Is there a way to remove those extra white spaces between the words "remove" and "all"?? Here is the serializer example: class exampleSerializer(serializers.ModelSerializer): class Meta: model = Example fields = ("title", ) extra_kwargs = {"content": {"trim_whitespace": True}} -
error: failed to push some refs to 'https://github.com/loliadus/djangolocallibrary.git'
So I'm trying to update the addition of new folders and files to a git repository. After cloning the repository and copying those folders and files to the repository, I run the following commands C:\Users\Ben\Documents\djangoprojects\djangolocallibrary>git add -A C:\Users\Ben\Documents\djangoprojects\djangolocallibrary>git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git restore --staged <file>..." to unstage) modified: .gitignore new file: catalog/__init__.py new file: catalog/admin.py new file: catalog/apps.py new file: catalog/forms.py new file: catalog/migrations/0001_initial.py new file: catalog/migrations/0002_bookinstance_borrower.py new file: catalog/migrations/0003_auto_20201007_2109.py new file: catalog/migrations/__init__.py new file: catalog/models.py new file: catalog/static/css/styles.css new file: catalog/templates/base_generic.html new file: catalog/templates/catalog/author_confirm_delete.html new file: catalog/templates/catalog/author_detail.html new file: catalog/templates/catalog/author_form.html new file: catalog/templates/catalog/author_list.html new file: catalog/templates/catalog/book_confirm_delete.html new file: catalog/templates/catalog/book_detail.html new file: catalog/templates/catalog/book_form.html new file: catalog/templates/catalog/book_list.html new file: catalog/templates/catalog/book_renew_librarian.html new file: catalog/templates/catalog/bookinstance_list_borrowed_all.html new file: catalog/templates/catalog/bookinstance_list_borrowed_user.html new file: catalog/templates/index.html new file: catalog/tests/__init__.py new file: catalog/tests/test_forms.py new file: catalog/tests/test_models.py new file: catalog/tests/test_views.py new file: catalog/urls.py new file: catalog/views.py new file: locallibrary/__init__.py new file: locallibrary/asgi.py new file: locallibrary/settings.py new file: locallibrary/urls.py new file: locallibrary/wsgi.py new file: manage.py new file: templates/logged_out.html new file: templates/registration/login.html new file: templates/registration/password_reset_complete.html new file: templates/registration/password_reset_confirm.html new file: templates/registration/password_reset_done.html new file: templates/registration/password_reset_email.html new file: templates/registration/password_reset_form.html C:\Users\Ben\Documents\djangoprojects\djangolocallibrary>git commit -m "Version 1.0 moved into Github" [main a706353] Version …