Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
Why does docker-compose.local.yml can not run django app?
I am using docker-compose -f docker-compose.local.yml run django black apps common tests individual_service It is giving: python: can't open file '/app/manage.py': [Errno 2] No such file or directory -
How to send mail when new blog post is published to subscribed users in django?
How to send mail when new post is published to subscribed users in django -
Is there a way to use the requirements.txt file when deploying a Django App with Azure CLI?
It seems that the requirements.txt file is automatically recognized and executed when using the github continous integration. Would it be possible to do this with Azure CLI? -
current path didn't match in django
I am a beginner for django. I tried to make my 1st project helloworld, with the help of tutorials I installed and followed their instructions. When I run my project in server it shows an error 404, the current path didn't match any of these. myproj/urls.py from django.contrib import admin from django.urls import path from helworld.views import hello urlpatterns = [ path('admin/', admin.site.urls), path('index/', hello), ] helworld/views.py from django.shortcuts import render from django.http import HttpResponse def hello(request): return HttpResponse(request, "hello world!") This is my code when I run it. Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/helworld Using the URLconf defined in myproj.urls, Django tried these URL patterns, in this order: admin/ index/ The current path, helworld, didn't match any of these. You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page. I searched for solution but being a beginner its bit tough for me to solve this error. so kindly help me with an easy clarification. Thank you in advance. -
Refresh table data every 5 seconds with ajax based on toggle button status
I am creating a web page using Django and Ajax. I want to refresh my page every 5 seconds depending on the status of a bootstrap toggle switch. i.e. On - Auto refresh table data every 5 seconds Off - Do not refresh I have the below written with ajax call. $(document).ready(function () { $('#auto_switch').hide(); $('#loading').show(); var broker = '{{ broker }}'; $.ajax({ type: "GET", cache: true, url: '{% url 'broker:load_data' %}', data: { 'broker': broker, }, data_type: 'html', success: function (data) { $('#loading').hide() $('#auto_switch').show(); $('#stock_holdings').html(data.rendered_table); } }); $("#auto_switch").change(function () { if ($(this).prop("checked") == true) { setInterval(function () { $.ajax({ type: "GET", cache: true, url: '{% url 'broker:load_data' %}', data: { 'broker': broker, }, data_type: 'html', success: function (data) { $('#loading').hide() $('#auto_switch').show(); $('#stock_holdings').html(data.rendered_table); } }); }, 5000); else { $.ajax({ type: "GET", cache: true, url: '{% url 'broker:load_data' %}', data: { 'broker': broker, }, data_type: 'html', success: function (data) { $('#loading').hide() $('#auto_switch').show(); $('#stock_holdings').html(data.rendered_table); } }); } }); }); I am expecting that if (toggle button is enabled), the function will trigger and the table data will keep refreshing every 5 seconds and on any change in the toggle switch it will find its status as off and no auto refresh … -
Send Html as text/html in Django
I have an entry.html file which looks like this: {% extends 'encyclopedia/layout.html' $} {% block title %} {{ title_name }} {% endblock %} {% block body %} {{ content }} {% endblock %} There are some markdown files (.md) which I have to read, convert to HTML, and display it on the webpage. There is a util.py file which returns the content of the markdown file by using the util.get_entry(title) function. Here is my views.py file: from django.shortcuts import render from django.http import HttpResponse from . import util from markdown2 import markdown ... def entry_page(request, title): md_text = util.get_entry(title) if md_text is not None: html = markdown(md_text) return render(request, 'encyclopedia/entry.html', { 'title_name': title, 'content': html }) else: return HttpResponse('<h1>404 Page Not Found!</h1>') The problem here is that the output is in plain text, like this: I want to send the text as html and not a plain text. How do I achieve this? -
Add row Id in Django data table
I am using django datatable the data that come from server has the following format: [ ['id_value','data col1','data col2',...] . . .] I am try to make id to every row as follow: 'rowId': 1, but it doesn't work my html code: <table id="mainDataTable" class="table table-responsive-md table-{{ documentvals.table_type }}"> <thead> <tr> {% for field in list_fields %} <th> {{ field }}</th> {% endfor %} </tr> </thead> <tbody> </tbody> <tfoot> <tr> {% for field in list_fields %} <th> {{ field }}</th> {% endfor %} </tr> </tfoot> </table> Also, my js code is: let _columns= [ {% for field in list_fields %} { "data": '{{ field }}' }, {% endfor %} ] $('#mainDataTable').DataTable({ "paging": true, "lengthChange": true, "searching": true, "ordering": true, "info": true, "columns": _columns, "autoWidth": false, "responsive": true, "aaSorting": [], "pageLength": pag, "bProcessing": true, "bServerSide": true, "ajax": { "url": mainUrl, }, 'rowId': 2, "pagingType": "full_numbers", destroy: true, }); I did not want to edit django datatable library. -
get the id and description from database for dropdown in django
I am trying to create a dropdown in my django form. I am new to django framework. In ASP.NET MVC, we use LINQ or SQL Procedure to fetch data and also in model class we can do, /// model class [NotMapped] public string ddl_productdesc { get { return string.Format("{1} --- {2}", ProductID, I_NUMBER, ProductDESC); } } In my table, there are around 30 columns from them I need three fields (ProductID, I_NUMBER, ProductDESC, I_NUMBER) for my dropdown How can I do the same in django, the ID field used for data fetching and insertion and other two fields as dropdown? Thank You! -
What is the best way to prepopulate Groups table and permissions for it at application startup?
My goal is: to have created custom Groups and populated with permissions for specific models. All that immediately after or during application starts Question: What is the most appropriate way to achieve that? For example my custom group is MY_CUSTOM_GROUP and i want to add change and view permissions for Model Book to that group -
How to concatenate two dates into one string in Django?
I have two model fields. class Event(models.Model):] start_date = models.DateTimeField() end_date = models.DateTimeField() I would like to concatenate two dates into one string I would like to obtain result like this as new field: {'dates': '2020-12-1-2021-12-1'} concatenate start_date and end_date into one string What I tried to do: event = Event.objects.annotate(dates=Concat('start_date__date', 'end_date__date')) event.values('dates') Output: <QuerySet [{'dates': '2020-12-25 17:44:50+002021-01-16 17:44:52+00'}], Not output I would like to obtain I need output like this: {'dates': '2020-12-1-2021-12-1'} Concatenate two date time fields into one string (only dates, don't need time) -
Django local_settings.py Protection and Permission
I want deploy a Django project, I created a local_settings.py for local variables(secret_key, database ,etc). Are there any best practices or check lists for protecting local_settings.py file? for example what should be its permission (e.g is 700 ok?)? or where should be located (its path)? Thanks -
How to add HTML tags functionality inside of a post model in Django
I'm learning to build a blog post using django. The Blog post has a title, introduction and body. I want to be able to use HTML tags inside of the body field. I'm a newbie in programming and I don't know how to go about it. Please I need your help. -
I am getting this error while adding product from django admin panel
When i try to add product from django built admin panel i get this error message: /home/pihffall/virtualenv/gngmain/3.7/lib/python3.7/site-packages/PIL/../Pillow.libs/libjpeg-ba7bf5af.so.9.4.0: file too short Can someone tell me how can i solve this issue ? -
Good: How can I run my django runserver command?
I have been having this error for 2 day Can somebody help? System check identified no issues (0 silenced). January 17, 2021 - 13:18:06 Django version 3.1.5, using settings 'dj_bootcamp.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. Exception in thread django-main-thread: Traceback (most recent call last): File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "C:\Users\Boshqaruvchi\dj-bootcamp\lib\site-packages\django\utils\autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "C:\Users\Boshqaruvchi\dj-bootcamp\lib\site-packages\django\core\management\commands\runserver.py", line 139, in inner_run run(self.addr, int(self.port), handler, File "C:\Users\Boshqaruvchi\dj-bootcamp\lib\site-packages\django\core\servers\basehttp.py", line 206, in run httpd = httpd_cls(server_address, WSGIRequestHandler, ipv6=ipv6) File "C:\Users\Boshqaruvchi\dj-bootcamp\lib\site-packages\django\core\servers\basehttp.py", line 67, in init super().init(*args, **kwargs) File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\socketserver.py", line 452, in init self.server_bind() File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\wsgiref\simple_server.py", line 50, in server_bind HTTPServer.server_bind(self) File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\http\server.py", line 140, in server_bind self.server_name = socket.getfqdn(host) File "C:\Users\Boshqaruvchi\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 756, in getfqdn hostname, aliases, ipaddrs = gethostbyaddr(name) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 13: invalid continuation byte -
admin inline ManyToMany autocomplete_fields
I want to add search for the AcademicGroupInline with using its vk_chat relation # models.py class AcademicGroup(models.Model): students = models.ManyToManyField( 'user.Student', ) vk_chat = models.OneToOneField( 'Chat', ) class Chat(models.Model): owner_id = models.BigIntegerField() name = models.CharField() # admin.py class AcademicGroupInline(admin.TabularInline): model = AcademicGroup.students.through autocomplete_fields = ( 'vk_chat', ) @admin.register(Student) class StudentAdmin(admin.ModelAdmin): inlines = [AcademicGroupInline] But I've got an error in result: <class 'user.admin.AcademicGroupInline'>: (admin.E037) The value of 'autocomplete_fields[0]' refers to 'vk_chat', which is not an attribute of 'course.AcademicGroup_students'. -
Django ModelForm for Multiple Categories of a Product in EAV data model
Hello all I am making auction website like ebay, I have this model design which has many other extra attributes model classes for different categories. But here let's take an example of a PC one which will be used for its sub-categories Desktop and Laptop. Now the problem, I want to create ModelForm for users. For instance if user selects Desktop as their product to put on auction, how will that modelform code look like, so the Desktop respected fields are given to the user to fill from the extra_pc_attributes class? The problem is that wouldn't it get tedious to write separate model for each category and also in the views.py, let alone how would each category form validate? Maybe use Jsonfield instead of creating a whole EAV old-fashioned table for extra attributes? But I am new and I don't know how it will work or even if it applies to this situation. class Categories(MPTTModel): name = models.CharField(max_length=50, unique=True) parent = TreeForeignKey('self', on_delete=models.CASCADE, null=True, blank=True, related_name='children') class auction_product(models.Model): product_name = models.CharField(max_length=64) category = models.ForeignKey(Categories, on_delete=models.CASCADE) date_added = models.DateField(default=timezone.now) user = models.ManyToManyField(User, through='product_ownership', related_name='product_user') product_bid = models.ManyToManyField(User, through='bid', related_name='product_bid') product_comment = models.ManyToManyField(User, through='comment') album = models.OneToOneField(ImageAlbum, related_name='product_model', on_delete=models.CASCADE) def __str__(self): return … -
Django Modelform Instance Uodate with Clean_field of modelform in form.py
I want to Update some value of a Book instance in Django from. I have put clean_field() methods in forms.py. So, everytime I update the value in a form it validates the clean_field and raises a validationError for those two fields. I want to bypass that while I update the object's some parameter like bookPrice or publicationDate. so, I can update that value without getting an error on existing fields. I have put clean_field() for bookname,bookisbn. views.py def updateBook(request, key_id): book = Book.objects.get(bookIsbn__exact=key_id) # date format 2/21/2020 print(request.method) if request.method == 'POST': form = BookUploadForm(request.POST, request.FILES, instance=book) if form.is_valid(): form.save() return redirect('bookList') else: print(form.errors.as_data()) form = BookUploadForm(request.POST or None, request.FILES or None, instance=book) template = 'storeApp-Templates/bookUpdate.html' context = {'book': book, 'form': form} return render(request, template, context) form.py class BookUploadForm(forms.ModelForm): class Meta: model = Book fields = "__all__" widgets = { 'bookName': forms.TextInput(attrs={'class': 'form-controls'}), 'bookPrice': forms.TextInput(attrs={'class': 'form-controls'}), 'bookAuthor': forms.TextInput(attrs={'class': 'form-controls'}), 'bookIsbn': forms.TextInput(attrs={'class': 'form-controls'}), 'bookPublicationDate': forms.DateInput(attrs={'class': 'form-controls'}), } bookPublicationDate = forms.DateField(widget=AdminDateWidget()) # this methods will generate error for book update as well as new book Upload def clean_bookName(self, *args, **kwargs): bookname = self.cleaned_data.get('bookName') qs = Book.objects.filter(bookName__exact=bookname) if qs.exists(): raise forms.ValidationError("This BookName has already been used.") return bookname def clean_bookIsbn(self, *args, **kwargs): bookisbn … -
can't understand error and type of error _new in django
File "C:\Users\XXX CCCC\AppData\Local\Programs\Python\Python39\lib\site-packages\ortools\constraint_solver\pywrapcp.py", line 2842, in __init__ _pywrapcp.RoutingModel_swiginit(self, _pywrapcp.new_RoutingModel(*args)) TypeError: Wrong number or type of arguments for overloaded function 'new_RoutingModel'. Possible C/C++ prototypes are: operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &) operations_research::RoutingModel::RoutingModel(operations_research::RoutingIndexManager const &,operations_research::RoutingModelParameters const &) I'm new in python please help to solve -
How to save PNG file using FileSystemStorage in Views
I am missing something in the documentation, but cannot figure out what. When a user sends a POST request, I want to generate PNG and put it to the ImageField. I generate PNG with qrcode generator, which give PymagingImage object. I tried to pass it to the FileSystemStorage. Later I tried using BytesIO, so I could open PngImageFile object and try to pass it too. In both cases, I failed, and I am getting object has no attribute 'read' error. As I understood from the documentation I have to use File or ImageFile object for FileSystemStorage to work. However, I cannot find a way how to convert my PNG to correct type. I would really appreciate if someone could pinpoint the error in my code or my logic. Thanks! views.py: qr = qrcode.make("123456", image_factory=PymagingImage) # PymagingImage object buffer = BytesIO() qr.save(buffer, "PNG") # PngImageFile object qr_from_buffer = Image.open(buffer) fs = FileSystemStorage() qr_img = fs.save("qrcode.png", qr_from_buffer) -
Email doesn't get sent in when I host with apache2 - Django
I am creating an eCommerce site and while in my local machine it has worked perfectly fine with no errors and emails are being sent without any error. However, when I hosted it on Linode(ubuntu) using apache2 my website seems to be working perfectly fine but only emails don't get sent... I usually wait around 2 mins when I submit a form to send an email, but it throws me with the contact_us_error.html template I have created. My Settings.py... import json with open('/etc/config.json') as config_file: config = json.load(config_file) ... EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = 'smtp.gmail.com' EMAIL_PORT = 587 EMAIL_USE_TLS = True EMAIL_HOST_USER = config.get('EBLOSSOM_EMAILID') EMAIL_HOST_PASSWORD = config.get('EBLOSSOM_EMAILPASS') AUTHENTICATION_BACKENDS = ['user.backends.EmailBackend'] And in my views.py... try: send_mail( 'Subject', 'Content', 'email_address', ['email_address'], fail_silently=False, ) return render(request, "store/email_confirmation.html") except: return render(request, "store/contact_us_error.html") This is the code that is currently stored in my server. I know for a fact that my environmental variables are read by Django, but it just doesn't seem to send emails when hosted in Linode. The current IP address of my server is http://192.46.213.68/ . Any help would be greatly appreciated thanks! -
Django rest framework: how to look up UUIDs properly and (with slugs?)
I'm struggling to figure out how to use uuids properly. I'm following Daniel Feldroys Two Scoops of Django, but I'm finding uuids difficult. My app was working before using sequential user ids, now I want to change it to a uuid to make the API more secure. But my question is: How to I actually look up the unique user ID? None of the views (http://127.0.0.1:8000/api/) seem to be displaying any data, despite that I can see data in Admin. I'm guessing I need to supply the unique user ID (http://127.0.0.1:8000/api/), but since this is autogenerated when I post objects to the database, how do you obtain the uuid? Is it only when you create the objects in the first place, for extra security? But if I have existing objects that I migrate over from another API, can I run python manage.py shell and look up the uuids of existing objects some how? I'm also conceptually struggling with the roles of slugs. how do I use them to find the correct web url? This is my models.py import uuid as uuid_lib from django.db import models from django.urls import reverse from .rewards import REWARDS class TimeStampedModel(models.Model): """ An abstract base class … -
My navbar brand is taking a whole lot of space
I was writing an html page with bootstrap and then I come across some sort of kind of error the navbrand is too long. It takes up a whole lot of space in my navbar at the point when I view it on mobile It takes up a whole line and the hamburger icon goes to the bottom. This problem doesn't occur with text only with images. {% load static %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Urci</title> <!-- BOOTSTRAP --> <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> <!-- CSS --> <!-- CSS --> <link rel='stylesheet' href="{% static 'home/css/custom.css' %}"> <!-- FONTS --> <link rel="preconnect" href="https://fonts.gstatic.com"> <link href="https://fonts.googleapis.com/css2?family=Lato&family=Oswald:wght@300&family=Roboto+Condensed&display=swap" rel="stylesheet"> <!-- W3 --> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> </head> <body> <nav class="navbar navbar-expand-lg navbar-light bg-light custom-navbar"> <div class="container-fluid"> <a class="navbar-brand urci-brand" href="{% url 'home' %}"><img class="branding "src="{% static 'home/images/Urci-Logo.png' %}" alt=""></a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNavAltMarkup"> <div class="navbar-nav custom-navbar"> <a class="nav-link" href="{% url 'bod' %} ">Board of Directors</a> <a class="nav-link" href="#">Events</a> {% if user.is_authenticated %} <div class="navbar-nav ml-auto"> <a class="nav-link" href="{% url 'announcement:create' %}">Create Announcement</a> <a class="nav-link" href="#">Create Events</a> {% endif … -
Django can send email from Python Shell but Gmail blocks mail when sent from front end form
I'm trying to make a password reset via email page following the tutorial here: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication#password_reset_templates I can send emails while in the Python-Django shell but when I try to send it via that form, Gmail blocks my messages. I have my email settings in settings.py configured as: #gmail_send/settings.py EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = 'foo@gmail.com' EMAIL_HOST_PASSWORD = os.environ['EMAIL_PASSWORD'] EMAIL_PORT = 587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = EMAIL_HOST_USER SERVER_EMAIL = EMAIL_HOST_USER When I do this using the shell, I'm able to receive the email: >>> from django.core.mail import send_mail >>> send_mail('test email', 'hello world', 'your@email.com', ['test@email.com']) My password reset form looks like this (base_generic just has some bootstrap and jquery CDN stuff along with a navbar) {% extends "OracleOC/base_generic.html" %} {% block content %} <form action="" method="post"> {% csrf_token %} {% if form.email.errors %} {{ form.email.errors }} {% endif %} <p>Please enter your email:</p> <p>{{ form.email }}</p> <input type="submit" class="btn btn-primary main_menu_button" value="Reset password"> </form> {% endblock %} When I press submit, everything looks fine and I get a [17/Jan/2021 07:04:12] "GET /accounts/password_reset/done/ HTTP/1.1" 200 2105 in my Django console but I get a copy of the message in my sender gmail box with this message: Gmail blocked my … -
Django REST framework - filtering against query params with date and string parameter
I created my "API" using REST framework, now trying to do filtering for it. That's how my models.py look for Schedule model. class Schedule(models.Model): bus_company_route = models.ForeignKey(BusCompanyRoute, on_delete=models.PROTECT) bus = models.ForeignKey(Bus, on_delete=models.PROTECT) travel_date_time = models.DateTimeField() I want to filter departure and travel_date_time on query parameters. Basically field departure comes from following models. class BusCompanyRoute(models.Model): route = models.ForeignKey(Route, on_delete=models.PROTECT) and route is linked with 'Route' model in following way class Route(models.Model): departure = models.ForeignKey( Location, on_delete=models.PROTECT, related_name='route_departure' ) class Meta: default_permissions = () verbose_name = 'Route' verbose_name_plural = 'Routes' I basically use usecases.py for my logic section so in my views.py file I have following code to get query paramters. class BusCompanyTicketDetailView(generics.ListAPIView, BusCompanyMixin): serializer_class = serializers.TicketDetailResponseSerializer def get_queryset(self): travel_date = (self.request.query_params.get('travel_date')) destination = (self.request.query_params.get('destination')) return usecases.ListBusCompanyTicketUseCase( bus_company=self.get_bus_company(), date=travel_date, destination=destination ).execute() and my usecase file have following code. class ListBusCompanyTicketUseCase(BaseUseCase): def __init__(self, bus_company: BusCompany, date: datetime, destination): self._bus_company = bus_company self._date = date self._destination = destination # print(datetime) def execute(self): self._factory() return self._schedules def _factory(self): self._schedules = Schedules.objects.filter(bus__bus_company=self._bus_company ,travel_date_time__date=self._date ,bus_company_route__route__destination=self._destination) Finally my url with query parameter is as follows http://127.0.0.1:8000/api/v1/ticket/bus-company/1037a4cc-ff38-4948-978a-5a7b92cb7a41/list?travel_date=2021-1-2&destination=florida I was getting correct query only with travel_date_time but on adding destiantion I am getting error as ValidationError at /api/v1/ticket/bus-company/1037a4cc-ff38-4948-978a-5a7b92cb7a41/list ['“florida” is … -
How to pass the value from v-for to a simple django filter
I have the following component in a django template <div class="trow" v-for="(item, idx) in data"> </div> Now if I try to write the following inside the div {{ item.co.name }} I won't get the value, I will have to write the following to get the value {% verbatim %} {{ item.co.name }} {% endverbatim %} Now my problem is that I have to do something with this value so I wrote a simple filter like this from django import template from django.templatetags.static import static register = template.Library() @register.filter def define(val=None): return static(f"images/{val.lower()}.svg") but I can't do the following <div class="trow" v-for="(item, idx) in data"> {% verbatim %} {{ item.co.name | define }} {% endverbatim %} </div> I've also tried a lot of combinations with no luck, how can I solve this?