Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
SMTPAuthenticationError at /contacts/contact on sending an email in django
I am newbie to django learning django from a course by doing a realestate website in which user makes inquiry of every site shown in every website. Here I want to send email in this and I did as said in the video tutorial I am following and I wrote the code as follows My settings.py is Email config EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER='glakshmi@gmail.com' EMAIL_HOST_PASSWORD='1@st345' EMAIL_USE_TLS=True In the views.py # Send email send_mail( 'Property Listing Inquiry', 'There has been an inquiry for ' + listing + '. Sign into the admin panel for more info', 'glakshmi@gmail.com', # This is the from email address [realtor_email, 'glakshmi.nyros@gmail.com'], # This is to email address means we are specifiying where should the email goes fail_silently=False ) messages.success(request, 'Your request has been submitted, a realtor will get back to you soon') return redirect('/listings/'+listing_id) getting error -
Python Sphinx css not working on github pages
I have created documentation for a Django project using Sphinx and copy the content of html folder after executing the make html command into the docs/ folder of my repo and push it to Github. After that I have set this docs/ directory to Github Pages, now it's loading the documentation but the css is not working it's just a docs text with any styling. Here's my Sphinx's config.py: import os import sys import django sys.path.insert(0, os.path.abspath('..')) os.environ['DJANGO_SETTINGS_MODULE'] = 'PROJECT_NAME.settings' django.setup() templates_path = ['_templates'] exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] html_theme = 'bizstyle' html_static_path = ['_static'] BUILDDIR = '.' and here's the link to the docs page from GitHub pages: https://arycloud.github.io/Tagging-Project-for-Machine-Learning-Natural-Language-Processing/ what can be wrong? -
How to save two forms from single view?
I'm trying to create a sign up form with additional information like, 'first name', 'email' etc. I'm following an article. I have created a model named 'Profile' using signal. When user signs up, only user is updated not 'Profile' model. I tried to create a model form to update 'Profile' model using same signup view but it is not working. What am I doing wrong? models.py class Profile(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE) first_name = models.CharField(max_length=50) last_name = models.CharField(max_length = 50) email = models.EmailField(unique=True) phone = models.IntegerField(blank=True, null=True) bio = models.TextField(max_length=500, null =True, blank=True) location = models.CharField(max_length=30, null=True, blank=True) birth_date = models.DateField(null=True, blank=True) # password1 = models.CharField(max_length=50) # password2 = models.CharField(max_length=50) def update_user_profile(sender, instance, created, *args, **kwargs): if created: Profile.objects.create(user=instance) instance.profile.save() post_save.connect(update_user_profile, sender = User) forms.py class SignUpForm(UserCreationForm): username = forms.CharField(max_length = 20, widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder':'username'} )) first_name = forms.CharField(max_length = 20, widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder':'First Name'} )) last_name = forms.CharField(max_length = 20, widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder':'Last Name'} ) ) email = forms.CharField(max_length = 50, widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder': 'some@email.address'} )) birth_date = forms.DateField(widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder': '1995-11-16'} )) phone = forms.IntegerField(widget = forms.TextInput(attrs ={ 'class':'form-control', 'placeholder': 'Phone Number'} )) … -
how to get the username that we choose to edit the role?
so i have a page of manage user , it will show the list of user , and has delete button and can edit role from just change the select option here's the html and ajax script code <div class="row mt"> <div class="col-md-12"> <div class="content-panel align-content-center"> <table class="table table-striped table-advance table-hover"> <thead> <tr> <th><i class="fa fa-bullhorn"></i> User</th> <th><i class="fa fa-bookmark"></i> Email</th> <th><i class="fa fa-bookmark"></i> Division</th> <th><i class="fa fa-bookmark"></i> Role</th> <!-- <th><i class=" fa fa-edit"></i> Status</th> --> <th></th> </tr> </thead> <tbody> {% for user in users %} <tr> <td> <div class="userid"> {{user.name}} </div> </td> <td> {{user.email}} </td> <td> {{user.division}} </td> <td> <select id="userroles" class="roleselect"> <option selected="selected"> {{user.role}} </option> {% if user.role == "Business Analyst" %} <option>Admin</option> <option>Manager</option> <option>Segment Manager</option> {% elif user.role == "Admin" %} <option>Business Analyst</option> <option>Manager</option> <option>Segment Manager</option> {% elif user.role == "Manager" %} <option>Admin</option> <option>Business Analyst</option> <option>Segment Manager</option> {% else %} <option>Admin</option> <option>Manager</option> <option>Business Analyst</option> {% endif %} </select> </td> <td> <button class="btn btn-primary btn-xs" id="roleselect" href="{% url 'polls:editrole' %}"><i class="fa fa-pencil"></i></button> <button class="btn btn-danger btn-xs"><i class="fa fa-trash-o "></i></button> </td> </tr> {% endfor %} <script> $(document).ready(function() { $(".roleselect").change(function () { var urls = "{% url 'polls:editrole' %}"; var editrole = $(this).val(); var userid = $(".userid").val(); $.ajax({ url: urls, … -
How can I validate a post request from an raw HTML form (No django form used)
def update(request, property_id): obj = get_object_or_404(PropertyModel, property_id= form = PropertyModelForm(request.POST or None, instance= if form.is_valid(): form.save() template = 'form.html' context = { 'form': form } return render(request, template, context) have done using Django model from but want to do it using HTML form -
how to fix HTTP ERROR 405 in Django form?
there I'm using Django 1.9. I'm watching thenewboston Django lessons with bucky now when I'm trying to test this form it doesn't work. when I lunch the code is already running but when send the form it gives me this page image link. so, if anyone knows about the solution! note: I imitate every single code he does with the same version for Django. so, what's going on? -
Getting JSON decode error even after enclosing property name in double quotes
When I try to make a post request so as test the login endpoint, I get "JsonDecodeError". login view class Login(APIView): def post(self,request): data = str(request.data["json"]) dd = json.loads(data) phone_number = dd["phone_number"] user = authenticate(phone_number=phone_number) if user is not None: token = Token.objects.get_or_create(user=user) print(token[0]) login(request, user) data = { 'message': 'valid', 'token': str(token[0]) } else: data = { 'message': 'invalid' } return JsonResponse(data) -
Can't load templatetag in django 2.2.5
I'm using django 2.2.5. Using default approach of adding custom templatetags doesn't work (creating folder templatetags, __init__ and tags python files). @register.simple_tag def url_replace(request, field, value): dict_ = request.GET.copy() dict_[field] = value return dict_.urlencode() Tried to add it to options - project starts, but still 'unresolved library' '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', ], 'libraries': { 'replace_url': 'templatetags.replace_url', } replace_url - is a python file. {% load replace_url %} in html. Are there special features for django 2.2? -
Sort django query set based on orders in a list
I have a django query set like: the_query_set = {<obj1>, <obj2>, <obj3>} and a corresponding list: the_list = [False, True, False] how can I sort the_query_set in order of sorted list: the_sorted_list = [True, True, False] desired_sorted_query_set = {<obj2>, <obj3>, <obj1>} -
* "<: None>" needs to have a value for field "id" before this many-to-many relationship can be used * this error is not caught by exception handling
I am trying to throw a error by not saving the id of many to many field and trying to reach the except block but it is still throwing the value error. The except block is not called. try: def save_model(self, request, obj, form, change): stop = False print("test2") if "_stop" in request.POST: stop = True obj.save() state_id = request.POST.getlist('state') get_homescommunity_data(request, state_id, stop) except ValueError: print("test1") redirect("/admin/newhomedata/communitypagesurl/") -
Saving state of button in Javascript even after refreshing for each logged-in user
I am working on a Django application and am trying to save the state of a button clicked. I have a login form that accepts a registered user's credentials (if inputted). If successful, the user will be redirected to a page that'll contain two buttons. My main intention is to set 'button 1' and disable 'button 2' for a new user (once he/she logs in). So, if a user clicks on 'button 1', this button will get disabled and then 'button 2' will be enabled. When the same user logs out, the button state should be saved. This means that the user shouldn't click on 'button 1' again because 'button 2' was enabled last time. However, this seems to be applied to all users who log in. The state of the button does not correspond with that particular user who's logged in but gets impacted to all users' in general. This is the code: interface.html: <script> var disbledBtn = localStorage.getItem('disabled'); // get the id from localStorage $(disbledBtn).attr("disabled", true); // set the attribute by the id $('#button1').click(function () { $("#button1").attr("disabled", true); $("#button2").attr("disabled", false); localStorage.setItem('disabled', '#button1'); } </script> <body> <button type="button" id ='button1'> Button 1 </button> <button type="button" id ='button2'> Button 2 … -
sending mail with drf django
i'm trying to send mail after signup from django drf: settings.py: EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_HOST_USER = 'mymail@gmail.com' EMAIL_HOST_PASSWORD = 'password' serializers.py: class RegisterSerializer(serializers.ModelSerializer): password = serializers.CharField(write_only=True) def create(self, validated_data): user = UserModel.objects.create(email=validated_data['email']) user.set_password(validated_data['password']) user.save() to_mail = user.email send_mail('Subject here','Here is the message.','myemail@gmail.com',['to_mail',],fail_silently=False,) return user class Meta: model = UserModel fields = ( "id", "email", "password", ) im'm getting this error: SMTPRecipientsRefused at /api/registration/ {'=?utf-8?q?to=5Fmail?=': (553, b'5.1.3 The recipient address <=?utf-8?q?to=5Fmail?=> is not a valid RFC-5321\n5.1.3 address. u2sm31792629pgc.19 - gsmtp')} i'm even tried to send mail to different mail but i'm still gettings this error -
Remove specific actions from existing drf model viewset
I re-use an existing drf model viewset but there are some custom actions (assigned with @action label) that i don't need. How can I hide/remove it from django rest framework without modifying the origional model viewset? for example class MyViewSet(viewsets.ModelViewSet): @action(["get",], detail=False) def custom_a(self, request): # some stuff @action(["get",], detail=False) def custom_b(self, request): # some stuff @action(["get",], detail=False) def custom_c(self, request): # some stuff My router router = routers.SimpleRouter() router.register("dummies", views.MyViewSet) urlpatterns = [ path('', include(router.urls)), ] Then I will have these endpoints GET /dummies/ GET /dummies/{id}/ POST /dummies/ PUT /dummies/{id}/ PATCH /dummies/{id}/ DELETE /dummies/{id}/ GET /dummies/custom_a/ GET /dummies/custom_b/ GET /dummies/custom_c/ Now how can I just keep 5 first views and GET /dummies/custom_a/? Thanks. -
Join two tables with ManyToMany relationship in Django
I have two tables with the ManyToMany relationship (Service andApiKey), as well as a third table that joins them. I have forms for adding a record to the database based on the model for these tables. I wish that when adding Service there was also a list of which key to bind to it. How to do it? Service: class Service(models.Model): flow = models.ForeignKey( Flow, on_delete=models.CASCADE, related_name='services_flows' ) currency = models.ForeignKey( Currency, on_delete=models.CASCADE, related_name='services_currencies' ) contractor = models.ForeignKey( Contractor, on_delete=models.CASCADE, related_name='services_contractors', ) amount = models.IntegerField(default=0) callback_url = models.CharField( max_length=128, blank=True, null=True, default=None, ) definition = JSONField(null=True, blank=True, default=dict()) name = models.CharField(max_length=255, db_index=True) description = models.TextField(null=True, blank=True) charge_strategy = models.CharField(max_length=64, default='default') routine = JSONField(null=True, blank=True, default=dict()) Apikey: class ApiKey(models.Model): open_key = models.CharField(max_length=128) secret_key = models.CharField(max_length=128) description = models.CharField(max_length=128) restrict_ip = models.BooleanField() ip = ArrayField( models.CharField(max_length=32, blank=False, null=True), size=8, blank=True, null=True ) valid_to_date = models.DateField() restrict_methods = models.BooleanField() allowed_methods = ArrayField( models.CharField(max_length=32, blank=True, null=True), size=8, blank=True, null=True ) forbidden_methods = ArrayField( models.CharField(max_length=32, blank=True, null=True), size=8, blank=True, null=True ) Service_key - joins these two tables: service_key ServiceForm: class ServiceForm(forms.ModelForm): def __init__(self, *args, user=None, **kwargs): super(ServiceForm, self).__init__(*args, **kwargs) class Meta: model = Service fields = [ 'name', 'amount', 'callback_url', 'charge_strategy', 'description', 'definition', 'routine', 'contractor', … -
How to read or save a file from MultiValueDict in Django
I'm sending a excel file from Angular to Django. I want to read the file using Pandas and perform some operations in the file, but I'm not sure how to do it. class fileupload(APIView) : def post(self, request): f = request.FILES print(f) When I print, it shows below, <MultiValueDict: {'excelfile': [<InMemoryUploadedFile: New_Excel.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)>]}> Here, I want to save this file to some location and use pandas to perform operations or if possible, directly would need to read the file using pandas. I'm new to Django and Pandas so if anything is wrong, please help.. Thanks in advance -
Django Admin Inline an object
I have Two models Question and QuestionChoice. QuestionChoice has a ForeignKeyfield which points to Question. I would like to have these as inline stack views in the admin view but I'm getting an error. Models: class Question(models.Model): PROFILE = 0 EVENT_REPORT = 1 UNIVERSITY_REPORT = 2 USER_REPORT = 3 TYPE_LIST = [PROFILE, EVENT_REPORT, UNIVERSITY_REPORT, USER_REPORT] TYPE_CHOICES = ( (PROFILE, 'Profile'), (EVENT_REPORT, 'User Report'), (UNIVERSITY_REPORT, 'University Report'), (USER_REPORT, 'User Report'), ) description = models.CharField(max_length=100) type =models.IntegerField(choices=TYPE_CHOICES, default=PROFILE) def __str__(self): return self.description class QuestionChoice(models.Model): description = models.CharField(max_length=100) question = models.ForeignKey(Question, on_delete=models.CASCADE) answer = models.CharField(max_length=100, blank=True) def __str__(self): return self.question.first().description + ' ' + self.description Admin: admin.site.register(QuestionChoice) class QuestionChoiceInline(admin.StackedInline): model = QuestionChoice can_delete = True verbose_name_plural = 'Question Choices' fk_name = "question" class CustomQuestionAdmin(UserAdmin): inlines = (QuestionChoiceInline, ) def get_inline_instances(self, request, obj=None): if not obj: return list() return super(CustomQuestionAdmin, self).get_inline_instances(request, obj) admin.site.register(Question, CustomQuestionAdmin) But I'm getting this error: ERRORS: <class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E019) The value of 'filter_horizontal[0]' refers to 'groups', which is not an attribute of 'userprofile.Question'. <class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E019) The value of 'filter_horizontal[1]' refers to 'user_permissions', which is not an attribute of 'userprofile.Question'. <class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E033) The value of 'ordering[0]' refers to 'username', which is not an attribute of 'userprofile.Question'. <class 'userprofile.admin.CustomQuestionAdmin'>: (admin.E108) … -
How render page using Jquery or Javascript script?
I have two users in a page one is active and another is inactive in users list page. When i do inactive an user then the page is not going to inactive list but when from inactive i activate user it's coming to active page. users For active users {% if active_users|length > 0 %} **some data** <a {% if user.is_active %} onclick="return confirm('Are you sure you want to deactivate this user?')" {% else %} onclick="return confirm('Are you sure you want to activate this user?')" {% endif %} href="{% url 'common:change_user_status' pk=user.id %}" class="on_off" style="color: #454545; text-decoration: none;"> {% if user.is_active == True %} <i class="fa fa-toggle-on"></i> Active {% else %} <i class="fa fa-toggle-off"></i> InActive {% endif %} </a> For inactive users {% if inactive_users|length > 0 %} **some data** a {% if user.is_active %} onclick="return confirm('Are you sure you want to deactivate this user?')" {% else %} onclick="return confirm('Are you sure you want to activate this user?')" {% endif %} href="{% url 'common:change_user_status' pk=user.id %}" class="on_off" style="color: #454545; text-decoration: none;"> {% if user.is_active == True %} <i class="fa fa-toggle-on"></i> Active {% else %} <i class="fa fa-toggle-off"></i> InActive {% endif %} </a> If i change the user status to inactive … -
Wagtail admin interface cannot properly display Django models with spaces in their names
I am trying to manage Django models via the Wagtail administration interface. I have one model working fine which uses numbers as its primary key. I have another model that uses a CharField for its primary key. If this field has any spaces in it, Wagtail will not load the respective model's entries in the Wagtail admin interface. Instead it will give a NoReverseMatch found error. The model works fine in Wagtail's admin if there are no entries that contain spaces in their primary key. I suspect this is because links with spaces are invalid. I do not know how to force Wagtailadmin to replace spaces with valid characters. -
Django - Override/Replace imports from 3rd part site-packages
I have upgraded my Django 2 to Django 3. There is a package django-jet which is not yet updated on Django 3. So i am facing a import issue which is removed from django 3, so how can i changes/override/replace that single line from django package file. File "/home/user/Documents/my_project/venv-3.7/lib/python3.7/site-packages/jet/models.py", line 3, in <module> from django.utils.encoding import python_2_unicode_compatible ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (/home/user/Documents/my_project/venv-3.7/lib/python3.7/site-packages/django/utils/encoding.py) I want to replace this line from package models.py file from django.utils.encoding import python_2_unicode_compatible # replace with from django.utils.six import python_2_unicode_compatible -
Django/python/static files/Jinja, How to concatenate string and jinja expression INSIDE jinja statement
How to concat a string and a jinja expression inside jinja statement? {% for pic in pictures %} {% if pic.name == line.name %} <img class="card-img-top" src="{% static 'orders/img/'pic.picture %}" > {% endif %} {% endfor %} In this tag with Jinja, the pic.picture is a jinja express but how to concat with 'orders/img/' ? ----> 1 Thanks. -
Django: Selecting different divs while indexing a list inside one, HTML/Javascript
I have two divs that are toggled between dislpay:none and display:inline through the same javascript function. This is working properly, however, I want to also index the outliers_data list at some integer value based on what is passed into the javascript function. I am not sure how to best accomplish this task. Here is my html: <div id="outlier_list" style="display: inline"> <label style="text-decoration: underline; font-size: 24px;">Outliers</label><br> {% for val, name in outliers %} <label onclick="swapOutlierContent({{ forloop.counter }})" style="font-weight: bold; cursor: pointer;">{{ val }} </label> <label style="font-style: italic;">{{ name }}</label><br> {% endfor %} </div> <div id="outlier_data" style="display: none;"> <label style="text-decoration: underline; font-size: 24px;">Outlier In-Depth</label><br> {% for val, name in outliers_data %} <label onclick="swapOutlierContent({{ forloop.counter }})" style="font-weight: bold; cursor: pointer;">{{ val }} </label> <label style="font-style: italic;">{{ name }}</label><br> {% endfor %} </div> <script> function swapOutlierContent(outlier_id) { outlier_list = document.getElementById('outlier_list'); outlier_data = document.getElementById('outlier_data'); if (outlier_list.style.display == 'inline'){ outlier_list.style.display = 'none' } else { outlier_list.style.display = 'inline' } if (outlier_data.style.display == 'inline'){ outlier_data.style.display = 'none' } else { outlier_data.style.display = 'inline' } } </script> I would like the {% for val, name in outliers_data %} to become something like {% for val, name in outliers_data.index %} but my current structure seems wrong for this. Thanks -
How to filter chart.js based on dates via django?
Here is my code for placing the code onto my api end point: class ChartData(APIView): authentication_classes = [SessionAuthentication, BasicAuthentication] permission_classes = [IsAuthenticated] def get(self, request, format=None): current_user = request.user print(current_user.id) sales_rev_data = Sales_project.objects.values_list('sales_project_est_rev').filter(sales_project_status = 'p4').filter(sales_extras = current_user.id) sales_project_closing_date_data = Sales_project.objects.values_list('sales_project_closing_date').filter(sales_project_status = 'p4') cost_data_per_unit = Sales_project.objects.values_list('material_costs').filter(sales_project_status = 'p4').filter(sales_extras = current_user.id) moq_data = Customer_requirement.objects.values_list('moq').filter(sales_project__sales_project_status__contains= 'p4') cost_data = np.array(list(moq_data)) * np.array(list(cost_data_per_unit)) profit_data = np.array(list(sales_rev_data))- cost_data data = { "sales_rev": sales_rev_data, "sales_time_axis": sales_project_closing_date_data, "profit_data_per_project": profit_data } return Response(data) Here is the code for rendering the charts: <script type="text/javascript"> endpoint = 'api/chart/data' $.ajax({ type: "GET", url: endpoint, success: function(data){ sales_time = data.sales_time_axis sales_rev = data.sales_rev profit_data_per_project= data.profit_data_per_project var ctx = document.getElementById('myChart').getContext('2d'); var ctx2 = document.getElementById('myChart2').getContext('2d'); var myChart = new Chart(ctx, { type: 'bar', data: { labels:sales_time, datasets: [{ label: sales_time, data: profit_data_per_project, backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] }, options: { scales: { yAxes: [{ ticks: { beginAtZero: true } }] } } }); … -
Deploying django media files to heroku
I am storing my image name that is uoloaded in database of postgres when deploying on heroku. In that case i am calling it from my views.py. The image name with media url in my development. What are the steps that i can follow to get this done? To upload the media in heroku as it is not found after upload. I have seen every blog and every page of stack overflow also. Please help -
How is django and reactjs related to instagram?
I'm new to Django framework and Reactjs. When going through how authentication work in django. The default link is "www.example.com/account/login" for login page. I take instagram as an example, it also implement something like this "www.instagram.com/account/login" < is this style Reactjs or django? I assume it is Django since I do not know how is the Reactjs router work. can someone roughly explain what is the architecture of website like Instagram? -
Cookiecutter local enviroment not working
i'm facing some troubles with my local docker enviroment (running docker-compose -f local.yml up), Error django_1 | /entrypoint: 4: set: Illegal option -o pipefail I've migrated from python:3.7-alpine to python:3.7-slim-buster Dockerfile FROM python:3.7-slim-buster ENV PYTHONUNBUFFERED 1 RUN apt update \ # psycopg2 dependencies && apt install -y gcc python3-dev musl-dev \ && apt install -y postgresql \ # Pillow dependencies && apt install -y libjpeg-dev zlib1g-dev libfreetype6 liblcms2-dev libopenjp2-7-dev libtiff-dev tk-dev tcl-dev \ # CFFI dependencies && apt install -y libffi-dev python-cffi \ # Translations dependencies && apt install -y gettext \ # https://docs.djangoproject.com/en/dev/ref/django-admin/#dbshell && apt install -y postgresql-client \ && apt install -y libcurl4-openssl-dev libssl-dev \ && apt install -y libproj-dev gdal-bin libgeos-dev libproj-dev RUN apt install -y chromium ENV CHROME_BIN=/usr/bin/chromium-browser ENV CHROME_PATH=/usr/lib/chromium/ # Requirements are installed here to ensure they will be cached. COPY ./requirements /requirements RUN pip install -r /requirements/local.txt COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint COPY ./compose/local/django/start /start RUN sed -i 's/\r$//g' /start RUN chmod +x /start WORKDIR /app ENTRYPOINT ["/entrypoint"] do you know why is this happening?