Re:REQUEST FOR GUIDES IN MY DJANGO CRYPTO EXCHANGE PROJECT

2021-01-15 Thread Joel Tanko
Still need help? Email me @ 7thog...@gmail.com

On 13 Jan 2021 3:03 pm, "yingi keme"  wrote:

> Send a mail to yingik...@gmail.com. From your name I know you are Ijaw. I
> am too.
>
> I can address all or most of your issues.
>
>
>  Original Message 
> Subject: REQUEST FOR GUIDES IN MY DJANGO CRYPTO EXCHANGE PROJECT
> From: Emiedonmukumo Dick Boro
> To: Django users
> CC:
>
> Hello Guys,
> This is my First Conversation in this Group. I want to create my Crypto
> Project using django, But I am having challenges with some areas in django.
> I need guides on :
> Login/Logout area,
> Signup,
> authentication,
> accepting and sending payments,
> also buy, that is the payment processor.
>
> Thanks.
>
> --
> 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/c1a17f64-ff78-48da-93b3-3e77c8e11b20n%
> 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/t4bcik6m5aitpo8k64ycldtzu0w3ii
> t5nmkn-vbj5oy-g8r38pfdwiov-3x0mv9-yd7hj0-20xung-rjr6xkleltim-fdmqcu-
> g1mbkk8p2jaerizduy-pyngxo-8kll6p850ygr-7qv1au-xt5fut-
> de3yr8.1610546533285%40email.android.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/CAJ4Kmg7agAYvJ7KpOxfP0yHGncAm95DFJgSYpuWEgnhuEY4F-A%40mail.gmail.com.


Using django cms in a model instance scenario rather than the whole site

2021-01-15 Thread Joel Tanko
Hey guys,
So I have this django project that works similar to shopify(only on a
smaller scale) that allows local businesses to open and manage their online
stores - made possible by the django app.
I decided it would be a good idea to let the store owners (or merchants)
send emails from their admin dashboard using django's send_mail and
django_cms to create a html template of the email.
My real issue is that i've no clue whatsoever as to integrating the
django_cms editor(and all editing tools) into the view without  django_cms
taking over the whole site ( also leaking django's admin panel to logged in
user, which is a big security issue). Any help on this? Is it even feasible?
Thanks for the help.

-JT

-- 
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/CAJ4Kmg4YhRdHg2Ez42YRBeA_2Ovd3gkMDzMSgBVEmVyAxMgryQ%40mail.gmail.com.


Re: Using django cms in a model instance scenario rather than the whole site

2021-01-15 Thread Andréas Kühne
Hi Joel,

I don't think you need to incorporate django cms for that use case. You
would be better just to add a HTML editor of some sort and then saving the
HTML in the database. That way you don't need to open up django admin for
the cms handling either? At least that's the way I would do it?

Regards,

Andréas


Den fre 15 jan. 2021 kl 11:02 skrev Joel Tanko <7thog...@gmail.com>:

> Hey guys,
> So I have this django project that works similar to shopify(only on a
> smaller scale) that allows local businesses to open and manage their online
> stores - made possible by the django app.
> I decided it would be a good idea to let the store owners (or merchants)
> send emails from their admin dashboard using django's send_mail and
> django_cms to create a html template of the email.
> My real issue is that i've no clue whatsoever as to integrating the
> django_cms editor(and all editing tools) into the view without  django_cms
> taking over the whole site ( also leaking django's admin panel to logged in
> user, which is a big security issue). Any help on this? Is it even feasible?
> Thanks for the help.
>
> -JT
>
> --
> 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/CAJ4Kmg4YhRdHg2Ez42YRBeA_2Ovd3gkMDzMSgBVEmVyAxMgryQ%40mail.gmail.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/CAK4qSCcOqnuBMNnYpXXer5VUVVsCrp%3DTpeh56v8ftK9gZGwe%2Bg%40mail.gmail.com.


Page not found error

2021-01-15 Thread Charapalli Tharun NIQIJGURDN


I am a newbie to django and I have been stuck here from the past two days 
please help me


Using the URLconf defined in mysite.urls, Django tried these URL patterns, 
in this order:

   1. polls/
   2. admin/

The empty path didn't match any of these.



*Views.py*

from django.shortcuts import render

from django.http import HttpResponse

def index(request):
return HttpResponse("Hello Chiku")



*polls/urls.py*

from django.urls import path

from polls import views

urlpatterns = [
path('', views.index, name='index'),
]


*mysite/urls.py*


from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('polls/', include("polls.urls")),
path('admin/', admin.site.urls),
]

-- 
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/de9f9d0f-4d88-43ae-9439-dcfed969f247n%40googlegroups.com.


[ANN] The covid-ht project

2021-01-15 Thread Matemática A3K
>From https://covid-ht.herokuapp.com/about:

According to Dr. Eugenia Barrientos[1], an ongoing viral infection can be
detected from the results of an hemogram test, and, given the current
COVID19 pandemic, all viral infections with cold and flu symptoms should be
treated as COVID19 cases.

The inference from the hemogram test results is done based on the knowledge
and experience of the Health Professional.

If that process could be automatized and widely available, the detection
toolkit of Health Professionals will be improved.

In many places (i.e. Perú) where specific COVID19 testing is not widely
available - saturated hospitals, not affordable or unavailable - hemogram
blood testing is in the opposite: affordable and in widely distributed
facilities.

If a viral infection classifier with an adequate accuracy through hemograms
can be built and made publicly available, all Health Professionals with a
smart-phone and Internet access could classify any hemogram with the same
accuracy as top-level experts on the matter.

Early detection is deemed to be the greatest success factor in COVID19
treatments.

This project aims to provide a tool to efficiently build and manage that
classifier and make it effectively available for widespread use in order to
improve detection and increase the use efficiency of specific testing of
COVID19.

This tool is totally transparent: you may audit it entirely to fully
understand how it works, what it provides and its limitations. It is
distributed under the GNU LGPLv3 license.

Improvements in early detection should increase successful treatments,
potentially saving lives.

Better resource efficiency can also be achieved with the tool, i.e. only
use expensive specific COVID19 testing for recovery after the hemogram does
not indicate infection.

The tool is not a replacement of Health Professionals.

Any diagnostic and treatment should be decided by a Health Professional
with the patient. If you are an individual with a recent hemogram result,
the tool may indicate to take preemptive care and seek a Health
Professional.

Also, don't blame the knife providers: This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

Everybody is welcome to join the community for building it and use it:
covid-ht+subscr...@googlegroups.com and https://github.com/math-a3k/covid-ht
.

Made with love for all humans of the world.

[1] https://youtu.be/ZO6EaAz465Y?t=570

-- 
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/CA%2BFDnhLFSnj56XO1DpbfCPuXSvjNiCapMGuNvTypfqe98ma9xw%40mail.gmail.com.


Re: Django ORM annotate performance

2021-01-15 Thread Naresh Jonnala
Hi,

print(qs.query) and share.

On Wednesday, January 13, 2021 at 11:25:06 PM UTC+5:30 pawe...@gmail.com 
wrote:

> Hi all,
>
> I wanted to cross post my question / problem in regards to Django's ORM 
> `annotate` performance. Not sure if I should post it here on or Django 
> developers mailing list, but I wanted to start here.
>
>
> https://stackoverflow.com/questions/65506731/django-orm-annotate-performance
>
> ---
>
> I'm using Django and Django REST Framework at work and we've been having 
> some performance issues with couple endpoints lately. We started by making 
> sure that the SQL part is optimized, no unnecessary N+1 queries, indexes 
> where possible, etc.
>
> Looking at the database part itself, it seems to be very fast (3 SQL 
> queries total, under a second), even with larger datasets, but the API 
> endpoint still took >5 seconds to return. I started profiling the Python 
> code using couple different tools and the majority of time is always spent 
> inside the `annotate` and `set_group_by` functions in Django.
>
> [image: le0oG.png]
>
> I tried Googling about `annotate` and performance, looking at Django docs, 
> but there's no mention of it being a 'costly' operation, especially when 
> used with the `F` function.
>
> The `annotate` part of the code looks something like this:
>
> qs = qs.annotate(
> foo_name=models.F("foo__core__name"),
> foo_birth_date=models.F("foo__core__birth_date"),
> bar_name=models.F("bar__core__name"),
> spam_id=models.F("baz__spam_id"),
> spam_name=models.F("baz__spam__core__name"),
> spam_start_date=models.F("baz__spam__core__start_date"),
> eggs_id=models.F("baz__spam__core___eggs_id"),
> eggs_name=models.F("baz__spam__eggs__core___name"),
> )
>
> qs = (
> qs.order_by("foo_id", "eggs_id", "-spam_start_date", "bar_name")
> .values(
> "foo_name",
> "foo_birth_date",
> "bar_name",
> "spam_id",
> "spam_name",
> "eggs_id",
> "eggs_name",
> )
> .distinct()
> )
>
> The query is quite big, spans multiple relationships, so I was sure that 
> the problem is database related, but it doesn't seem to be. All the 
> `select_related` and `prefetch_related` are there, indexes too.
>
> I tried rewriting the code without `annotate` at all, but it didn't seem 
> to help. I started wondering wether the time spent in `annotate` is really 
> a red herring and it's only how the profiler sees it, but all profilers I 
> tried showed the same thing.
>
> While I feel like I know Django quite well and had success optimising API 
> endpoints before, I'm not sure what 'thread' to pull in this case. I tried 
> looking at Django internals, especially around `annotate` and 
> `set_group_by` but couldn't pin point the time spent there. My last ditch 
> effort will be trying to rewrite those couple endpoints with raw SQL, but 
> I'd very much like to avoid that.
>
> All help will be much appreciated : )
>

-- 
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/34d7939c-f7de-4793-bff3-cf46bb5fe68en%40googlegroups.com.


Re: muliple queryset result

2021-01-15 Thread Naresh Jonnala

Hi,

'OR' operator kills expected logic.

try removing 'or' operator.


For best practice, prepare raw sql and execute,untill you get logic. then 
update django query set.





On Saturday, January 9, 2021 at 6:31:33 PM UTC+5:30 soumenk...@gmail.com 
wrote:

> Hi Folks,
>
> Actually I have one *Primary *Table called *CustomUser *and I'm extending 
> this model as *Foreign *Key in *UserContactDetails model*. So now 
> basically *one user have multiple contact details.* But whenever I'm 
> applying *filter *on *Primary Table field* as well as *Foreign Key table* 
> field, this queryset is returnning  multiple Object inside queryset, like 
> If my *ContactDetails *have 3 numbers of record for a user then it's 
> returning the same record 3 number of times inside queryset, can you guys 
> tell me, How can I solve this problem? I almost spend three hours on it, 
> please help me.
>
> *models.py*
> **
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *class CustomUser(AbstractBaseUser, PermissionsMixin):email = 
> models.EmailField(_('email address'), unique=True)company_name = 
> models.CharField(max_length = 150)sap_code = 
> models.CharField(max_length = 150)is_staff = 
> models.BooleanField(default=False)is_active = 
> models.BooleanField(default=True)date_joined = 
> models.DateTimeField(default=timezone.now)USERNAME_FIELD = 'email'
> REQUIRED_FIELDS = []objects = CustomUserManager()class 
> UserContactDetails(models.Model): user_details = 
> models.ForeignKey(CustomUser, related_name = 'usercontactdetailes', 
> related_query_name = 'usercontactdetaies', on_delete = models.CASCADE) 
> address = models.CharField(max_length = 150) mobile_no = 
> models.CharField(max_length = 150) primary_contact = 
> models.BooleanField(default = False)*
>
>
> *views.py*
> **
>
> *query = request.GET.get('param')*
>
>
>
>
>
> * user_data = CustomUser.objects.filter(  
>  Q(usercontactdetaies__address = query)|  
>  Q(usercontactdetaies__mobile_no = query)|   Q(company_name__exact = 
> query) |   Q(sap_code__exact = query)  )*
>
> * ,  soum...@gmail.com>, ]>*
>
> *Instead of returnning one matched object inside queryset it's returnning 
> three matched object because I have three contact details for this user.*
>
>
> *Thank you in advance*
>
> *Regards,*
> *Soumen Khatua*
>
>
>
>
>

-- 
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/0a21ed59-c2df-410d-92d2-32000314577en%40googlegroups.com.


Re: Is there any way to custom group models in the admin panel?

2021-01-15 Thread onyilimba martins mclaren tochukwu
I stumbled on the need to do this, is there any pacakage that does this 
now? the one I saw was last updated 2018

On Wednesday, July 18, 2007 at 6:05:02 PM UTC+1 Sebastian Macias wrote:

> I just opened a ticket for this.
>
> http://code.djangoproject.com/ticket/4918
>
> Sebastian Macias
>
>
> On Jul 12, 6:37 pm, "Russell Keith-Magee" 
> wrote:
>
>
> > On 7/12/07,SebastianMacias  wrote:
> >
> >
> >
> > > By default models are grouped by app. I really need to be able to
> > > break down that grouping a little bit more. I will have an app with
>
> > > probably 40-50 models and would like togroupthose logically instead
>
>
> > > of having them all listed under my app name.
> >
> > This isn't possible at present. You can collect the fields on an
>
> > individual model into groups, but there isn't currently a mechanism 
> togroupmodels other than by application.
>
>
> >
> > It is an interesting idea though. I would suggestion opening a ticket
> > requesting this feature - we are currently rewriting the admin views
> > to use newforms. This particular feature probably won't be a target
> > for the initial release, but its worth documenting it to make sure we
> > don't code ourselves into a corner.
> >
> > Yours,
> > Russ Magee %-)
>
>

-- 
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/239eb7a0-92ba-400c-9fd8-aa198bb873e7n%40googlegroups.com.