Native info

2019-01-03 Thread rbrown107074
Hi all

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ac46d7e-42d2-4c63-9328-fa0f96dbbabd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing and using django registration – backends

2019-01-03 Thread Rahul Verma
Can you try like ths
  urlpatterns = [
 # Other URL patterns ...
url(r'^accounts/', include('registration.backends.activation.urls')),
# More URL patterns ...
]
 By the way, this is the documentation of Django Registration ,Hopefully it
may help you.
https://media.readthedocs.org/pdf/django-registration/latest/django-registration.pdf

On Thu, Jan 3, 2019 at 12:33 AM Yuval Bachrach 
wrote:

> Installing and using django registration – backends
>
> The package is installed (pip) and migration is clean. Next steps at the
> documents: Adding to urls at urlpatterns but I get error messages (details
> below). So I am stacked at the very beginning. As a Django beginner, I
> would be happy to get some help.
>
> The issues are with “backaends” that exists on the file system (with the
> required content) but Django can’t find it
>
>
>
> *Details:*
>
> Ø  The urls added:
>
> urlpatterns = [
>
> url(r'^accounts/',
> include('django_registration.backends.activation.urls')),
>
> url(r'^accounts/', include('django.contrib.auth.urls')),
>
> .
>
> .
>
> ]
>
> o   In here there is an error message (from runserver) ended with:
>
>   File "", line 965, in
> _find_and_load_unlocked
>
> ModuleNotFoundError: No module named 'django_registration.backends'
>
>
>
> Ø  Commenting out the first url out of the two makes the error go away
>
> Ø  Adding (inside url.py prior to urlpattern declaration):
>
> from django_registration import backends
>
> is resulted with the following error message:
>
> ImportError: cannot import name 'backends' from 'django_registration'
> (C:\Users\yuval\OneDrive\pythonWorkDir\django\tutor1\ybsite\django_registration\__init__.py)
>
> (I did not think this line is to be added but wanted to see the
> response…). I commented it out.
>
>
>
> Ø  This is the case both when in settings.py INSTALLED_APPS I have or
> don’t have the following:
>
>  'django_registration',   # <= This one is OK
>
> Ø  Trying to add
>
>  'django_registration.backends',
>
>  #   <= This one is NOT OK : error message:
>
> oduleNotFoundError: No module named 'django_registration.backends'
>
> (I did not think this line is to be added but wanted to see the
> response…). I commented it out.
>
>
>
> So now I don’t have an error message but also not having Django
> registration ready to use…
>
> --
>
> Yuval B
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD16PYRvn0652HHEXrQJ4J4hy5b4VmonUwBvi5NdxaOs7CoDtQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
*   donverma*

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALedDsJW6Vd0ASOAYMj2xbsH-%3DYghNFa-gyxn7UCMgp0e6fs_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


: (admin.E108) The value of 'list_display[0]' refers to 'title', which is not a callable, an attribute of 'PostAdmin', or an attribute or method on 'blog.Post'.

2019-01-03 Thread Daniel Roseman
Don't post pictures of code.

Your Post model doesn't have any fields in it, just the two Managers. We can't 
see what model the fields are defined in, because your screenshot cuts that off.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/38f0c9a6-41df-4358-b3cd-79e810ee93d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installing and using django registration – backends

2019-01-03 Thread Yuval Bachrach
For the suggested link I get the following error message:
"ModuleNotFoundError: No module named 'registration'"
I think registration is the old name used at version 2.3.
 Instead of following the pdf I follow
https://django-registration.readthedocs.io/en/3.0/
(pdf is for an older version 2.3)
specifically
https://django-registration.readthedocs.io/en/3.0/quickstart.html is short
and describes the way to start and the urls to use... but, I am getting the
error message I have described.



On Thu, Jan 3, 2019 at 12:03 PM Rahul Verma 
wrote:

> Can you try like ths
>   urlpatterns = [
>  # Other URL patterns ...
> url(r'^accounts/', include('registration.backends.activation.urls')),
> # More URL patterns ...
> ]
>  By the way, this is the documentation of Django Registration ,Hopefully
> it may help you.
>
> https://media.readthedocs.org/pdf/django-registration/latest/django-registration.pdf
>
> On Thu, Jan 3, 2019 at 12:33 AM Yuval Bachrach 
> wrote:
>
>> Installing and using django registration – backends
>>
>> The package is installed (pip) and migration is clean. Next steps at the
>> documents: Adding to urls at urlpatterns but I get error messages (details
>> below). So I am stacked at the very beginning. As a Django beginner, I
>> would be happy to get some help.
>>
>> The issues are with “backaends” that exists on the file system (with the
>> required content) but Django can’t find it
>>
>>
>>
>> *Details:*
>>
>> Ø  The urls added:
>>
>> urlpatterns = [
>>
>> url(r'^accounts/',
>> include('django_registration.backends.activation.urls')),
>>
>> url(r'^accounts/', include('django.contrib.auth.urls')),
>>
>> .
>>
>> .
>>
>> ]
>>
>> o   In here there is an error message (from runserver) ended with:
>>
>>   File "", line 965, in
>> _find_and_load_unlocked
>>
>> ModuleNotFoundError: No module named 'django_registration.backends'
>>
>>
>>
>> Ø  Commenting out the first url out of the two makes the error go away
>>
>> Ø  Adding (inside url.py prior to urlpattern declaration):
>>
>> from django_registration import backends
>>
>> is resulted with the following error message:
>>
>> ImportError: cannot import name 'backends' from 'django_registration'
>> (C:\Users\yuval\OneDrive\pythonWorkDir\django\tutor1\ybsite\django_registration\__init__.py)
>>
>> (I did not think this line is to be added but wanted to see the
>> response…). I commented it out.
>>
>>
>>
>> Ø  This is the case both when in settings.py INSTALLED_APPS I have or
>> don’t have the following:
>>
>>  'django_registration',   # <= This one is OK
>>
>> Ø  Trying to add
>>
>>  'django_registration.backends',
>>
>>  #   <= This one is NOT OK : error message:
>>
>> oduleNotFoundError: No module named 'django_registration.backends'
>>
>> (I did not think this line is to be added but wanted to see the
>> response…). I commented it out.
>>
>>
>>
>> So now I don’t have an error message but also not having Django
>> registration ready to use…
>>
>> --
>>
>> Yuval B
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAD16PYRvn0652HHEXrQJ4J4hy5b4VmonUwBvi5NdxaOs7CoDtQ%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> *   donverma*
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALedDsJW6Vd0ASOAYMj2xbsH-%3DYghNFa-gyxn7UCMgp0e6fs_A%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Yuval B

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.go

Re: Are distance lookups available for MySQL or not?

2019-01-03 Thread Clara Daia
Hello, Jason

I appreciate your help, and I tried running the test with a MySQL container
but got the same error.
The MySQL spatial reference

does not have a'dwithin' entry or similar either.

I changed my query to

self.assertEqual(MyModel.objects.filter(
geopositionfield__distance_lt=(
Point(-25.427855, -49.279644),
0.00028321143293561684)
).count(), 1)

And it seems to have worked, both on the MySQL and the MariaDB containers.
I suppose there is limited support and the documentation should specify
which distance functions are available for MySQL. Do you think I should
file a ticket?

Best regards,

Clara

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMpbhxy7Rm8KtwMasfvhsa%2Bg-howDZFu_EX%3D6NGcfWUNmKsEbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Are distance lookups available for MySQL or not?

2019-01-03 Thread Clara Daia
Shame on me, there is a table for that in the docs.
https://docs.djangoproject.com/en/2.1/ref/contrib/gis/db-api/#spatial-lookup-compatibility

Em qui, 3 de jan de 2019 às 10:38, Clara Daia 
escreveu:

> Hello, Jason
>
> I appreciate your help, and I tried running the test with a MySQL
> container but got the same error.
> The MySQL spatial reference
> 
> does not have a'dwithin' entry or similar either.
>
> I changed my query to
>
> self.assertEqual(MyModel.objects.filter(
> geopositionfield__distance_lt=(
> Point(-25.427855, -49.279644),
> 0.00028321143293561684)
> ).count(), 1)
>
> And it seems to have worked, both on the MySQL and the MariaDB containers.
> I suppose there is limited support and the documentation should specify
> which distance functions are available for MySQL. Do you think I should
> file a ticket?
>
> Best regards,
>
> Clara
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMpbhxy0E%3DnRanAd%2Bi%2BBXkfr%3DRGJ3h72dp1BcBbJZpXbD_SQMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django ORM queryset substring on a column

2019-01-03 Thread BIJAL MANIAR

Hello,

Consider below column in mysql table Employee. I need to write django orm 
query for below mysql query.
emp_number
4-DEF-A111
3-MNO-333
2-DEF-222
1-ABC-111


Mysql query which splits by '-' and matches against last index.
SELECT * from Employee WHERE substring_index(emp_number, '-', -1) = '111';

I cannot write endswith on a column like below:
Employee.objects.filter(emp_number__endswith='111').values('emp_number')
This will return below 2 records:
4-DEF-A111
1-ABC-111

 Any help would be appreciated. Thanks.

-Bijal

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8998da5d-3e3b-4fcd-a675-e5fc01ab01e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Loop over Django objects and Bootstrap cards

2019-01-03 Thread valentin jungbluth
I used UploadField so I just have to use 
{{ object.fieldname.url }}

and it works.

But my question is : How I can gather all documents according to one 
publication in one card ?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cafbf573-f6ac-4ee7-9d3a-d89f42e18820%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Show locations on maps on realtime sent from ios app django as a backend.

2019-01-03 Thread Achyut Pandey
What are the possible ways to show the locations data sent from ios app to 
django backend on maps. Please anyone respond i really need your help guys .

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0A7C06F3-DEA8-4CC0-981B-70471416CCC3%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Regarding:- Mobile App With Django Rest API

2019-01-03 Thread Pravin Yadav
Hello Friends,

I have created the website in Python + Django and also website has been
live
*Live Url:-* *http://tripsanditineraries.com
.*

I want to create the* "Mobile APP"* also. Kindly advise how will i
implement.



Thanks and Regards,
Pravin Kumar Yadav
8743064255

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEr6%3DdzJdqtNZa7-_t7t9vorq9U44_RW4MMcBkytVDpHpEnjsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regarding:- Mobile App With Django Rest API

2019-01-03 Thread Nebojsa Hajdukovic
Do you have any experience with rest API?

чет, 3. јан 2019. у 15:55 Pravin Yadav  је написао/ла:

> Hello Friends,
>
> I have created the website in Python + Django and also website has been
> live
> *Live Url:-* *http://tripsanditineraries.com
> .*
>
> I want to create the* "Mobile APP"* also. Kindly advise how will i
> implement.
>
>
>
> Thanks and Regards,
> Pravin Kumar Yadav
> 8743064255
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEr6%3DdzJdqtNZa7-_t7t9vorq9U44_RW4MMcBkytVDpHpEnjsA%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ60hW3%3DYJmzCyUXO0maUGt-x66UCTSH4hZO5M6DCgG2vkCx9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Show locations on maps on realtime sent from ios app django as a backend.

2019-01-03 Thread Jani Tiainen
Hi.

Where do you want to display this location information?

Achyut Pandey  kirjoitti to 3. tammik. 2019 klo
16.36:

> What are the possible ways to show the locations data sent from ios app to
> django backend on maps. Please anyone respond i really need your help guys .
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0A7C06F3-DEA8-4CC0-981B-70471416CCC3%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91odQbCJcF%3DverNHpyOVUVmg4KnnHH9C1wC2iM7M8kb77HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regarding:- Mobile App With Django Rest API

2019-01-03 Thread Pravin Yadav
I haven't any experience with rest API.

Thanks for replying.



On Thu, Jan 3, 2019 at 8:26 PM Nebojsa Hajdukovic 
wrote:

> Do you have any experience with rest API?
>
> чет, 3. јан 2019. у 15:55 Pravin Yadav  је написао/ла:
>
>> Hello Friends,
>>
>> I have created the website in Python + Django and also website has been
>> live
>> *Live Url:-* *http://tripsanditineraries.com
>> .*
>>
>> I want to create the* "Mobile APP"* also. Kindly advise how will i
>> implement.
>>
>>
>>
>> Thanks and Regards,
>> Pravin Kumar Yadav
>> 8743064255
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAEr6%3DdzJdqtNZa7-_t7t9vorq9U44_RW4MMcBkytVDpHpEnjsA%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJ60hW3%3DYJmzCyUXO0maUGt-x66UCTSH4hZO5M6DCgG2vkCx9w%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEr6%3Ddza9nSpjN2bmQbthLZm2T5z-ZNn60q2ovxKuWyeHGOf9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Regarding:- Mobile App With Django Rest API

2019-01-03 Thread Pravin Yadav
please guide me. It will be great.

Thanks.

On Thu, Jan 3, 2019 at 8:28 PM Pravin Yadav  wrote:

> I haven't any experience with rest API.
>
> Thanks for replying.
>
>
>
> On Thu, Jan 3, 2019 at 8:26 PM Nebojsa Hajdukovic <
> nebojsa.zero...@gmail.com> wrote:
>
>> Do you have any experience with rest API?
>>
>> чет, 3. јан 2019. у 15:55 Pravin Yadav  је
>> написао/ла:
>>
>>> Hello Friends,
>>>
>>> I have created the website in Python + Django and also website has been
>>> live
>>> *Live Url:-* *http://tripsanditineraries.com
>>> .*
>>>
>>> I want to create the* "Mobile APP"* also. Kindly advise how will i
>>> implement.
>>>
>>>
>>>
>>> Thanks and Regards,
>>> Pravin Kumar Yadav
>>> 8743064255
>>>
>>> --
>>> 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 post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAEr6%3DdzJdqtNZa7-_t7t9vorq9U44_RW4MMcBkytVDpHpEnjsA%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJ60hW3%3DYJmzCyUXO0maUGt-x66UCTSH4hZO5M6DCgG2vkCx9w%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEr6%3DdxSsgOHGZnZz%3Dtd2Cq-mXYacuj8svMYqn8j3Vi6Eb7qYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Are distance lookups available for MySQL or not?

2019-01-03 Thread Jason
nice job in finding the cause and +1 for posting the compatibility table 
link here for future search reference.


-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f3a2ff27-246c-4dfc-8fa1-acd74e9bf2ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Deploying Django multi servers, 1 DB server

2019-01-03 Thread Peter van der Does
We currently have one app server, so deployment with migrations is easy,
but we're expanding to multiple app servers and one DB server.

How do people handle migrations? I understand you run migrations on one
server only. But how do you inform the other servers that migrations has
finished and they can start doing the next steps.

We're open to using any DevOps tool, Ansible, Puppet, Chef.
We don't do any form of CI, nor are we planning to do so in the near future.

If more details are needed let me know and I can provide them.

-- 
*Peter van der Does
o: ***410-584-2500
m: 732-425-3102
*ONeil Interactive, Inc *
oneilinteractive.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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8a49a438-eb2f-78ab-bc5a-ae9edb1a07af%40oneilinteractive.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django multi servers, 1 DB server

2019-01-03 Thread Christian Ledermann
You will have to split migrations from code changes.
The migrated database will have to run with both old and new code.
You may have to split one migration into several to achieve this


On Thu, 3 Jan 2019 at 15:28, Peter van der Does 
wrote:

> We currently have one app server, so deployment with migrations is easy,
> but we're expanding to multiple app servers and one DB server.
>
> How do people handle migrations? I understand you run migrations on one
> server only. But how do you inform the other servers that migrations has
> finished and they can start doing the next steps.
>
> We're open to using any DevOps tool, Ansible, Puppet, Chef.
> We don't do any form of CI, nor are we planning to do so in the near
> future.
>
> If more details are needed let me know and I can provide them.
> --
>
> *Peter van der Does o: **410-584-2500*
> * m: 732-425-3102 ONeil Interactive, Inc  oneilinteractive.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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8a49a438-eb2f-78ab-bc5a-ae9edb1a07af%40oneilinteractive.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABCjzWobSNRgmuvrQGDOp%3D79xGKhFv6X0rLzNrfLcznJ%3DGtvhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best way to submit application cmd, then download a resulting file?

2019-01-03 Thread PASCUAL Eric
Hi Chris,


The problem you describe does not require Django at all to be solved.


WRT process parameter input, what you need here is a simple Web based UI with a 
basic form. Of course Django can do it, but if you don't need features such as 
the ORM, admin... you can implement it with a couple of lines using lighter 
frameworks (e.g. Tornado).


The point about monitoring  the process requires first that this process is 
able to provide a feedback on demand. On *nix systems, this can be done by 
handling one of the USR signals (e.g. SIG_USR1) and of course implementing the 
process in non blocking mode (to be able to handle the USR signal while 
computing).


How the feedback is returned to the end user is another story. Real time 
feedback in Web apps is preferably done using Web sockets (rather than polling 
periodically the server from JS code on the UI page). Who will push the 
feedback on the socket ? It can be the computation process itself, supposing 
appropriate connection information are passed to it. But it is cleaner to 
separate concerns and isolate this in a monitoring specialized layer, 
communicating with the computation process via Unix sockets for instance or 
capturing its stdout and grabbing dedicated messages in it (e.g. a message like 
"PROGRESS: 30"). One option for implementing this monitor is using job Queues, 
as provided in the multiprocess part of Python standard lib. One you also use 
Celery, RQ or any job queue framework, but chances are that this would be 
overkill (especially Celery). RQ is maybe a good choice here, since very 
lightweight and having RabbitMQ as its only dependency.


Hope this helps


Regards

Eric



From: django-users@googlegroups.com  on behalf 
of Chris Robinson 
Sent: Wednesday, January 2, 2019 10:05:39 PM
To: Django users
Subject: Best way to submit application cmd, then download a resulting file?

Hello,

I'm going to attempt to generalize my question to make this easier to answer.

Lets say I have a simple terminal based application (e.g. multiply_by_two) that 
takes a number argument, then multiplies that number by 2, and returns the 
result into a result.txt file.

I would enter something like this:
multiply_by_two -n 6

The -n flag asks what number I would like to multiply by 2. The result of this 
would be a result.txt, containing the number 12 inside.


What I would like to do is develop a simple Djano application that contains a 
text field allowing me to input the number 6, then click "Submit."

This job will start on the server by running my custom multiply_by_two 
application with my input parameter (6), but when the job is finished and the 
result.txt is available, the browser will automatically download the file.

To make this a tad bit more complex, lets say that the job takes 2 minutes to 
run. What would be the best way to monitor the job? Maybe I accidentally close 
the window.

Not looking for anyone to solve this, I'm just new to Django and want to know 
if someone can give me any pointers on where to start. Are there any apps 
existing that will help me not need to write everything from scratch, 
especially if 'monitoring' is needed? Would Celery be ideal for this?

Thanks for any input!

Regards,
Chris


--
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 post to this group, send email to 
django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6ba9ac84-366c-4c91-b068-3ecc65c27a9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/AM0P193MB030870706B6BD352ED1D42E88C8D0%40AM0P193MB0308.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Filter by sum of filtered related objects?

2019-01-03 Thread Dustin Wyatt
Given the following models:


class Transaction(models.Model):
  amount = models.IntegerField()
  date = models.DateField()
  terms = models.ForeignKey('Terms')


class Terms(models.Model):
  name = models.CharField(max_length=100)
  timezone = models.CharField(max_length=50)


I need to annotate Terms with the sum of the related Transaction.amount's 
where the Transaction.date is between two dates and what those two dates 
are varies by Terms.timezone.

Possible?

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/02257cdb-55a5-4ae9-bc2d-3b3fef0ef91f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Hacking attempts

2019-01-03 Thread Mike Dewhirst
I'm no expert and I suspect things are working as designed but I'm 
getting multiple admin emails from a production site reporting attempts 
to access wsgi.py


So my question is: Can I change the name of wsgi.py so the hackers get 
401 errors and maybe go away?


The emails have subject lines like ...

[Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: 
'43.211.128.177'. You may need to add u'43.211.128.177' to ALLOWED_HOSTS.


ALLOWED_HOSTS is tied down to exactly the website domain.

Thanks

Mike

--
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9bfa0c95-68a9-170c-fb39-3888d376f98b%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Loop over Django objects and Bootstrap cards

2019-01-03 Thread shiva kumar
I think use inline div elements in place of block. Block elements makes u
to start elements in next line.

On Thu 3 Jan, 2019 7:41 pm valentin jungbluth  I used UploadField so I just have to use
> {{ object.fieldname.url }}
>
> and it works.
>
> But my question is : How I can gather all documents according to one
> publication in one card ?
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cafbf573-f6ac-4ee7-9d3a-d89f42e18820%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMsYeuGSJeG_CTGuXRpS5GvOVHNAc5Q-Ts0hRzn18Ei2-N4ssQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hacking attempts

2019-01-03 Thread Ansh Srivastava
Yes! You can do that. You've to just hop over to the wsgi.py setting part.



[image: Mailtrack]

Sender
notified by
Mailtrack

04/01/19,
11:20:50

On Fri, Jan 4, 2019 at 5:39 AM Mike Dewhirst  wrote:

> I'm no expert and I suspect things are working as designed but I'm
> getting multiple admin emails from a production site reporting attempts
> to access wsgi.py
>
> So my question is: Can I change the name of wsgi.py so the hackers get
> 401 errors and maybe go away?
>
> The emails have subject lines like ...
>
> [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header:
> '43.211.128.177'. You may need to add u'43.211.128.177' to ALLOWED_HOSTS.
>
> ALLOWED_HOSTS is tied down to exactly the website domain.
>
> Thanks
>
> Mike
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9bfa0c95-68a9-170c-fb39-3888d376f98b%40dewhirst.com.au
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHMQ533t94rMEK0f%2BGJ2cDV8WUoQ%2B5nyAgQcfddOpvfkYmwQ9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.