Re: Stuck with Django on a Synology Diskstation

2020-03-05 Thread V. J
Zdravím vás, myslíme že přístup byl udělen jen pár lidem kteří odvádí dobrou práci, jelikož by bylo dost nebezpečné udělit přístup všem, tak pokud vas mohu poprosit obraťte se s žádostí na ně. A pokud uznaji za vhodné že je to potřeba, provedou opravu, nebo doplnění. Pokud se mýlím, tak mě kontaktujte a prenastavim pravidla přístupu. Přeji hezký den s pozdravem Vasek JachimOdesláno z mého telefonu Huawei Původní zpráva Předmět: Re: Stuck with Django on a Synology DiskstationOdesílatel: 'MH' via Django users Komu: Django users Kopie: Is there anything particular hat I have to write into that wsgi.py file?



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0bfe682d-5dda-4f50-85bc-1239b17a82a3%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/-kdq1xj-ohu8uudyni2w-qp6yfm-r1fto6-uhymk84wh307-guno8r-c497jr9gy14j-8vrumlx66jke-aw50mvkek1qxdc72ifubmccbwl6u8u-idee96zjjyzg7gdypxqtaqh-jvqrulz2p1np-1icriq.1583442428804%40email.android.com.


Re: NoReverseMatch at /searchlit/customsearch and bigger problem of exporting a filtered queryset

2020-08-29 Thread V. J
Věřte si 😉 Vašek. JOdesláno z mého telefonu Huawei Původní zpráva Od: RANGA BHARATH JINKA Datum: so 29. srp 2020 5:00Komu: django-users@googlegroups.comPředmět: Re: NoReverseMatch at /searchlit/customsearch and bigger problem of exporting a filtered querysetHi,     There is a django module.     https://pypi.org/project/django-datatables-view/On Sat, 29 Aug 2020, 8:25 am RANGA BHARATH JINKA,  wrote:Hi,    Use jQuery datatable for this. It is easy to use and has inbuilt search and export to CSV, Excel options also.https://datatables.net/extensions/buttons/examples/initialisation/export.htmlOn Sat, 29 Aug 2020, 7:54 am RANGA BHARATH JINKA,  wrote:Hi,     Check this.      https://pypi.org/project/django-queryset-csv/On Sat, 29 Aug 2020, 7:33 am RANGA BHARATH JINKA,  wrote:Hi,         Please check this package. This may help you. All the best    https://django-tables2.readthedocs.io/en/latest/pages/filtering.html  On Sat, 29 Aug 2020, 4:36 am Patrick Carra,  wrote:Hello All!  I need some help with a problem I have been struggling with.  One of you generous geniuses has the answer I'm sure of it.  I am working on integrating an export to csv button(link) on my template to export filtered data from one of my tables.  I have previously only been able to dump the entire table to csv which isn't exactly what I need.  So my thoughts were to place a button/link on the template passes a parameter(dictionary of my filter criteria) to a view named ExportSearch.  The view then calls a function that I have defined to perform my filtered query to the table and then writes outs to csv.  In theory I thought this should work but I keep getting errors that I have not been able to resolve and I am at the end of my knowledge capacity here.  Applicable code below.  Did I mention THANK YOUFrom searchLit/urls.pyfrom django.urls import include, pathfrom . import viewsfrom .views import searchapp_name= "searchLit"urlpatterns=[    path('customsearch/', views.search, name='search'),    path('customsearch//', views.search, name='search'),    path('noccustomsearch/', views.nocSearch, name='nocSearch'),    path('nocreport/export/', views.noc_export, name='noc_export'),    path('customsearch/export/', views.searchLit_export, name='SearchLit_export'),    path('customsearch/exportSearch//', views.exportSearch, name='exportSearch'),]From searchLit/views.pydef filterCircuits(params, search_vector):    circuits=[]    if(params['circuitid']==None and params['bandwidth']==None and params['region']==None and params['carrier']==None and params['status']==None and params['segmentname']==None and params['mrcnew']==None):        circuits=Circuitinfotable.objects.all()    else:        if(params['multipleSearch']!=None and params['multipleSearch']!=""):            circuits=Circuitinfotable.objects.annotate(search=search_vector).filter(search=params['multipleSearch'])        else:            circuits = Circuitinfotable.objects.all()        if(params['circuitid']!=None and params['circuitid']!=""):            circuits = Circuitinfotable.objects.all()            circuits=circuits.filter(circuitid__icontains=params['circuitid'])        if(params['bandwidth']!=None and params['bandwidth']!="" and params['bandwidth']!='Select Bandwidth'):            circuits=circuits.filter(bandwidth=params['bandwidth'])        if(params['region']!=None and params['region']!="" and params['region']!='Select Region'):            circuits=circuits.filter(region=params['region'])        if(params['carrier']!=None and params['carrier']!="" and params['carrier']!='Select Carrier'):            circuits=circuits.filter(carrier=params['carrier'])        if(params['status']!=None and params['status']!="" and params['status']!='Select Status'):            circuits=circuits.filter(status=params['status'])        if(params['segmentname']!=None and params['segmentname']!="" and params['segmentname']!='Select Segment'):            circuits=circuits.filter(segmentname=params['segmentname'])        if(params['mrcnew']!=None and params['mrcnew']!=""):            circuits=circuits.filter(mrcnew=params['mrcnew'])        if(params['diversity']!='Select Option'):            if(params['diversity']=='None'):                circuits=circuits.filter(diversity=None)            else:                circuits=circuits.filter(diversity__icontains=params['diversity'])        if(params['kmz']!='Select YES/NO'):            if(params['kmz']=='No'):                circuits=circuits.filter(kmz=None)            else:                circuits=circuits.filter(kmz__isnull=False)    return(circuits)def search(request):    form = CircuitForm    template =  'customsearch/customsearch.html'    search_vector = SearchVector('circuitid', 'carrier', 'pathname', 'segmentname', 'segmentid', 'alocationaddress', 'alocationcity', 'alocst', 'zlocationaddress', 'zlocationcity', 'zlocst', 'handoffalocaddress', '

Re: CSS not linking with HTML

2021-07-26 Thread V. J
Hello, I'm making a list of potential customers, in about two months, we
will have a business plan ready and we will issue a digital token (ICO)
based on our product in the company.  Would you be interested in learning
more ...?

Dne čt 3. čvn 2021 10:06 uživatel sukhy gill 
napsal:

> Dear frnd
> First of all thanks to all for spare your valueable time for
> me.🙏🙏
>
>
>  Now my Server is working and inline CSS also working but Internal and
> External CSS not working.
> In my last project, image css was also working but now it is not working.
>
> Another problem is "python manage.py collectstatic"  commd giving error.
>
> My Whatsapp no is - 9493878322 ( Anyone may contact me through my whatsapp
> also if you feel so)
>
> Regards
>
>
>
> On Mon, May 31, 2021, 22:41 Chelsea Fan  wrote:
>
>> You are welcome))
>>
>> On Mon, 31 May 2021, 6:44 pm sukhy gill, 
>> wrote:
>>
>>> Thanku so much all of you for your valuable guidance to me 🙏🙏🙏🙂🙂
>>>
>>> On Mon, May 31, 2021, 21:07 Chelsea Fan >> wrote:
>>>
 Good luck 

 On Mon, 31 May 2021, 6:31 pm sukhy gill, 
 wrote:

> I deleted my project and will start project again from begining and
> then will let you know the progress.
> Regards
>
> On Sun, May 30, 2021, 16:48 Mehdi Ismail  wrote:
>
>> you want to mention (provide screenshot) of the error?
>>
>> On Sunday, 30 May 2021 at 09:14:22 UTC+5:30 sukhy.g...@gmail.com
>> wrote:
>>
>>> Getting error while using using command python manage.py
>>> collectstatic
>>> Regarda
>>>
>>> On Sat, May 29, 2021, 21:23 Mehdi Ismail >>
 python manage.py collectstatic


 try that... and update
 On Saturday, 29 May 2021 at 20:44:48 UTC+5:30 sukhy.g...@gmail.com
 wrote:

> Project Folder ➡️static ➡️css➡️style.css➡️
>
> On Sat, May 29, 2021, 19:16 Fabiano Leite  wrote:
>
>>
>> Where is located your 'css/style.css';
>> Em sábado, 29 de maio de 2021 às 10:04:50 UTC-3,
>> sukhy.g...@gmail.com escreveu:
>>
>>> No dear
>>>
>>> On Sat, May 29, 2021, 18:29 Chelsea Fan >> wrote:
>>>
 Is it working now?

 On Sat, 29 May 2021, 3:40 pm lalit suthar, <
 sutharl...@gmail.com> wrote:

> read this
> https://docs.djangoproject.com/en/2.2/intro/tutorial06/ and
> check how you are giving paths. Also after loading the page on 
> your browser
> go to "View Page Source" and click on the CSS file link and check 
> if the
> file is opening or not.
>
> On Saturday, 29 May 2021 at 17:57:21 UTC+5:30
> sukhy.g...@gmail.com wrote:
>
>> Yes Sir,There was no mistake in code. Code problem was only
>> in mail content actually code was correct as instruction given 
>> by Aniket Sir
>>
>> Regards
>>
>>
>> On Sat, May 29, 2021, 13:14 lalit suthar <
>> sutharl...@gmail.com wrote:
>>
>>> have you checked Aniket's answer?
>>>
>>> On Saturday, 29 May 2021 at 11:09:07 UTC+5:30
>>> sukhy.g...@gmail.com wrote:
>>>
 Done Sir, but not working

 On Sat, May 29, 2021, 10:50 Venu Gopal <
 reachme...@gmail.com wrote:

> In Firefox  Goto Preferences ---> Choose Privacy and
> Security ---> scroll down until you get cookies and site data 
> --> clear data
> Chrome  Goto Settings ---> Choose Privacy and Security
> ---> select cookies and other site data --> select see all 
> cookies and site
> data --> Remove all
>
> On Sat, May 29, 2021 at 9:50 AM sukhy gill <
> sukhy.g...@gmail.com> wrote:
>
>> @Venu Gopal
>>
>> No Sir, I don't know, how to do this.
>>
>> May I know Sir, how to do the same?
>>
>> Regards
>>
>> On Sat, May 29, 2021, 09:41 Venu Gopal <
>> reachme...@gmail.com wrote:
>>
>>> Hi, Have you tried deleting existing cache and cookies
>>> in the browser?
>>>
>>> On Sat, May 29, 2021 at 12:08 AM sukhy gill <
>>> sukhy.g...@gmail.com> wrote:
>>>
 Dear Frnds
 I am unable to  link CSS with HTML
 HTML working but CSS not working inside the .htm

Re: use of annotate in django query

2021-07-26 Thread V. J
Hello, I'm making a list of potential customers, in about two months, we
will have a business plan ready and we will issue a digital token (ICO)
based on our product in the company.  Would you be interested in learning
more ...?

Dne so 5. čvn 2021 19:09 uživatel Lalit Suthar 
napsal:

> just replied to your mail
>
> On Sat, 5 Jun 2021 at 11:48, Eugene TUYIZERE 
> wrote:
>
>> Dear Suthar,
>>
>> Can I have your private contact?
>>
>> regards,
>>
>> On Fri, 4 Jun 2021 at 06:25, Lalit Suthar 
>> wrote:
>>
>>> my pleasure :)
>>>
>>> On Thu, 3 Jun 2021 at 20:28, Eugene TUYIZERE 
>>> wrote:
>>>
 Dear Suthar,

 Thank you very much. It works well.


 On Thu, 3 Jun 2021 at 16:48, Lalit Suthar 
 wrote:

> not sure but maybe this can work inside views replace
> chart = {
>   'chart': {'type': 'column'},
>   'title': {'text': 'Previous statistics'},
>   'xAxis': {'replist': replist},
>   'series': [arriva_days]
> }
> with
> chart = {
>   'chart': {'type': 'column'},
>   'title': {'text': 'Previous statistics'},
>   'xAxis': {'categories': replist},
>   'series': [arriva_days]
> }
>
> On Thu, 3 Jun 2021 at 18:00, Eugene TUYIZERE 
> wrote:
>
>> This what I have in summarizedchart.html:
>>
>> {% extends "layouts/base.html" %}
>> {% load static %}
>> {% block title %} Repport {% endblock %}
>>
>> 
>> {% block stylesheets %}{% endblock stylesheets %}
>>
>> {% block content %}
>>
>> 
>> 
>> 
>> 
>> 
>> Report
>>
>> 
>>
>> 
>>
>> 
>> 
>> Highcharts.chart('container', {{ chart|safe }});
>> 
>> 
>> 
>> 
>> 
>> 
>> {% endblock content %}
>> {% block custom_js %}
>>
>> {% endblock custom_js %}
>>
>> On Thu, 3 Jun 2021 at 14:22, Lalit Suthar 
>> wrote:
>>
>>> so the view is not giving error right now but maybe we are passing
>>> the data in different format then the chart is expecting.
>>> What are you using for drawing the chart? can I see the code inside
>>> "summarizedchart.html"
>>>
>>> On Thu, 3 Jun 2021 at 17:43, Eugene TUYIZERE <
>>> eugenetuyiz...@gmail.com> wrote:
>>>
 Dear Suthar,

 You saved my day. Once more, the chart is displayed but the date is
 not displayed on Xaxis. This how it is:

 [image: image.png]

 Th codes are:
 def reqChart(request):
 current_date = date.today()
 days_before = date.today()-timedelta(days=30)
 datelist = Customer_Requests.objects.values("arrival_date").
 annotate(num_req=Count("request_name")).order_by('-arrival_date')[:
 20:-1]
 replist = list()
 sumdata = list()
 for listd in datelist:
 replist.append(listd['arrival_date'])
 sumdata.append(listd['num_req'])
 arriva_days = {
 'name': 'Datess',
 'data': sumdata,
 'color': 'green'
 }
 chart = {
 'chart': {'type': 'column'},
 'title': {'text': 'Previous statistics'},
 'xAxis': {'replist': replist},
 'series': [arriva_days]
 }
 dump = json.dumps(chart,cls=DjangoJSONEncoder)
 return render(request,'summarizedchart.html',{'chart': dump})


 On Thu, 3 Jun 2021 at 13:27, lalit suthar 
 wrote:

> Hi there!
> make these couple of changes
>
> 1) from django.core.serializers.json import DjangoJSONEncoder
> 2) dump3 = json.dumps(chart3, cls=DjangoJSONEncoder)
> On Thursday, 3 June 2021 at 16:18:15 UTC+5:30 eugenet...@gmail.com
> wrote:
>
>> Dear Suthar,
>>
>> Your idea works well , but I want now to display the result on
>> chart. Below is the code I am trying to use:
>> but Am getting the error message:
>>
>> Exception Value:
>>
>> Object of type date is not JSON serializable
>>
>>
>> def reqChart(request):
>> aa = Customer_Requests.objects.values("arrival_date").annotate(
>> num_req=Count("request_name")).order_by('-arrival_date')[:20:-1]
>> print(aa)
>> datesb = list()
>> sumdata = list()
>> for dd in aa:
>> datesb.append(dd['arrival_date'])
>> sumdata.append(dd['num_req'])
>> arriva_days = {
>> 'name': 'Datess',
>> 'data': sumdata,
>> 'color': 'green'
>> }
>> chart3 = {
>> 'chart': {'type': 'column'},
>> 'title': {'text': 'Previous statistics'},
>> 'xAxis': {'datesb': datesb},
>> 'series': [arriva_days]
>> }
>> dump3 = json.dumps(chart3)
>> return render(request,'summarizedchart.html',{'chart3': dump3})
>>
>>

Re: What's the preferred way to implement matching mechanism (radius distance search) in an uber-like app

2020-02-16 Thread V. J
Zdravím vás, přišel jsem o PC tak nejsem schopen dělat víc, vše dělám stále jen po telefonu, budu se snažit o to co chci a pokud se mi to povede bude to báječný, pokud bych dělal špatně věci, rád bych od vás zpětnou vazbu, děkuji vám a napíšeme si. Vašek JachimOdesláno z mého telefonu Huawei Původní zpráva Předmět: What's the preferred way to implement matching mechanism (radius distance search) in an uber-like appOdesílatel: Jose Chacón Komu: Django users Kopie: Hello, django newbie here. I'm from Peru, currently assigned to participate in the development of a  startup app. What this startup wants is to match business with truck drivers to transport stuff.  I was asked to implement a matching mechanism, firstly I have no idea how to do it but then an idea came to my mind. The requirement its that radius distance search should be increased every 40s when it doesn't found a driver ready to take it. And the search goes on until a driver accepts the incoming request ( i omitted this part in my code)  - or until there's no driver left in the database. So just for testing purposes, this returns true when it finds a driver near according to radius distance search   Here it is:def search_simulation():#first filter - i will apply some conditions to the model . Actual filter value for test purposesfirst_filter = TransportistaGeolocalizacion.objects.filter(transportista_id__gt=18)#parameterflag_found = Falsestart_time_search = timezone.now()km = 2#loopwhile not flag_found:#loop break conditionif(km == 10):break#logic to search for driverdiff = timezone.now() - start_time_searchif(diff.seconds > 20):  #every 20seconds ,distance radius increaseskm+=1start_time_search = timezone.now()print("New round")print("New radius: " + str(km))else:search_result = first_filter.annotate(distance=ExpressionWrapper(6371 * Acos(Cos(Radians(-12.17261550001))* Cos(Radians((F('latitud'* Cos(Radians((F('longitud'))) -   Radians(-77.0259502999))+ Sin(Radians(-12.17261550001))* Sin(Radians((F('latitud'),output_field=FloatField())).filter(distance__lte=km)if(len(search_result) > 0):print("Driver found!")flag_found=Trueelse:print("Failed search")return flag_foundProbably it sucks , I'm afraid its not gonna work when deployed due to concurrent requests ,etc.  so what i wanted is to get is some advice from you. I know it's a super basic implementation (sorry i'm not a django expert yet :c). If  you've done this before or you  know a  better solution to what i want to achieve, it'd like to know (also bc i'm afraid my boss also has no idea how to do it) . It'd mean a lot. Thanks in advance.



-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b00b15ec-271f-4ce2-b8e7-7ff438a9d419%40googlegroups.com.




-- 
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/-5o3k3comh7vj-mc2ntg-jwgctzw93b1ofw0pioemwmqs-vkdyad-2m5o7qwi0wbuc5k09z-dvu7yd-gylinor8vywj-jdaieb-h5nbo-9js5ys-tj35rps40tnm-8njg22-2ahl26-l00ztx-9ow44zpa7ub5.1581864081034%40email.android.com.