Re: Django documentation tutorial part 1

2017-02-06 Thread Sergiy Khohlov
I have not seen  setting.py in your project . Also could you please  send
your runserver command  and output

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Feb 6, 2017 at 7:49 PM, Philip  wrote:

> Hello,
>
> I am working through the tutorial included with the django documentation,
> and I am confused as to why my url is not working. I have the most recent
> versions of django and python (the ones that the tutorial says to use) and
> I believe my file structure is correct, you can see it on
> https://github.com/philipkiely/docexample to verify. However, I get a 404
> error when I try localhost:8000/polls/, where the documentation tutorials
> says that I should be seeing the page that I built.
>
> Thank you,
>
> Philip
>
> --
> 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/cd2c6578-2029-484e-96d6-816fe3b16163%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/CADTRxJNHMNZhdG1vdEAJowWX5GL-CPdseBd0%2BNw8F7YxN_ogcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: change site_header and site_title and ... dynamically

2017-02-03 Thread Sergiy Khohlov
you can pass  this values from view to  template using context_data

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Feb 3, 2017 at 8:59 AM,  wrote:

> hi guys
> i wanna to change site_header and site_title and other thing e.g
> list_per_page and ,,, dynamically. is there any way for do this?
> 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 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/26d8007a-67f5-4777-80ca-2baff58b1457%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/CADTRxJMMh_8vKzNrtpqquQwh3h-aAKi%3DPGQyQk6j%2BbxDZwguog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: prepopulate form with model instance values using UpdateView and ModelForm

2017-01-18 Thread Sergiy Khohlov
Hello,
 I had a similar problem  (but I'm using DetailView for sending some
additional data) and I hope I  can help
 Usually editing page  is  using GET for receiving  default data and POST
for sending  data from  form to  view ( we are skipping ajax way)
1) You would like to set initial data to the page but  default get is not
customized
Could you please  addnext code to view
def get(self, request, *args, **kwargs):
"""  Default  GET view"""
print ("Default view is calliable")
return super(ModifyTaskView, self).get(request, *args, **kwargs)


2) Also  have you seen any printing of your form ?


 I would like to separate task in two simplest task
 1) Verify if view is preparing data for form
2) Verifing populating form by data

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Jan 19, 2017 at 3:22 AM, Melvyn Sopacua 
wrote:

> On Wednesday 18 January 2017 14:26:52 Benjamin Dauer wrote:
>
> > Hi Melvyn,
>
> >
>
> > That's exactly what I'm trying to do, but prior to making the changes
>
> > it wasn't prepopulating. At each stage I tested and was getting blank
>
> > fields albeit based off of the correct model.
>
> >
>
> > Maybe it's because I don't provide the pk in the URL? I was trying to
>
> > avoid that.
>
>
>
> Gotcha! By default the class-based generic views provide two ways to
> identify the instance:
>
> - pk
>
> - slug
>
>
>
> Look at slug_field and slug_url_kwarg here.
> 
>
>
>
> But in the end, this is passed to get_object() (method also shown on that
> handy page) and this shall return the instance to be shown.
>
> The tricky part about passing this in a form, is that you're fighting the
> order: the form is processed after the instance is loaded.
>
>
>
> The best way to go is to put something in the URL that uniquely identifies
> the object and then override get_object() to work with that. Note that
> little added security is gained from hiding the PK, but if user-friendly
> URLs is what you're after, slugs (or some other field(s) with unique=True)
> are the way to go.
>
>
>
> --
>
> Melvyn Sopacua
>
> --
> 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/17336152.2CZh43FIzZ%40devstation
> 
> .
>
> 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/CADTRxJMyg9cW0SEfdu69f8T12KggrqxQCnYHdiJ7FGFL_HzstA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Happy New Year 2017

2016-12-31 Thread Sergiy Khohlov
Happy new years! Better code, better goal and winning!

31 груд. 2016 20:57 "Lekan Wahab"  пише:

> Happy New year guys.
> Let's do more of this next year.
>
> On Sat, Dec 31, 2016 at 7:49 PM, Robin Lery  wrote:
>
>> Happy new year!
>>
>> On 1 Jan 2017 12:05 a.m., "pradam programmer" <
>> pradam.programm...@gmail.com> wrote:
>>
>>> Happy New Year Guys, i hope this year fill with alot of love, happiness
>>> and Joy to everyone.
>>>
>>>
>>> --
>>> 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/ms
>>> gid/django-users/CAGGVXBOiUZcsYMyu237t2nirG%3DrzOD_v68b1AqYV
>>> kijk-fDk5Q%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/ms
>> gid/django-users/CA%2B4-nGr%2BajFGPFssTO9nKr94AECOiBSJ1KTiat
>> gHDTzZJdd1fg%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/CAE6v7oe%2BLdfyj3MnCTaiuY00oGC9hpaidCa9
> i%2Bd0FEGtcvWaBw%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/CADTRxJM_fot_xPa%3D5k-R0nLXf4z4XNYC%3D15mHdY-rG1T_2E4%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql GeoDjango Distance search

2016-11-27 Thread Sergiy Khohlov
MySQL  does not have  this support. I've tested few  potential solution but
most of them have a hige problem with performance.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Nov 25, 2016 at 1:52 PM, Karesh Arunakirinathan  wrote:

> down votefavorite
> 
>
> Is there any pure Django/faster way to get the distances less than x km. I
> have the model
>
> class Products(models.Model):
> title = models.CharField(max_length=10)
> point = models.PointField(srid=32140, null=True, blank=True)
>
> So I want to search the products less than x km from the persons view in
> mysql.? Because distance less than is only supported in postgresql. I want
> to do in mysql database. Thanks
>
> Could anyone help please ?
>
> --
> 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/b914da61-bffc-4591-98d3-84d919420764%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/CADTRxJP-qQy2WBCqJeHCw0Tis63CDzfKE_fCcPZMJUEhB9tpFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Filtering in ListView

2016-11-25 Thread Sergiy Khohlov
simplest way is update  get_content_data in view:
 Take a look at example :


class CompanyDetail(TemplateVariables, LoggedInMixin, DetailView):
""" """
model = Company
template_name = 'company/company_detail.html'

def cars(self):

return Car.objects.filter(Company_id=context['company'].id)

def get_context_data(self, **kwargs):
""" filtering cars assigned to company with last coord"""
context = super(CompanyDetail, self).get_context_data(**kwargs)
CarList = Car.objects.filter(Company_id=context['company'].id)
PointList = []
CarListFiltered = []
for car in CarList:
if Points.objects.filter(Car_id = car.id).exists():
point = Points.objects.filter(Car_id = car.id
).order_by('CreatedTime').last()
PointList.append( point)
CarListFiltered.append(car)
context['Cars'] = CarListFiltered
context['PointList'] = zip(CarListFiltered, PointList)
return context




 This view returns  some additional data  but main idea is clear (line
 with Car.object.filter)



Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Nov 25, 2016 at 10:38 AM,  wrote:

> If you're ok with using an external package you can check out
> django-filter , it makes
> filtering very easy.
>
>
> On Thursday, November 24, 2016 at 8:35:30 PM UTC+1, Artem Bernatskyy wrote:
>>
>> Hello,
>>
>> how can i accomplish filtering in ListView via GET ?
>>
>> Now i am trying it with ListView and FormMixin...
>>
>> To keep long story short:
>> - we are visiting page and filling form (which are generating from
>> forms.py)
>> - than we are sending it via GET to the same page
>> - and somehow we need to validate income data and to filter by it
>>
>>
>> Any help is highly 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 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/b704e15f-b422-4f31-a773-53f995946f7c%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/CADTRxJOoOMQAOhCPe6%2BM5dgNTR3wXV6UGNGgiKpFsNiMAFqd5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django runserver does not work

2016-10-08 Thread Sergiy Khohlov
have you are opening  127.0.0.1:8000 ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sat, Oct 8, 2016 at 6:09 AM, 居飞  wrote:

> Hi:
>I installed the django 1.10.2 on Centos, after I started a project and
> run the "python manage.py migrate", then run "python manage.py runserver",
> it shows:
>
> [root@pet1jenkins testsite1]# python manage.py runserver
> Performing system checks...
>
> System check identified no issues (0 silenced).
> October 08, 2016 - 10:59:19
> Django version 1.10.2, using settings 'testsite1.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
>
> Everything seems OK but my browser could not access the webpage.
> I use netstat to check and found the 8000 is listen;
> Then I use telnet 127.0.0.1 80 ; connect is OK, I enter GET /, no
> response; then I enter return key, it shows:
>
> [root@pet1jenkins ~]# telnet 10.69.2.134 8000
> Trying 10.69.2.134...
> Connected to 10.69.2.134.
> Escape character is '^]'.
> GET /
>
>
> 
> 
>   
>   Welcome to
> Django
>   
> html * { padding:0; margin:0; }
> body * { padding:10px 20px; }
> body * * { padding:0; }
> body { font:small sans-serif; }
> body>div { border-bottom:1px solid #ddd; }
> h1 { font-weight:normal; }
> h2 { margin-bottom:.8em; }
> h2 span { font-size:80%; color:#666; font-weight:normal; }
> h3 { margin:1em 0 .5em 0; }
> h4 { margin:0 0 .5em 0; font-weight: normal; }
> table { border:1px solid #ccc; border-collapse: collapse; width:100%;
> background:white; }
> tbody td, tbody th { vertical-align:top; padding:2px 3px; }
> thead th {
>   padding:1px 6px 1px 3px; background:#fefefe; text-align:left;
>   font-weight:normal; font-size:11px; border:1px solid #ddd;
> }
> tbody th { width:12em; text-align:right; color:#666;
> padding-right:.5em; }
> #summary { background: #e0ebff; }
> #summary h2 { font-weight: normal; color: #666; }
> #explanation { background:#eee; }
> #instructions { background:#f6f6f6; }
> #summary table { border:none; background:transparent; }
>   
> 
>
> 
> 
>   It worked!
>   Congratulations on your first Django-powered page.
> 
>
> 
>   
> Of course, you haven't actually done any work yet. Next, start your
> first app by running python manage.py startapp [app_label].
>   
> 
>
> 
>   
> You're seeing this message because you have DEBUG = True
> in your Django settings file and you haven't configured any URLs. Get to
> work!
>   
> 
> 
>
> Notice: it seems need a more RETURN key, because I tested the nginx server
> use telnet, when I input GET /, it reply the webpage immediately!
>
> So anyone who can help me?
>
> 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 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/cf21ecd0-8406-496e-94bb-d8e03c3d465e%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/CADTRxJMhJ6oDL-%2BxJRY_BXwiVBZ%2BCzPAQkH%3D265PO7XMsYrY%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cache-Control header for Flat Pages

2016-09-29 Thread Sergiy Khohlov
Another way  is writing middleware class such as:

 class MyFlatMiddleware(FlatpageFallbackMiddleware):
   def process_response(self, request, response):
response =super(sMyFlatMiddleware, self).process_response(request,
response)
   response['HEADER_NAME'] = "HEADER_VALUE"
   return response

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Sep 29, 2016 at 2:37 PM, Michal Petrucha <
michal.petru...@konk.org> wrote:

> On Thu, Sep 29, 2016 at 03:47:11AM -0700, Web Architect wrote:
> > Hi Serge,
> >
> > Thanks for your response.
> >
> > We do not have any Views implemented for flatpages. I think they are
> Django
> > internal stuff for static html content (something like a CMS):
> >
> > https://docs.djangoproject.com/en/1.10/ref/contrib/flatpages/
> >
> > Have used the url pattern as in the example mentioned in the link above:
> >
> > from django.contrib.flatpages import views
> > urlpatterns += [
> > url(r'^about-us/$', views.flatpage, {'url': '/about-us/'},
> name='about'),
> > url(r'^license/$', views.flatpage, {'url': '/license/'},
> name='license'),]
>
> You can use the cache_control view decorator to wrap the flatpage view
> before you plug it into your urlpatterns::
>
> from django.contrib.flatpages import views
> from django.views.decorators.cache import cache_control
>
> cached_flatpage = cache_control(max_age=4700)(views.flatpage)
>
> urlpatterns += [
> url(r'^about-us/$', cached_flatpage, {'url': '/about-us/'},
> name='about'),
> url(r'^license/$', cached_flatpage, {'url': '/license/'},
> name='license'),]
>
> Cheers,
>
> Michal
>
> --
> 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/20160929113704.GT6601%40konk.org.
> 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/CADTRxJOzzt9E%3Dhbku076E3pUpYsRcMAPZYuFWaYwKyCpXcnEiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cache-Control header for Flat Pages

2016-09-29 Thread Sergiy Khohlov
could you please example your view.py   of those  flat pages. In case of
CBV syntax is little different  but it is possible to add any  response
header using view.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Sep 29, 2016 at 7:30 AM, Web Architect  wrote:

> Hi,
>
> We are using Django Flat pages for some static pages like About us,
> privacy policy etc. We are using Web Accelerator (like Varnish) in front of
> Django. Hence, would like to set the Cache-Control Header to cache the flat
> pages. I am not able to figure how to do that for flat pages.
>
> Tried using the middleware UpdateCacheMiddleware but it's not working.
> Would really appreciate if someone could throw some light.
>
> 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 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/38b38234-21bf-487a-9497-8120f7699513%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/CADTRxJNM5amojWdLa31MvHChHR8%3DwyvGAhJd%2BAv%3DdB7fHb1LiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django server

2016-09-28 Thread Sergiy Khohlov
please send output of python manage.py run server

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Sep 28, 2016 at 5:06 PM, NOOREEN  wrote:

> Problem in launching django server in ubuntu 14.04.How to resolve the
> given issue?
>
> --
> 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/f5727e95-7f84-4a31-acce-e5825aac2b87%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/CADTRxJOHtSewacExqP24Qcs5a4wzLOjcW-8koDipH99VyM2_7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Ticketing Application

2016-09-12 Thread Sergiy Khohlov
 Hello Alexandra,
 Have have no answer due to no question. You have decided to do
application. It is good , but you have not informed us about steps which
are done. In tho case nobody can help you. I was thinking that this a adv
email for popularizing you commercial chat client.  No more.


Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Sep 12, 2016 at 4:45 PM, M Hashmi  wrote:

> Hello Alexandra,
>
> You are at the right forum. But chatting as ticket needs some workout.
> Each message needs to be contain with all ticketing properties and upon
> selection of a message it should act as ticket. Now for that simply If you
> can, start with DjangoSocketIO
> at https://djangopackages.org/grids/g/chat/. After you've created and
> integrated in your project then extend this with submodel of Tickets. Then
> in view you can define that if you select a particular message to be
> treated as ticket then how should that particular message behave.
>
> Or you simply can use two packages like DjangoSocketIO and DjangoHelpDesk
> and create a sublayer model that combines feature of both the packages and
> then you iterate the behaviour in your view.
>
> It may look complicated but to keep it simple I hope this will be a good
> start. Craft your app with a visual work process or mockup and then
> everybody will start helping you.
>
> With generic question It will be hard for anyone to help you and yes you
> can treat a chat as ticket.
>
> Looking forward you start working on it so this group can help you create
> it.
> Hope this is helpful.
>
> Regards,
> Mudassar
>
> On Mon, Sep 12, 2016 at 4:18 AM, Alexandra 
> wrote:
>
>> Hi, could you please suggest other forums where I can find this
>> information?
>> Thank you 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 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/ms
>> gid/django-users/fe028722-d44a-40ff-b26d-d9813268213c%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/CANoUts6zSMSk_bPQg1x%2B3GfEG1YrfauAFTNPbV5UKUjTsmm0
> Hw%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/CADTRxJPYi7GLFY4Ysxj5t0soG6aTnXbvx-%3D94o_dRX3ZjfU%2BwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: iregex doesn't work properly

2016-08-30 Thread Sergiy Khohlov
 this one problem is not related  to the django. It is Mysql special
configuration.   Dot  is not working in your system as expected :
http://dev.mysql.com/doc/refman/5.7/en/regexp.html

 Looks like your localization is broking regular expression in MySQL.
In this case please ask this question in  MySQL topic not django.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Aug 30, 2016 at 1:00 PM, Denis Yu <denis.yu...@gmail.com> wrote:

> Here is the results:
> mysql> SELECT id FROM `clients_order_process` WHERE
> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$';
> Empty set (0,00 sec)
>
>
> while:
> mysql> SELECT id FROM `clients_order_process` WHERE
> `clients_order_process`.`step_description` REGEXP '^заказ роутер*а*$';
> +-+
> | id  |
> +-+
> | 241 |
> +-+
> 1 row in set (0,00 sec)
>
>
> вторник, 30 августа 2016 г., 15:31:51 UTC+6 пользователь Sergiy Khohlov
> написал:
>>
>> try to execute from console :
>>  SELECT id FROM `clients_order_process` WHERE  `clients_order_process`
>> .`step_description` REGEXP '^заказ роутер.$'
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Tue, Aug 30, 2016 at 11:58 AM, Denis Yu <denis...@gmail.com> wrote:
>>
>>>
>>> sorry, may be I explained the result of testing incorrectly(
>>> pls let me make another try):
>>>
>>> here is the record in log table:
>>> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934 |
>>>  0 | Query| SELECT COUNT(*) AS `__count` FROM
>>> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
>>> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')
>>>
>>>
>>> Django doesn't return any data. But I'm checking the record in table and
>>> it exists:
>>>
>>> mysql> select id, step, step_description from clients_order_process
>>> where id =241;
>>> +-+--+-------+
>>> | id  | step | step_description  |
>>> +-+--+---+
>>> | 241 |1 | заказ роутера |
>>> +-+--+---+
>>> 1 row in set (0,00 sec)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> вторник, 30 августа 2016 г., 14:37:24 UTC+6 пользователь Sergiy Khohlov
>>> написал:
>>>>
>>>> You are making me confused.
>>>> 1) Django  send data to db and SQL is correct
>>>> 2) MySQL returns correct result
>>>> 3) Django shows right data
>>>>
>>>>  Which one step has issue ?
>>>>
>>>> Many thanks,
>>>>
>>>> Serge
>>>>
>>>>
>>>> +380 636150445
>>>> skype: skhohlov
>>>>
>>>> On Tue, Aug 30, 2016 at 10:51 AM, Denis Yu <denis...@gmail.com> wrote:
>>>>
>>>>> Yes, i've seen.
>>>>>
>>>>> could you pls say one more ideas to check?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> воскресенье, 28 августа 2016 г., 21:11:56 UTC+6 пользователь Sergiy
>>>>> Khohlov написал:
>>>>>>
>>>>>> I've made mistake : "$" should be in request not "%"
>>>>>>
>>>>>>  this request "SELECT COUNT(*) AS `__count` FROM
>>>>>> `clients_order_process` WHERE (`clients_order_process`.`step` = 1
>>>>>> AND `clients_order_process`.`step_description` REGEXP '^заказ
>>>>>> роутер.$')"  informs that django sends data correctly.
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Serge
>>>>>>
>>>>>>
>>>>>> +380 636150445
>>>>>> skype: skhohlov
>>>>>>
>>>>>> On Sun, Aug 28, 2016 at 2:18 PM, Denis Yu <denis...@gmail.com> wrote:
>>>>>>
>>>>>>>
>>>>>>>1. Here is the result in logging table:
>>>>>>>
>>>>>>>
>>>>>>> mysql> select * from mysql.general_log;
>>>>>>> 
>>>>>>> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934
>>>>>>> | 0 | Query| SELECT COUNT(*) AS `__count` FROM
>>>>

Re: iregex doesn't work properly

2016-08-30 Thread Sergiy Khohlov
try to execute from console :
 SELECT id FROM `clients_order_process` WHERE
 `clients_order_process`.`step_description` REGEXP '^заказ роутер.$'

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Aug 30, 2016 at 11:58 AM, Denis Yu <denis.yu...@gmail.com> wrote:

>
> sorry, may be I explained the result of testing incorrectly(
> pls let me make another try):
>
> here is the record in log table:
> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934 |
>0 | Query| SELECT COUNT(*) AS `__count` FROM
> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')
>
>
> Django doesn't return any data. But I'm checking the record in table and
> it exists:
>
> mysql> select id, step, step_description from clients_order_process where
> id =241;
> +-+--+---+
> | id  | step | step_description  |
> +-+--+---+
> | 241 |1 | заказ роутера |
> +-+--+---+
> 1 row in set (0,00 sec)
>
>
>
>
>
>
>
>
> вторник, 30 августа 2016 г., 14:37:24 UTC+6 пользователь Sergiy Khohlov
> написал:
>>
>> You are making me confused.
>> 1) Django  send data to db and SQL is correct
>> 2) MySQL returns correct result
>> 3) Django shows right data
>>
>>  Which one step has issue ?
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Tue, Aug 30, 2016 at 10:51 AM, Denis Yu <denis...@gmail.com> wrote:
>>
>>> Yes, i've seen.
>>>
>>> could you pls say one more ideas to check?
>>>
>>>
>>>
>>>
>>> воскресенье, 28 августа 2016 г., 21:11:56 UTC+6 пользователь Sergiy
>>> Khohlov написал:
>>>>
>>>> I've made mistake : "$" should be in request not "%"
>>>>
>>>>  this request "SELECT COUNT(*) AS `__count` FROM
>>>> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
>>>> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')"
>>>>  informs that django sends data correctly.
>>>>
>>>> Many thanks,
>>>>
>>>> Serge
>>>>
>>>>
>>>> +380 636150445
>>>> skype: skhohlov
>>>>
>>>> On Sun, Aug 28, 2016 at 2:18 PM, Denis Yu <denis...@gmail.com> wrote:
>>>>
>>>>>
>>>>>1. Here is the result in logging table:
>>>>>
>>>>>
>>>>> mysql> select * from mysql.general_log;
>>>>> 
>>>>> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934 |
>>>>>0 | Query| SELECT COUNT(*) AS `__count` FROM
>>>>> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
>>>>> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')
>>>>> 
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> the record exists in table:
>>>>> mysql> select id, step, step_description from clients_order_process
>>>>> where id =241;
>>>>> +-+--+---+
>>>>> | id  | step | step_description  |
>>>>> +-+--+---+
>>>>> | 241 |1 | заказ роутера |
>>>>> +-+--+---+
>>>>> 1 row in set (0,00 sec)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>1. the result of query  SELECT id from Order_process WHERE
>>>>>step_description REGEXP BINARY '^заказ роутера%'; :
>>>>>
>>>>>
>>>>> mysql>  SELECT id from clients_order_process WHERE step_description
>>>>> REGEXP BINARY '^заказ роутера%';
>>>>> Empty set (0,00 sec)
>>>>>
>>>>>
>>>>>
>>>>> mysql> select * from mysql.general_log;
>>>>> ++-+
>>>>> ---+---+--+-
>>>>> 
>>>>> +
>>>>> | event_time | user_host   | thread_id |
>>>>> 

Re: iregex doesn't work properly

2016-08-30 Thread Sergiy Khohlov
You are making me confused.
1) Django  send data to db and SQL is correct
2) MySQL returns correct result
3) Django shows right data

 Which one step has issue ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Aug 30, 2016 at 10:51 AM, Denis Yu <denis.yu...@gmail.com> wrote:

> Yes, i've seen.
>
> could you pls say one more ideas to check?
>
>
>
>
> воскресенье, 28 августа 2016 г., 21:11:56 UTC+6 пользователь Sergiy
> Khohlov написал:
>>
>> I've made mistake : "$" should be in request not "%"
>>
>>  this request "SELECT COUNT(*) AS `__count` FROM `clients_order_process`
>> WHERE (`clients_order_process`.`step` = 1 AND
>> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')"
>>  informs that django sends data correctly.
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Sun, Aug 28, 2016 at 2:18 PM, Denis Yu <denis...@gmail.com> wrote:
>>
>>>
>>>1. Here is the result in logging table:
>>>
>>>
>>> mysql> select * from mysql.general_log;
>>> 
>>> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934 |
>>>  0 | Query| SELECT COUNT(*) AS `__count` FROM
>>> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
>>> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')
>>> 
>>>
>>>
>>>
>>>
>>> the record exists in table:
>>> mysql> select id, step, step_description from clients_order_process
>>> where id =241;
>>> +-+--+---+
>>> | id  | step | step_description  |
>>> +-+--+---+
>>> | 241 |1 | заказ роутера |
>>> +-+--+---+
>>> 1 row in set (0,00 sec)
>>>
>>>
>>>
>>>
>>>1. the result of query  SELECT id from Order_process WHERE
>>>step_description REGEXP BINARY '^заказ роутера%'; :
>>>
>>>
>>> mysql>  SELECT id from clients_order_process WHERE step_description
>>> REGEXP BINARY '^заказ роутера%';
>>> Empty set (0,00 sec)
>>>
>>>
>>>
>>> mysql> select * from mysql.general_log;
>>> ++-+
>>> ---+---+--+-
>>> 
>>> +
>>> | event_time | user_host   | thread_id |
>>> server_id | command_type | argument
>>>         |
>>> ++-+
>>> ---+---+--+-
>>> 
>>> +
>>> | 2016-08-28 14:18:20.921420 | crm[crm] @ localhost [] |   857 |
>>>  0 | Query| SELECT id from clients_order_process WHERE
>>> step_description REGEXP BINARY '^заказ роутера%'
>>>
>>>
>>> Pls, explain, what way do you recommend using raw string?
>>>
>>>
>>> thanks
>>>
>>>
>>>
>>>
>>> воскресенье, 28 августа 2016 г., 0:58:24 UTC+6 пользователь Sergiy
>>> Khohlov написал:
>>>>
>>>> Not sure that problem is related to character_set_server due to highest
>>>> priority of create table option.  I'm using postgres as default.  I'm
>>>> proposing to check latin chars and turn on mysql debugging  in case of your
>>>> permission.
>>>>   localization coding  of MySql is  here http://dev.mysql.com/doc
>>>> /refman/5.7/en/charset-syntax.html
>>>>  It will be nice to check your sql by using this
>>>> http://stackoverflow.com/questions/650238/how-to-show-t
>>>> he-last-queries-executed-on-mysql
>>>>
>>>>
>>>>  At this moment I propose do next :
>>>> 1)  check log for sql request from django to Mysql
>>>> 2) execute next sql from mysql :SELECT id from Order_process WHERE
>>>> step_description REGEXP BINARY '^заказ роутера%';
>>>>
>>>>
>>>>  Why are you not using raw string in your regex ?
>>>>
>>>>
>>>> Many thanks,
>>>>
>>>> Serg

Re: Djang freelance hourly rates

2016-08-28 Thread Sergiy Khohlov
Related to country skills etc. Based on the question I would like to say 3$.

28 серп. 2016 21:41 "Sithembewena Lloyd Dube"  пише:

> Out of curiousity, what do those who are freelancing on Django projects
> charge per hour?
>
> --
> Regards,
> Sithembewena
>
> --
> 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/CAH-SnCAPH_1a04XGUwdS4vRPQBcUzHTT0Kw08%
> 3D8wHqzeaENzsQ%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/CADTRxJPwCuhTH90QesbRvcBbV3XDFCSbqzgVyN3XfbNWCUxRTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: iregex doesn't work properly

2016-08-28 Thread Sergiy Khohlov
I've made mistake : "$" should be in request not "%"

 this request "SELECT COUNT(*) AS `__count` FROM `clients_order_process`
WHERE (`clients_order_process`.`step` = 1 AND
`clients_order_process`.`step_description`
REGEXP '^заказ роутер.$')"  informs that django sends data correctly.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sun, Aug 28, 2016 at 2:18 PM, Denis Yu <denis.yu...@gmail.com> wrote:

>
>1. Here is the result in logging table:
>
>
> mysql> select * from mysql.general_log;
> 
> | 2016-08-28 14:14:17.188990 | crm[crm] @ localhost [] |   934 |
>0 | Query| SELECT COUNT(*) AS `__count` FROM
> `clients_order_process` WHERE (`clients_order_process`.`step` = 1 AND
> `clients_order_process`.`step_description` REGEXP '^заказ роутер.$')
> 
>
>
>
>
> the record exists in table:
> mysql> select id, step, step_description from clients_order_process where
> id =241;
> +-+--+---+
> | id  | step | step_description  |
> +-+--+---+
> | 241 |1 | заказ роутера |
> +-+--+---+
> 1 row in set (0,00 sec)
>
>
>
>
>1. the result of query  SELECT id from Order_process WHERE
>step_description REGEXP BINARY '^заказ роутера%'; :
>
>
> mysql>  SELECT id from clients_order_process WHERE step_description REGEXP
> BINARY '^заказ роутера%';
> Empty set (0,00 sec)
>
>
>
> mysql> select * from mysql.general_log;
> ++-+
> ---+---+--+-
> 
> +
> | event_time | user_host   | thread_id |
> server_id | command_type | argument
> |
> ++-+
> ---+---+--+-
> 
> +
> | 2016-08-28 14:18:20.921420 | crm[crm] @ localhost [] |   857 |
>0 | Query| SELECT id from clients_order_process WHERE
> step_description REGEXP BINARY '^заказ роутера%'
>
>
> Pls, explain, what way do you recommend using raw string?
>
>
> thanks
>
>
>
>
> воскресенье, 28 августа 2016 г., 0:58:24 UTC+6 пользователь Sergiy Khohlov
> написал:
>>
>> Not sure that problem is related to character_set_server due to highest
>> priority of create table option.  I'm using postgres as default.  I'm
>> proposing to check latin chars and turn on mysql debugging  in case of your
>> permission.
>>   localization coding  of MySql is  here http://dev.mysql.com/doc
>> /refman/5.7/en/charset-syntax.html
>>  It will be nice to check your sql by using this
>> http://stackoverflow.com/questions/650238/how-to-show-t
>> he-last-queries-executed-on-mysql
>>
>>
>>  At this moment I propose do next :
>> 1)  check log for sql request from django to Mysql
>> 2) execute next sql from mysql :SELECT id from Order_process WHERE
>> step_description REGEXP BINARY '^заказ роутера%';
>>
>>
>>  Why are you not using raw string in your regex ?
>>
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Sat, Aug 27, 2016 at 8:13 PM, Denis Yu <denis...@gmail.com> wrote:
>>
>>> Sergiy,
>>>
>>> Thank you for reply
>>>
>>> I checked following parameters:
>>>
>>> mysql> show create table clients_order_process; (clients_order_process -
>>> it's my table)
>>>
>>> | clients_order_process | CREATE TABLE `clients_order_process` (
>>>   `id` int(11) NOT NULL AUTO_INCREMENT,
>>>   `step` int(11) NOT NULL,
>>>   `step_description` longtext NOT NULL,
>>>   `date_step` datetime NOT NULL,
>>>   `order_id` int(11) NOT NULL,
>>>   `manager_id` int(11),
>>>   PRIMARY KEY (`id`),
>>>   KEY `clients_order_proces_order_id_1eb697bf_fk_clients_order_id`
>>> (`order_id`),
>>>   KEY `clients_order_process_8784215c` (`manager_id`),
>>>   CONSTRAINT `clients_order_proces_order_id_1eb697bf_fk_clients_order_id`
>>> FOREIGN KEY (`order_id`) REFERENCES `clients_order` (`id`),
>>>   CONSTRAINT `clients_order_process_manager_id_f3e3fa60_fk_auth_user_id`
>>> FOREIGN KEY (`manager_id`) REFERENCES `auth_user` (`id`)

Re: iregex doesn't work properly

2016-08-27 Thread Sergiy Khohlov
Not sure that problem is related to character_set_server due to highest
priority of create table option.  I'm using postgres as default.  I'm
proposing to check latin chars and turn on mysql debugging  in case of your
permission.
  localization coding  of MySql is  here
http://dev.mysql.com/doc/refman/5.7/en/charset-syntax.html
 It will be nice to check your sql by using this
http://stackoverflow.com/questions/650238/how-to-show-the-last-queries-executed-on-mysql


 At this moment I propose do next :
1)  check log for sql request from django to Mysql
2) execute next sql from mysql :SELECT id from Order_process WHERE
step_description REGEXP BINARY '^заказ роутера%';


 Why are you not using raw string in your regex ?


Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sat, Aug 27, 2016 at 8:13 PM, Denis Yu <denis.yu...@gmail.com> wrote:

> Sergiy,
>
> Thank you for reply
>
> I checked following parameters:
>
> mysql> show create table clients_order_process; (clients_order_process -
> it's my table)
>
> | clients_order_process | CREATE TABLE `clients_order_process` (
>   `id` int(11) NOT NULL AUTO_INCREMENT,
>   `step` int(11) NOT NULL,
>   `step_description` longtext NOT NULL,
>   `date_step` datetime NOT NULL,
>   `order_id` int(11) NOT NULL,
>   `manager_id` int(11),
>   PRIMARY KEY (`id`),
>   KEY `clients_order_proces_order_id_1eb697bf_fk_clients_order_id`
> (`order_id`),
>   KEY `clients_order_process_8784215c` (`manager_id`),
>   CONSTRAINT `clients_order_proces_order_id_1eb697bf_fk_clients_order_id`
> FOREIGN KEY (`order_id`) REFERENCES `clients_order` (`id`),
>   CONSTRAINT `clients_order_process_manager_id_f3e3fa60_fk_auth_user_id`
> FOREIGN KEY (`manager_id`) REFERENCES `auth_user` (`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=249 DEFAULT CHARSET=utf8 |
>
>
> mysql> show variables like 'character_set%';
> +--++
> | Variable_name| Value  |
> +--++
> | character_set_client | utf8   |
> | character_set_connection | utf8   |
> | character_set_database   | utf8   |
> | character_set_filesystem | binary |
> | character_set_results| utf8   |
> | character_set_server | latin1 |
> | character_set_system | utf8   |
> | character_sets_dir   | /usr/share/mysql/charsets/ |
> +--++
> 8 rows in set (0,01 sec)
>
>
> so, I found  | character_set_server | latin1
> is this the problem?
>
>
>
>
>
> суббота, 27 августа 2016 г., 19:28:18 UTC+6 пользователь Sergiy Khohlov
> написал:
>>
>> Try to check this via mysql shell. It will be nice to know codepage at
>> system, database and django project. Have you checked this with Latin
>> charset already ?
>>
>> 27 серп. 2016 16:06 "Denis Yu" <denis...@gmail.com> пише:
>>
>>> Hi,
>>>
>>> Someone please, help to resolve my problem with iregex !
>>>
>>> using Django 1.9
>>> mysql Server version: 5.7.13-0ubuntu0.16.04.2 (Ubuntu)
>>> python 2.7
>>>
>>> I got the record in mysql in table Order_process:
>>>
>>> +-+--+---+--
>>> ---+--++
>>> | id  | step | step_description  | date_step   |
>>> order_id | manager_id |
>>> +-+--+---+--
>>> ---+--++
>>> | 241 |1 | заказ роутера | 2016-08-21 11:03:16 |
>>> 170 |  1 |
>>> +-+--+---+--
>>> ---+--++
>>>
>>> next, I'd like to get thi record by queryset:
>>> str_iregex = '^заказ роутер.$'
>>> orders = Order_process.objects.filter(step_description__iregex =
>>> str_iregex , step = 1).order_by('-id')
>>>
>>> But the got no result.
>>> pls help
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/dja

Re: iregex doesn't work properly

2016-08-27 Thread Sergiy Khohlov
Try to check this via mysql shell. It will be nice to know codepage at
system, database and django project. Have you checked this with Latin
charset already ?

27 серп. 2016 16:06 "Denis Yu"  пише:

> Hi,
>
> Someone please, help to resolve my problem with iregex !
>
> using Django 1.9
> mysql Server version: 5.7.13-0ubuntu0.16.04.2 (Ubuntu)
> python 2.7
>
> I got the record in mysql in table Order_process:
>
> +-+--+---+--
> ---+--++
> | id  | step | step_description  | date_step   | order_id
> | manager_id |
> +-+--+---+--
> ---+--++
> | 241 |1 | заказ роутера | 2016-08-21 11:03:16 |  170
> |  1 |
> +-+--+---+--
> ---+--++
>
> next, I'd like to get thi record by queryset:
> str_iregex = '^заказ роутер.$'
> orders = Order_process.objects.filter(step_description__iregex =
> str_iregex , step = 1).order_by('-id')
>
> But the got no result.
> pls help
>
>
>
>
>
>
>
>
> --
> 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/8da615e3-c990-4359-9851-32d12b5d9fb0%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/CADTRxJO2Snjz9N%2BzHNsPMkFxcr_Oui3oSgz9p7xSLUbzdCUDvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Attribute error, with a very basic banking app

2016-08-26 Thread Sergiy Khohlov
I can help with this one. But I m not ready to write code over weekend. It
is a nice to have used django auth model. You can extend it and this can
cut a lot of your code. Early versions had a problem with correct author
model but now situation is better.
Try to catch me at the beginning of the week.

26 серп. 2016 18:03 "Neil Hunt" <hunt.n...@gmail.com> пише:

> I've read the tutorial but I didn't fully appreciate how useful CBV are.
> Amazing as well that sometimes you can write almost no code. Thanks a lot
> for explaining that.
>
> On Fri, Aug 26, 2016 at 3:29 PM, Andromeda Yelton <
> andromeda.yel...@gmail.com> wrote:
>
>> In my experience, CBVs are useful when the view you want to write is
>> basically a create, read, update, or delete operation on a single database
>> item, or a bunch of instances of the same model (...and it turns out a lot
>> of web app pages are just that). And they're useful because they let you do
>> that with almost no lines of code - they take care of all the things you'd
>> have to write over and over, and let you focus on the things that are
>> unique to your use case.
>>
>> The farther away your business logic is from that, the more you need to
>> understand the actual methods available and the inheritance tree and so
>> forth. It took me a while to get over this hurdle too, but now that I have
>> I use CBVs exclusively.
>>
>> On Fri, Aug 26, 2016 at 10:13 AM, Neil Hunt <hunt.n...@gmail.com> wrote:
>>
>>> heh heh. I don't fully appreciate the usefulness of CBV at the moment.
>>> Getting a simple example working helps as much as reading the tutorial.
>>> Thanks again for your help,
>>>
>>> Neil
>>>
>>> On Fri, Aug 26, 2016 at 2:24 PM, Sergiy Khohlov <skhoh...@gmail.com>
>>> wrote:
>>>
>>>> Never mind.
>>>>  Few year ago I  was thinking that moving to CBV is bad idea, but
>>>> suddenly  BUUUHHH !! in my head and everything was clear.
>>>>
>>>> Many thanks,
>>>>
>>>> Serge
>>>>
>>>>
>>>> +380 636150445
>>>> skype: skhohlov
>>>>
>>>> On Fri, Aug 26, 2016 at 3:40 PM, Neil Hunt <hunt.n...@gmail.com> wrote:
>>>>
>>>>> Hello Serge,
>>>>>
>>>>> I can't believe that's all I have to add to get the class based views
>>>>> to work. It seems easier to get it to work than I thought it would be. Now
>>>>> that you've explained it. Thank you so much for that.
>>>>>
>>>>> Kind regards,
>>>>>
>>>>> Neil
>>>>>
>>>>> On Fri, Aug 26, 2016 at 11:46 AM, Sergiy Khohlov <skhoh...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>>  Hello Neil,
>>>>>>
>>>>>>  It is nota problem  to use Class based view. Could you please
>>>>>>  update your views.py  with next code.
>>>>>>  Look like you would like to have detail  of the deposit in this case
>>>>>> add next string to the header
>>>>>>
>>>>>> from  django.views.generic import DetailView
>>>>>> from models import Account1, Person
>>>>>>
>>>>>>
>>>>>>  # next  you should create a special view class for each Account1
>>>>>>
>>>>>>
>>>>>>  class Deposit(DetailView):
>>>>>> model = Account1
>>>>>>
>>>>>>
>>>>>>   Of course  function Deposit is  useless
>>>>>>
>>>>>>  thats all.
>>>>>>
>>>>>>
>>>>>>  P.S. Look like better way is adding auth  and receive person using
>>>>>> auth data. In this case  every authorized person can  connect to his
>>>>>> account  using auth info and  account id
>>>>>>
>>>>>> Many thanks,
>>>>>>
>>>>>> Serge
>>>>>>
>>>>>>
>>>>>> +380 636150445
>>>>>> skype: skhohlov
>>>>>>
>>>>>> On Thu, Aug 25, 2016 at 8:27 PM, Neil Hunt <hunt.n...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Thank you so much Andromeda. I didn't know you could use class based
>>>>>>> views. I'll have a look at the documents. I don't know why I was trying 
>

Re: Attribute error, with a very basic banking app

2016-08-26 Thread Sergiy Khohlov
Never mind.
 Few year ago I  was thinking that moving to CBV is bad idea, but suddenly
 BUUUHHH !! in my head and everything was clear.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Aug 26, 2016 at 3:40 PM, Neil Hunt <hunt.n...@gmail.com> wrote:

> Hello Serge,
>
> I can't believe that's all I have to add to get the class based views to
> work. It seems easier to get it to work than I thought it would be. Now
> that you've explained it. Thank you so much for that.
>
> Kind regards,
>
> Neil
>
> On Fri, Aug 26, 2016 at 11:46 AM, Sergiy Khohlov <skhoh...@gmail.com>
> wrote:
>
>>  Hello Neil,
>>
>>  It is nota problem  to use Class based view. Could you please  update
>> your views.py  with next code.
>>  Look like you would like to have detail  of the deposit in this case add
>> next string to the header
>>
>> from  django.views.generic import DetailView
>> from models import Account1, Person
>>
>>
>>  # next  you should create a special view class for each Account1
>>
>>
>>  class Deposit(DetailView):
>> model = Account1
>>
>>
>>   Of course  function Deposit is  useless
>>
>>  thats all.
>>
>>
>>  P.S. Look like better way is adding auth  and receive person using auth
>> data. In this case  every authorized person can  connect to his account
>>  using auth info and  account id
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Thu, Aug 25, 2016 at 8:27 PM, Neil Hunt <hunt.n...@gmail.com> wrote:
>>
>>> Thank you so much Andromeda. I didn't know you could use class based
>>> views. I'll have a look at the documents. I don't know why I was trying to
>>> use them when I didn't need to.
>>>
>>> On Thu, Aug 25, 2016 at 4:23 PM, Andromeda Yelton <
>>> andromeda.yel...@gmail.com> wrote:
>>>
>>>> The stacktrace is helpful, thanks!
>>>>
>>>> The specific message with the AttributeError is helpful here:
>>>> `AttributeError: 'module' object has no attribute 'DepositView'`
>>>>
>>>> The line above it is `  File 
>>>> "/home/soupdragon/DJapps/banking/mybank/banking/urls.py",
>>>> line 8, in 
>>>> url(r'^deposit/$', views.DepositView.as_view(), name='deposit'),`
>>>>
>>>> So I checked to see if your views.py contains anything named
>>>> DepositView...and it does not. That's why the AttributeError is showing up.
>>>>
>>>> The `DepositView.as_view()` syntax is suitable for class-based views,
>>>> which means I expect to see something in your views.py to the effect of:
>>>>
>>>> class DepositView(View):
>>>>   def post(self, request, *args, **kwargs):
>>>> // the logic in your deposit() function actually belongs here
>>>>
>>>> Have a look at the class-based views documentation to see what the
>>>> different classes are, and what options they provide you.
>>>>
>>>> Alternately, your urls.py could reference views.deposit (which does
>>>> exist) instead of views.DepositView (which does not).
>>>>
>>>> Hope this helps!
>>>>
>>>> On Thu, Aug 25, 2016 at 11:14 AM, Neil Hunt <hunt.n...@gmail.com>
>>>> wrote:
>>>>
>>>>> Thanks for your speedy reply, I've attached the stack trace
>>>>>
>>>>> On Thursday, August 25, 2016 at 4:00:16 PM UTC+1, ludovic coues wrote:
>>>>>>
>>>>>> Could you share the full stack trace you get when trying to run the
>>>>>> server ?
>>>>>> The attribute error should come with a ton of information like the
>>>>>> file and the line where the error occur.
>>>>>>
>>>>>> 2016-08-25 16:57 GMT+02:00 Neil Hunt <hunt...@gmail.com>:
>>>>>> > I've beem working on a simple banking app based on the Django
>>>>>> tutorial.
>>>>>> > Thanks to your help it almost works now. It was working using
>>>>>> templates but
>>>>>> > after making some changes to get HttpResponseRedirect to work I
>>>>>> changed what
>>>>>> > was in the urls file like it shows in the tutorial. Now, the server
>>>>>> doesn't
>>>>>> > run. It says there's an attribute error. I've temporarily left the
>>>>>

Re: Attribute error, with a very basic banking app

2016-08-26 Thread Sergiy Khohlov
 Hello Neil,

 It is nota problem  to use Class based view. Could you please  update your
views.py  with next code.
 Look like you would like to have detail  of the deposit in this case add
next string to the header

from  django.views.generic import DetailView
from models import Account1, Person


 # next  you should create a special view class for each Account1


 class Deposit(DetailView):
model = Account1


  Of course  function Deposit is  useless

 thats all.


 P.S. Look like better way is adding auth  and receive person using auth
data. In this case  every authorized person can  connect to his account
 using auth info and  account id

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Aug 25, 2016 at 8:27 PM, Neil Hunt  wrote:

> Thank you so much Andromeda. I didn't know you could use class based
> views. I'll have a look at the documents. I don't know why I was trying to
> use them when I didn't need to.
>
> On Thu, Aug 25, 2016 at 4:23 PM, Andromeda Yelton <
> andromeda.yel...@gmail.com> wrote:
>
>> The stacktrace is helpful, thanks!
>>
>> The specific message with the AttributeError is helpful here:
>> `AttributeError: 'module' object has no attribute 'DepositView'`
>>
>> The line above it is `  File 
>> "/home/soupdragon/DJapps/banking/mybank/banking/urls.py",
>> line 8, in 
>> url(r'^deposit/$', views.DepositView.as_view(), name='deposit'),`
>>
>> So I checked to see if your views.py contains anything named
>> DepositView...and it does not. That's why the AttributeError is showing up.
>>
>> The `DepositView.as_view()` syntax is suitable for class-based views,
>> which means I expect to see something in your views.py to the effect of:
>>
>> class DepositView(View):
>>   def post(self, request, *args, **kwargs):
>> // the logic in your deposit() function actually belongs here
>>
>> Have a look at the class-based views documentation to see what the
>> different classes are, and what options they provide you.
>>
>> Alternately, your urls.py could reference views.deposit (which does
>> exist) instead of views.DepositView (which does not).
>>
>> Hope this helps!
>>
>> On Thu, Aug 25, 2016 at 11:14 AM, Neil Hunt  wrote:
>>
>>> Thanks for your speedy reply, I've attached the stack trace
>>>
>>> On Thursday, August 25, 2016 at 4:00:16 PM UTC+1, ludovic coues wrote:

 Could you share the full stack trace you get when trying to run the
 server ?
 The attribute error should come with a ton of information like the
 file and the line where the error occur.

 2016-08-25 16:57 GMT+02:00 Neil Hunt :
 > I've beem working on a simple banking app based on the Django
 tutorial.
 > Thanks to your help it almost works now. It was working using
 templates but
 > after making some changes to get HttpResponseRedirect to work I
 changed what
 > was in the urls file like it shows in the tutorial. Now, the server
 doesn't
 > run. It says there's an attribute error. I've temporarily left the
 user name
 > and password in at the moment. I had a look at their tutorial how to
 do a
 > use the Django authentication system (thanks for telling me about
 that) and
 > I'm going to change that after I understand what's going on here.
 It's
 > amazing how much you can do with Django. Do you think with time you
 get more
 > used to what different errors mean? The errors seem new and confusing
 to me
 > at the moment. Any help would be very much appreciated. Thanks in
 advnace.
 >
 > --
 > 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...@googlegroups.com.
 > To post to this group, send email to django...@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/b30091ce-fcbf
 -461e-869e-bba72eb9dcfe%40googlegroups.com.
 > For more options, visit https://groups.google.com/d/optout.



 --

 Cordialement, Coues Ludovic
 +336 148 743 42

>>> --
>>> 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/ms
>>> gid/django-users/b9b247a9-830d-4cc0-a441-5a8013899f13%40googlegroups.com
>>> 

Re: New to Django

2016-08-20 Thread Sergiy Khohlov
I've created project for managing virtual machines via libvirt using django
few years ago. Also you can take a look at ganeti project. I'm ready to
answer any question related to django and cloud computing.

Thanks, Serge

20 серп. 2016 20:23 "Wolf Painter"  пише:

> If you look at the code for the template, images is in there. I've tried
> all the ways I found to display my multidimensional dictionary, one of
> which is to loop through the first part, then the second. If you look at
> the code below, I'm looping through the first part of the dictionary, then
> the second by calling the value on child_list.items which is images. So
> far, nothing I've tried is working no matter how I loop through it in the
> template. I'm still stuck on this as nothing I have looked up has worked,
> but I am new to django, so there may be something I'm missing.:
>
> {% for server, images in child_list.items %}
> {{ server }}
> {% for image, number in images.items %}
> {{ number }}
> {% endfor %}
> {% endfor %}
>
>
> On Thursday, August 18, 2016 at 6:33:58 AM UTC-7, Derek wrote:
>>
>> In your view you have:
>>
>> context = {
>> "server_list": serverlist,
>> "image_list": imagelist,
>> "child_list": childimagelist
>> }
>>
>> So the variables being passed through to your template are named:
>> server_list, image_list, child_list.
>>
>> In your template you call this:
>>
>> for server, images in child_list.items
>>
>> Which is fine, but then you call this:
>>
>> for image, number in images.items
>>
>> But there is no variable called "images" I think it should be
>> "image_list:.
>>
>> HTH
>> Derek
>>
>>
>> On Tuesday, 16 August 2016 02:22:28 UTC+2, Wolf Painter wrote:
>>>
>>> Hey everyone, I didn't see any posts (or google search) that could
>>> possibly answer my question, so I am here... I'm trying to create a way to
>>> launch vm's on a Xen or VMWare server using a website. I have the python
>>> file written on the Server and am currently creating a DJango app to manage
>>> everything. I'm stuck in a big way. I  currently have models that track
>>> servers, images and child images launched from the parent, but I can't
>>> figure out how to display it properly in a template so i can update the
>>> count (either add or subtract a number of VM's from a server). I'm new to
>>> both Django and Python, so please excuse any ignorance here... Here are my
>>> relevant models:
>>>
>>> class Image(models.Model):
>>> name = models.CharField(verbose_name='Image Name', max_length=50)
>>> labID = models.ManyToManyField(Lab, blank=True, related_name='labID')
>>> type = models.CharField(max_length=50)
>>>
>>> def __str__(self):
>>> return self.name
>>>
>>>
>>> class Server(models.Model):
>>> name = models.CharField(verbose_name='Server Name', max_length=50)
>>> ipAddress = models.CharField(max_length=15)
>>> maxCCU = models.IntegerField(default=0)
>>> images = models.ManyToManyField(Image, blank=True, 
>>> related_name='baseImage')
>>>
>>> def __str__(self):
>>> return self.ipAddress
>>>
>>> class Childimage(models.Model):
>>> name = models.CharField(verbose_name='Child Image Name', max_length=50)
>>> parent = models.ForeignKey(Image, related_name='base')
>>> server = models.ForeignKey(Server, related_name='server')
>>> inUse = models.BooleanField()
>>> rdpportnum = models.CharField(max_length=4)
>>>
>>> def __str__(self):
>>> return self.name
>>>
>>> What I'm trying to do is have a web page that displays the number of parent 
>>> images on a server by counting the child image. For example, I have a 
>>> parent image called win2k12_excel and there are 12 child images of the 
>>> parent win2k12_excel on the x.x.x.x server. I would like a web page that 
>>> shows there are 12 win2k12_excel images on that server that would allow me 
>>> to add or subtract the number on that server.
>>>
>>>
>>> I have created a view that does this and puts it into a multidimensional 
>>> dictionary, but I cannot figure out how to get that to render properly in a 
>>> template. Here is my view:
>>>
>>>
>>> def servers(request):
>>> serverlist = Server.objects.all()
>>> imagelist = Image.objects.filter(baseImage__in=serverlist).distinct()
>>>
>>> childimagelist = defaultdict(list)
>>> for server in serverlist:
>>> for image in imagelist:
>>> number = 
>>> Childimage.objects.filter(parent__name__contains=image).filter(server__ipAddress__contains=server).count()
>>> childimagelist[server].append({image: number})
>>> childimagelist.default_factory = None
>>> context = {
>>> "server_list": serverlist,
>>> "image_list": imagelist,
>>> "child_list": childimagelist
>>> }
>>> return render(request, "administration/servers.html", context)
>>>
>>> No matter what I have tried so far, I cannot get this dictionary to 

Re: Odd problem: some database updates do not appear on other pages until server restart

2016-08-18 Thread Sergiy Khohlov
Hello,
This is trivial mistake. Use form.__init__ if you would like to change it
dynamically

18 серп. 2016 22:14 "bobhaugen"  пише:

> Also, how pervasive is this behavior? Does it affect all querysets
> generated by model methods? I do that all over the place. This could be bug
> heaven!
>
> --
> 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/16924d52-c9e7-4666-b80d-7baaa49e59e7%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/CADTRxJOrnvSacsL%2Bseok_PP-QnGdFo%2B-%3DMNU-ESd_ugpzSdUyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.10

2016-08-09 Thread Sergiy Khohlov
On Tue, Aug 9, 2016 at 6:46 PM,  wrote:

> view_course


 Send definition of  this function view_course

Many thanks,

Serge


+380 636150445
skype: skhohlov

-- 
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/CADTRxJOe3tUrB_HHZ8UK7nsEpJYCRbwtYSL%3DE-%2BqjaOy0Mznxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Launching websites

2016-08-08 Thread Sergiy Khohlov
Hello David,
You have mixed different tasks. I have a question for you.
What kind of goal do you have?
Are you planing to have mail server, web server, dev box etc?
How much money are you going to spend?
Do you have sysadmin ?
Of course first question has high priority.

Thanks.,
Serge

8 серп. 2016 18:20  пише:

> Hi,
>
> This is slightly off topic, but I can imagine some of you might have faced
> this situation. I've been launching quite a few websites lately. It usually
> involves at least the following for me:
> - Domain registration and DNS setup
> - Server/Host configuration: Heroku setup (registration, environment
> variables for some of the steps above) or Docker setup
> - Deployment
> - Security aspects: TLS certificates, HTTPS setup, HTTP security headers,
> etc
> - Legal aspects: cookie policy, T, privacy, etc (implications from
> other steps)
> - Email: basic setup, SPF/DKIM for the spam, create RFC email addresses,
> etc
> - Mailing list setup (MailChimp or others)
> - Social media: signup to a few social networks, add "social sharing"
> buttons
> - Analytics/instrumentation/monitoring (Google Analytics, New Relic, etc)
> - Search engine registration/indexation (Google, Bing)
> - etc
>
> Some of these steps are interlinked and that's only for fairly "basic
> website" without any payment, A/B testing, user feedback or advertising
> requirements.
>
> None of it is particularly complex, although it does require some
> knowledge/experience, but it takes quite a lot of time and feels repetitive.
>
> There are lots of great products/services for the individual steps
> involved, but I can't find anything to streamline the whole (or at least
> part of the) process.
>
> Does anyone know any good tool, product, checklist or website for this? Do
> you have the same problem? How do you handle this yourself?
>
> Thanks for your help.
>
> David
>
> --
> 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/5de3b67d-5b14-4e98-a1ae-0638addbce1b%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/CADTRxJMfAGj4dcMiP%2B2jFJVeM2Kx3DGeMGbvk%3DJ%2Bk4TCXQA9Qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: redirect NoReverseMatch Django error

2016-08-05 Thread Sergiy Khohlov
Also please add your templates. Looks like you are using URLs in the
templates

5 серп. 2016 14:05 "ludovic coues"  пише:

> Have you added your app to the INSTALLED_APPS setting ?
>
> 2016-08-05 10:05 GMT+02:00 Dimitris Tsiktsiris :
> > Here are my view and urls
> > app url
> > app_name = 'profs'
> > urlpatterns = [
> > url(r'^$', views.index, name='index'),
> > url(r'^contact/', views.contact, name='contact'),
> > url(r'^check_login/', views.check_login, name='check_login'),
> > url(r'^(?P[a-zA-Z]+)/edit_news/$', views.edit_news,
> > name='edit_news'),
> > url(r'^(?P[a-zA-Z]+)/$', views.show, name='show'),
> > ]
> > root url
> > urlpatterns = [
> > url(r'^admin/', admin.site.urls),
> > url(r'^', include('profs.urls')),
> > ]
> > view
> > def check_login(request):
> > if request.method == 'POST':
> > if request.POST.get('username') != '' and
> > request.POST.get('password') != '' and request.POST.get('password') !=
> > 'free':
> > prof = get_object_or_404(Professional,
> > url_name=request.POST.get('username'))
> > if prof.subscription == request.POST.get('password'):
> > return redirect('edit_news', url_name_para =
> > request.POST.get('username'))
> > #return render(request, 'profs/edit_news.html', {'prof':
> > prof})
> > else:
> > return render(request, 'profs/test.html', {'val': 1})
> > else:
> > return render(request, 'profs/test.html', {'val': 2})
> > else:
> > return render(request, 'profs/test.html', {'val': 3})
> > def edit_news(request, url_name_para):
> > if request.method == 'POST':
> >
> > Professional.objects.filter(url_name=request.POST.get('
> url_name')).update(update_news=request.POST.get('editor1'))
> > return render(request, 'profs/index.html')
> >
> > prof = get_object_or_404(Professional, url_name=url_name_para)
> > return render(request, 'profs/edit_news.html', {'prof': prof})
> >
> > If I visit directly "http://127.0.0.1:8000/dtsik/edit_news/; I get this
> > error
> > NoReverseMatch at /dtsik/edit_news/
> > Reverse for 'edit_news' with arguments '()' and keyword arguments '{}'
> not
> > found. 1 pattern(s) tried: ['(?P[a-zA-Z]+)/edit_news/$']
> >
> >
> > When I submit to check login I get this error
> > NoReverseMatch at /check_login/
> > Reverse for 'edit_news' with arguments '()' and keyword arguments
> > '{'url_name_para': 'dtsik'}' not found. 0 pattern(s) tried: []
> >
> >
> > What is the problem? Though is something with url pattern but cant
> figure it
> > out
> >
> > --
> > 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/061336d6-
> 7ff2-4cc1-bad5-907fe3b5a988%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> Cordialement, Coues Ludovic
> +336 148 743 42
>
> --
> 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/CAEuG%2BTbCG1h7qWKat6vj%2BVo3d6SQo%
> 3DfWU9%2Bp5c%3DkgtgVzbN3YA%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/CADTRxJOMuVNBCdENZgqZt2kU3FJi7E2Q-b6jHWNAtjWQCtLoQA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installation

2016-07-27 Thread Sergiy Khohlov
Take a look at
https://jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/
this is perfect doc related to your situation s.

27 лип. 2016 12:04 "Its Eternity"  пише:

Hey, a friend recently wrote my a web-app for me to use however I am not
sure how I deploy the web app onto my VPS. I've looked at the tutorials on
Django but it says that  I can only use it for development. Is there a
method for me to get Django for public use?

-- 
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/95e91756-b960-4021-8603-e3ee21c3b4b9%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/CADTRxJMBN2Voi0pqOoc7iY_rjzbwX9e99kSktsWqXjN3GrRQPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django selected value

2016-07-25 Thread Sergiy Khohlov
Many to many fields are not good due to performance issues. It is not
important for small Db but for big it is a problem.
Simplest way for understanding form is a adding debug print(form)inside
your views get function.
Next step is turning off form autocommit, update your form fields and save
it.

25 лип. 2016 21:36 "Volodymyr Kirichinets"  пише:

> Hi Shem,
> Thanks for Your interest,
> But I solved this in more flexible and convenient model.(without requests,
> get selected options and other).
> I use now ManyToManyField and this solve many problems.
> Thanks for Your interest. I invite You to Python Dnipro, Django Dnipro,
> Pyramid Dnipro - Google Groups,
> If You interested - add this groups.
> Sincerely,
> Volodymyr
>
>>
>> --
> 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/162bbeb2-2d91-4755-93e0-aa5ec9018599%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/CADTRxJMpeF7LOsC4VqotCWznHFf8r2m-VO9rP1cmXEYP5mDU2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting an error when I try to make an html page on django

2016-07-19 Thread Sergiy Khohlov
Looks like you have deleted artist with Id#2.

19 лип. 2016 18:21 "Jose"  пише:

>
>
> On Tuesday, July 19, 2016 at 8:15:54 AM UTC-4, Jose wrote:
>>
>> I was watching a Django tutorial video and on the video the guy writes
>> the exact same code I have on the picture. In the video whats inside of his
>> curly brackets turns to purple. Mine does not turn purple and there is
>> something wrong since I get an error when I run the code. Why is anything I
>> write inside of the curly brackets not turning purple? I suspect that is
>> why I get an error when I run the server and try to open the webpage.
>>
>>
>> --
> 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/412953f9-6d21-4dd6-bf53-dc6c07ac9e2f%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/CADTRxJPNct_1_W6WBEDKjYTYw7w4W2M4%2BQwSeCF191fVrfnvyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: running django 1.9 problem

2016-07-13 Thread Sergiy Khohlov
Simple way is using virtual environment. In this case version of system is
not important. I'm using Mac for coding without any issues.

12 лип. 2016 14:28 "Nicolas Favede"  пише:

> hi i am a bit used to python i have a mac coming with 2.7.6 version and
> install 3.4 that i can use if i call
> i installed with difficulties django 1.9
> it came
> there /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4
> don't ask me why
> now i cannot import or work with
> PLEASE SOME HELP
> 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 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/b98bbc7f-111f-4d00-ab5d-23519ed67b46%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/CADTRxJMovX8jqUFQ1bJ%2Bwr6PP_0GR4kPPrTUaq2PQKwR%2B%2BDiWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: GeoDjango and Google Maps

2016-07-02 Thread Sergiy Khohlov
  Hello,
 Django Geo API  does not have  MapWidget. And this error is expected.
 List of supported widget is place here :
https://docs.djangoproject.com/ja/1.9/ref/contrib/gis/forms-api/
One of the simplest way of the adding map to the page is using leaflet
library which is nice supported.
 I'm using next code  for adding maps to the pages GeoDjango + leaflet

  {%   leaflet_map "map" callback="window.map_init"  fitextent=True
 creatediv=True  %}

 + some js  code.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Jul 1, 2016 at 1:49 PM, Dennis  wrote:

> Hello, friends!
> Please, help with the issue -
> http://stackoverflow.com/questions/38140407/how-to-hook-up-google-maps-to-geodjango
> Thanks A LOT !!
>
> --
> 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/486a2d4b-6226-43d6-aeed-6a1ecaedc54c%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/CADTRxJOOZ5v5RS%2BK%2BZuaOJ5k3x8Y%3Dhj9Omq42ovgfuUJXB_wBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django TCP Socket Communication

2016-06-17 Thread Sergiy Khohlov
Simple script receives data from GPS tracker and stores data into database.
Django has geodjango application for plotting point at the map.
17 черв. 2016 08:16 "Anil reddy reddy M"  пише:

> How i can store gps output in django model, how django will communicate
>  with micro controllar
>
>
> On Thursday, June 16, 2016 at 5:08:12 PM UTC+5:30, Jani Tiainen wrote:
>>
>> Oops, apparently you hijacked over year old thread...
>>
>> On 16.06.2016 13:45, Anil reddy reddy M wrote:
>>
>> Hi,
>>
>>  I made a TCP Server Socket  programming in python, it's nicely
>> communicating with micro controller, and also i can store latitude
>> ,longitude values in MySqldb from GPS output. Now I want develop a web
>> application for vechile  tracking. How can i do this stuff in django.  I
>> would be thankful   for all  the help i can get!
>>
>>
>>
>> Just make models to match tables and then use Django as you wish. There
>> isn't nothing magical there.
>>
>> For starting point you can use inspectdb to create initial models from
>> your database which you then can refine to suit your needs.
>>
>>
>>
>> On Saturday, March 28, 2015 at 7:21:24 PM UTC+5:30, Gergely Polonkai
>> wrote:
>>>
>>> Hello,
>>>
>>> it's a bit hard to understand what you exactly want to achieve. How can
>>> you communicate with the microcontroller? Do you connect to one of its TCP
>>> ports, and send it data, I assume. Is it done with a well-known protocol,
>>> like HTTP, or some custom one?
>>>
>>> You say that it opens a port every 5 seconds to a server. Where is that
>>> server? Is it on the same machine as you Django based application? How does
>>> the microcontroller and the server communicate with each other?
>>>
>>> There are so many architectural questions here before you get to a web
>>> application, and I'm afraid you original question cannot be answered before
>>> we see the whole picture.
>>>
>>> Best,
>>> Gergely
>>> On 28 Mar 2015 11:06, "bobdxcool"  wrote:
>>>
 But is that compatible with django ?

 On Sat, Mar 28, 2015 at 1:24 AM, François Schiettecatte [via Python] 
 <[hidden
 email] > wrote:

> Have you looked at the ‘socket’ python library ?
>
> François
>
> > On Mar 27, 2015, at 3:05 PM, bobdxcool <[hidden email]
> > wrote:
> >
> > I am new to TCP socket programming. I have a django based server
> > communicating with a microcontroller. Now, I want to implement TCP
> based
> > socket on the server side in order to communicate with the TCP
> socket on the
> > microcontroller. Can anyone give me an idea on how to do this ? What
> > libraries should I use on my django server The microprocessor
> basically
> > opens the socket every 5 seconds and sends a notification to the
> server. I
> > on the server side should be able to read this and pump data back to
> the
> > microprocessor using this socket which was opened by the
> microprocessor.
> >
> >
> >
> > --
> > View this message in context:
> 
> http://python.6.x6.nabble.com/
> Django-TCP-Socket-Communication-tp5090792.html
> > Sent from the django-users mailing list archive at Nabble.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 [hidden email]
> .
> > To post to this group, send email to [hidden email]
> .
> > Visit this group at 
> http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.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 [hidden email]
> .
> To post to this group, send email to [hidden email]
> .
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/
> msgid/django-users/DAE16363-2EEE-4E0F-A230-A31BB270E2F9%40gmail.com.
> For more options, visit 

Re: Why in Django the field IntegerRangeField not worked with None?

2016-06-16 Thread Sergiy Khohlov
Look like it is expected behaviour.
filter builds sql, any sql should have sence. What is sence with broken sql
?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Jun 15, 2016 at 1:09 PM, Seti Volkylany 
wrote:

> The model next:
>
> class Writter(models.Model):
> """
> Model for writters of books
> """
>
> id = models.UUIDField(primary_key=True, editable=False, default=uuid.
> uuid4)
> name = models.CharField(
> _('Name'),
> max_length=200,
> validators=[MinLengthValidator(settings.
> MIN_LENGTH_FOR_NAME_OR_TITLE_OBJECT)],
> unique=True,
> error_messages={'unique': _('The such writter already is here.')}
> )
> slug = ConfiguredAutoSlugField(_('Slug'), populate_from='name', unique
> =True)
> #
> # basic trends of books
> #
> about = models.TextField(
> _('About writter'),
> validators=[MinLengthValidator(100)],
> help_text=_('Give brief character of the writter and his books.')
> )
> years_life = IntegerRangeField(
> _('years life'),
> null=True,
> blank=True,
> help_text='Enter year birth and year death, if have.'
> )
>
>
>
> I am tried next:
>
>  Writter.objects.filter(years_life__endswith=None)
>
> but found error:
>
> allow_joins)
> 998 if value is None:
> 999 if lookups[-1] not in ('exact', 'iexact'):
> -> 1000 raise ValueError("Cannot use None as a query
> value")
>1001 lookups[-1] = 'isnull'
>1002 value = True
>
> ValueError: Cannot use None as a query value
>
>
> --
> 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/72566fb6-79ba-416c-9e3f-7b07a7df6e3f%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/CADTRxJP9y65d712bs-yNECGtcB6L1e49cy8MS6Yb75ZeF%3DtKew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: LoginRequiredMixin ignored

2016-06-16 Thread Sergiy Khohlov
please send  your http header. Look like auth header is present by  browser
default


Вірусів
немає. www.avast.com

<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Jun 16, 2016 at 8:29 PM, Lee Hinde  wrote:

> I always assume it's me. That was some errant copy and paste.
>
> Thanks!
>
> On Wed, Jun 15, 2016 at 11:51 PM, Babatunde Akinyanmi <
> tundeba...@gmail.com> wrote:
>
>> Actually it's you. Please see inline:
>>
>> On Jun 15, 2016 11:56 PM, "Lee Hinde"  wrote:
>> >
>> > Using Django 1.9.7.
>> >
>> > I have the following class:
>> >
>> > class AddView(LoginRequiredMixin, CreateView):
>> > template_name = "entry.html"
>> > model = Property
>> > form_class = AddPropertyForm
>> > success_url = "/buy/"
>> > login_url = '/account/login/'
>> >
>>
>> Consider your code for `dispatch`
>> > def dispatch(self, request, *args, **kwargs):
>> > print request.user
>> > print request.user.is_authenticated()
>> > return super(AddView, self).post(request, *args, **kwargs)
>> >
>> You have bypassed `LoginRequiredMixin` implementation of `dispatch` and
>> there's where the login logic is done. You should be returning a super call
>> to `dispatch` not `post`. If you are actually trying to force all requests
>> into POSTs (which I doubt), you are better off doing it in the `get`
>> method.
>>
>> > def form_valid(self, form):
>> > ls_property = form.save(commit=False)
>> > ls_property.user = get_user(self.request)
>> > ls_property.latitude = form.cleaned_data['latitude']
>> > ls_property.longitude = form.cleaned_data['longitude']
>> > submit =  form.cleaned_data['submit']
>> > ls_property.visible = (submit != 'draft')
>> > ls_property.save()
>> > return super(AddView, self).form_valid(form)
>> >
>> >
>> > The LoginRequiredMixin is ignored, i.e, I can get to the page without
>> being logged in.
>> >
>> > request.user reports: AnonymousUser
>> > request.user.is_authenticated() reports: False
>> >
>> > If I wrap the url:
>> >
>> > url(r'^sell', user_passes_test(user_is_active)(AddView.as_view()),
>> name="add"),
>> >
>> > the page is protected, so I have a work around.
>> >
>> > This seems basic and I don't find other reports of LoginRequiredMixin
>> not working, so I assume it's me.
>> >
>> > What am I missing?
>> >
>>
> --
> 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/CA%2BePoMwMHRW6cEbzPypBhTnGCRJ7W0nGE%2BvaQ_ytmA_D2WhiSg%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/CADTRxJMCA8NRG9hVtg%3DMDXiwCLrcwfeuw3tUXFqbenrxqwqdTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django TCP Socket Communication

2016-06-16 Thread Sergiy Khohlov
Have ready  this kind of application  using  django + postgis. At this
moment protocols Cabon and teltronika are supported. Are you interested ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Jun 16, 2016 at 2:37 PM, Jani Tiainen  wrote:

> Oops, apparently you hijacked over year old thread...
>
> On 16.06.2016 13:45, Anil reddy reddy M wrote:
>
> Hi,
>
>  I made a TCP Server Socket  programming in python, it's nicely
> communicating with micro controller, and also i can store latitude
> ,longitude values in MySqldb from GPS output. Now I want develop a web
> application for vechile  tracking. How can i do this stuff in django.  I
> would be thankful   for all  the help i can get!
>
>
>
> Just make models to match tables and then use Django as you wish. There
> isn't nothing magical there.
>
> For starting point you can use inspectdb to create initial models from
> your database which you then can refine to suit your needs.
>
>
>
>
> On Saturday, March 28, 2015 at 7:21:24 PM UTC+5:30, Gergely Polonkai
> wrote:
>>
>> Hello,
>>
>> it's a bit hard to understand what you exactly want to achieve. How can
>> you communicate with the microcontroller? Do you connect to one of its TCP
>> ports, and send it data, I assume. Is it done with a well-known protocol,
>> like HTTP, or some custom one?
>>
>> You say that it opens a port every 5 seconds to a server. Where is that
>> server? Is it on the same machine as you Django based application? How does
>> the microcontroller and the server communicate with each other?
>>
>> There are so many architectural questions here before you get to a web
>> application, and I'm afraid you original question cannot be answered before
>> we see the whole picture.
>>
>> Best,
>> Gergely
>> On 28 Mar 2015 11:06, "bobdxcool"  wrote:
>>
>>> But is that compatible with django ?
>>>
>>> On Sat, Mar 28, 2015 at 1:24 AM, François Schiettecatte [via Python] 
>>> <[hidden
>>> email] > wrote:
>>>
 Have you looked at the ‘socket’ python library ?

 François

 > On Mar 27, 2015, at 3:05 PM, bobdxcool <[hidden email]
 > wrote:
 >
 > I am new to TCP socket programming. I have a django based server
 > communicating with a microcontroller. Now, I want to implement TCP
 based
 > socket on the server side in order to communicate with the TCP socket
 on the
 > microcontroller. Can anyone give me an idea on how to do this ? What
 > libraries should I use on my django server The microprocessor
 basically
 > opens the socket every 5 seconds and sends a notification to the
 server. I
 > on the server side should be able to read this and pump data back to
 the
 > microprocessor using this socket which was opened by the
 microprocessor.
 >
 >
 >
 > --
 > View this message in context:
 
 http://python.6.x6.nabble.com/
 Django-TCP-Socket-Communication-tp5090792.html
 > Sent from the django-users mailing list archive at Nabble.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 [hidden email]
 .
 > To post to this group, send email to [hidden email]
 .
 > Visit this group at 
 http://groups.google.com/group/django-users.
 > To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/1427483125637-5090792.post%40n6.nabble.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 [hidden email]
 .
 To post to this group, send email to [hidden email]
 .
 Visit this group at http://groups.google.com/group/django-users.
 To view this discussion on the web visit
 
 https://groups.google.com/d/
 msgid/django-users/DAE16363-2EEE-4E0F-A230-A31BB270E2F9%40gmail.com.
 For more options, visit 
 https://groups.google.com/d/optout.


 --
 If you reply to this email, your message will be added to the
 discussion below:

 

Re: how to forbidden mouse click and keyboard typing when loading page after press submit button in django web?

2016-06-10 Thread Sergiy Khohlov
This is not django question. Let's imagine. User has pressed submit.
Browser is forming request and data is passing to web app. Has web aapp
informed about user typing? Of course no. Simple redirect makes forgotting
filled form.
10 черв. 2016 04:36 "meInvent bbird"  пише:

> how to forbidden mouse click and keyboard typing when loading page after
> press submit button in django web?
>
> --
> 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/792a83c6-500a-4443-8c2b-e1a0cb7ae661%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/CADTRxJMM-7Rk0yDqPy-y3Mv%2Bxo216%3DQY6Fd7-gahoJ-wXD9bRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: negative float

2016-05-12 Thread Sergiy Khohlov
Hard to help with this small code. Could you please send me all function or
class from your view.py ?
12 трав. 2016 22:37 "Григор Колев"  пише:

> #models.py
> coef = models.DecimalField(max_digits=5, decimal_places=4, default=0.0100,
> verbose_name='Коефицент')
>
>
> #view.py
> item['coef'] == 0.01
> print item['coef'] # return 0.0
> if item['total'] < 0:
> item['sum'] = item['total'] * ( item['coef'] * -1)
>
> On Python it is work.
> I try to make coke Float but without success
>
> --
> 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/22a61dc0-808a-4e55-9b06-14db6664b1db%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/CADTRxJOjSSv6z%2Bf9Sp0AzpxsO%2BC2hzpzjSxZHPKVAFe7vdB3cQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Models

2016-05-06 Thread Sergiy Khohlov
 simplest way is using  filter() against all()
Take a look at
https://docs.djangoproject.com/en/1.9/ref/models/querysets/

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, May 6, 2016 at 5:27 PM, Omar  wrote:

> Gretting, I have in my DataBase (Directorios) two row, Departamento and
> Telefonos with the method Directorios.objects.all() I can get all objects
> in my DB but I need just get all Departamento in a variable, I don’t know
> how get it separated.
>
> --
> 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/001a01d1a7a3%246b23ef40%24416bcdc0%24%40infomed.sld.cu
> 
> .
> 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/CADTRxJNVNQE-M-Agy9Ca3iJyA5fTBeOU%3DetV9K7dd%2BzhhMVG1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: google/bing maps using django

2016-04-09 Thread Sergiy Khohlov
Check django-leaflet. Also best way for storing lon lat use geodjango with
postgis
9 квіт. 2016 23:26 "Xristos Xristoou"  пише:

> if i have two fields in my model with coordinates lon = models.FloatField
> ()
>
>lat = models.FloatField()
>
> how to show this place in google maps in my html template ?
>
>
>
>
> Τη Σάββατο, 9 Απριλίου 2016 - 10:50:08 μ.μ. UTC+3, ο χρήστης Xristos
> Xristoou έγραψε:
>>
>> hello
>>
>>
>> i want some toturial or examble to easy way ping and show one place in
>> google maps/bing maps with lat/log
>> and can be dynamic because i have more places to show in my web site ?
>>
> --
> 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/b835e6ef-c8c1-4762-bb4c-e2a669c363c6%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/CADTRxJNP-ys_ERk35g43SFrvd%2Bi0ubyUHkeUm6AkqUjc4sR2Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Both directly transfer data from django to jQuery

2016-03-10 Thread Sergiy Khohlov
Ajax ?
 Have you checked this one ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Mar 10, 2016 at 2:18 PM,  wrote:

> I had method model that generate dict, sample:
>
> {
> 'translators': 5,
> 'glossaries': 1,
> 'abbrs': 0,
> }
>
> I want known, how transfer data without hidden fields in html file. I need
> here for generate google-chart.
>
> --
> 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/1cc9d0cd-b6d1-46dc-9c7a-092e7422464e%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/CADTRxJOSjnfqrg1UAj-WjO4Af%3D9-4bjj9UO1LzeOmpmfL0tq6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: variable to a template

2016-03-02 Thread Sergiy Khohlov
 try to use :
"{% static "mysite/scorr{{a}}" %}"



Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Mar 2, 2016 at 1:00 PM, 'luca72' via Django users <
django-users@googlegroups.com> wrote:

> Hello Thanks for your reply
>
> STATIC_URL = '/static/'
>
> I have no static root configured
>
> But why if i writewidth="100" height="100"   i get the image
>
> and if i write   height="100"  where a is the file name i can't get?
>
> The path is
> F:\Sito_01_03_16\test\nuovo\myproject\mysite\static\mysite\scorr
>
> Thanks for your help
>
> Il giorno mercoledì 2 marzo 2016 11:52:05 UTC+1, Sergiy Khohlov ha scritto:
>>
>> original path  og your image please.
>>  Also setting for STATIC_ROOT  from setting.py send please
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Wed, Mar 2, 2016 at 12:41 PM, 'luca72' via Django users <
>> django...@googlegroups.com> wrote:
>>
>>> Hello i have write this in a template:
>>> {% for a in lista %}
>>> >> height="100" 
>>>  {% endfor %}
>>> But i get no image
>>>
>>> if i add just a  {{a}}  i see that the file name is righ,
>>> also if i direct write the file i get it
>>>  {% for a in lista %}
>>> >> width="100" height="100" 
>>>  {% endfor %}
>>>
>>> can you tell me what is wrong
>>>
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@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/9a12167f-e919-4632-b77a-6d5acc80fd3e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/9a12167f-e919-4632-b77a-6d5acc80fd3e%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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/e23e424c-0105-4b11-878c-86bb9dbe5613%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/e23e424c-0105-4b11-878c-86bb9dbe5613%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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/CADTRxJNYVrCFyqcnnZhbQqF-Kd-AnB0K3hYWtBj9BtibtELpyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: variable to a template

2016-03-02 Thread Sergiy Khohlov
original path  og your image please.
 Also setting for STATIC_ROOT  from setting.py send please

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Mar 2, 2016 at 12:41 PM, 'luca72' via Django users <
django-users@googlegroups.com> wrote:

> Hello i have write this in a template:
> {% for a in lista %}
>  height="100" 
>  {% endfor %}
> But i get no image
>
> if i add just a  {{a}}  i see that the file name is righ,
> also if i direct write the file i get it
>  {% for a in lista %}
>  height="100" 
>  {% endfor %}
>
> can you tell me what is wrong
>
> 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 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/9a12167f-e919-4632-b77a-6d5acc80fd3e%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/CADTRxJOVdo5oM38qBOgAVYD7cSVMDip%3DB4FW5TAHK85bWgG8dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Default Site

2016-02-27 Thread Sergiy Khohlov
This is task for apache not for django.
G
26 лют. 2016 23:06  пише:
> no
> Hi,
>
>
> Shouldn’t django.contrib.sites.models.SiteManager.get_current() first
check the given request to determine the current site and then look at the
SITE_ID setting?
>
>
> I would like to have multiple Sites and choose the current site based on
the context of the request, but fall back to the configured SITE_ID setting
if there doesn’t happen to be a request available.
>
>
> Is this a bug or am I missing something?
>
>
> Thanks,
>
>
> - Doug
>
> --
> 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/fe79eaa4-a276-423d-bdb8-bda0759977b2%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/CADTRxJMrn-oMxD%3DQ57bpbw6%3DTOhz39tVgLEv5bE0vpb9VBbd1w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ValidationError syntax different than in Django 1.9 docs

2016-02-14 Thread Sergiy Khohlov
 Check localization   page
https://docs.djangoproject.com/en/1.9/topics/i18n/

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sun, Feb 14, 2016 at 5:23 PM, Andrzej Olchawa 
wrote:

> Hi guys,
>
> first of all, I'm new to Django and this group.
>
> I've just created my first Django login form by extending
> AuthenticationForm and overriding confirm_login_allowed method to do some
> extra checks and raise proper exceptions. I've done that based on an
> example from the Django 1.9 documentation (
> https://docs.djangoproject.com/en/1.9/topics/auth/default/#module-django.contrib.auth.forms
> ):
>
> class PickyAuthenticationForm(AuthenticationForm):
> def confirm_login_allowed(self, user):
> if not user.is_active:
> raise forms.ValidationError(
> _("This account is inactive."),
> code='inactive',
> )
>
> ...
>
>
>
> Of course I imported the forms (it would be nice if I didn't have to
> figure out which forms should I import ...):
> *from django import forms*
>
> This, however, issues a problem: *"... confirm_login_allowed _("This
> account is inactive."), NameError: global name '_' is not defined".*
>
> So, despite what the doc says, I tweaked the code a bit to this, and it
> works:
>
> class PickyAuthenticationForm(AuthenticationForm):
> def confirm_login_allowed(self, user):
> if not user.is_active:
> raise forms.ValidationError("This account is inactive.", 
> code='inactive',)
>
> ...
>
>
> I still don't understand why the previous one code didn't work. Is it a
> mistake in the documentation? I doubt it, and what I think instead is that
> I imported wrong forms. Instead of:
>
> *from django import forms*
>
> I should do:
>
> *from django. import forms*
>
> and maybe then the syntax ValidationError would be as in the docs.
>
> --
> 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/e02dea8c-f9c7-4850-a825-c14d775b1e8d%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/CADTRxJMhbe-iA7s9YC_rtBcoG_VTfBBTsXpnCoh1K9naW2ikww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Send an object parameter from views.py to forms.py

2016-02-10 Thread Sergiy Khohlov
I've moved to CBV sometime ago  and  I can not write  your code on fly:

 Let imagine:
1) User request page using "GET"
2) User set some values and send it using  "POST"
3) New page is shown using  new "GET"

id_medioedit is set ant stage 2 and answer at 3 is ok. But you dont know
how to set  it at stage 1 . In this case  you need default value  for first
get
Add  some code for "GET" such as
if request.method == "GET":
p = Medious.object.get(id=1)

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Feb 10, 2016 at 1:17 PM, elcaiaimar  wrote:

> Hello,
>
> I have a problem because I don't know how could I send one specific
> parameter. I've sent other parameters sometimes in others apps but this
> time is more difficult.
> Below it's my code. I want to send '*p*', which is an object. The problem
> is that I can't send it in *else *because I've defined *p *outside (*if*).
> So when I tried to send it, *p *is not defined. I can't define it outside
> because I need *id_medioedit*, which is an id obtained from template in
> *medioedit_id* form.
>
> Anyone who knows how to solve this?
>
> Thank you in advance
>
>
> Views.py
>
> if 'medioedit_id' in request.POST:
> formularioeditarmedios = EditMediosForm(request.POST)
>
> try:
> id_medioedit = request.POST['medioedit_id']
> p = Medios.objects.get(pk=id_medioedit)
> mensaje = {"status":"True","medioedit_id":p.id}
>
>
> if formularioeditarmedios.is_valid():
>...
>
> else:
> formularioeditarmedios = EditMediosForm(p=p)
>
>
> Forms.py
>
> class EditMediosForm(forms.Form):
>   #initial='somevalue'
>   titulo = forms.CharField(max_length=140, widget=forms.TextInput(attrs={
> 'style': 'width:140px'}))
>
> def __init__(self,p,*args,**kwargs):
> p = kwargs.pop("p", None)
> super(EditMediosForm, self).__init__(*args,**kwargs)
> self.fields['titulo'].initial = p.titulo
>
>
> --
> 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/e4c77318-156a-40da-9761-9c03f382af77%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/CADTRxJN4z4HnZ%2BKzpOGp8y7qtmMYeBGYFDsA4jOz7UbZJjX6og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-09 Thread Sergiy Khohlov
Add regext to the  url.py and  view function to it
Add function to the view.py accepted  function values from  request object
and return  value of  your functions
Create template  which few input values field and shown result

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Feb 9, 2016 at 9:47 PM, Xristos Xristoou  wrote:

> hello,
>
>
> i create some python mathematical function on python idle,
> i want to create website where the user import value numbers on the
> function
> and take the results from that.
> question one,how to connect my mathematical function on the django?
> question two,how to connect input and output from the scipts in the
> website ?
> the second question i ask because input and output from the function is a
> dynamic define from the user
>
>
>
> --
> 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/b9267697-b28e-4a03-af7c-88fd384cc72b%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/CADTRxJMfi8ToRx3h0KkQFz5nYUDtKh-GLz5PP94fNR6nG_w8Sg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Polymorphic class and geomodels?

2016-02-08 Thread Sergiy Khohlov
Class Based Views has ability to include function in view from template.
 Short example:
 I have finished  small  (GTS) project  related  to  GPS system. Each car
has a array of points (car positions) and route (named as LineString in
GeoDjango).

 part of models.py


class Points(models.Model):
""" """
Car  = models.ForeignKey(Car)
Speed= models.IntegerField(default=0)
Time = models.DateTimeField()
Course   = models.IntegerField(default=0)
Altitude = models.IntegerField(default=0)
Sat  = models.IntegerField(default=1)
Point= gismodels.PointField()

 Points has connection to the Car  and has DateTime field used for correct
point sorting.
HTML page (Car) should contains array of related  object based on Car ID
and specific time range.
I add to views.py  (CarDetail class )next function:

def points(self):
""" """
timefmt= "%Y-%m-%d %H:%M:%S"
usertimezone= self.request.user.profile.timezone
try:
StartDateTime  =
usertimezone.localize(datetime.strptime(self.request.GET['StartDateTime'],
timefmt))
EndDateTime   =
usertimezone.localize(datetime.strptime(self.request.GET['EndDateTime'],
timefmt))
except:
StartDateTime  = datetime.combine(date.today(), time.min)
EndDateTime   = datetime.now()

context = super(CarDayReport, self).get_context_data()
return Points.objects.filter(Car_id=context['car'].id,
 Time__gt=StartDateTime,
 Time__lte=EndDateTime).order_by('Time')

  Time range is set via html template. Car ID is  also known.   Not hard
way to do.,



Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sat, Feb 6, 2016 at 9:29 AM, Luca Moiana <luca.moi...@gmail.com> wrote:

> Hi Serge,
>
> sorry for the expert warning you gave me on performance. But I have
> trouble following your really techincal suggestion, my goal is to have one
> table with measures that is related to three models with different
> geometries, so I can't use a foreign key in measure table, I don't
> understand the use of related obj, can you point me to a good source ?
>
> thanks
>
> On Friday, February 5, 2016 at 7:40:53 PM UTC+1, Sergiy Khohlov wrote:
>>
>> I’ve decided  to use  connection via key. and using via  key directly or
>>  via related objects.  Such us Car  -> Point  (multiline). Reason is simple
>> : django creates not perfect database structure  and I would like think
>> about performance as soon as possible.  My project contains Car and points
>> related to the car and of course route (POLYLINE).  I deceided to use
>> trivial PostGIS model for avoiding  bottleneck that use simple code in
>> view.  It is really easy to change view and hard to change models in case
>> of important data present. (Every 100km generates 2000 points which cause
>> and route length and motor service interval). In case of success Abstract
>> class (with good performance) let me know please.
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Fri, Feb 5, 2016 at 7:25 PM, Luca Moiana <luca@gmail.com> wrote:
>>
>>> Hi Serge,
>>>
>>> thank you for your reply.
>>>
>>> I'm working on an environmental monitoring app, where I want to store,
>>> and serve, monitoring value on different geometries, points, tracks or
>>> polygon.
>>> That's why I'm trying to use a polymorphic model in order to have one
>>> entity and multiple geometries.
>>>
>>> Cheers
>>>
>>> L
>>>
>>>
>>> On Friday, February 5, 2016 at 10:51:31 AM UTC+1, Sergiy Khohlov wrote:
>>>>
>>>>  I would like as simple question :  Are you planning  to have some
>>>> advantages using this abstract class ?
>>>>  I’m working on  similar product  (look like you are making energy
>>>> pipeline system based on postgis and gjango). My product is GTS system
>>>> which includes POINTS (datas are received via GTS devices mounted on
>>>> vehicles). Polylines (car route for selected time range),  etc.  Producing
>>>> abstract class can decrease DB productivity. Which one functional do you
>>>> need in case of abstract class for different types usage ?
>>>>
>>>> Many thanks,
>>>>
>>>> Serge
>>>>
>>>>
>>>> +380 636150445
>>>> skype: skhohlov
>>>>
>>>> On Fri, Feb 5, 2016 at 11:07 AM, Luca Moiana <luca@gmail.com>
>>>>

Re: Scaling Django

2016-02-07 Thread Sergiy Khohlov
Normalization  is something like that :

http://www.studytonight.com/dbms/database-normalization.php


 hardware for this Mysql was :
serg@anomehost:~$ free -m
 total   used   free sharedbuffers cached
Mem:  4049   3920129  0338   2016
-/+ buffers/cache:   1565   2484
Swap: 2863516   2347

serg@anomehost:~$ cat /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model   : 15
model name  : Intel(R) Xeon(R) CPU   E5310  @ 1.60GHz
stepping: 11
microcode   : 0xb7
cpu MHz : 1596.170



 Mysql has a problem :
 db file is grown regularly and  run vacuum is  really hard. Only
partitutioning  helps in this case

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sun, Feb 7, 2016 at 5:37 AM, Dexter T. <dexte...@gmail.com> wrote:

> Hi Sergiy, are you referring to my post or to the OP?
>
> On Sunday, February 7, 2016 at 6:03:11 AM UTC+8, Sergiy Khohlov wrote:
>>
>> Print database structure.
>> Check possibility of DB normalization.
>>
>
> You might have meant "denormalization" here (?), especially when operating
> at such scale. We do used denormalization for some of our larger tables.
>
>
>> 100 GB  (my "record" is 452 GB  )is not so high but  this size requires
>> some attention. (Look like you Mysql used only one db file: try to set
>> table per file.  Check index size , and verify that indexes  are working
>> corectly)
>>
>
> We are using innodb_file_per_table. But see that I mentioned that all this
> 100GB data fit on a lowly 8GB ram VM, 50% of which was allocated to innodb
> buffers. With such little resources, but at the same time intimately
> knowing your database workload, it is still possible to handle such db
> size. And yes, our indexes are used well, as most queries were EXPLAINed
> and optimized accordingly.
>
> What hardware are you running your 452GB db in?
>
> Review  your project:
>>  try to avoid  Many to Many field
>> Is it possible switch from hardcode SQL to  stored function and procedure
>> ?
>>
>
> See my above post about denormalization. And arguably storedprocs are even
> harder to manage, code-wise, and deployment wise.
>
>
>>  Look like  this issue in not connected to django only.
>>
>
> Again, if you are referring to my post, I am not the OP. Not that our
> system is perfect, and yes we're not the ones with scaling problems.
> I was in fact sharing the practices of scaling that worked for us. See the
> OPs post on what problems they're facing (organizational / political /
> methodological).
>
> Cheers!
>
>
>>
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Sat, Feb 6, 2016 at 7:09 PM, Dexter T. <dext...@gmail.com> wrote:
>>
>>> Lots of great replies already.
>>> I also want to add a few (random) things ...
>>>
>>> - have you clearly defined and isolated what issue(s) are you facing?
>>> - you mentioned using DRF in a service, with a large JSON reponse taking
>>> seconds to finish, how did you troubleshoot/profile this? Seconds to
>>> process server-side? Seconds to download client-side? Where specifically?
>>> If you said you don't know, then find out!
>>> - your system will have so many legs, have you made an effort to
>>> instrument and measure and isolate which parts are slow and why?
>>> - you mentioned using the debug toolbar, have you proven that your
>>> database schema is optimal? Any queries in your slow queries log? Indexes
>>> used and ok and optimal? For your workload, can_read caching help? Db
>>> replicas be of help?
>>> - how are your server resources utilized? Are you sure you are not
>>> bottlenecked by thrashing disk-io? Overcomitted CPU? Low memory/swapping?
>>> File descriptor count?
>>> - have you checked if clients are not bottlenecked? An ajax call to
>>> download a  complex nested json object is both costly to serialize, CPU and
>>> bandwidth wise. Gzip can help here, if applicable.
>>> - for more context, can you share some numbers, like http and db level
>>> req/sec, row count for the most heavily used tables? How about server
>>> infrastructure specs?
>>>
>>> Note that these are basic questions and are basic problem-solving steps,
>>> im assuming your teams should be aware and be taking steps like these
>>> already.
>>>
>>> In one project of mine, we're doing a 100gb mysql db, some tables above
>

Re: django現在インストールエラーにつきまして

2016-02-06 Thread Sergiy Khohlov
 look like you have used pip or easy_install  for downloading  django
 Verify that  django is ok

python -c "import django; print(django.__path__)"

After this

django-admin startproject mysite

 this command creates mysite dir  and  settings.py of course


Many thanks,

Serge


+380 636150445
skype: skhohlov

2016-02-06 9:37 GMT+02:00 makamaka32 :

> お世話になります。
> 現在djangoを学習しようとしている者ですがインストール時にエラーが起こり先に進めないようになっております。
>
> easy_installにてdjangoをダウンロードし
> python manage.py startapp myapp まで進むと
> importError: No module named mysite.settings
> と表示されます。
>
> こういった場合どのように対処すればよろしいでしょうか?
> 同じフォルダの中にはsettings.pyは存在するのですが。
>
> 誠に申し訳ございません。
> 回答どうかよろしくお願いいたします。
>
> --
> 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/9a31b441-6771-4078-844f-90da754bfd52%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/CADTRxJPC4sZrb_xD%2BumARGpNseukNKc%2Brc7Tw_Hx24iCjpbP8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Scaling Django

2016-02-06 Thread Sergiy Khohlov
Print database structure.
Check possibility of DB normalization.
100 GB  (my "record" is 452 GB  )is not so high but  this size requires
some attention. (Look like you Mysql used only one db file: try to set
table per file.  Check index size , and verify that indexes  are working
corectly)
Review  your project:
 try to avoid  Many to Many field
Is it possible switch from hardcode SQL to  stored function and procedure ?
 Look like  this issue in not connected to django only.


Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sat, Feb 6, 2016 at 7:09 PM, Dexter T.  wrote:

> Lots of great replies already.
> I also want to add a few (random) things ...
>
> - have you clearly defined and isolated what issue(s) are you facing?
> - you mentioned using DRF in a service, with a large JSON reponse taking
> seconds to finish, how did you troubleshoot/profile this? Seconds to
> process server-side? Seconds to download client-side? Where specifically?
> If you said you don't know, then find out!
> - your system will have so many legs, have you made an effort to
> instrument and measure and isolate which parts are slow and why?
> - you mentioned using the debug toolbar, have you proven that your
> database schema is optimal? Any queries in your slow queries log? Indexes
> used and ok and optimal? For your workload, can_read caching help? Db
> replicas be of help?
> - how are your server resources utilized? Are you sure you are not
> bottlenecked by thrashing disk-io? Overcomitted CPU? Low memory/swapping?
> File descriptor count?
> - have you checked if clients are not bottlenecked? An ajax call to
> download a  complex nested json object is both costly to serialize, CPU and
> bandwidth wise. Gzip can help here, if applicable.
> - for more context, can you share some numbers, like http and db level
> req/sec, row count for the most heavily used tables? How about server
> infrastructure specs?
>
> Note that these are basic questions and are basic problem-solving steps,
> im assuming your teams should be aware and be taking steps like these
> already.
>
> In one project of mine, we're doing a 100gb mysql db, some tables above
> 100mil recs and growing rapidly, properly indexed and optimized, it works
> ok on a lowly single vps instance with 8gb ram; workload is clearly oltp,
> we're throwing more sustained writes (100s/sec) than reads, all queries
> were scrutinized, almost all using the ORM, some handwritten SQL, other
> complex queries rewritten to be done at application level, joins are harder
> at this scale and therefore preferrably avoided (major architectural
> decision anticipated). But still we can easily throw hardware if needed.
>
> For us, scaling is an continuous commitment to measure and refactor.
>
> And one very important learning for me in my years of writing software:
> rewriting is very very very very costly.
>
> These new engineers/other colleagues coming in, are they familiar with the
> domain problem, the exisiting codebase, the scale at which you operate now
> and expected in the future? Are they experienced in doing similar scaling
> before? And even if you think you can throw your old work, and now that you
> guys think you know better, be very careful of The-Second-System-Effect.
>
> I hope you succeed.
>
>
> --
> 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/ddc6db79-af4c-4e78-a16f-84f2dc8b69ae%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/CADTRxJN1yiVH1oviDiJRKCL2dN5%2BKpTwxyU7SksrF%3DwV6sWPXA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Polymorphic class and geomodels?

2016-02-05 Thread Sergiy Khohlov
I’ve decided  to use  connection via key. and using via  key directly or
 via related objects.  Such us Car  -> Point  (multiline). Reason is simple
: django creates not perfect database structure  and I would like think
about performance as soon as possible.  My project contains Car and points
related to the car and of course route (POLYLINE).  I deceided to use
trivial PostGIS model for avoiding  bottleneck that use simple code in
view.  It is really easy to change view and hard to change models in case
of important data present. (Every 100km generates 2000 points which cause
and route length and motor service interval). In case of success Abstract
class (with good performance) let me know please.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Feb 5, 2016 at 7:25 PM, Luca Moiana <luca.moi...@gmail.com> wrote:

> Hi Serge,
>
> thank you for your reply.
>
> I'm working on an environmental monitoring app, where I want to store, and
> serve, monitoring value on different geometries, points, tracks or polygon.
> That's why I'm trying to use a polymorphic model in order to have one
> entity and multiple geometries.
>
> Cheers
>
> L
>
>
> On Friday, February 5, 2016 at 10:51:31 AM UTC+1, Sergiy Khohlov wrote:
>>
>>  I would like as simple question :  Are you planning  to have some
>> advantages using this abstract class ?
>>  I’m working on  similar product  (look like you are making energy
>> pipeline system based on postgis and gjango). My product is GTS system
>> which includes POINTS (datas are received via GTS devices mounted on
>> vehicles). Polylines (car route for selected time range),  etc.  Producing
>> abstract class can decrease DB productivity. Which one functional do you
>> need in case of abstract class for different types usage ?
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Fri, Feb 5, 2016 at 11:07 AM, Luca Moiana <luca@gmail.com> wrote:
>>
>>> Hi Collin,
>>>
>>> Sorry for the late reply, but I still don't get the google groups;
>>>
>>> Yes, I am tryng to crete a models where you can choose between the three
>>> geometry types.
>>>
>>> I'll go back to my app and test the code you suggested and post again
>>> the error.
>>>
>>> thanks
>>>
>>>
>>> On Wednesday, October 28, 2015 at 7:00:26 PM UTC+1, Collin Anderson
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Are you trying to combine multiple models into one, like this?
>>>>
>>>> class PolyModel(pdmpunto, pdmtransetto, pdmarea):
>>>> pass
>>>>
>>>> You could also try asking on the geodjango list:
>>>> http://groups.google.com/group/geodjango
>>>>
>>>> Collin
>>>>
>>>> On Monday, October 26, 2015 at 7:18:24 AM UTC-4, Luca Moiana wrote:
>>>>>
>>>>> Hi, working on my first django app, and run into a problem.
>>>>>
>>>>> I tend to create geodjango objects, and add all data from external
>>>>> tables with pk.
>>>>>
>>>>> Then I want to have different geometries 8points, lines, polygons)
>>>>> into a unique polymorphic class, can I do that?
>>>>>
>>>>> I have an error that I'll document later, and I'm trying to figure out
>>>>> what to do.
>>>>>
>>>>> Here is the model:
>>>>> import datetime
>>>>>
>>>>> from django.db import models
>>>>> from django.contrib.gis.db import models as geomodels
>>>>> from django.utils import timezone
>>>>> from django.forms import ModelForm
>>>>> from polymorphic import PolymorphicModel
>>>>>
>>>>> # Geometria linea da monitorare
>>>>> class geolinea(geomodels.Model):
>>>>> progetto = models.CharField(max_length=14, primary_key=True)
>>>>> geom = geomodels.MultiLineStringField()
>>>>> objects = geomodels.GeoManager()
>>>>> def __str__(self):
>>>>> return '%s' % (self.progetto)
>>>>> # Oggetto Progetto soggetto a PMA
>>>>> class linea(models.Model):
>>>>> progetto = models.ForeignKey(geolinea)
>>>>> nome = models.CharField(max_length=200)
>>>>> TENSIONE = (
>>>>> ('132', '132kV'),
>>>>> ('150', '150kV'),
>>>>>

Re: Polymorphic class and geomodels?

2016-02-05 Thread Sergiy Khohlov
 I would like as simple question :  Are you planning  to have some
advantages using this abstract class ?
 I’m working on  similar product  (look like you are making energy pipeline
system based on postgis and gjango). My product is GTS system which
includes POINTS (datas are received via GTS devices mounted on vehicles).
Polylines (car route for selected time range),  etc.  Producing abstract
class can decrease DB productivity. Which one functional do you need in
case of abstract class for different types usage ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Feb 5, 2016 at 11:07 AM, Luca Moiana  wrote:

> Hi Collin,
>
> Sorry for the late reply, but I still don't get the google groups;
>
> Yes, I am tryng to crete a models where you can choose between the three
> geometry types.
>
> I'll go back to my app and test the code you suggested and post again the
> error.
>
> thanks
>
>
> On Wednesday, October 28, 2015 at 7:00:26 PM UTC+1, Collin Anderson wrote:
>>
>> Hello,
>>
>> Are you trying to combine multiple models into one, like this?
>>
>> class PolyModel(pdmpunto, pdmtransetto, pdmarea):
>> pass
>>
>> You could also try asking on the geodjango list:
>> http://groups.google.com/group/geodjango
>>
>> Collin
>>
>> On Monday, October 26, 2015 at 7:18:24 AM UTC-4, Luca Moiana wrote:
>>>
>>> Hi, working on my first django app, and run into a problem.
>>>
>>> I tend to create geodjango objects, and add all data from external
>>> tables with pk.
>>>
>>> Then I want to have different geometries 8points, lines, polygons) into
>>> a unique polymorphic class, can I do that?
>>>
>>> I have an error that I'll document later, and I'm trying to figure out
>>> what to do.
>>>
>>> Here is the model:
>>> import datetime
>>>
>>> from django.db import models
>>> from django.contrib.gis.db import models as geomodels
>>> from django.utils import timezone
>>> from django.forms import ModelForm
>>> from polymorphic import PolymorphicModel
>>>
>>> # Geometria linea da monitorare
>>> class geolinea(geomodels.Model):
>>> progetto = models.CharField(max_length=14, primary_key=True)
>>> geom = geomodels.MultiLineStringField()
>>> objects = geomodels.GeoManager()
>>> def __str__(self):
>>> return '%s' % (self.progetto)
>>> # Oggetto Progetto soggetto a PMA
>>> class linea(models.Model):
>>> progetto = models.ForeignKey(geolinea)
>>> nome = models.CharField(max_length=200)
>>> TENSIONE = (
>>> ('132', '132kV'),
>>> ('150', '150kV'),
>>> ('220', '220kV'),
>>> ('380', '380kV'),
>>> )
>>> tensione = models.CharField(max_length=5,
>>> choices=TENSIONE)
>>> def __str__(self):
>>> return '%s' % (self.nome)
>>>
>>> # Geometria dei pdm
>>> class pdmpunto(geomodels.Model):
>>> linea = models.ForeignKey(linea)
>>> numero = models.CharField(max_length=3)
>>> geom = geomodels.PointField()
>>> objects = geomodels.GeoManager()
>>>
>>> class pdmtransetto(geomodels.Model):
>>> linea = models.ForeignKey(linea)
>>> numero = models.CharField(max_length=3)
>>> geom = geomodels.LineStringField()
>>> objects = geomodels.GeoManager()
>>>
>>> class pdmarea(geomodels.Model):
>>> linea = models.ForeignKey(linea)
>>> numero = models.CharField(max_length=3)
>>> geom = geomodels.PolygonField()
>>> objects = geomodels.GeoManager()
>>>
>>> class pdm(PolymorphicModel):
>>> numero = models.CharField(max_length=14, primary_key=True)
>>> class punto(pdm):
>>> rifpunto = models.ForeignKey(pdmpunto)
>>> class transetto(pdm):
>>> riftransetto = models.ForeignKey(pdmtransetto)
>>> class area(pdm):
>>> rifarea = models.ForeignKey(pdmarea)
>>>
>>>
>>>
>>> --
> 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/cd243d25-0aff-446d-b9c9-cb5682d9bdf3%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 

Re: How to know our Django version

2016-02-04 Thread Sergiy Khohlov
python
import django
print (django.version)

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Feb 4, 2016 at 6:15 PM,  wrote:

> Hello
>>
>
> because i want to know if its possible to have "featured news" in our news
> section.
>
> as i looked on a tutorial, its included in Django version xxx, but not in
> our, so i wanted to know what is our version to know what would include to
> make an update of our django version.
>
> excuse me foor my poor english.
>
> --
> 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/f0df2403-7f06-4073-b94c-ef8c9d364285%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/CADTRxJNBqbkDjyetqkunduQkQtOXyTgPBFQkbzeOgzzrDf_Mzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re:

2016-02-04 Thread Sergiy Khohlov
hard to help without settings.py


Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Feb 4, 2016 at 8:57 AM, Denis Bellavance <de...@peachd.com> wrote:

> Allright,
>
> Deploying with verbosity=0 solved my problem.
>
> Something is happening in that  self.log(  call at line 112 that make it
> crash on Heroku. Unsure what it is and unsure the issue is on Django side.
>
> At least this resolves my problem and there is some reference if someone
> else encounter this issue on Heroku too...
>
> Thanks
>
> On Wednesday, February 3, 2016 at 10:36:01 PM UTC-8, Denis Bellavance
> wrote:
>>
>> Hi,
>>
>> The "remote: Found another file with the destination path" is not
>> actually an error, I actually have thousands of those and it is normal.
>> It's simply suppose to be a warning that was added in version 1.9:
>>
>> https://github.com/django/django/commit/5304494585c58b0c9245ea9896a6d6122a8673a2
>> "Added warning to collectstatic when static files have clashing names"
>>
>> It should not make the code crash... but somehow maybe the logger become
>> unavailable and it is why I get exception "Resource temporarily
>> unavailable" ?
>>
>> I will try turning down verbosity (so shouldn't be logging this anymore),
>> and see if it help... (verbosity=0)
>>
>>
>>
>> On Wednesday, February 3, 2016 at 6:34:47 AM UTC-8, Sergiy Khohlov wrote:
>>>
>>>  Hello Denis,
>>>
>>>  This issue  is not related  to the  django-require.  Look like you have
>>> two  files (with  same name ) at the different paths. New  collect static
>>> is trying to colelct both files and can not decided  which one should be
>>> used.
>>> Could you please  send part of the section  STATICFILES_DIRS and
>>> INSTALLED_APP ?
>>>
>>> Many thanks,
>>>
>>> Serge
>>>
>>>
>>> +380 636150445
>>> skype: skhohlov
>>>
>>> On Wed, Feb 3, 2016 at 9:19 AM, Denis <de...@peachd.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm looking at upgrading my application from 1.6 to 1.9.2... An issue
>>>> I'm encountering now is that on Heroku, running collectstatic doesn't work
>>>> on 1.9.2. The odd  things is that if I try 1.8.7 instead, it work great...
>>>>
>>>>
>>>> Running:
>>>> remote: python manage.py collectstatic -i docs -i tests --noinput -v 3
>>>> remote: Copying '/app/accounts/static/...js'
>>>> remote: Copying '/app/accounts/static/js'
>>>> remote: Copying '/app/accounts/static/js'
>>>> ... [ Thousands of lines... ]
>>>> remote: Found another file with the destination path
>>>> 'app/controllers/...js'. It will be ignored since only the first
>>>> encountered file is collected. If this is not what you want, make sure
>>>> every static file has a unique path.
>>>> remote: Found another file with the destination path
>>>> 'app/controllers/js'. It will be ignored since only the first
>>>> encountered file is collected. If this is not what you want, make sure
>>>> every static file has a unique path.
>>>> remote: Traceback (most recent call last):
>>>> remote: output = self.handle(*args, **options)
>>>> remote:   File
>>>> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
>>>> line 176, in handle
>>>> remote: collected = self.collect()
>>>> remote:   File
>>>> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
>>>> line 114, in collect
>>>> remote: level=1,
>>>> remote:   File
>>>> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
>>>> line 201, in log
>>>> remote: self.stdout.write(msg)
>>>> remote:   File
>>>> "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py",
>>>> line 111, in write
>>>> remote: self._out.write(force_str(style_func(msg)))
>>>> remote: IOError: [Errno 11] Resource temporarily unavailable
>>>>
>>>>
>>>> I do have a lot of static file... Unsure that matter.
>>>>
>>>> An other things is that it doesn't seem to fail at the same point in
>>>

Re: Scaling Django

2016-02-03 Thread Sergiy Khohlov
Hello,
 Your first  words have a answer. Swift coding always produces performance
problem.  This is expected.  Looks like  few new engineers  use another one
technology  and would not like to use django.  This a reason of his
criticism. Mostly low performance is related to the DB  performance. I'm
preferring avoid using ManyToMany  ability by due to high res usage at the
DB level. Writing  correct models and DB function helps in  the most case.
I have no idea about proposed solution but I definitely sure that code
produces bottleneck not programming language.  RubyOnRails has a same
problem such a Django for example.. Have you got  good performance at
JAva+Tomkat+Apache ?  I'm ready to see this high performance  ASP.
Half year ago I've rewritten GTS  service from C# to python. As result CPU
usage dropped  from 45% to 7-9% and memory usage from 1.5Gb  to 300kb.
Wrong solution, mistakes at the building project requirement stage
produces  more problem that selecting programming language.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Feb 3, 2016 at 5:30 PM, Joshua Pokotilow 
wrote:

> At the startup where I work, we've written a lot of our server code in
> Django. So far, we've adopted a "build it fast" mentality, so we invested
> very little time in optimizing our code. A small amount of load testing has
> revealed our codebase / infrastructure as it stands today needs to run
> faster and support more users.
>
> We recently hired some new engineers who are extremely skeptical that we
> should optimize our existing code. Their main concerns are:
>
> - We need to move to a service-oriented infrastructure because Django is
> too monolithic (monolithic = technology lock-in & difficult to troubleshoot)
> - It's too easy to write slow queries using the Django ORM
> - It's hard to hire Django engineers
> - While Instagram and DISQUS use Django to service large numbers of
> people, they don't use it for any serious backend work
>
> After having worked with Django for the last 3 years, I'm a big believer
> in it, and I believe it would scale. To defend my position, I've pointed
> out to my colleagues that it's easy to identify bottlenecks with tools like
> the Django Debug Toolbar and Yet Another Django Profiler. With my
> colleagues present, I've isolated and fixed significant speed problems
> inside of a few hours. I don't believe the Django ORM is inherently bad,
> although I do think that coders who use it should Know What They're Doing.
> Finally, I've referenced blog entries that talk about how Instagram and
> Disqus use Django on the backend for backend-y tasks.
>
> Despite my best efforts, my colleagues are still pushing to have us
> rewrite large portions of our infrastructure as separate services before we
> try to fix them. For example, we have one slow REST endpoint that returns a
> boatload of user data, and so there's talk about using a new microservice
> for users in lieu of our existing Django models. Even if we are able to fix
> bottlenecks we encounter in a timely fashion, my colleagues fear that
> Django won't scale with the business.
>
> I'm writing this post to garner additional evidence that Django will
> scale. Anything compelling (and preferably not obvious) that would help
> shed some light on Django's ability to scale would be *greatly*
> appreciated, as it's very difficult for me to defend my position that
> Django is a viable long-term solution without solid evidence to back up my
> claims. It certainly doesn't help that I don't have any experience scaling
> Django myself!
>
> Thank you.
>
> --
> 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/83968c41-d415-4189-b33b-9f99b10b1c41%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/CADTRxJPCNO2r%3D2-Vog0DGiXjmQof%3DQgH_RNjgySX1ENOkwUOrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re:

2016-02-03 Thread Sergiy Khohlov
 Hello Denis,

 This issue  is not related  to the  django-require.  Look like you have
two  files (with  same name ) at the different paths. New  collect static
is trying to colelct both files and can not decided  which one should be
used.
Could you please  send part of the section  STATICFILES_DIRS and
INSTALLED_APP ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Wed, Feb 3, 2016 at 9:19 AM, Denis  wrote:

> Hi,
>
> I'm looking at upgrading my application from 1.6 to 1.9.2... An issue I'm
> encountering now is that on Heroku, running collectstatic doesn't work on
> 1.9.2. The odd  things is that if I try 1.8.7 instead, it work great...
>
>
> Running:
> remote: python manage.py collectstatic -i docs -i tests --noinput -v 3
> remote: Copying '/app/accounts/static/...js'
> remote: Copying '/app/accounts/static/js'
> remote: Copying '/app/accounts/static/js'
> ... [ Thousands of lines... ]
> remote: Found another file with the destination path
> 'app/controllers/...js'. It will be ignored since only the first
> encountered file is collected. If this is not what you want, make sure
> every static file has a unique path.
> remote: Found another file with the destination path
> 'app/controllers/js'. It will be ignored since only the first
> encountered file is collected. If this is not what you want, make sure
> every static file has a unique path.
> remote: Traceback (most recent call last):
> remote: output = self.handle(*args, **options)
> remote:   File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
> line 176, in handle
> remote: collected = self.collect()
> remote:   File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
> line 114, in collect
> remote: level=1,
> remote:   File
> "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
> line 201, in log
> remote: self.stdout.write(msg)
> remote:   File
> "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/base.py",
> line 111, in write
> remote: self._out.write(force_str(style_func(msg)))
> remote: IOError: [Errno 11] Resource temporarily unavailable
>
>
> I do have a lot of static file... Unsure that matter.
>
> An other things is that it doesn't seem to fail at the same point in the
> collectstatic command every time I run it. So look like it's failing on
> different file every time I run it...
>
>
> I did find this: https://github.com/etianen/django-require/issues/20
> But I actually don't use django-require... (It's not in my requirement.txt
> of what I install on Heroku)
>
>
> I also see it fail (sometime but much less often as the "Resource
> temporarily unavaible" error this way:
> remote: Found another file with the destination path 'accounts/..html'. It
> will be ignored since only the first encountered file is collected. If this
> is not what you want, make sure every static file has a unique path.
> remote: Found another file with the destination path 'accounts/...js'. It
> will be ignored since only the first encountered file is collected. If this
> is not what you want, make sure every static file has a unique path.
> remote: Traceback (most recent call last):
> remote:   File "manage.py", line 10, in 
> remote: execute_from_command_line(sys.argv)
> remote: utility.execute()
> remote: self.execute(*args, **cmd_options)
>
> Which is even less helpful in figuring out what's going on...
>
>
> So I'm looking for some though on what this error mean and how to debug it
> further. We never encountered that error when on 1.6. Testing on 1.8.7
> works fine but then if I only change the Django version (nothing else) to
> 1.9.2, I start getting that error...
>
>
> Thanks everyone!
>
> Denis Bellavance
> Peach
> Seattle
>
> --
> 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/CAOdjZ6K7j9Xv70%2BRYSBEdFom-VWRLMMy_e2CRZzfqmngA1ZBrw%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.

Re: Re: help with the django tutorial part 1

2016-02-02 Thread Sergiy Khohlov
 SHould be

 url(r'^$', views.index , name='index')


 you have missed  '

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Feb 2, 2016 at 3:58 PM, 林攀 <18610710...@163.com> wrote:

>  url(r'^/$, views.index, name='index'),
>
>
>
>
>
> --
> *林攀*
>
> At 2016-02-02 20:35:58,"Bipul Raj"  wrote:
>
>   >> url(r'^$, views.index, name='index'),
>
> Are you sure if you have closing single quote with *r'^$* ? I do not see
> it in error.
>
> On 2 February 2016 at 17:00, Russell Stanfield <
> russell.stanfi...@gmail.com> wrote:
>
>> Hi,
>>
>> at this page:
>>
>> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>>
>> I have got this far in the tutorial:
>>
>>
>> In the polls/urls.py file include the following code:
>> polls/urls.py
>>
>> from django.conf.urls import url
>> from . import views
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),]
>>
>> The next step is to point the root URLconf at the polls.urls module. In
>> mysite/urls.py, add an import for django.conf.urls.include and insert an
>> include()
>> 
>> in the urlpatterns list, so you have:
>> mysite/urls.py
>>
>> from django.conf.urls import include, urlfrom django.contrib import admin
>> urlpatterns = [
>> url(r'^polls/', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),
>>
>>
>> You have now wired an index view into the URLconf. Lets verify it’s
>> working, run the following command:
>>
>> $ python manage.py runserver
>>
>> When I try to start the server I get the following output:
>>
>>
>> root@russellberrypi:/home/mycode/mysite# python manage.py
>> 
>> runserver
>> Performing system checks...
>>
>> Unhandled exception in thread started by 
>> Traceback (most recent call last):
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/autoreload.py", line
>> 226, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/runserver.py",
>> line 116, in inner_run
>> self.check(display_num_errors=True)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 426, in check
>> include_deployment_checks=include_deployment_checks,
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/registry.py",
>> line 75, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
>> 10, in check_url_config
>> return check_resolver(resolver)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/checks/urls.py", line
>> 19, in check_resolver
>> for pattern in resolver.url_patterns:
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
>> 33, in __get__
>> res = instance.__dict__[self.name
>> ]
>> = self.func(instance)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
>> 417, in url_patterns
>> patterns = getattr(self.urlconf_module, "urlpatterns",
>> self.urlconf_module)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line
>> 33, in __get__
>> res = instance.__dict__[self.name
>> ]
>> = self.func(instance)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line
>> 410, in urlconf_module
>> return import_module(self.urlconf_name)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/mysite/urls.py", line 20, in 
>> url(r'^polls/', include('polls.urls')),
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/conf/urls/__init__.py", line
>> 52, in include
>> urlconf_module = import_module(urlconf_module)
>>   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in
>> import_module
>> __import__(name)
>>   File "/home/mycode/mysite/polls/urls.py", line 8
>> url(r'^$, views.index, name='index'),
>>  ^
>> SyntaxError: invalid syntax
>>
>>
>>
>> I think all the files  I have created/edited look good, but can put them
>> up here if required
>>
>>
>>
>> --
>> You received this message because you are 

Re: Access denied for MySQL user in Django

2016-01-17 Thread Sergiy Khohlov
Using password no. Have you set notempty password with creating table
permission?
15 січ. 2016 18:20 "Galil"  пише:

> Hi Fred,
>
> The user cdraccess is not the root user and it does not have the rights to
> access table 'user'. I deleted the guest user as root but nothing changes.
> The problem was not fixed.
>
> On Thursday, 14 January 2016 17:50:21 UTC, Fred Stluka wrote:
>>
>> Galil,
>>
>> I had a problem like this a couple years ago, and the solution
>> was to delete the anonymous MySQL guest user as:
>>
>> mysql> use mysql;
>> mysql> delete from user where host='localhost' and 'user='';
>> mysql> flush privileges;
>>
>> I'm not sure why Django 1.4 was trying to connect as the guest
>> user when it had a username and password that it was
>> supposed to be using, but for some reason it was.  Deleting
>> the guest user from MySQL fixed it for me, and is a good idea
>> for security reasons anyhow.
>>
>> --Fred
>> --
>> Fred Stluka -- mailt...@bristle.com -- http://bristle.com/~fred/
>> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
>> Open Source: Without walls and fences, we need no Windows or Gates.
>> --
>> On 1/14/16 7:11 AM, Galil wrote:
>>
>> I have created a Django app and which uses MySQL. The settings.py file in
>> the database sections is:
>>
>> DATABASES = {
>> 'cdraccess': {
>> 'ENGINE': 'django.db.backends.mysql',
>> 'NAME': os.environ.get('CDR_DB_NAME', 'portal2'),
>> 'USER': os.environ.get('CDR_DB_USER', 'cdraccess'),
>> 'HOST': os.environ.get('CDR_DB_HOST', '127.0.0.1'),
>> 'CONN_MAX_AGE': 0,
>> 'PASSWORD': os.environ.get('CDR_DB_PASSWORD', ''),
>> },
>> 'default': {
>> 'ENGINE': 'django.db.backends.sqlite3',
>> 'NAME': 'db.sqlite3',
>> }}
>>
>> I run the app like:
>>
>> CDR_DB_PASSWORD='password' CDR_DB_HOST='host_name' ./manage.py runserver
>>
>> but I get the following error:
>>
>> Access denied for user 'cdraccess'@'host_ip_here' (using password: NO)")
>>
>> I tried to access the database from terminal, like:
>>
>>$ mysql --host=[host_name] --user=cdraccess -p portal2
>>
>> and worked fine.
>>
>> What is going wrong in here? And what does this "(using password: NO)"
>> mean?
>>
>> --
>> 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...@googlegroups.com.
>> To post to this group, send email to django...@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/e1c26a0d-a509-46eb-b496-f7f09161e606%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/fa3b7acf-e015-4e0c-abbe-49da80b752a9%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/CADTRxJNBV29q6XBTjSK0haKpVNhNe%3Dj5BtUxCmgL%2BwtrAOvEsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Performance difference between django query and stored procedure (MySQL)?

2016-01-08 Thread Sergiy Khohlov
better way is using storing procedure.
You  also can compare trivial SQL command and stored procedure
performance.  Result is a same  such as django and stored procedure (or
near to the same)

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Jan 8, 2016 at 4:30 PM, Maor Levy  wrote:

> I was wondering what the performance hit on using a django query over a
> stored procedure would be? I realize that django doesn't support stored
> procedures so that's why I was hoping to avoid using stored procedures.
> However, then the query won't be compiled in the db and the calculations
> would have to be done in python ... etc. What's the difference in
> performance between a django query and a store procedure called from django?
>
> --
> 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/58776ba6-c4de-4110-92f2-6f915e4a7e38%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/CADTRxJMGfHAu6K5qBzCxWV6cphhbqG3AQEY1JMSMMpu8J6yVFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModelForm.is_valid() doesn't work the first time but does the second

2016-01-02 Thread Sergiy Khohlov
Sorry I missed. You have valid unknown at the start. Why are you not used
django user model and author? Study purpose ,?
3 січ. 2016 05:53 "Michael Molloy" <ukalu...@gmail.com> пише:

> I'm not sure what could be wrong with the database settings. If I just
> create an instance of the model and save it, it saves to the database:
>
>
> <https://lh3.googleusercontent.com/-jyOjeZShpXU/VoibBXC7gPI/AFU/WeJ9TBxQemQ/s1600/Screen%2BShot%2B2016-01-02%2Bat%2B9.52.18%2BPM.png>
>
> >>> u.email = 'j...@test.com'
>
> >>> u.save()
>
>
>
> <https://lh3.googleusercontent.com/-jyOjeZShpXU/VoibBXC7gPI/AFU/WeJ9TBxQemQ/s1600/Screen%2BShot%2B2016-01-02%2Bat%2B9.52.18%2BPM.png>
>
> --M
>
> On Saturday, January 2, 2016 at 9:48:39 PM UTC-6, Sergiy Khohlov wrote:
>>
>> Is_valid is working. You have
>> problem with save. Check database setting.
>>
>> 3 січ. 2016 04:18 "Michael Molloy" <ukal...@gmail.com> пише:
>> >ve
>> > This is running in Openshift with Python 3.3 and Django 1.8.4
>> >
>> > Here's my model:
>> >
>> > class Users(models.Model):
>> > first_nm = models.CharField('First Name', max_length=100)
>> > last_nm = models.CharField('Last Name', max_length=100)
>> > email = models.CharField('Email Address', max_length=200,
>> unique=True)
>> >
>> >
>> > Here's my form:
>> >
>> > class UsersForm(forms.ModelForm):
>> > class Meta:
>> > model = Users
>> > fields = ['first_nm', 'last_nm', 'email']
>> >
>> >
>> >
>> > When I run the shell inside Openshift, this is what happens:
>> >
>> > Python 3.3.2 (default, Mar 20 2014, 20:25:51)
>> >
>> > [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
>> >
>> > Type "help", "copyright", "credits" or "license" for more information.
>> >
>> > (InteractiveConsole)
>> >
>> >
>> > >>> from django.conf import settings
>> >
>> > >>> from package.forms import UsersForm
>> >
>> > >>> from package.models import Users
>> >
>> >
>> > >>> u = Users()
>> >
>> > >>> u.first_nm = 'First'
>> >
>> > >>> u.last_nm = 'Last'
>> >
>> > >>> u.email = 'em...@email.com'
>> >
>> > >>> uf = UsersForm(u)
>> >
>> > >>> uf.is_bound
>> >
>> > True
>> >
>> > >>> uf.is_valid
>> >
>> > > valid=Unknown, fields=(first_nm;last_nm;email)>>
>> >
>> >
>> > >>> uf.save()
>> >
>> >
>> > Traceback (most recent call last):
>> >
>> >   File "", line 1, in 
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/models.py",
>> line 463, in save
>> >
>> > construct=False)
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/models.py",
>> line 84, in save_instance
>> >
>> > if form.errors:
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
>> line 176, in errors
>> >
>> > self.full_clean()
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
>> line 392, in full_clean
>> >
>> > self._clean_fields()
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
>> line 401, in _clean_fields
>> >
>> > value = field.widget.value_from_datadict(self.data, self.files,
>> self.add_prefix(name))
>> >
>> >   File
>> "/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/widgets.py",
>> line 223, in value_from_datadict
>> >
>> > return data.get(name, None)
>> >
>> > AttributeError: 'Users' ob

Re: ModelForm.is_valid() doesn't work the first time but does the second

2016-01-02 Thread Sergiy Khohlov
Is_valid is working. You have
problem with save. Check database setting.

3 січ. 2016 04:18 "Michael Molloy"  пише:
>ve
> This is running in Openshift with Python 3.3 and Django 1.8.4
>
> Here's my model:
>
> class Users(models.Model):
> first_nm = models.CharField('First Name', max_length=100)
> last_nm = models.CharField('Last Name', max_length=100)
> email = models.CharField('Email Address', max_length=200, unique=True)
>
>
> Here's my form:
>
> class UsersForm(forms.ModelForm):
> class Meta:
> model = Users
> fields = ['first_nm', 'last_nm', 'email']
>
>
>
> When I run the shell inside Openshift, this is what happens:
>
> Python 3.3.2 (default, Mar 20 2014, 20:25:51)
>
> [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> (InteractiveConsole)
>
>
> >>> from django.conf import settings
>
> >>> from package.forms import UsersForm
>
> >>> from package.models import Users
>
>
> >>> u = Users()
>
> >>> u.first_nm = 'First'
>
> >>> u.last_nm = 'Last'
>
> >>> u.email = 'em...@email.com'
>
> >>> uf = UsersForm(u)
>
> >>> uf.is_bound
>
> True
>
> >>> uf.is_valid
>
> >
>
>
> >>> uf.save()
>
>
> Traceback (most recent call last):
>
>   File "", line 1, in 
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/models.py",
line 463, in save
>
> construct=False)
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/models.py",
line 84, in save_instance
>
> if form.errors:
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
line 176, in errors
>
> self.full_clean()
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
line 392, in full_clean
>
> self._clean_fields()
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/forms.py",
line 401, in _clean_fields
>
> value = field.widget.value_from_datadict(self.data, self.files,
self.add_prefix(name))
>
>   File
"/var/lib/openshift/5678c24389f5cff0330001cd/python/virtenv/venv/lib/python3.3/site-packages/Django-1.8.4-py3.3.egg/django/forms/widgets.py",
line 223, in value_from_datadict
>
> return data.get(name, None)
>
> AttributeError: 'Users' object has no attribute 'get'
>
>
> >>> uf.save()
>
> 
>
>
> First, why does uf.is_valid() return
>
>
> >
>
>
> the first time I call it, but on subsequent calls, uf.is_valid() returns
True?
>
>
> Second, why does uf.save() return that stacktrace the first time I call
it, but the second time I call it, the object saves?
>
>
> Third, even though the Users object saves, the only value in the database
for that row is the primary key. Neither the names nor the email field is
saved.
>
>
>
> I'm working through the Django Unchained book, and I'm also looking at
the Django tutorial on djangoproject.com, and it looks to me like I'm doing
everything that I'm supposed to, but obviously I'm missing something.
>
>
> --Michael
>
>
>
> --
> 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/dd08dc98-e3af-49c8-b549-c5dc4e72d3d6%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/CADTRxJN_SOa%2BDnxJjQbXZjbS3fq%3D8w4xBfQ5CZ9RAdTDVsO9-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: wsgi.py apache segmentation fault

2015-12-31 Thread Sergiy Khohlov
Is code working right via manage runserver?
30 груд. 2015 13:59 "Baris Adrian"  пише:

> hi Eugenio,
>
> Did you get a solution to this problem.
>
> If so what? because i am stuck and i could appreciate the help.
>
> Kindest REgards
>
> On Thursday, October 8, 2015 at 5:45:40 PM UTC+3, Eugenio Trumpy wrote:
>>
>> Hello everybody,
>>
>> I'm very not so expert on django, I'm at the first experience.
>> I'm using django as backhand of geonode application.
>>
>> Geonode works quite fine, however during a save map request from client
>> side I got this apache2 segmentation fault:
>>
>> [Thu Oct 08 15:30:38.037330 2015] [core:error] [pid 10101] [client
>> X.X.X.X:50787] End of script output before headers: wsgi.py, referer:
>> http://my_server_name/maps/new
>> [Thu Oct 08 15:30:38.292052 2015] [core:notice] [pid 2697] AH00052: child
>> pid 10004 exit signal Segmentation fault (11)
>>
>> I discovered this page on similar issue:
>>
>> https://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions
>>
>> but I checked and I have not the mod_python installed.
>>
>> Can somebody give me hints on how to solve this problem?
>>
>> Best
>>
>> Eugenio
>>
> --
> 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/e6042667-df1e-47c2-b8dd-6ce5046ae672%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/CADTRxJNC--8VcK0QonQm6Ms%3DsHTEEb8V3-vARhEKBvBxznBzPA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.9 - application does not

2015-12-27 Thread Sergiy Khohlov
Django toolbar does not work with 1.9 please comment it in and restart
server
24 груд. 2015 19:36 "Shekar Tippur"  пише:

> Just for testing, I downgraded django to 1.8.4
>
> # pip-3.4 install Django==1.8.4
>
> You are using pip version 6.1.1, however version 7.1.2 is available.
>
> You should consider upgrading via the 'pip install --upgrade pip' command.
>
> Collecting Django==1.8.4
>
>   Downloading Django-1.8.4-py2.py3-none-any.whl (6.2MB)
>
> 100% || 6.2MB 89kB/s
>
> Installing collected packages: Django
>
>   Found existing installation: Django 1.9
>
> Uninstalling Django-1.9:
>
>   Successfully uninstalled Django-1.9
>
> Successfully installed Django-1.8.4
>
>
> Now I get ImportError: No module named 'provider'.
>
>
> - Shekar
>
> --
> 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/c6e8eebf-a65e-4161-be30-215dd926963c%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/CADTRxJOnNh41Vtqzr07VK%2BPt%3D_SLxOUTe%3DU504gtH6tC8_zzHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.9 - application does not

2015-12-24 Thread Sergiy Khohlov
I've had a similar problem. And use next way to solve:

1)  Create new  project  at the new directory and  verify  that  Django 1.9
is OK
2) Check  (compare ) setting  related to the TEMPLATE  in  setting.py file
3) Disable installed add modules

At this  step I detected that django-debug-toolbar and  django json
produces  this issue.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Dec 24, 2015 at 3:27 PM, AJ Abrahamsen 
wrote:

> This person had a similar problem.  Hopefully this can give you some clue
> to help fix your issue:
>
>
> http://stackoverflow.com/questions/26276397/django-1-7-upgrade-error-appregistrynotready-apps-arent-loaded-yet
>
> --
> 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/7d13ff6a-d684-4a7f-950a-da273353b68c%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/CADTRxJM3Mt3%3DofwfCxNNADhg%2BwP0UqvGwcV5pQOGQ2edyJ2w-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I might do it wrong -- How to get and process an object from FormView ?

2015-12-11 Thread Sergiy Khohlov
Form.save returns object. You don't need tricking with post directly.
11 груд. 2015 22:30 "Dino"  пише:

> The form submission and processing as I've done it works,
> but I'm not sure its the right way.
>
> The part I'm concerned about is detailed in these 3 steps:
> - I save the form with the data submitted -- form.save()
> - then I check request.POST for the name of a (unique) field submitted
> - then I query the database for the object with the field specified in
> request.POST,  to process it further.
>
> Can't I access the object easier ?  ( either before or after saving the
> form)
>
> class FormViewCustom(FormView):
> form_class = SomeForm
> success_url = reverse_lazy("index")
> template_name = "index.html"
>
> def form_valid(self, form):
> form.save(commit=True)
> ...
> request_field = self.request.POST['fieldx']
> retrieve_model = MyModel.objects.filter(fieldx =
> request_field).get()
>
> #and now process the object before returning
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/6913290d-2be5-467e-a307-b03a111c9b2d%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJO%3Dphd1mmn_hy9fdgD9a9NreX1THdYNx5AnuFRrxcgN6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: But I can not figure out how to write the code to add a page. Thank you so much.

2015-12-06 Thread Sergiy Khohlov
Nature language  of this  maillist is English.  Please keep this in mind
Take a look at the example at
https://docs.djangoproject.com/en/1.8/topics/db/queries/
 your task is subpart of the task in  documentations.

 General procedure is next :
 1) set user authorization
1a) This is not important but can be usefull : Add  to the user profile
last edited book
2)  User select  book  or use  default choice
3)  User  create a page  which is used ID (slug) of the book in constructor

 Also you url.py should looks like :

urlpatterns = [
url(r'^(?P[-\w]+)/$', PageCreateView.as_view()),]

 Where P[-\w+] is a slug field of the edited book
 or P\d+  for Key usage


Many thanks,

Serge


+380 636150445
skype: skhohlov

2015-12-06 14:39 GMT+02:00 Валерий Бовсуновский <id290...@gmail.com>:

> В просто варианте получается так как, я понимаю. Модель Book и связанная с
> ней модель Pages, связанная многие к одному.
>
> class Book(models.Model):
> book = models.CharField(max_length=200)
>
> def __unicode__(self):
> return self.book
>
> class Pages(models.Model):
> connect = models.ForeignKey(Book)
> pages = models.TextField(blank=True, verbose_name='Страница')
>
>
>
> Не сходится у меня или чего то упускаю. У меня 300 пользователей.
> Каждый допустим создаст книгу.
> Тогда при выбое страницы, придётся выбирать из списка с 300 книг.
>
> Как сделать так, что бы когда пользователь при создании книги, страницы,
> которые он будет добавлять по умолчнаю уже выбирали его новую книгу.
> Я так понимаю нужно это как то прописать. Как забронировать это?
>
> Общая идея такая. Я хочу избежать личных аккаунтов пользователей.
> Что бы н было блуждания по аккаунтам а всё находилось в одном месте.
>
> Сейчас начала описывать Rest Framework дам начало и основные возможности.
> Но потом хочу дать возможность, что бы когда люди научаться, то будут
> добавлять свой опыт.
>
> Для этого.
>
> а)
> 1. Создам три рубрики и свяжу их с книгами. (здесь это модели пока нет)
> 1. Начало работы.
> 2. Рецепты
> 3. Лучшие практики.
> Здесь мне всё понятно. Добавлю ещё одну связь и человек будет выбирать из
> трёх рубрик, куда добавить свою книгу. - это мне понятно. (книги будут
> выводмится по категориям)
>
>
> б) Пользователь может иметь много книг и их можно отдельно вывести. Здест
> тоже нет проблем (создам отношение к User один к одному) - это тоже понятно.
>
> в)
> Остается, только не понятно то что описал выше. Что бы при создании книги,
> страницы присоединялись именно к вновь созданной книге, без выбора из
> списка из всех книг.
>
>
> воскресенье, 6 декабря 2015 г., 1:33:32 UTC+3 пользователь Sergiy Khohlov
> написал:
>>
>> Two models book and page. Page has key field to book . page is attached
>> to the book page as related object.
>> 5 груд. 2015 17:42 "Валерий Бовсуновский" <id29...@gmail.com> пише:
>>
>>> But I can not figure out how to write the code to add a page.
>>>
>>> Guys, please natolknite the idea. If possible, reset the reference to an
>>> example or help section.
>>> I can not understand. I want to do a book on the website:
>>> What would each user can create a book. (unlimited number of pages)
>>> But I can not figure out how to write the code to add a page.
>>> Thank you so much.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/f3d8d77b-4e91-4aec-819b-844e79258a14%40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f3d8d77b-4e91-4aec-819b-844e79258a14%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ae74e0ba-a077-4246-a5ad-6b2dce3e8294%40googlegroups.com
> <https://grou

Re: But I can not figure out how to write the code to add a page. Thank you so much.

2015-12-05 Thread Sergiy Khohlov
Two models book and page. Page has key field to book . page is attached to
the book page as related object.
5 груд. 2015 17:42 "Валерий Бовсуновский"  пише:

> But I can not figure out how to write the code to add a page.
>
> Guys, please natolknite the idea. If possible, reset the reference to an
> example or help section.
> I can not understand. I want to do a book on the website:
> What would each user can create a book. (unlimited number of pages)
> But I can not figure out how to write the code to add a page.
> Thank you so much.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f3d8d77b-4e91-4aec-819b-844e79258a14%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNZriDVWpmO7ow4q0BWoOxfGGcvEfbr2qtJcwVvB2ZAbQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Encrypted web mail

2015-08-16 Thread Sergiy Khohlov
Anyway this not solve Uri problem. Man in black ask about access to the
user private data. Problem with auth by hash? It is not a problem. Reset
password generates new hash.
Let's imagine:
Bad guy hack into system and has all data. passwords hash other tricks
hosting at the server side is not a problem. This guy has time to sort out
all parts. One good way is use public and private keys private is stored at
user PC only. Retrieving crypted data to user PC and uncrypt at client side
is a way to solve this problem.
If some market is for this task it is possible to start, but not for free.
Software part requires 6-8k$. But you should check some rules with lawyer.
16 серп. 2015 16:16 "Uri Even-Chen"  пише:

>
> On Sun, Aug 16, 2015 at 11:18 AM, Avraham Serour 
> wrote:
>
>> no, passwords shouldn't be encrypted, you should store hashes, just use
>> the django default auth app
>>
>> Yes, I meant storing the hash in the database and not the password.
>
> Uri.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMQ2MsEn4ZeUjNVoXOX0AEe67_q_SLH-bz57_nrPS%3DwgFhz2Pg%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMjTNkPv8NRCLV6uqtvz7RX2gV2L190UzP6tNUX2RNMew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Encrypted web mail

2015-08-15 Thread Sergiy Khohlov
Looks like it is not hard to change postfix maildrop agent to crypt mail
passing to user dir. But some work should be done at mua side.
Anyway it is not a question of django
15 серп. 2015 15:49 "Uri Even-Chen"  пише:

> Thanks Pedro, actually I understand cryptography and I agree with you.
> Sonebody replied to me off-list and wrote me about ProtonMail
> , actually they are doing exactly what I wanted
> (I think), so maybe I will try to cooperate with them and/or use their open
> source source code. Anyway thanks for the feedback!
>
> Uri.
>
>
> *Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
> Email: u...@speedy.net
> Website: http://www.speedysoftware.com/uri/en/
> 
> 
>   
> > Speedypedia in Hebrew and English
> 
>
> On Sat, Aug 15, 2015 at 3:32 PM, Pedro  wrote:
>
>> Hello Uri,
>>
>> what you want is completely possible, but demands you to understand some
>> concepts of cryptography. To make your server completely safe against court
>> orders or anyone that have access to it, including yourself, you need to
>> encrypt and decrypt the emails at client side. For this you may use some
>> public-key cryptosystem and store all user's public keys at your server
>> (they are not secret). Probably the best option for you is to use PGP. If
>> the clients run in Javascript you can use OpenPGP.js for this. It is very
>> easy to use and you won't need to know anything about how to implement a
>> secure cipher.
>>
>>
>>
>> --
>> Pedro Alves
>>
>> *Mestrando em Ciência da Computação*
>> *Universidade Estadual de Campinas*
>>
>> 2015-08-15 6:47 GMT-03:00 Uri Even-Chen :
>>
>>> To Python, Django and Speedy Mail Software developers,
>>>
>>> Is it possible to make Speedy Mail encrypted? I want mail to be
>>> encrypted on the server, and only the user will be able to read his/her
>>> mail. The user's password will be encrypted on the server and nobody will
>>> be able to read the user's mail except the user himself. Is it possible?
>>> When  I had Speedy Mail from 2000 to 2005 I received a court order by a
>>> court in Tel Aviv once from two policemen to give a specific user's
>>> password to the Israeli police, and the password and mail were not
>>> encrypted then. And I was not allowed to tell anyone about this court
>>> order, except my lawyer. But I refused to give the user's password to the
>>> police. So if I receive a court order again, I don't want to be able to
>>> give the user's password or mail to anyone, and I don't want it to be on
>>> the servers unless it's encrypted. That's why I want it to be encrypted. If
>>> I receive a court order again I want to be able to tell the police that the
>>> mail and password are encrypted, and only the user knows the password and
>>> is able to read his mail. Is it possible?
>>>
>>> I believe a user's mail is something personal, like his thoughts. I
>>> don't want the police to read my mail and it's similar to reading my
>>> thoughts.
>>>
>>> Thanks,
>>> Uri.
>>>
>>> *Uri Even-Chen*   [image: photo] Phone: +972-54-3995700
>>> Email: u...@speedy.net
>>> Website: http://www.speedysoftware.com/uri/en/
>>> 
>>> 
>>> 
>>> 
>>> > Speedypedia in Hebrew and English
>>> 
>>>
>>> --
>>> 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 http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAMQ2MsHDNLRuth59FRAtXwMXY14LyMUibxHCFxZswdD7Jw4oyg%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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> 

Re: Newbie

2015-08-02 Thread Sergiy Khohlov
Welcome aboard
2 серп. 2015 16:38 "Matthew Yankey"  пише:

> Hi, matthew here.
>
> I just started reading about django. hope to learn from this group as well.
>
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/04d882f2-3b5b-4275-8f1a-4eacd375a435%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJPNXEdXqnN_KJzMdZ61BUxUq1pQ4FNr6hhibxiQ2%2BGVRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to debug? -- DoesNotExist at /admin/login/

2015-07-14 Thread Sergiy Khohlov
Looks like you have missed char. Admi/login is requested not admin. I hope
it is typo
14 лип. 2015 00:13 "elim"  пише:

> I got error when I did
> $ python manage.py runserver
> Performing system checks...
>
> System check identified no issues (0 silenced).
> July 13, 2015 - 20:42:02
> Django version 1.8.3, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CONTROL-C.
> [13/Jul/2015 20:42:10]"GET /admin/ HTTP/1.1" 302 0
> [13/Jul/2015 20:42:10]"GET /admin/login/?next=/admin/ HTTP/1.1" 500 152252
> [13/Jul/2015 20:42:11]"GET /favicon.ico HTTP/1.1" 404 1936
>
> submit the url  http://localhost:8000/admin/  in browser I got error
> below:
>
> DoesNotExist at /admi/login/
> Site matching query does not exist.
> Request Method: GET
> Request URL: http://localhost:8000/admin/login/?next=/admin/
> Django Version: 1.8.3
> Exception Type: DoesNotExist
> Exception Value:
> Site matching query does not exist.
> Exception Location: 
> /usr/local/lib/python2.7/dist-packages/Django-1.8.3-py2.7.egg/django/db/models/query.py
> in get, line 334
> Python Executable: /usr/bin/python
> Python Version: 2.7.6
> Python Path:
> ['/home/elim/Projects/python/mydjango',
>  '/usr/local/lib/python2.7/dist-packages/Django-1.8.3-py2.7.egg',
>  '/usr/lib/python2.7',
>  '/usr/lib/python2.7/plat-x86_64-linux-gnu',
>  '/usr/lib/python2.7/lib-tk',
>  '/usr/lib/python2.7/lib-old',
>  '/usr/lib/python2.7/lib-dynload',
>  '/usr/local/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages',
>  '/usr/lib/python2.7/dist-packages/PILcompat',
>  '/usr/lib/python2.7/dist-packages/gst-0.10',
>  '/usr/lib/python2.7/dist-packages/gtk-2.0',
>  '/usr/lib/python2.7/dist-packages/ubuntu-sso-client']
> Server time: Mon, 13 Jul 2015 20:42:10 +
>
> I'd like to know how to debug this. What's "Site matching query does not
> exist." mean?
> How to fix this?
>
> Thanks a lot.
>
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/772e41c0-4ca6-44da-be85-358d78e8b884%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOej5WWkPbtk9Qnu2bEf8zqhc75DNFqSNf5wPaL_S9%3Dmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 想用中文说清楚:我在远程工作机服务器上建立了django框架,想启动web server ,启动成功,但是无法打开127.0.0.1:8000 ,中间端口转接该怎么做

2015-06-11 Thread Sergiy Khohlov
 127.0.0.1  is always your local PC.
 you should use another one interface for accessing from remote host.
 if  your local PC has IP 192.168.0.10
  right syntax is django-admin.py runserver 192.168.0.10:8000

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Jun 11, 2015 at 5:26 PM, Neto  wrote:

> 通过远程计算机,您无法打开地址?如果是这样,你应该用你的电脑的IP要访问。
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/029d94b6-7967-4921-ba3e-16c8d3fe3a01%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJM_jDHYqbRJ_j-qsEODfDpGpdEsHrUYRjSsVY1UMJsxsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to change type of field in model, when database is already populated ?

2015-05-16 Thread Sergiy Khohlov
Dump your data in the SQL file. Of course , separate structure and data.
Update structure. Verify ability to switch into digit. If you have using
Digit as string in dump you can update data manually or by see or ask. If
previous data contains char then no chances.
16 трав. 2015 16:26 "mangu rajpurohit"  пише:

> Hi,
>
> I am new to Django. I am working on an application ,where the types of
> table fields in database are not known before hand. So, say for eg. In
> student table, I am assigning CharField to marks field, ie
>
> class Student(models.Model):
>  marks = model.CharField(max_length = 3)
>
> and after Student table in database is populated, can I change the type of
> marks to IntegerField as shown below :-
>
> class Student(models.Model):
>  marks = model.IntegerField()
>
>
> Is it possible ? If not feasible, then what are the alternatives
> ways/design strategies or what should be done in such cases ? If feasible,
> then what are its side-effects ?
>
> Sorry for my poor english.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/aed20dfc-8777-4998-b1ff-224f5012ff20%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOSad4TT6fFgLyTx%2BLVoMX2kQLq-77N%2BaQkEZA3UptB-w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SETTINGS Error

2015-05-11 Thread Sergiy Khohlov
You have not configured database in your setup. Your error is popped up in
this case.
11 трав. 2015 18:57, користувач "SUBHABRATA BANERJEE" <
subhabrata.bane...@gmail.com> написав:

> Dear Group,
>
> I am pretty new to Django. I was using
> https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to learn aspects
> of Django.
> As I gave the command in IDLE,
> from django.db import models
>
> I am getting the error as,
> Traceback (most recent call last):
>   File "", line 1, in 
> from django.db import connection
>   File "C:\Python27\lib\site-packages\django\db\__init__.py", line 11, in
> 
> if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 53,
> in __getattr__
> self._setup(name)
>   File "C:\Python27\lib\site-packages\django\conf\__init__.py", line 46,
> in _setup
> % (desc, ENVIRONMENT_VARIABLE))
> ImproperlyConfigured: Requested setting DATABASES, but settings are not
> configured. You must either define the environment variable
> DJANGO_SETTINGS_MODULE or call settings.configure() before accessing
> settings.
>
> I tried to do some research on the problem in internet and did not find
> anything much of use.
>
> I am using Windows 7 Professional, Python 2.7.9 and IDLE as GUI. I am
> using
> >>> django.get_version()
> '1.5.4'
> as my django version, and learnt more or less how to use command prompt as
> given in this tutorial.
>
> If anyone may kindly suggest how to solve the problem.
>
> Regards,
> Subhabrata Banerjee.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4a3531e6-de46-4106-bfaa-1787e9696d86%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJPmT%2BMqUs9qJ14uyqiiZHa_TK_2kY%3D%3DG%2BTiScTVCfTaSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: .get() has unexpected behaviour on a queryset after previously applying .order_by().distinct()

2015-04-18 Thread Sergiy Khohlov
Both methods use SQL request s.  Try to test using SQL directly. Database
has no idea about a returning order. Good result for filter is "nice shot".
Adding and deleting objects you broke filter method.
Use always order_by for this kind of purpose.
15 квіт. 2015 19:46, користувач "Nick Smith"  написав:

> >>> from django.db.models import models
> >>> class MarketPrice(models.Model):
> market = models.CharField(max_length=30)
> crop = models.CharField(max_length=30)
> price = models.PositiveSmallIntegerField()
> date = models.DateField()
>
> def __str__(self):
> return "{}, {}, {}, {}".format(
> self.market,
> self.crop,
> self,price,
> self.date
> )
>
> >>> FIXTURES = [
> ('London', 'carrots', 15, datetime.date(2015, 1, 1)),
> ('London', 'carrots', 20, datetime.date(2015, 1, 2)),
>
> ('London', 'potatoes', 12, datetime.date(2015, 1, 1)),
> ('London', 'potatoes', 14, datetime.date(2015, 1, 2)),
>
> ('Manchester', 'carrots', 18, datetime.date(2015, 1, 1)),
> ('Manchester', 'carrots', 21, datetime.date(2015, 1, 2)),
>
> ('Manchester', 'potatoes', 10, datetime.date(2015, 1, 1)),
> ('Manchester', 'potatoes', 12, datetime.date(2015, 1, 2)),
> ]
>
> >>> for market, crop, price, date in FIXTURES:
> MarketPrice.objects.create(market=market,
>crop=crop,
>price=price,
>date=date)
>
> We want to get only the latest prices for every possible combination of
> markets and crops...
>
> >>> prices = (MarketPrice.objects
>   .order_by('market', 'commodity', '-date')
>   .distinct('market', 'commodity'))
> [,  potatoes, 14, 2015-01-02>,  02>, ]
>
> .filter() works as expected
>
> >>> prices.filter(market='Manchester', crop='carrots')
> []
>
> but .get is totally unexpected
>
> >>> prices.get(market='Manchester', crop='carrots')
> 
>
> not only does it return the 'wrong' entry, but one which didn't even seem
> to be in prices (because it's a distinct queryset)
>
> It looks and feels even weirder if you apply the filtering first:
>
> >>> prices = (MarketPrice.objects
>   .filter(market='Manchester', crop='carrots')
>   .order_by('market', 'commodity', '-date')
>   .distinct('market', 'commodity'))
> >>> prices
> []
>
> >>> prices.get(market='Manchester', crop='carrots')
> 
>
> There's a note seemingly related to this at
> https://docs.djangoproject.com/en/1.7/ref/models/querysets/#django.db.models.query.QuerySet.distinct,
> but I'm not clear how it directly describes what I'm seeing here.
>
> The line which seems to be causing this is from
> https://github.com/django/django/commit/e4757ec7afd54861e0c34d9b0f5edbbac4e2b860,
> which strips the ordering I've previously applied
>
> >>> prices
> []
>
> >>> prices.order_by()
> []
>
> Is this intended behaviour?
>
> PS the above code examples are untested, manually-typed pseudocode for the
> sake of keeping the example simple.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/50f5ba71-bb20-42f4-96bd-3f1ce17338bb%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMpyf2cg2pTMb%3DXiZfLM1dtWT-s3t5__VR6gi4RbjLkJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django beggining problems

2015-03-17 Thread Sergiy Khohlov
Answer is simple. Notepad opens python files.. Try to start python.exe
djangoadmin
 13 бер. 2015 18:55, користувач  написав:

> i am following the tutorial right now...
> I use windows 7
>  python 2.7.6
> and  django 1.7.6
>
> when i run "django-admin startproject mysite"
>
> it opens a file on notepad++ called django-admin with some code in it
>
>
> #!c:\users\radcliff\appdata\local\enthought\canopy32\user\scripts\python.exe
> from django.core import management
>
> if __name__ == "__main__":
> management.execute_from_command_line()
>
> and no folder or file have been created.
>
> have i done something wrong?
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/217b9837-c580-433a-adff-98066624e967%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJN6LRzA%2B2t3_rSd8Yyg3OxbdtnhVwY1g9--kGQiCZ0rYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about subdomains.

2015-02-11 Thread Sergiy Khohlov
Also one project can serve few domain names.
10 лют. 2015 17:22, користувач "Chen Xu"  написав:

> Hi
> I am using Django to build a website.
>
> I saw some websites have www.ABC.com, support.ABC.com, and career.ABC.com.
> I wonder how this is achieved. Are these 3 different apps in 1 project, or
> 3 different projects.
>
> Thanks
>
>
>
> --
> ⚡ Chen Xu ⚡
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACac-qbEVzrX4W-A2jFMoi5ogTFeptj65kLyH3_UkOQ%3Dw%2BvAWw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMjj%2BjrG-d7fzObZuaEePx6e8N0JBrHpFmHnU5GLsxUqw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django views error

2015-01-28 Thread Sergiy Khohlov
Second function has ident mistakes .2last lines have additional space.
27 січ. 2015 09:31, користувач "Stephen J. Butler" 
написав:

> Not all your lines have the same indent level in your profile method. Line
> 52.
>
> On Tue, Jan 27, 2015 at 1:03 AM, Mosharof sabu 
> wrote:
> > my view
> >
> >
> > def index(request):
> > category_list = Status.objects.filter(comment__startswith="d")
> > context_dict = {'categories': category_list}
> > return render(request, 'idesk/index.html', context_dict)
> >
> > it shows result in index.html page
> >
> > but when i try to show query in profile.html page like bellow,
> >
> > def profile(request):
> >
> >category_list = Status.objects.filter(comment__startswith="d")
> > context_dict = {'categories': category_list}***
> > return render(request, 'idesk/profile.html', context_dict)
> >
> > it shows
> >
> > IndentationError at /idesk/
> >
> > unexpected indent (views.py, line 52)
> >
> > Request Method: POST
> > Request URL: http://127.0.0.1:8000/idesk/
> > Django Version: 1.7.1
> > Exception Type: IndentationError
> > Exception Value:
> >
> > unexpected indent (views.py, line 52)
> >
> >
> >
> > anyone  can please help me?
> >
> > --
> > 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 http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/03c70c0f-8293-4388-87cd-53ce3d5f801f%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD4ANxUjC6CPvMJXkd-qSgR3WjUut4ikj%3DMrLZMHSZ3F5ALhYw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOV%2BHaJCpihgvu0O%3DeNHEyESLYQfkdbhAzza9ehzkR9Fg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Select Field With Other option

2015-01-27 Thread Sergiy Khohlov
You can not do it directly. This should be do by JavaScript's using at HTML
side. All field s are added to form and some of them are hidden.
27 січ. 2015 00:29, користувач "Paul Royik" 
написав:

> I need to build a form field with a special select field.
> Select field should have option other on which text field is shown. After
> entering value in textfield, it should be validated, saved and then refered
> to initial form.
>
> How this can be done?
>
>
> I'm trying to override MultiValueField and MultiWidget, but no luck.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/268074d9-67af-4b19-a083-314ad1125414%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJM2v%2BxBUDtNm0F6uKn44oz8Oq8te%3DCTCHCgQqvQ_rkrVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django for latex

2015-01-23 Thread Sergiy Khohlov
try to use texi2pdf

 Of course this  list for django not LaTex

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Jan 23, 2015 at 10:37 AM, Hitesh Sofat 
wrote:

> I want to generate pdf using latex. Please guide me for this , anybody
> having any tutorial please share it here.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5666b161-6abe-43e0-b8ef-3e11c6607bf9%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJO6BqTTzWn1-gdK7Qw5SQgA-LW1c07air_uG41mDke_zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Canvas OAuth2 From Django View

2015-01-17 Thread Sergiy Khohlov
Is CRFS protection enabled ?
15 січ. 2015 18:51, користувач "Henry Versemann" 
написав:

> First let me say that I haven't done a lot of stuff with either Python or
> Django, but I think I understand most of the basics.
> I am trying to get an access token back from the OAuth2 Web Application
> Flow of the Canvas' LMS API (
> https://canvas.instructure.com/doc/api/file.oauth.html ).
> I have successfully sent the request in step 1 of the flow, and
> received back and extracted out of the response all of the data needed for
> step 3, which came back in step 2 of the flow.
> So now in step 3 of the flow my problem is how to send a POST of the
> request needed, as described in step 3 of the flow, from a Django View.
> I've not found anything definitive saying that I absolutely can't do
> a POST of a request, from a Django View, and have seen some  items which
> seem to indicate that I can do a POST from a view, but none of them seem to
> have detailed code examples or explanations of how to do it if it is
> possible.
> So far I've tried several ways of sending the POST within a
> returned HttpResponse and have not been successful, and if I understand
> things correctly HttpResponse doesn't allow it.
> I have also looked at all of the other Django Shortcut Functions
> documentation, and none of them seem to offer any obvious way of POSTing a
> request either.
> Can someone please point me to a good example of how to do it if it is
> possible, and if it is not maybe point me to one or more examples of how I
> might be able to successfully go through the Canvas OAuth2 Web Application
> Flow using some other module or package, that I can integrate into my
> Django application?
> Thanks for the help.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/298a8f9d-3694-45f8-88c4-d9049a1e68d2%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOq-D%3DjquCS1D7r%2BkHbJ_eFTxhrOQVsFQOg-LhU0pGPbg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: python with django orm code , after exits, the entry from db revert backs

2015-01-12 Thread Sergiy Khohlov
Have you enabled autocommit to yes?

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJM1w%3DJKpR5DtEmWEyOtRiQoBxwYQgdRCY0t8QmGBixuWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
Add function get() and post() to the view class.  Code is near to same not
class view

6 січ. 2015 18:45, користувач "Brad Rice" <bradri...@gmail.com> написав:
>
> When I was working with formsets, it seemed to me best to just use a
single UpdateView with post and get functions defined rather than having a
separate CreateView class. Seemed to handle both create and update ok.
>
> On Tuesday, January 6, 2015 9:39:49 AM UTC-5, Sergiy Khohlov wrote:
>>
>> Diff is simple : UpdateView is using for changing already created
object. CreateView is using  for creating new object.
>> I have few simpleast class for your request. But I have not  commented
yet.
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice <brad...@gmail.com> wrote:
>>>
>>> Does anyone have a recommendation for intermediate reading to
understand Class Based Views? It seems most of the Django books were
written when function based views were prevalent. I'm still having trouble
understanding what the differences are between CreateView and UpdateView
and what Meta is as well as slug_field and pk. Perhaps my issue is
understanding Object oriented python? I wish there were some tutorials or
cookbooks that offer better understanding.
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7fac53a2-7ff6-488f-903f-ed46edf15deb%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/703f0448-2152-418a-9466-4e87e1226b62%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOJa74iiNge3F0vBbOkthafSAmhD13QSwJoT%3DYSLkF7Gw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
Diff is simple : UpdateView is using for changing already created object.
CreateView is using  for creating new object.
I have few simpleast class for your request. But I have not  commented
yet.

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice  wrote:

> Does anyone have a recommendation for intermediate reading to understand
> Class Based Views? It seems most of the Django books were written when
> function based views were prevalent. I'm still having trouble understanding
> what the differences are between CreateView and UpdateView and what Meta is
> as well as slug_field and pk. Perhaps my issue is understanding Object
> oriented python? I wish there were some tutorials or cookbooks that offer
> better understanding.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7fac53a2-7ff6-488f-903f-ed46edf15deb%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJM1Y9DGN-w1-rmZe0_mLd%3Du1OFaQF9iW1NvGMaZ%3DChCXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hierarchical User Groups

2014-12-12 Thread Sergiy Khohlov
  I have a  code for  product and product category.  Look like it is a same
task. Are you interested in ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Fri, Dec 12, 2014 at 12:37 AM, Wellington Cordeiro  wrote:
>
> I'm building a project where we need to have a hierarchical system of
> Users.
>
> The gist of it is this, there needs to be way to create Companies with
> permission groups within them. How would you implement this?
>
> For example:
>
> Company: Foo has admins, managers and users
> Company Bar has admins, managers and users
>
> Then you could query for employees of foo, or admins of foo and get only
> those users.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/70774376-a50d-49c7-916f-a43ac283feb0%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJP_2Ohp%3D-oS5S4fr3Du%3DBRFGeV3517kj1Jh4_7JVNd5mA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: default login template not found (registration/login.html)

2014-11-20 Thread Sergiy Khohlov
Check  your settings.py for TEMPLATE_DIRS

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Nov 20, 2014 at 7:48 AM, 顏大剛  wrote:

> Hi,
>
> I follow the doc to test the login system. I set a view function with
> @login_required to show successful login message.
>
> In the html, a link like:
> Login
>
> The URLconf under 'account' namespace contains one url:
> url(r'^login/$', 'django.contrib.auth.views.login', name='login',)
>
>
> It shows the exceptions, and I show the traceback here:
>
>
>
>
>
>
>
> *Template Loader Error:Django tried loading these templates, in this
> order:Using loader django.template.loaders.filesystem.Loader: project>/templates/registration/login.html (File does not exist)Using
> loader
> django.template.loaders.app_directories.Loader:/usr/local/lib/python3.2/dist-packages/django/contrib/admin/templates/registration/login.html
> (File does not
> exist)/usr/local/lib/python3.2/dist-packages/django/contrib/auth/templates/registration/login.html
> (File does not exist)*
> I found one login.html in
> 'django/contrib/admin/templates/admin/login.html'.
> Is it a bug or I miss something?
>
> Yen
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAFnq%3D1iCtD9KYK52VdOnrUtqEoyCP5b8jNiwYspc2M73X7bJ0Q%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJPmZWKNd1CE%2BYrtgSwAmD24zwxGoWM%3DaXrO-zaZnOBs0g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postawienie łącznika międy bazą danych a resztą świata (aplikacje mobilne)

2014-11-18 Thread Sergiy Khohlov
 Hello Robert,
 I would like to say django has all functionality  for web development and
C# is not needed. At first try to pass  first 6 tutors. After this you can
do  start. Last one, speaking language in this  maillist is English not
Polish

Many thanks,

Serge


+380 636150445
skype: skhohlov

2014-11-18 13:46 GMT+02:00 Robert Ostrowski :

> Witam wszystkich, jestem kompletnie zielony jak chodzi o weba, tworzę
> aplikacje i gry na platformy mobilne (i nie tylko).
> Dostałem zlecenie na napisanie aplikacji wymagającej komunikacji z bazą
> danych.
> Wiem już że postawienie samej bazy danych jest dość proste (mySQL znam),
> wiem też że serwerem może być zwykły serwer pod stronę internetową, nie
> wiem jednak jak wygląda komunikacja między instancjami aplikacji którą
> tworzę, a bazą danych (a konkretniej modułem w django który pełnił by formę
> łącznika).
> Myślę że po stronie aplikacji sobie poradzę (piszę w C#), jednak pythona
> widzę pierwszy raz na oczy (no dobra drugi ale to było dawno i nie prawda)
> - jak to się pisze? Konkretnie interesują mnie takie szczegóły - jak
> wywołać funkcję która jest na serwerze (napisana w pythonie + django) z
> poza serwera oraz co ta funkcja zwraca, jak zwraca etc.
> Z kwestii technicznych zastanawia mnie jeszcze jak się uruchamia (nawet w
> celach testowych) kod po stronie serwera (w przypadku gdy serwer nie będzie
> lokalnie na moim pc'cie tylko już u jakiegoś dostawcy).
> Fragmenty kodu mile widziane.
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf2db56d-3fd6-4366-b603-41529372528e%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMNuY7h0X3J-Kgnb1CK5sHxfYo0gfgXc0mnZCTfWpHSug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django CMS

2014-11-10 Thread Sergiy Khohlov
 no problem.
You are welcome

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Nov 10, 2014 at 3:14 PM, Niall <conwayni...@gmail.com> wrote:

> Sergiy, just got it all sorted, one of my extra installed apps was
> commented out in settings.py.
> Thanks for response in any case
> Niall
>
> On Monday, 10 November 2014 17:35:39 UTC+10, Sergiy Khohlov wrote:
>>
>> send also log from console
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Sun, Nov 9, 2014 at 6:06 PM, Niall <conwa...@gmail.com> wrote:
>>
>>> Hi guys,
>>>
>>> I was hoping that someone could help me out with the following. I m
>>> currently trying to access Djang CMS for the first time. I have been
>>> following the steps on this page
>>> <https://www.digitalocean.com/community/tutorials/how-to-set-up-and-install-django-cms-on-a-debian-7-or-ubuntu-13-vps>
>>>  but
>>> it turns up with this error when I run the server and load int he browser.
>>>
>>> Would appreciate any tips please. Thanks
>>>
>>> Niall
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/bc63432e-7bbe-44f9-bd56-220dc7256634%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/bc63432e-7bbe-44f9-bd56-220dc7256634%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bb17878b-cde2-43ab-8005-bab2fbc0bce7%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/bb17878b-cde2-43ab-8005-bab2fbc0bce7%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMk704VpbS8XczeN3Tv5Ts_aGR5DW64Rc1jYvuHcnY%3DrA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django CMS

2014-11-09 Thread Sergiy Khohlov
send also log from console

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Sun, Nov 9, 2014 at 6:06 PM, Niall  wrote:

> Hi guys,
>
> I was hoping that someone could help me out with the following. I m
> currently trying to access Djang CMS for the first time. I have been
> following the steps on this page
> 
>  but
> it turns up with this error when I run the server and load int he browser.
>
> Would appreciate any tips please. Thanks
>
> Niall
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc63432e-7bbe-44f9-bd56-220dc7256634%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJPUE1gUQqSVx%3D29pDuQbEsS-fxEypLO2sv-zxtR388TYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Weird form validation question

2014-10-09 Thread Sergiy Khohlov
could you please paste  code in form valid block ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Oct 9, 2014 at 11:23 AM, termopro <termo...@gmail.com> wrote:

> I am using form.is_valid()
>
> On Thursday, October 9, 2014 10:54:56 AM UTC+3, Sergiy Khohlov wrote:
>>
>> Are you using form_valid method in view ?
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>> On Thu, Oct 9, 2014 at 10:10 AM, termopro <term...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> I am building a user registration page. Page has a form where user can
>>> select his current state and city.
>>>
>>> The problem with that is that i cannot load list of cities into the form
>>> when the page is being generated.
>>> That's because i show the user only cities from his state, not all of
>>> them.
>>>
>>> So i generate a form with a list of states and an empty 'cities'. When
>>> user selects one of the states, i populate 'cities' with ajax.
>>>
>>> Everything works fine, except i don't know how to validate 'cities'
>>> correctly and show form errors.
>>> What is the correct way of doing this ?
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/25d67c01-df04-424c-9171-88def729d3a6%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/25d67c01-df04-424c-9171-88def729d3a6%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/035094d3-4359-4823-a991-e2ac2b08c96e%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/035094d3-4359-4823-a991-e2ac2b08c96e%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJO0eMXVdjbLa9S6Q_8krUBEmxiGYwmwSfO6-58QmQkfew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Weird form validation question

2014-10-09 Thread Sergiy Khohlov
Are you using form_valid method in view ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Oct 9, 2014 at 10:10 AM, termopro  wrote:

> Hi,
>
> I am building a user registration page. Page has a form where user can
> select his current state and city.
>
> The problem with that is that i cannot load list of cities into the form
> when the page is being generated.
> That's because i show the user only cities from his state, not all of them.
>
> So i generate a form with a list of states and an empty 'cities'. When
> user selects one of the states, i populate 'cities' with ajax.
>
> Everything works fine, except i don't know how to validate 'cities'
> correctly and show form errors.
> What is the correct way of doing this ?
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/25d67c01-df04-424c-9171-88def729d3a6%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNqQ1FhOKxEVF%3DXBa2mcUsFVTyY%3DTQpMTXfg1__ZyRYFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: issues with get_initial() in CreateView?

2014-10-09 Thread Sergiy Khohlov
 Could you please paste your form_valid method ?
 You should update it for right saving object

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Thu, Oct 9, 2014 at 7:40 AM, Lachlan Musicman  wrote:

> Ok, I think it's because the modela is not passed in the POST data. Is
> there any way to set the modela field in the CreateView without
> needing it to be in the POST data?
>
> IE, set the field in the CreateView (because the value is known
> immediately by virtue of ), and leave it out of the ModelForm
> and the template?
>
> Cheers
> L.
>
> On 9 October 2014 15:33, Lachlan Musicman  wrote:
> > I'm struggling with CreateView get_initial() in django1.7
> >
> > I have a modelA detail page with an "add ModelB" (modelB has FK to
> ModelA)
> > button.
> >
> > When I hit that button, I want the new ModelB obj to have the modelA FK
> set. So
> > in the ModelB CreateView I have a get_initial that uses the slug to set
> the
> > modela.
> >
> > When I run the code below , the modelB wont save ("missing modelA_id")
> >
> > forms.py doesn't include modela field because I want modela set without
> ability
> > to edit it. Have tried including it, and excluding from the template -
> always
> > get's a "modela is required field" error.
> >
> > What am I doing wrong or what test can I run to determine why the
> > field isn't being set?
> >
> >
> > models.py:
> >
> > class ModelA(models.Model):
> >   name = models.CharField(max_length=30)
> >
> > class ModelB(models.Model):
> >   name = models.CharField(max_length=30)
> >   modela = models.ForeignKey(ModelA, related_name='moda')
> >
> >
> > urls.py:
> >
> > url(r'^model/add/$', views.ModelAAdd.as_view(), name='modelA_add'),
> > url(r'^model/(?P[-\w]+)/$', views.ModelADetail.as_view(),
> > name='modelA_detail'),
> > url(r'^model/(?P[-\w]+)/modelb/add/$',
> > views.ModelBAdd.as_view(), name='modelB_add'),
> >
> >
> > views.py:
> >
> > class ModelBAdd(generic.CreateView):
> >   fields = ['modela', 'name']
> >   form_class = ModelBAddForm
> >   model = ModelB
> >   template_name = 'jobs/modelB_form.html'
> >
> >   def get_initial(self):
> > slug = self.kwargs['slug']
> > modela = ModelA.objects.get(slug=slug)
> > print modela.id, modela  # <- prints correct details in log
> > return {'modela': modela.id }
> >
> > forms.py
> >
> > class ModelBAddForm(forms.ModelForm):
> >   class Meta:
> > fields = ['name']
> > model = ModelB
> > widgets = {
> > 'name': forms.TextInput(attrs={'class':'form-control'}),
> > }
> >
> >
> >
> > --
> > You have to be really clever to come up with a genuinely dangerous
> > thought. I am disheartened that people can be clever enough to do that
> > and not clever enough to do the obvious thing and KEEP THEIR IDIOT
> > MOUTHS SHUT about it, because it is much more important to sound
> > intelligent when talking to your friends.
> > This post was STUPID.
> >
> ---
> > The Most Terrifying Thought Experiment of All Time
> >
> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>
>
>
> --
> You have to be really clever to come up with a genuinely dangerous
> thought. I am disheartened that people can be clever enough to do that
> and not clever enough to do the obvious thing and KEEP THEIR IDIOT
> MOUTHS SHUT about it, because it is much more important to sound
> intelligent when talking to your friends.
> This post was STUPID.
>
> ---
> The Most Terrifying Thought Experiment of All Time
>
> http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGBeqiMB0EnD94STioijH4iL2V1xvX4fxZkm9beoPmxs3JWPtw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: поиск

2014-10-07 Thread Sergiy Khohlov
Check this one.
http://stackoverflow.com/questions/23304821/django-ajax-populate-form-with-model-data
 also could you please use English in this list ?

Many thanks,

Serge


+380 636150445
skype: skhohlov

2014-10-07 17:58 GMT+03:00 RSS :

> направьте, пожалуйста
> есть форма:
> 1. первый выпадающий список, одна запись которой равна одной модели
> 2. в зависимости от выбранной модели, остальные поля принадлежат одной
> модели
>
> если можно ссылки или примеры
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/61c235b3-720d-477f-af0b-c6af63f27051%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJN8Sr9%2BaOkK_yCNn27kOnoG-J14bLFEyTMF-jXkoQUVgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Simple task. Get request.META values listed on a page via template

2014-09-18 Thread Sergiy Khohlov
simple ways is using form and passing values to the template from the form.
https://docs.djangoproject.com/en/dev/topics/forms/

Many thanks,

Serge


+380 636150445
skype: skhohlov

On Mon, Sep 8, 2014 at 7:08 PM, Артём Мутерко 
wrote:

> I need to list all values from request.META in Django using template.
>
> I've done it without template like this
> (code from my views.py)
>
> def display_meta(request):
>   values = request.META.items()
>   values.sort()
>   html = []
>   for k, v in values:
>   html.append(‘%s%s’ % (k, v))
>   return HttpResponse(‘%s’ % ‘\n’.join(html))
>
> For example I have template 'values.html', how can I do the same as above
> but using template and not hardcoding html in views.py?
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4673f20b-aa76-4012-882b-fa370299ba1a%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNOSFmZpW5CZi_S2CWtuftLF%2B%2BtkFzzaht98kLuTpj-Aw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with time field in mysql

2014-08-19 Thread Sergiy Khohlov
which one error ?

 Look like error is related to  __str__ function  but I'm not sure (I'm
using python 2.7 )

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Tue, Aug 19, 2014 at 6:09 PM, Andreas Kuhne 
wrote:

> Hi all,
>
> I am having a problem with a time field in my mysql database. I can add
> values to the database, but when I try to read the values, I get the
> following error:
> Failed converting row to Python types; can't use a string pattern on a
> bytes-like object (field start_time)
>
> The database model looks like this:
> class AvailableTimeSetting(models.Model):
> SETTINGS_CHOICES = (
> (0, _('Monday')),
> (1, _('Tuesday')),
> (2, _('Wednesday')),
> (3, _('Thursday')),
> (4, _('Friday')),
> (5, _('Saturday')),
> (6, _('Sunday')),
> )
> store = models.ForeignKey('store.RetailStore')
> weekday = models.IntegerField(_('Week day'),
>   max_length=1,
>   choices=SETTINGS_CHOICES)
> start_time = models.TimeField(_('Start time'))
> end_time = models.TimeField(_('End time'))
> max_parallel_bookings = models.IntegerField()
>
> class Meta:
> app_label = 'timebooking'
> verbose_name = 'Available time setting'
> verbose_name_plural = 'Available time settings'
>
> def __repr__(self):
> return "<%s: %s>" % (self.__class__.__name__, self.__str__())
>
> def __str__(self):
> return "%s %s-%s %d" % (self.weekday, self.start_time,
> self.end_time, self.max_parallel_bookings)
>
>
> And the problem is on the start_time field. I see that the fields get
> saved correctly in the database. However as soon as I try to get an object
> I get the error.
>
> I am using mysql-connector-python version 1.2.2, and Python 3.4 in a
> django 1.6.4 project.
>
> Regards,
>
> Andréas
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALXYUb%3DAk1GfO5bknfsMJ7cCYdFC0JACc3TXKb1cbFQHpFzppw%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJOU%3DtBKpwBFw_Afd73HBzu3vF5V%3DZy8NbHouFG20O_f1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for an email-based tutor

2014-08-19 Thread Sergiy Khohlov
Hello Study,

 It will be nice to have a list of the question.  Could you please to tell
about goal of the your  learning ?

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Tue, Aug 19, 2014 at 9:39 AM,  wrote:

> Hi Python/Django developers,
>
> I've been learning python/django for some weeks now and now I'd like to
> look for a tutor to ask questions via emails.
>
> Here is the study that I've been doing.
> 1) Using Udemy and Udacity to improve my coding skills
> 2) My first project is simple EC site (My questions will mostly be from
> this)
> 3) I'm thinking monthly fixed payment. $50 - $200 per months (negotiable)
>
> Required skills
> - Python/Django developers
> - ECommerce development using Bootstrap, Webpay.jp integration experiences
> (if you don't know webpay, it's pretty similar to Stripe) are preferred
>
> If you are interested, please feel free to send me an email.
>
> Looking forward to hearing from you:)
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bf5c8b29-b1f8-47c9-b69c-4b9eb0ca0001%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNaEBpH3ojHExAxP91GKxhBswZzshbZy1RZJvg14PSKnw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems with "Hello World" Debian Wheezy Django 1.6.5

2014-08-19 Thread Sergiy Khohlov
also try
 python manage.py runserver  127.0.0.1:8000

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Tue, Aug 19, 2014 at 8:46 AM, Aaron C. de Bruyn 
wrote:

> After trying to load the page in Chrome, do you see any output in the
> 'runserver' window?
>
>
> On Mon, Aug 18, 2014 at 7:28 PM, Andrew Koller 
> wrote:
>
>> I'm having issues getting the dev server to work. After I installed
>> Django, and
>>
>> $ python -c "import django; prindjango.get_version())"
>>
>>> returns 1.6.5
>>
>> Then:
>>
>> $ python manage.py runserver
>>
>> returns:
>>
>> Validating models...
>> 0 errors found
>> August 19, 2014 - 02:19:03
>> Django version 1.6.5, using settings 'mysite.settings'
>> Starting development server at http://127.0.0.1:8000/
>> Quit the server with CONTROL-C.
>>
>> but 127.0.0.1:8000 shows no data in Chrome.
>>
>> Thanks for the help
>>
>>  --
>> 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 http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/13f29c35-56bb-455e-b7dc-68d2f160c82e%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEE%2BrGrz1Ocwbb4X3WKv2P0-%2Bd2aqO1%3DDbat%3DccEe2BbXyTneQ%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJO_NXKLtCjDDN%2BRaNDgOc-xxqKNO%2B2ZB5B6FMpefgP1wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Efficient way to perform many queries

2014-08-15 Thread Sergiy Khohlov
good question !

1) I like to use some optimization at view side not template
2) if i need something like your code I using optimization.
 Something like that :

{% with items = mymodels.items.all  %}

{% for item in items %}

{{ item.name }}

{% for tag in item.tags.all %}
{{ tag }}
{% endfor %}

{% endfor %}

{% endwith %}

First records means get ALL record to the variable which should be cached
and used sometimes later


3) Anyway  i dont like  "object.all "
I like to retrieve minimum of the field for decreasing database loading

Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Aug 15, 2014 at 5:46 PM, Collin Anderson 
wrote:

> you could try in your view:
>
> items = items.prefetch_related('tags')
>
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0acd3536-93e7-463a-9805-06d1b9236b63%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJPQ%2BRA2eOCw4WuYag238W_nxrEBQngVdUb-TgA7is_Tjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem in the Tutorial 01

2014-07-24 Thread Sergiy Khohlov
On Thu, Jul 24, 2014 at 3:53 PM, Fabian Zentner <
zentner.fab...@googlemail.com> wrote:

> *Poll.objects.get(pub_date__year=current_year) *


try to use
*Poll.objects.first()*
 you have 2 object and it is a reason of your traceback

Many thanks,

Serge


+380 636150445
skype: skhohlov

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJNYz1imQ9i50EnSW9oYzREhT38pmdjbX6gsSqq8vYtJRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: urls prob

2014-07-18 Thread Sergiy Khohlov
Ok,
 I've used some code from tutorials :
1) add apl akumbo
python manage startapp akumbo

2) add your models
3) add urls:

from django.conf.urls import patterns, include, url
from django.contrib import admin
from akumbo.views import EventListView
from akumbo.views import EventDetailView

urlpatterns = patterns('',

#url(r'^blogs/', include('blogs.urls')),
url(r'^admin/', include(admin.site.urls)),

#news urls

#events urls
url(r'^$', EventListView.as_view(), name='event'),
url(r'^(?P[-_\w]+)/event/$', EventDetailView.as_view(),
name='Event-detail'),

)

4.  Check sql


serg@debian:~/project/django/tutor/mysite$ python manage.py  sql
akumbo

BEGIN;

CREATE TABLE `akumbo_event`
(

`id` integer AUTO_INCREMENT NOT NULL PRIMARY
KEY,

`name` varchar(100) NOT
NULL,

`slug` varchar(50) NOT NULL
UNIQUE,

`type_of` varchar(100) NOT NULL,
`image1` varchar(100) NOT NULL,
`entertainer` varchar(100) NOT NULL,
`description` longtext NOT NULL,
`speakers` varchar(100) NOT NULL,
`pub_date` datetime NOT NULL,
`location` varchar(100) NOT NULL
)
;

run syncdb

python manage.py  syncdb
Creating tables ...
Creating table akumbo_event
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)


create a simple  template
serg@debian:~/project/django/tutor/mysite$ mkdir templates
serg@debian:~/project/django/tutor/mysite$ mkdir templates/akumbo
serg@debian:~/project/django/tutor/mysite$ touch
templates/akumbo/event_list.html
serg@debian:~/project/django/tutor/mysite$ python manage.py  runserver

  lunch  app
 visit page  no error
Also I've update setting.py for supporting your urls




Many thanks,

Serge


+380 636150445
skype: skhohlov


On Fri, Jul 18, 2014 at 4:54 PM, ngangsia akumbo <ngang...@gmail.com> wrote:

> It is still breaking
>
>
> On Friday, July 18, 2014 1:56:38 PM UTC+1, Sergiy Khohlov wrote:
>
>> try to use
>> url(r'^/event/$', EventDetailView.as_view(), name='Event-detail')
>>
>>
>>  and ofcourse turn off color
>>
>> Many thanks,
>>
>> Serge
>>
>>
>> +380 636150445
>> skype: skhohlov
>>
>>
>> On Fri, Jul 18, 2014 at 3:43 PM, ngangsia akumbo <ngan...@gmail.com>
>> wrote:
>>
>>> it gives me this error
>>> Page not found (404) Request Method:GET Request URL:
>>> http://127.0.0.1:8000/event/
>>>
>>> No post found matching the query
>>>
>>> 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.
>>>
>>>
>>>>  --
>>> 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...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>>
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit https://groups.google.com/d/
>>> msgid/django-users/f68ef88b-e1a5-4aef-b0b3-cb91730ba312%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/django-users/f68ef88b-e1a5-4aef-b0b3-cb91730ba312%40googlegroups.com?utm_medium=email_source=footer>
>>> .
>>>
>>> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0c4f31f2-9c39-4639-a371-32e258153608%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/0c4f31f2-9c39-4639-a371-32e258153608%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CADTRxJMfA7FgFxpT9p6f3zt2ac4NqfyE2yAJb%2BiB8juiG9CKzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >