Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
How to have a permission-based user system in Django?
I want the build a REST API where user can do operations on objects, based on their permissions. Consider a record that represents a car - it contains the license number, the type of the car and extra information. Also consider the following user system: Owners - Who owns the car object. Can modify it and delete it. Editors - Who can only modify the object properties. Viewers - Can only view the object properties. Each record can contain multi owners/editors/viewers (The user who created the object should be automatically the owner). Also, owners can add or remove editors/viewers. So in case of a GET request, I want to be able to return all objects that the user has permissions for, separated into those three categories. So under my api app, I have the following code: The models.py file contains: class CarRecord(models.Model): type = models.CharField(max_length=50) license = models.CharField(max_length=50) The serializers.py file contains: class CarRecordSerializer(serializers.ModelSerializer): type = models.CharField(max_length=50) license = models.CharField(max_length=50) class Meta: model = CarRecord fields = ('__all__') In view.py I have: class CarRecordViews(APIView): def get(self, request): if not request.user.is_authenticated: user = authenticate(username=request.data.username, password=request.data.password) if user is not None: return Response(data={"error": "invalid username/password"}, status=status.HTTP_401_UNAUTHORIZED) # return all records of cars … -
Easy Problem: CSS in DMs on a social media site not displaying correctly
Within the DM function on my social media platform I would like the received messages to appear on the left hand side and the sent messages to appear on the right hand side. Currently it is the other way round: https://i.stack.imgur.com/qGDDP.png (Sent messages (light pink) = #D7A5EB, received messages (dark pink) = #CC64C3) Ì have been trial-and-erroring this for a while now, but it simply refuses to allow sent messages (I.e. the ones that the currently logged-in user sent) on the right hand side. thread.html: {% extends 'landing/base.html' %} {% load crispy_forms_tags %} {% block content %} <div class="container"> <div class="row"> <div class="card col-md-12 mt-5 p-3 shadow-sm"> {% if thread.receiver == request.user %} <h5><a href="{% url 'profile' thread.user.profile.pk %}"><img class="rounded-circle post-img" height="50" width="50" src="{{ thread.user.profile.picture.url }}" /></a> @{{ thread.user }}</h5> {% else %} <h5>@{{ thread.receiver }}</h5> {% endif %} </div> </div> {% if message_list.all.count == 0 %} <div class="row my-5"> <div class="col-md-12"> <p class="empty-text">No messages yet.</p> </div> </div> {% endif %} {% for message in message_list %} <div class="row"> {% if message.sender_user == request.user %} <div class="col-md-12 my-1"> {% if message.image %} <div class="message-sender-container ms-auto"> <img src="{{ message.image.url }}" class="message-image" /> </div> {% endif %} <div class="sent-message my-3"> <p>{{ message.body … -
Preserve image metadata in Django upload form
I want to extract metadata from images that are uploaded using a form. Right now it seems that metadata is overwritten/removed. I have already checked this question, but the answer provided in that thread is lacking in where that code should be and why. Using that in my view gave nothing. Here's my current model: class signUp(models.Model): name = models.CharField(max_length=20) sex = models.CharField(max_length=1) dob = models.CharField(max_length=10) image = models.FileField(upload_to='images') -
How to write .set() for this error? To update m2m field?
I'm trying to edit the M2m field. Gives an error: Direct assignment to the forward side of a many-to-many set is prohibited. Use analog.set() instead. How to solve this problem (I don’t understand where to put set()) def editpart(request, id, **kwargs): added = '' error = '' PartAllView = Part.objects.order_by('-id') part = Part.objects.get(id=id) form = PartForm(request.POST, request.FILES) if request.method == 'POST': part.brand = request.POST.get("brand") part.number = request.POST.get("number") part.name = request.POST.get("name") part.description = request.POST.get("description") part.images = request.FILES.get("images") part.images0 = request.FILES.get("images0") part.images1 = request.FILES.get("images1") part.images2 = request.FILES.get("images2") part.analog = request.POST.get("analog") part.save() added = 'Запчасть успешно отредактирована' form = PartForm() data = { 'added': added, 'error': error, 'form': form, 'PartAllView': PartAllView, 'part': part, } context_object_name = "part" return render(request, 'kross/editpart.html', data) -
Django ordering by date_created with ManyToMany using Through
Having trouble figuring out how to order by date created. I've looked at some similar problems on here and no fix. I need the dates to order by ascending so that the most recent object created is on the top of the list. I've tried different things even using JS to revert the list and still no luck. I have class Info(models.Model): detail = models.CharField(max_length=50) text = models.TextField(max_length=2000) created_by = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True, related_name='cb_section') updated_by = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True, related_name='up_section') date_created = models.DateField('Date created', auto_now_add=True) date_updated = models.DateField('Date updated', auto_now=True) class Section(models.Model): name = models.CharField(max_length=20) section_infos = models.ManyToManyField(Info, through='SectionInfo') date_created = models.DateField('Date created', auto_now_add=True) date_updated = models.DateField('Date updated', auto_now=True) def __str__(self): return self.name def get_section_info(self): return self.section_infos.order_by('-date_created') class SectionInfo(models.Model): info = models.ForeignKey(Info, on_delete=models.CASCADE) section = models.ForeignKey(Section, on_delete=models.CASCADE) class Meta: ordering = ('info__date_created',) and in my template I have <div class="row"> {% for object in object_list %} <div class="col-sm-4"> <div class="card"> <div class="card-header"> <h1><strong>{{ object.name }}</strong></h1> <hr> </div> <div class="card-body"> <div class="row"> {% for info in object.section_infos.all %} <ul id="list"> <li>{{ info.date_created }}</li> | <li><a href="{% url 'manufacturing:section_info_detail' info.id %}">{{ info.detail }}</a></li> <hr> </ul> {% endfor %} </div> </div> </div> </div> {% endfor %} </div> View for this is … -
Django new WebSocket(url)
I am trying to do a chat app in django with channels. I try to do it from this video. But when I run it I get in console (index):16 WebSocket connection to 'ws://127.0.0.1//8000/ws/socket-server/' failed: . The moment in video is 8:31 and the program is working. Please help. Thanks. -
django.db.utils.IntegrityError: NOT NULL constraint failed: userapp_resume.last_updated
I get that error when I try to save data for a resume I'm creating. "The above exception (NOT NULL constraint failed: userapp_resume.last_updated) was the direct cause of the following exception:" This is the error message that the browser throws. I'm not sure what I'm missing here. userapp is the name of my app models.py ```user = models.OneToOneField(User, on_delete = models.CASCADE) uniqueId = models.CharField(null=True, blank=True, max_length=200) image = models.ImageField(default = 'default.jpg', upload_to='profile_images') email_confirmed = models.BooleanField(default=False) date_birth = models.DateField(blank=True, null=True) sex = models.CharField(choices=SEX_CHOICES, default=OTHER, max_length=200) marital_status = models.CharField(choices=MARITAL_CHOICES, default=SINGLE, max_length=200) addressLine1 = models.CharField(null=True, blank=True, max_length=200) addressLine2 = models.CharField(null=True, blank=True, max_length=200) village = models.CharField(null=True,blank=True, max_length=200) city = models.CharField(null=True, blank=True, choices=DISTRICT_CHOICES, default=KAMPALA, max_length=200) district = models.CharField(choices=DISTRICT_CHOICES, default=KAMPALA, max_length=100) phoneNumber = models.CharField(null=True, blank=True, max_length=200) slug = models.SlugField(max_length=500, unique=True, blank=True, null=True) date_created = models.DateTimeField(default= timezone.now) last_updated = models.DateTimeField(blank=True, null=True) cover_letter = models.FileField(upload_to='resumes', null=True, blank=True,) cv = models.FileField(upload_to='resumes', null=True, blank=True,)``` Url patterns ```urlpatterns = [ path('admin/', admin.site.urls), path('home/', job_views.index, name='home_page'), path('register/', user_views.register, name='register_page'), path('profile/', user_views.profile, name='profile'), path('login/', auth_views.LoginView.as_view(template_name='login.html'), name='login_page'), path('logout/', auth_views.LogoutView.as_view(template_name='logout.html'), name='logout_user'), path('terms-and-conditions/', job_views.terms, name='terms'), path('create-resume/', user_views.create_resume, name='create-resume'), path('<slug:slug>/', user_views.ResumeDetailView.as_view(template_name='resume-detail.html'), name='resume-detail'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ``` these are the apps ```INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'jobapp', 'userapp', ]``` -
relationship primaryjoin in django.db
how to implement primaryjoin through django.db as in the example below with sqlalchemy.orm relationship primaryjoin Class Account(Base): name = Column(String(64), primary_key=True) data = relationship( "AccountData", primaryjoin="AccountData.name == Account.name", uselist = False ) ... Class AccountData(Base): name = Column(String(64), ForeignKey('account.name'), primary_key=True) ... -
How to pass a parameter in the string in python using format
There as a url link which i have in settings.py file : KAVENEGAR_URL = "https://api.kavenegar.com/v1/{key}/verify/lookup.json?receptor={phone}&token={otp}".format(key,phone,otp) I want to use it in service.py file inside send_otp_sms method I dont know how to pass key, phone, otp variables in it from django.conf import settings def send_otp_sms(key, phone, otp): kavenegar_url = settings.KAVENEGAR_URL.format({key}, {phone}, {otp}) response = requests.post(kavenegar_url) if response.status_code != 200: raise APICallError return response I used .format as you see in the codes but it pass error in settings.py which Unresolved reference 'key' Unresolved reference 'phone' Unresolved reference 'otp' -
Django admin navigate through self referring Foreign Key
I have a Folder model with a self-referring Foreign Key. The folders represent the structure of a root folder on my computer, and this structure can only be modified in the admin panel. With the number of folders rising, this could be quite hard to clearly look for a folder from inside the admin panel. My goal is to add a View children link that allows the admins to navigate through the folders by filtering them and displaying only the children of the folder : However, I didn't find how to implement it. I supposed I had to use a filter in order to get all children of the folder that was clicked, however I couldn't find a way of doing it. I only found the SimpleListFilter but that doesn't do the job since I need to set values for the side filter panel. What I want would be to have a view_children like that in my list_display : def view_children(self): return format_html('<a href="?children_of={}">View Children</a>', self.pk) And then be able to filter the folders with the pk that was passed to the url. How could I do something like that ? -
Related Field got invalid lookup: icontains ( when using foreignKey
I am trying to search blogs by blog author name where author is a foreignkey. models.py class Blog(models.Model): author=models.ForeignKey(User,on_delete=models.CASCADE,related_name='post_author') blog_title=models.CharField(max_length=264,verbose_name='Put a Title') category=models.ForeignKey(Category,on_delete=models.CASCADE,related_name='category',default=None) slug= models.SlugField(max_length=264,unique=True,null=True,allow_unicode=True) blog_content=models.TextField(verbose_name='what is on your mind?') here's the views.py logic if request.method == "GET": search= request.GET.get('search',' ') if not search == ' ': result = Blog.objects.filter(Q(blog_title__icontains=search) | Q(author__icontains=search)) i know it's happening because author is a foreignkey. But I have went through many questions but couldn't find the answer. Thanks i advance -
how to make call to aws api gateway and a lambda function real time and update a database table
I have the following script, which make a call to a lambda function via an API Gateway. The lambda function, when it is called, retrieve some data from the database (RDS), which is inside of a AWS VPC, then update some value. snippet lambda def handler(event, context): ... conn = pg2.connect( host=DATABASE_HOST, database=DATABASE_NAME, user=DATABASE_USER, password=DATABASE_PASSWORD, ) try: cur = conn.cursor(cursor_factory=pg2extras.DictCursor) cur.execute(""" SELECT users_user.id FROM users_user WHERE users_user.username = (%s) """, [username]) ... cur.execute(""" UPDATE person SET first_name = 'john' WHERE id = (%s) """) ... conn.commit() except (Exception, pg2.DatabaseError) as e: if conn: conn.rollback() print("Error: {}".format(e)) sys.exit((1)) finally: if conn: response = {} response["statusCode"] = 200 response["body"] = "OK" conn.close() return response the calls to the lambda and api gateway are stored in the aws cloudwatch log streams. Now i have noticed that when the first call is made to this api gateway, for some reason, i have to wait until the second call is made for the update to show when i query the data from the database, the same thing happen when i look at the log stream , i am not able to see the real time log. When i make call 1 to the api gateway, … -
How to use multiple {% block content %} {% endblock%} in the same HTML file
I want to use multiple block contents on the same html file to create a layout template. The actual layout.html body looks lije this: <body> <main role="main" class="container"> <div class="row"> <div class="col-md-8"> {% with messages = get_flashed_messages(with_categories=true) %} {% if messages %} {% for category, message in messages %} <div class="alert alert-{{ category }}"> {{ message }} </div> {% endfor %} {% endif%} {% endwith %} **{% block content %}{% endblock %}** </div> </div> </main> </body> How can i implement another block content but with certain specific id so i can refer it from another html file? -
deploying Django project on AWS lambda without using Zappa [closed]
I have created my complete django app and I want to deploy it on lambda . I am not willing to deploy via zappa . I will have my zip generated of the project using zappa and I want to put this in another bucket in AWS but this time I dont want to use zappa as it will not give me control to certain properties if any i want in future. -
Is there anyone can help me with a task of Django [closed]
Now I need to implement a project of Django (add a new tab in company website). Can anyone help me to look into it together, to help me with outline the step? Since I am totally new beginner and I feel a little confused about this. I can share the screen to express the problem. Thank you so much. -
Template Tag - Get class variables
I need to get information in template tag from a custom class This is the class class EmpleadoSiradig: def __init__(self, cuit, nro_presentacion, fecha, deducciones={}, cargasFamilia={}, ganLiqOtrosEmpEnt={}, retPerPagos={}): self.cuit = cuit self.nro_presentacion = nro_presentacion self.fecha = fecha self.deducciones = deducciones self.cargasFamilia = cargasFamilia self.ganLiqOtrosEmpEnt = ganLiqOtrosEmpEnt self.retPerPagos = retPerPagos def get_cuit(self): return self.cuit Views @login_required def archivo_solo_view(request, slug): dd = os.path.join(get_carpeta(), slug) siradig_empleado = formulas.leeXML3(dd) context = { 'siradigEmpleado': siradig_empleado, } return render(request, 'reader/soloxml2.html', context) HTML {% block title %} Siradig Individual - CUIT: {{ siradigEmpleado.cuit }}{% endblock title%} "siradig_empleado" is an EmpleadoSiradig object type, but I'm not getting a result in {{ siradigEmpleado.cuit }}. Thanks in advance. -
How to set is_staff field to False when user is created by logging in from google using alluth package
I am building a django website and I wanted to know how can I set is_staff of my custom user model to false when some user logs in from their google account. When someone logs in from their email and password their is_staff is set to false(implemented by me), but I can't find nor figure out a way to do so when someone logs in from their google account. I am using allauth package for google login. Here is my models.py for accounts app models.py from django.db import models from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager # Custom User Manager class CustomUserManager(BaseUserManager): def _create_user(self, email, password, first_name, last_name=None, **extra_fields): if (not email): raise ValueError("Email Must Be Provided") if (not password): raise ValueError("Password is not Provided") user = self.model( email=self.normalize_email(email), first_name=first_name, last_name=last_name, **extra_fields ) user.set_password(password) user.save(using=self._db) return user def create_user(self, email, password, first_name, last_name=None, **extra_fields): extra_fields.setdefault('is_staff', False) extra_fields.setdefault('is_active', False) extra_fields.setdefault('is_superuser', False) return self._create_user(email, password, first_name, last_name, **extra_fields) def create_superuser(self, email, password, first_name, last_name=None, **extra_fields): extra_fields.setdefault('is_staff', True) extra_fields.setdefault('is_active', True) extra_fields.setdefault('is_superuser', True) if extra_fields.get('is_staff') is not True: raise ValueError('Superuser must have is_staff=True.') if extra_fields.get('is_superuser') is not True: raise ValueError('Superuser must have is_superuser=True.') return self._create_user(email, password, first_name, last_name, **extra_fields) # Custom user Model class User(AbstractBaseUser, … -
Container commands for Elastic Beanstalk
I'm upgrading to Linux 2 on Elastic Beanstalk and I'm having trouble with command 02. commands 01 and 03 are confirmed to be working. when 02 is introduced, the deployment fails. container_commands: 01_migrate: command: "source /var/app/venv/*/bin/activate && python3 myapp/manage.py migrate --noinput" leader_only: true 02_makesuper: command: "python3 myapp/manage.py makesuper" leader_only: true 03_collectstatic: command: "source /var/app/venv/*/bin/activate && python3 myapp/manage.py collectstatic --noinput" leader_only: true the makesuper.py file exists within the following path myapp/useraccounts/management/commands/makesuper.py Under linux 1, the following command worked 02_makesuper: command: "python3.6 myapp/manage.py makesuper" leader_only: true Thanks! -
How to apply filter on django ManyToManyField so that multiple value of the field follow the condition?
class Publication(models.Model): title = models.CharField(max_length=30) class Article(models.Model): headline = models.CharField(max_length=100) publications = models.ManyToManyField(Publication) p1 = Publication.objects.create(title='The Python Journal') p2 = Publication.objects.create(title='Science News') p3 = Publication.objects.create(title='Science Weekly') I want to filter articles, published in both p1 and p3. They might or might not publish in other publications but they must have to publish in p1 and p3. -
Django- HTTP status code must be an integer
I have error for pagination view.py def ShowAll(request): s = request.GET.get('s') products = Domains.objects.all() paginator=Paginator(products,2) # page_num=request.GET.get('page',1) # products=paginator.page(page_num) if s: products = products.filter(Q(name__icontains=s) | Q(description__icontains=s)) serializer = DomainsSerializers(products, many=True) return Response(serializer.data,{'paginator':paginator}) what i do? -
Django does not display errors from the custom validator, and instead resets the form
I recently started learning django and can't solve one problem. I created my validator for the form, but instead of showing an error window, it just resets the form. Here is the code models.py: from django.db import models from django.urls import reverse_lazy from django.core.exceptions import ValidationError class News(models.Model): title = models.CharField(max_length=150, verbose_name='Title') content = models.TextField(blank=True, verbose_name='Content') created_at = models.DateTimeField(auto_now_add=True, verbose_name='Date of publication') updated_at = models.DateTimeField(auto_now=True, verbose_name='Update') photo = models.ImageField(upload_to='photos/%Y%m/%d/', verbose_name='Photo', blank=True) is_published = models.BooleanField(default=True, verbose_name='Is_published ') category = models.ForeignKey('Category', on_delete=models.PROTECT, null=True, verbose_name='Category') def get_absolute_url(self): return reverse_lazy('read', kwargs={'news_id' : self.pk}) def __str__(self): return self.title class Meta: verbose_name = 'new' verbose_name_plural = 'news' ordering = ['-created_at', 'title'] class Category(models.Model): title = models.CharField(max_length=150, db_index=True, verbose_name='Title of category') def get_absolute_url(self): return reverse_lazy('category', kwargs={'pk' : self.pk}) def __str__(self): return self.title class Meta: verbose_name = 'category' verbose_name_plural = 'categories' ordering = ['-title'] This is the code forms.py: from django import forms from .models import News, Category from django.core.exceptions import ValidationError import re class NewsForm(forms.Form): title = forms.CharField(max_length=150, min_length=1, label='Title', widget=forms.TextInput(attrs={'class' : 'form-control'})) content = forms.CharField(label='Text', required=False, widget=forms.Textarea(attrs={'class' : 'form-control', 'rows' : 15})) # photo = forms.ImageField(upload_to='photos/%Y%m/%d/') is_published = forms.BooleanField(label="To publish", initial=True) category = forms.ModelChoiceField(label='Category', queryset=Category.objects.all(), empty_label='Select a category', widget=forms.Select(attrs={'class' : 'form-control'})) def clean_title(self): raise ValidationError('Error!') # … -
User can't login into my application hosted in heroku
I hosted my application on Heroku for almost two weeks. For the first time everything is working fine but yesterday at morning, i have try to login but it does not redirected me to the user dashboard, and I don't know why as you can see in code below nothings is wrongs with it: def login(request): if request.method == 'POST': username = request.POST['username'] password = request.POST['password'] user = auth.authenticate(username=username, password=password) if user is not None: auth.login(request, user) return redirect('index') else: messages.info(request, 'Invalid Credential') return redirect('login') else: return render(request, 'login.html') my form: <form method="POST"> {% csrf_token %} <div class="form-group"> <label class="text-primary">Enter Username</label> <input type="text" class="form-control" name="username"> </div> <br> <div class="form-group"> <label class="text-primary ">Enter Password</label> <input type="password" class="form-control" name="password"> </div> <br> <a href="{% url 'register' %}" style="text-decoration: none;" class="text-primary text-center"> SignUp Now <br> <br> <a href="{% url 'reset_password' %}" style="text-decoration: none;" class="text-primary text-center"> Forgot Password </a> </a> <br> <br> <button type="submit" class="btn btn-primary">Login</button> </form> -
django data table filters with filter-checkbox
HOW CAN I CONVERT THIS DYNAMIC FILTER JAVASCRIPT INTO CHECKBOX FILTER JS AND THE DATA WHICH IS EXPOSED IN THE FOR LOOP IS COMING DIRECTLY FROM SQL CONNECTION. PLEASE HELP """ function myFunction() { var input, filter, table, tr, td, i, txtValue; input = document.getElementById("myInput"); filter = input.value.toUpperCase(); table = document.getElementById("myTable"); tr = table.getElementsByTagName("tr"); for (i = 0; i < tr.length; i++) { td = tr[i].getElementsByTagName("td")[1]; if (td) { txtValue = td.textContent || td.innerText; if (txtValue.toUpperCase().indexOf(filter) > -1) { tr[i].style.display = ""; } else { tr[i].style.display = "none"; } } } } </script> """ """ <div class="sub-filter filter-hide" aria-labelledby="static-filter-company" data-toggle="checkboxgroup"> <ul role="listbox"> <li role="option"> <div class="filter-item pad-responsive-lr"> <div class="checkbox"> <input id="static-check-company" type="checkbox" data-indeterminate checked/> <label for="static-check-company">Select All</label> </div> </div> <ul class="filter-checklist"> {% for i in res %} <li class="pad-responsive-lr filter-item" role="option"> <div class="checkbox"> <input class ="filter-checkbox" data-filter="cols" id="static-check-mendez" type="checkbox" value="{{i.0}}"/> <label for="static-check-mendez">ID</label> </div> </li> {% endfor %} </ul> </div> """ HOW CAN I CONVERT THIS DYNAMIC FILTER JAVASCRIPT INTO CHECKBOX FILTER JS AND THE DATA WHICH IS EXPOSED IN THE FOR LOOP IS COMING DIRECTLY FROM SQL CONNECTION. PLEASE HELP -
Django Develop Live Streaming Application
We are building Live Streaming Application and I found there is very few resources to achieve this kind of thing. I decided to integrate third-party tools with Django to implement live streaming! Does anyone know any third-party service or tutorial to develop live video streaming? so that my user can go love using my webpage anytime. -
django.core.exceptions.SuspiciousFileOperation: The joined path is located outside of the base path comp
raise SuspiciousFileOperation( [20/Jun/2022 15:21:10] "GET /static/assets/img/logos/facebook.svg HTTP/1.1" 404 1846 django.core.exceptions.SuspiciousFileOperation: The joined path (S:\cdn.startbootstrap.com\sb-forms-latest.js) is located outside of the base path component (C:\Users\Nishant\Envs\work\lib\site-packages\django\contrib\admin\static) [20/Jun/2022 15:21:10] "GET /static/assets/img/about/2.jpg HTTP/1.1" 404 1825 [20/Jun/2022 15:21:10] "GET /static/assets/img/logos/google.svg HTTP/1.1" 404 1840 [20/Jun/2022 15:21:10] "GET /static/assets/img/about/3.jpg HTTP/1.1" 404 1825 [20/Jun/2022 15:21:10] "GET /static/https%3A/cdn.startbootstrap.com/sb-forms-latest.js HTTP/1.1" 500 59 [20/Jun/2022 15:21:10] "GET /static/assets/img/team/1.jpg HTTP/1.1" 404 1822 [20/Jun/2022 15:21:10] "GET /static/assets/img/about/4.jpg HTTP/1.1" 404 1825* [ [ i am having this error that path is located outside of the base path and i also uploaded all my file in github link is given ][github link for files] ][screenshort of the error] *