Re: Django 1.7 problem

2014-12-04 Thread Andreas Kuhne
2014-12-04 1:39 GMT+01:00 Carl Meyer :

> Hi Andreas,
>
> On 12/03/2014 01:34 PM, Andreas Kuhne wrote:
> > I am trying to migrate our current website to django 1.7.
> >
> > Currently we are using a plugin called django-dbgettext to get parts of
> our
> > database translated (we are running in 10 different languages). The
> problem
> > is that django-dbgettext starts by going through all of the models and
> does
> > this before the translation framework is running. So I get an exception
> > during startup that says:
> > "django.core.exceptions.AppRegistryNotReady: The translation
> infrastructure
> > cannot be initialized before the apps registry is ready. Check that you
> > don't make non-lazy gettext calls at import time."
> >
> > The problem seems to be that the classes are loaded before the models are
> > correctly loaded and the translation framework is running. All of the
> > classes use ugettext_lazy, but the stack trace includes ugettext.
> >
> > I want to rewrite the django-dbgettext plugin so that it goes through the
> > code AFTER the models are correctly loaded. I don't know how to do this
> > however. Is there anyway of running code after django is fully
> initialized?
>
> Indeed there is! See
>
> https://docs.djangoproject.com/en/dev/ref/applications/#django.apps.AppConfig.ready
>
> > Django admin should do the same thing, it also has a autodiscover()
> > function and I was wondering why this doesn't happen with django admin?
> > Could this be a good place to start looking for a solution?
>
> Yes, admin.autodiscover now runs in the admin's AppConfig.ready() in
> Django 1.7, so that would have been a good place to start looking :-)
>
> Carl
>
> --
> 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/547FAD59.5090809%40oddbird.net
> .
> For more options, visit https://groups.google.com/d/optout.
>

Thanks Carl,

With your help here I was able to fix this in less than an hour. Was really
easy :-)

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


Django development server crash on syntactic or indent error after check

2014-12-04 Thread Mario De Frutos Dieguez
First of all i want to say hi!, i'm new in the group :)

I'm having a problem with the development server (a.k.a runserver). When 
i'm working in a file but i have an error (for example indent error or 
syntactic error) the server crash instead of report the error and keep 
running.

I've been reading the doc and i saw this phrase "..If any errors are found, 
they will be printed to standard output, but it won’t stop the server..." 
(https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port).

What i don't know if this is a bug or the expected behaviour.

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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3af61c48-af43-4947-8d18-7c9fbb393480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ManyToManyField with rating using 'through' on each ManyToMany relation in Django

2014-12-04 Thread inoyon artlover KLANGRAUSCH
 

I am very beginner in the programming world, so please forgive my lack of 
understanding...
There is a CustomUserprofile in my models.py.. nothin very special about 
this... 

class Interests(models.Model):

RATING = [(y, y) for y in range(1, 7)]

interest = models.CharField(max_length=40)
interest_rating = models.SmallIntegerField(choices=WEIGHT)


class CustomUserprofileInterests(models.Model):

user = models.OneToOneField(User)
interests = models.ManyToManyField(
Interests, through='CustomInterests',
through_fields=('custominterest', 'interest'),
null=True, blank=True)


class CustomInterests(models.Model):

WEIGHT = [(y, y) for y in range(1, 7)]

interest = models.ForeignKey(Interests)
custominterest = models.ForeignKey(CustomUserprofileInterests)
rating = models.SmallIntegerField(choices=WEIGHT)
 

I want to accomplish a rating on each relation in the 'interests = 
ManyToManyField' in my CustomUserprofile. The Interests-Model HAS to have 
an OWN, self relating rating in each 'interest' entry, NOT related to the 
CustomUserprofile.

Startet lot of investigation and the 'through' option seems to be the 
solution? Don't got it really because in my ModelForm and Admin there is NO 
field to choose some 'interests' and an option to rate it.
Got absolutley NO idea how to do it, would appreciate any hints.
 

-- 
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/b14f39c9-57da-481e-bf38-218445a01c2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django development server crash on syntactic or indent error after check

2014-12-04 Thread Mike Dewhirst

On 4/12/2014 7:58 PM, Mario De Frutos Dieguez wrote:

First of all i want to say hi!, i'm new in the group :)

I'm having a problem with the development server (a.k.a runserver). When
i'm working in a file but i have an error (for example indent error or
syntactic error) the server crash instead of report the error and keep
running.

I've been reading the doc and i saw this phrase "..If any errors are
found, they will be printed to standard output, but it won’t stop the
server..."
(https://docs.djangoproject.com/en/dev/ref/django-admin/#runserver-port-or-address-port).

What i don't know if this is a bug or the expected behaviour.


It is expected behaviour. In Django 1.6+ a syntax error or indent error 
doesn't stop the dev server. If you read the traceback and see where the 
error originates, you can open that source file in your editor, fix the 
problem and when you save it, the dev server detects the repair and 
keeps on keeping on!


Very clever IMO

Cheers



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 http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/3af61c48-af43-4947-8d18-7c9fbb393480%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/54805429.1080703%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Beginner: Creating a form with variable number of checkboxes

2014-12-04 Thread Collin Anderson
Hi,

The forms.ModelMultipleChoiceField might help you out here.

class UpdateGroup(forms.Form):
non_member_checkboxes = forms.ModelMultipleChoiceField(
queryset=User.objects.all(),
widget=forms.CheckboxSelectMultiple,
)

Collin

On Tuesday, December 2, 2014 7:27:47 PM UTC-5, T Kwn wrote:
>
> I'm creating a page where the user can add other users to a group. I am 
> able to dynamically fetch all users and list them on a template with 
> checkboxes. I'm getting stuck creating a form for them however.
>
> I read this post (among others)
>
>
> http://stackoverflow.com/questions/19947538/django-form-with-unknown-number-of-checkbox-fields-and-multiple-actions
>
> I don't understand what should be used to define "choices" in this 
> example. He says fill it with a queryset but which one?
>
> choices = queryset_of_valid_choices,
>
> Would that be something like objects_list.all()?
>
>
> Currently my form is defined as this:
>
> class UpdateGroup(forms.Form):
> non_member_checkboxes = forms.MultipleChoiceField(
> widget  = forms.CheckboxSelectMultiple,
> )
>
> I know it's missing something because the form.is_valid is always False.
>

-- 
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/3b48f951-9cf4-4728-bb24-29849b5fa685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass request.user in .hbs file in django

2014-12-04 Thread Collin Anderson
Hi,

What happens when you try?

You may need to "serialize" the individual attributes of user, or just 
return request.user.username.

Django has some tools to help you serialize models.
https://docs.djangoproject.com/en/dev/topics/serialization/

Collin


On Tuesday, December 2, 2014 11:57:10 PM UTC-5, JAI PRAKASH SINGH wrote:
>
> sir, 
>
>thank you for reply. but actually this mistake was while posting , in  
> my actual code  request.user is present .
>so please if some more  guidance from your side please share ...
>
> On Tue, Dec 2, 2014 at 7:16 PM, Jerry Dumblauskas  > wrote:
>
>> missing the t? reques.user to request.user
>>
>> On Tue, Dec 2, 2014 at 7:42 AM, JAI PRAKASH SINGH > > wrote:
>>
>>> hello all, 
>>> 
>>> i am very new to django , i have just started to work on django , 
>>>
>>> i am using .hbs file in django project
>>> my aim is to use request.user in .hbs file 
>>>
>>> i am trying this ...
>>> not working 
>>>
>>>
>>>
>>> ***view.py
>>> data_dict = {...
>>> 'user':reques.user,
>>> # not working # but stacin name working like user: 
>>> "jp"
>>>...}
>>>
>>> content_type = 'application/json'
>>> return HttpResponse(json.dumps(data_dict), content_type)
>>>
>>>
>>> ***.hbs 
>>> file*
>>>
>>>
>>>  *{{response.user}}*NO 
>>> RATING
>>>
>>>
>>>
>>> 
>>>
>>>
>>>
>>>  -- 
>>> 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/3a08e636-78ac-4342-8577-816ac25a29e9%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/django-users/rxIIoZ0dGLY/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/CA%2BG_OOsDz5NJdNXGkHi8Y0gUZ1GwdSb%3DouSVPzdz68AiC27bVg%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/e5b3c665-42f3-40df-9d84-f13e211707d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-04 Thread Collin Anderson
Hi,

Not sure about namespaces, but you can certainly use name:

urlpatterns = patterns('',
url(r'^about/', login_required(AboutView.as_view()), name='about'),
)

Or better yet, patterns() is deprecated so:

urlpatterns = [
url(r'^about/', login_required(AboutView.as_view()), name='about'),
]

Collin

On Wednesday, December 3, 2014 10:13:24 AM UTC-5, Rootz wrote:
>
> URL Reversing the view where login is required.
>
> On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote:
>>
>> Hi,
>>
>> It's probably possible. Do you mean url reversing the login view, or url 
>> reversing the view where login is required?
>>
>> Collin
>>
>> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:
>>>
>>> Hi can this work with url reversing namespaced urls?
>>> thanks
>>>
>>> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:

 If you are usign class based generic views you can use the decorators 
 in the URL config of your app, for example

 urlpatterns = patterns('',
 (r'^about/', login_required(AboutView.as_view())),
 )


 On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:

> Can I use both Generic View and the Django.contrib.auth features (such 
> as login_required decorator and other auth interface tool)? And if it is 
> not possible to integrate auth into Generic Views then can you recommend 
> alternative way of making the two work together? Adding to this I am 
> using 
> Django 1.7v and python 3.4v. 
>
> 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...@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/09fe215a-4572-418c-959f-567e9ab05b0b%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/09792d6b-460d-4beb-bf7f-e7112107e29c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-04 Thread Collin Anderson
Hi,

That is quite odd. Do you have the DJANGO_SETTINGS_MODULE set in your shell 
environment? (you shouldn't).

What version of Django are you using?

Are you doing this from your home directory?

Collin

On Wednesday, December 3, 2014 10:44:20 AM UTC-5, Shashwat singh wrote:
>
> Django is properly installed but when i try to create a new project --- " 
>> django-admin.py startproject abc " it returns ^^ that error. 
>
> I've tried almost everything, but nothing seems to fix that.
>
> Any help will be 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/53792f41-ba5d-416d-b5fe-b241d5141893%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: cURL or wget with contrib.auth and CSRF

2014-12-04 Thread Kevin Trainor
David,

I realize this was a long time ago, wondering if you ever got it working.

I'm battling the same dragon currently.

Step 1: seems to work
wget --save-cookies c:\cifs\cookies.txt --keep-session-cookies 
--no-check-certificate --http-user=myuser --http-password=mypass 
https://www.pdfstore.com/
which will save the session cookie allowing you to perform a second wget 
using the saved cookies

Step 2: Is where I'm getting an error "Error 400 not-valid csrf token"
wget --load-cookies c:\cifs\cookies.txt --no-check-certificate --no-parent 
--recursive https://www.pdfstore.com/pdfvault/?T&csrfToken=null

I'm inclined to think that wget cannot save csrf tokens in the same way it 
can session cookies. Wondering if you ever found a way out of this dragons 
den?

Not sure if it makes a diff but im running on windows7 going through a 
bluecoat proxy on the way out so using Unixutils as it allows me to set the 
proxy config.

Thanks,
Kevin


On Thursday, April 14, 2011 4:32:46 AM UTC-7, David wrote:
>
> Hello, 
>
> I am sorry for asking this, I know similar questions have been asked 
> before but I could not piece together the answer I needed from 
> previous contribution! 
>
> I have a view, for example: 
>
> @login_required 
> def clever_view(request): 
> #Render a PDF to a string 
> response = HttpResponse(content_type='application/pdf') 
> response.write(pdf_as_string) 
> return response 
>
> Now, in a browser, if I request http://my.host.name/clever_view.pdf I 
> get sent to the log in page, I log in, and I get my file. If I don't 
> log out I can later on request http://my.host.name/clever_view.pdf and 
> I get the file strait away. The browser handles the session and csrf 
> cookies perfectly. 
> For clarity, the login requires POST inputs 'username', 'password' and 
> the submit button is called 'submit'. 
>
> Now a client wants to use wget or curl to get the file: 
>
> wget http://my.host.name/clever_view.pdf 
>
> However, all I get are 403 even when I POST the username and password, 
> save the cookies and keep the session cookies. 
>
> So in short, how do I access a view when session and csrftoken cookies 
> are required. 
>
> If someone could show me an example of using curl or wget to access a 
> view that is not wrapped with @csrf_exempt but is wrapped with 
> @login_required I would be very grateful indeed. 
>
> Thanks in advance 
>
> Dave 
>
>

-- 
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/a4bd863c-aa3c-45fd-bf0a-54acd5a8b8b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-04 Thread Florian Schweikert
On 03/12/14 16:36, Shashwat singh wrote:
> Django is properly installed but when i try to create a new project ---
> " django-admin.py startproject abc " it returns ^^ that error. 
> Any help will be highly appreciated.

starting new project with name abc throws the my_project.settings not
found? Then there is something wrong with the env_variables of your shell.

-- Florian

-- 
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/548085D4.7000504%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Redirect not working

2014-12-04 Thread jogaserbia
Hi,  

I am trying to build a simple app.  On the index.html page an input box and 
button.  I put address in, click box to geocode and output some maps.  When 
I click on the button, the geocoding seems to work (see chrome output 
below), but it does not bring up the testing URL.   

This is what I get from chrome when I click on the button in the 
index.html, but nothing else happens. I bolded what I believe should 
redirect to the testing UR with the lng and lat data.   



   1. Request URL:
   
   
https://maps.googleapis.com/maps/api/js/AuthenticationService.Authenticate?1shttp%3A%2F%2F127.0.0.1%3A8000%2F&5e1&callback=_xdc_._fzm3dd&token=7767
   2. Request Method:
   GET
   3. Status Code:
   200 OK
   4. 


Any ideas would be helpful. 

Ivan

   1. 
   
*index.html*
...


 


var geocoder

function searchAddress()

{
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
  if (status == google.maps.GeocoderStatus.OK) {
  *   $.get("{% url 'testing' %}",*
 var position: results[0].geometry.location
   {
lat: position.lat(),
lng: position.lng()
}

});
  } else {
alert("Geocode was not successful for the following reason: " + 
status);
  }
});
  }


 







*APP\urls.py *

urlpatterns = [
   url(r'^$', views.index, name='index'),
   url(r'^output/$', views.output, name='output'),
   url(r'^testing/$', views.testing, name='testing'),
   ]


*views.py*


def index(request):
return render(request, 'locator/index.html')   



def testing(request):
searchpoint = Point(float(request.GET.get('lon')), 
float(request.GET.get('lat')))
atminfo = AtmInfo.objects.all()[:3]
locations = 
AtmInfo.objects.distance(searchpoint).transform().order_by('distance')[:3]
context = {'atminfo': atminfo, 'locations': locations, 'mainpnt': 
mainpoint}
return render(request, 'locator/testing.html', context)



-- 
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/6b386a6d-70df-4de0-8be2-43897ce7ce07%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-04 Thread jogaserbia
Are you trying to set it up in a virtualenv?  

On Wednesday, December 3, 2014 10:36:34 AM UTC-5, Shashwat singh wrote:
>
> Django is properly installed but when i try to create a new project --- " 
> django-admin.py startproject abc " it returns ^^ that error. 
> Any help will be 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/67e4f1e0-0e9c-4745-895f-43ee38af4204%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect not working

2014-12-04 Thread Florian Schweikert
On 04/12/14 18:58, jogaserbia wrote:
> This is what I get from chrome when I click on the button in the
> index.html, but nothing else happens. I bolded what I believe should
> redirect to the testing UR with the lng and lat data.   

does it work with hardcoded url?
is the testing url in the rendered index.html?
if the javascript doesn't try to load the testing url there is something
wrong with your js.
Maybe $.get is supposed to get a success function as parameter? (wild
guessing, I'm not a js guy)

and why "redirect not working"? Can't see any redirects in your code.

-- Florian

-- 
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/5480A5BA.6070903%40ist-total.org.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Mysql connector python 3

2014-12-04 Thread Andreas Kuhne
Hi all,

We went live with a new website, completely rewritten in python 3 and with
django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course
there were some minor issues, but most of them have been resolved and so
far everything is working really nice.

HOWEVER... We are having major issues with the mysql-connector-python pip
package. We are running the latest stable version (2.0.2), but it seems as
if the connector looses it's connection every now and then. This is really
irritating as it can happen 10-15 times / day. This means that a lot of our
customers are probably having problems. The exception we are getting is:
mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL
server during query

We are running on AWS with a RDS instance for the mysql server. This worked
perfectly in our previous configuration with python 2.7 and the mysqldb
connector.

Is mysql-connector-python not ready for a production system? Is there
anyone else who has had the same problems?

Is there any other python 3 compatible connector that we can use instead?
We are also using south, so it has to be compatible with south as well.

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


Re: Mysql connector python 3

2014-12-04 Thread François Schiettecatte
Andreas

Are your sql queries taking a very long time or is this for quick queries. 
Places to start would be to check that CONN_MAX_AGE in settings.py is less than 
wait_timeout in my.cnf. You could also check slow query log in MySQL. 

I ran into this issue but with a different setup, Django 1.6, Python 2.7 and 
MySQL-python 1.2.3, but this was specifically when I upgraded from Django 1.5 
to 1.6 and the introduction of CONN_MAX_AGE.

François

> On Dec 4, 2014, at 1:49 PM, Andreas Kuhne  wrote:
> 
> Hi all,
> 
> We went live with a new website, completely rewritten in python 3 and with 
> django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> there were some minor issues, but most of them have been resolved and so far 
> everything is working really nice.
> 
> HOWEVER... We are having major issues with the mysql-connector-python pip 
> package. We are running the latest stable version (2.0.2), but it seems as if 
> the connector looses it's connection every now and then. This is really 
> irritating as it can happen 10-15 times / day. This means that a lot of our 
> customers are probably having problems. The exception we are getting is:
> mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL server 
> during query
> 
> We are running on AWS with a RDS instance for the mysql server. This worked 
> perfectly in our previous configuration with python 2.7 and the mysqldb 
> connector. 
> 
> Is mysql-connector-python not ready for a production system? Is there anyone 
> else who has had the same problems? 
> 
> Is there any other python 3 compatible connector that we can use instead? We 
> are also using south, so it has to be compatible with south as well.
> 
> 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/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%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/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-04 Thread Andreas Kuhne
François,

Thanks for your answer. I will check the settings. The problem we have had
is that it seems to be on ANY query, both those that take a long time and
those that take a short time. But I'll check.

Being an RDS instance it's not easy for me to get the my.cnf file, but I
should be able to see the settings somehow.

Thanks again,

Andréas

2014-12-04 19:58 GMT+01:00 François Schiettecatte 
:

> Andreas
>
> Are your sql queries taking a very long time or is this for quick queries.
> Places to start would be to check that CONN_MAX_AGE in settings.py is less
> than wait_timeout in my.cnf. You could also check slow query log in MySQL.
>
> I ran into this issue but with a different setup, Django 1.6, Python 2.7
> and MySQL-python 1.2.3, but this was specifically when I upgraded from
> Django 1.5 to 1.6 and the introduction of CONN_MAX_AGE.
>
> François
>
> > On Dec 4, 2014, at 1:49 PM, Andreas Kuhne 
> wrote:
> >
> > Hi all,
> >
> > We went live with a new website, completely rewritten in python 3 and
> with django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of
> course there were some minor issues, but most of them have been resolved
> and so far everything is working really nice.
> >
> > HOWEVER... We are having major issues with the mysql-connector-python
> pip package. We are running the latest stable version (2.0.2), but it seems
> as if the connector looses it's connection every now and then. This is
> really irritating as it can happen 10-15 times / day. This means that a lot
> of our customers are probably having problems. The exception we are getting
> is:
> > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL
> server during query
> >
> > We are running on AWS with a RDS instance for the mysql server. This
> worked perfectly in our previous configuration with python 2.7 and the
> mysqldb connector.
> >
> > Is mysql-connector-python not ready for a production system? Is there
> anyone else who has had the same problems?
> >
> > Is there any other python 3 compatible connector that we can use
> instead? We are also using south, so it has to be compatible with south as
> well.
> >
> > 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/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%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/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbmQGv-gDSZiRO6ycuCDCdv6XrJAuuN7GSi3W%3D2NZtcZNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-04 Thread François Schiettecatte
Andréas

Django 1.6 introduced persistent connections:


https://docs.djangoproject.com/en/dev/ref/databases/#persistent-database-connections

The problem is that the mysql is dropping the connection while it is still in 
the pool on the django side (I have run into this with Java connection pools 
too, its a common gotcha). 

You might also want to check this:

https://code.djangoproject.com/ticket/21597

I just found when I was looking at a hack I had to put in because a very long 
running script was always triggering this issue.

François

> On Dec 4, 2014, at 2:03 PM, Andreas Kuhne  wrote:
> 
> François,
> 
> Thanks for your answer. I will check the settings. The problem we have had is 
> that it seems to be on ANY query, both those that take a long time and those 
> that take a short time. But I'll check. 
> 
> Being an RDS instance it's not easy for me to get the my.cnf file, but I 
> should be able to see the settings somehow.
> 
> Thanks again,
> 
> Andréas
> 
> 2014-12-04 19:58 GMT+01:00 François Schiettecatte :
> Andreas
> 
> Are your sql queries taking a very long time or is this for quick queries. 
> Places to start would be to check that CONN_MAX_AGE in settings.py is less 
> than wait_timeout in my.cnf. You could also check slow query log in MySQL.
> 
> I ran into this issue but with a different setup, Django 1.6, Python 2.7 and 
> MySQL-python 1.2.3, but this was specifically when I upgraded from Django 1.5 
> to 1.6 and the introduction of CONN_MAX_AGE.
> 
> François
> 
> > On Dec 4, 2014, at 1:49 PM, Andreas Kuhne  
> > wrote:
> >
> > Hi all,
> >
> > We went live with a new website, completely rewritten in python 3 and with 
> > django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> > there were some minor issues, but most of them have been resolved and so 
> > far everything is working really nice.
> >
> > HOWEVER... We are having major issues with the mysql-connector-python pip 
> > package. We are running the latest stable version (2.0.2), but it seems as 
> > if the connector looses it's connection every now and then. This is really 
> > irritating as it can happen 10-15 times / day. This means that a lot of our 
> > customers are probably having problems. The exception we are getting is:
> > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL 
> > server during query
> >
> > We are running on AWS with a RDS instance for the mysql server. This worked 
> > perfectly in our previous configuration with python 2.7 and the mysqldb 
> > connector.
> >
> > Is mysql-connector-python not ready for a production system? Is there 
> > anyone else who has had the same problems?
> >
> > Is there any other python 3 compatible connector that we can use instead? 
> > We are also using south, so it has to be compatible with south as well.
> >
> > 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/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%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/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/CALXYUbmQGv-gDSZiRO6ycuCDCdv6XrJAuuN7GSi3W%3D2NZtcZNA%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 t

Re: Redirect not working

2014-12-04 Thread jogaserbia
Thanks for the reply Florian.

I am unclear on what exactly does the redirecting.  I think you are right 
about the .get. I stripped it out of the code, same issue.  You say there 
is no redirect, I am unclear on what exactly should be doing the 
redirecting.  

What has to be in the index.html to be able to call the testing view?  

Much appreciated.

Ivan


On Thursday, December 4, 2014 1:20:15 PM UTC-5, Florian Schweikert wrote:
>
> On 04/12/14 18:58, jogaserbia wrote: 
> > This is what I get from chrome when I click on the button in the 
> > index.html, but nothing else happens. I bolded what I believe should 
> > redirect to the testing UR with the lng and lat data.   
>
> does it work with hardcoded url? 
> is the testing url in the rendered index.html? 
> if the javascript doesn't try to load the testing url there is something 
> wrong with your js. 
> Maybe $.get is supposed to get a success function as parameter? (wild 
> guessing, I'm not a js guy) 
>
> and why "redirect not working"? Can't see any redirects in your code. 
>
> -- Florian 
>
>

-- 
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/f199469e-b3c5-4576-a4b1-dc469ccb6752%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-04 Thread Andreas Kuhne
François,

I hear what you are saying, checked the doc's and as far as I can see I
don't have any MAX_CONN_AGE defined (i.e. it should be 0, which means no
connection pooling). But what I see here is that there could be an issue
even though it should be 0. I'll have to give it a try.

Thanks again,

Andréas

2014-12-04 20:14 GMT+01:00 François Schiettecatte 
:

> Andréas
>
> Django 1.6 introduced persistent connections:
>
>
> https://docs.djangoproject.com/en/dev/ref/databases/#persistent-database-connections
>
> The problem is that the mysql is dropping the connection while it is still
> in the pool on the django side (I have run into this with Java connection
> pools too, its a common gotcha).
>
> You might also want to check this:
>
> https://code.djangoproject.com/ticket/21597
>
> I just found when I was looking at a hack I had to put in because a very
> long running script was always triggering this issue.
>
> François
>
> > On Dec 4, 2014, at 2:03 PM, Andreas Kuhne 
> wrote:
> >
> > François,
> >
> > Thanks for your answer. I will check the settings. The problem we have
> had is that it seems to be on ANY query, both those that take a long time
> and those that take a short time. But I'll check.
> >
> > Being an RDS instance it's not easy for me to get the my.cnf file, but I
> should be able to see the settings somehow.
> >
> > Thanks again,
> >
> > Andréas
> >
> > 2014-12-04 19:58 GMT+01:00 François Schiettecatte <
> fschietteca...@gmail.com>:
> > Andreas
> >
> > Are your sql queries taking a very long time or is this for quick
> queries. Places to start would be to check that CONN_MAX_AGE in settings.py
> is less than wait_timeout in my.cnf. You could also check slow query log in
> MySQL.
> >
> > I ran into this issue but with a different setup, Django 1.6, Python 2.7
> and MySQL-python 1.2.3, but this was specifically when I upgraded from
> Django 1.5 to 1.6 and the introduction of CONN_MAX_AGE.
> >
> > François
> >
> > > On Dec 4, 2014, at 1:49 PM, Andreas Kuhne 
> wrote:
> > >
> > > Hi all,
> > >
> > > We went live with a new website, completely rewritten in python 3 and
> with django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of
> course there were some minor issues, but most of them have been resolved
> and so far everything is working really nice.
> > >
> > > HOWEVER... We are having major issues with the mysql-connector-python
> pip package. We are running the latest stable version (2.0.2), but it seems
> as if the connector looses it's connection every now and then. This is
> really irritating as it can happen 10-15 times / day. This means that a lot
> of our customers are probably having problems. The exception we are getting
> is:
> > > mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL
> server during query
> > >
> > > We are running on AWS with a RDS instance for the mysql server. This
> worked perfectly in our previous configuration with python 2.7 and the
> mysqldb connector.
> > >
> > > Is mysql-connector-python not ready for a production system? Is there
> anyone else who has had the same problems?
> > >
> > > Is there any other python 3 compatible connector that we can use
> instead? We are also using south, so it has to be compatible with south as
> well.
> > >
> > > 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/CALXYUbmZYaEhoyt5OCWd_F47a0LbkuQRJ3pjJL3vz98Y6hwZNA%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/9358A368-FA33-462F-AE58-DB3F86D1A7AC%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com.
> > To post to this group, send email to django-users@googlegroups.com.
> > Visit this group at http://groups.google.com/group/django-users.
> > To view this discussion on the web visit
> https://g

Re: Mysql connector python 3

2014-12-04 Thread Michael Pöhn
On 2014-12-04 20:03, Andreas Kuhne wrote:
> Being an RDS instance it's not easy for me to get the my.cnf file, but
> I should be able to see the settings somehow.
You may use the MySQL Statement: show variables; for listing most
configuration properties, wait_timeout included.

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


Re: Mysql connector python 3

2014-12-04 Thread Andreas Kuhne
I now checked the RDS settings and set a CONN_MAX_AGE on the database
connection. Previously the connections were being terminated after use, so
it probably took a while to get information from the database (so
CONN_MAX_AGE was 0). I could see this in the number of connections that are
on the server now, which have increased greatly. I will try the
configuration this way and see if any change happens.

I am not completely convinced that this is the issue though

Thanks for all the information so far!

Regards,

Andréas

2014-12-04 20:21 GMT+01:00 Michael Pöhn :

> On 2014-12-04 20:03, Andreas Kuhne wrote:
> > Being an RDS instance it's not easy for me to get the my.cnf file, but
> > I should be able to see the settings somehow.
> You may use the MySQL Statement: show variables; for listing most
> configuration properties, wait_timeout included.
>
> br.
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/5480B425.30209%40fsfe.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUb%3D383AOE1xd1L1G_M%3D6gaAw5aHAoUNMX6_fDzNobSch2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to pass request.user in .hbs file in django

2014-12-04 Thread JAI PRAKASH SINGH
hi

actuall when i pass simple static value it shhows it in .hbs file
(user: = "jai prakash singh") but when i pass request.user it show
none (user:request.user) i think u r right  , i should passs in
serialise format. thank you let me try, and i will send u what is the
response

thank you again for answer

On 12/4/14, Collin Anderson  wrote:
> Hi,
>
> What happens when you try?
>
> You may need to "serialize" the individual attributes of user, or just
> return request.user.username.
>
> Django has some tools to help you serialize models.
> https://docs.djangoproject.com/en/dev/topics/serialization/
>
> Collin
>
>
> On Tuesday, December 2, 2014 11:57:10 PM UTC-5, JAI PRAKASH SINGH wrote:
>>
>> sir,
>>
>>thank you for reply. but actually this mistake was while posting , in
>>
>> my actual code  request.user is present .
>>so please if some more  guidance from your side please share ...
>>
>> On Tue, Dec 2, 2014 at 7:16 PM, Jerry Dumblauskas > > wrote:
>>
>>> missing the t? reques.user to request.user
>>>
>>> On Tue, Dec 2, 2014 at 7:42 AM, JAI PRAKASH SINGH >>
>>> > wrote:
>>>
 hello all,

 i am very new to django , i have just started to work on django ,

 i am using .hbs file in django project
 my aim is to use request.user in .hbs file

 i am trying this ...
 not working



 ***view.py
 data_dict = {...
 'user':reques.user,
 # not working # but stacin name working like user:
 "jp"
...}

 content_type = 'application/json'
 return HttpResponse(json.dumps(data_dict), content_type)


 ***.hbs
 file*


  *{{response.user}}*NO
 RATING



 



  --
 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/3a08e636-78ac-4342-8577-816ac25a29e9%40googlegroups.com

 
 .
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>  --
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/rxIIoZ0dGLY/unsubscribe.
>>> To unsubscribe from this group and all its topics, 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/CA%2BG_OOsDz5NJdNXGkHi8Y0gUZ1GwdSb%3DouSVPzdz68AiC27bVg%40mail.gmail.com
>>>
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/rxIIoZ0dGLY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/e5b3c665-42f3-40df-9d84-f13e211707d2%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/CAGtuQrgNL8dpF39pOLmOcWTbjAFSz%2BCVcFUiU3PsamionKHwig%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect not working

2014-12-04 Thread jogaserbia
I now realize that the button type input does not automatically submit a 
form in all browsers.  I changed the button type to submit, and it worked 
to call the testing view.

  
 
 



Thanks for pointing me in the right direction.   Now I am going to try to 
get the data from the function passed to the testing view.  

>
> Ivan
>
>
> On Thursday, December 4, 2014 1:20:15 PM UTC-5, Florian Schweikert wrote:
>>
>> On 04/12/14 18:58, jogaserbia wrote: 
>> > This is what I get from chrome when I click on the button in the 
>> > index.html, but nothing else happens. I bolded what I believe should 
>> > redirect to the testing UR with the lng and lat data.   
>>
>> does it work with hardcoded url? 
>> is the testing url in the rendered index.html? 
>> if the javascript doesn't try to load the testing url there is something 
>> wrong with your js. 
>> Maybe $.get is supposed to get a success function as parameter? (wild 
>> guessing, I'm not a js guy) 
>>
>> and why "redirect not working"? Can't see any redirects in your code. 
>>
>> -- Florian 
>>
>>

-- 
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/01f8e16a-85bd-4379-9421-d69e0857ef3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Postgresql Triggers and Django

2014-12-04 Thread Philip Haynes
Hi,
I have tracked back through the messages in this group and examined the 
documentation for version 1.7 of Django and I have a question.

The 1.7 documentation 
(https://docs.djangoproject.com/en/1.7/howto/initial-data/) 
describes the "Providing initial SQL data" functionality as deprecated. Is 
that referring to using this hook for any SQL processing or just for the 
loading of initial data? From the phrasing in the documentation it is not 
clear to me if the entire hook for loading SQL code after the CREATE TABLE 
statement is deprecated or whether it is just deprecated for initial data. 
The deprecation comment refers to using Migrations to achieve the purpose, 
I can do that, its just a bit more inconvenient than loading my sql 
directly.

FWIW, my goal is to insert triggers into a few places in the database. I 
would prefer triggers because I have non-Django processes that can interact 
with the database and it is most robust for me to have the RDBMS itself 
perform the work.

Anybody have a definitive understanding of the deprecation of the hook for 
loading app/.sql ?

Thanks
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/02579470-4f77-43ce-b765-30ad2c53a03f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgresql Triggers and Django

2014-12-04 Thread Andreas Kuhne
Hi Philip,

I ran into this problem earlier today actually. The problem is that you
can't provide initial data for populating the models (or tables). That's
what this refers to. To provide initial data, you have to run a migration.

The initial-data information is only for loading the database with
information (default users and so on), not for running arbitrary sql code.
I think if you want to do that you will have to have a data migration,
which you can run when the initial migration is run.

Regards,

Andréas

2014-12-04 22:28 GMT+01:00 Philip Haynes :

> Hi,
> I have tracked back through the messages in this group and examined the
> documentation for version 1.7 of Django and I have a question.
>
> The 1.7 documentation (https://docs.
> djangoproject.com/en/1.7/howto/initial-data/) describes the "Providing
> initial SQL data" functionality as deprecated. Is that referring to using
> this hook for any SQL processing or just for the loading of initial data?
> From the phrasing in the documentation it is not clear to me if the entire
> hook for loading SQL code after the CREATE TABLE statement is deprecated or
> whether it is just deprecated for initial data. The deprecation comment
> refers to using Migrations to achieve the purpose, I can do that, its just
> a bit more inconvenient than loading my sql directly.
>
> FWIW, my goal is to insert triggers into a few places in the database. I
> would prefer triggers because I have non-Django processes that can interact
> with the database and it is most robust for me to have the RDBMS itself
> perform the work.
>
> Anybody have a definitive understanding of the deprecation of the hook for
> loading app/.sql ?
>
> Thanks
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/02579470-4f77-43ce-b765-30ad2c53a03f%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/CALXYUbnxL2p%2BQz5cPVaR5d2VeizsbgXKNVZ9uQdrgTeg3f7DrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-04 Thread inoyon artlover KLANGRAUSCH
Hi there, I got a following Form-Class:


class CustomUserprofileInterestsForm(forms.ModelForm):

interests = forms.ModelMultipleChoiceField(
queryset=Interests.objects.all(),
widget=forms.CheckboxSelectMultiple)


I want to limit the choices for example to 6 of all displayed. 
Is it possible with some optional arguments I don't know somehow?

Best regards.. cheers!

-- 
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/56b7-f23a-4ee4-96b5-d3e919ecf467%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Postgresql Triggers and Django

2014-12-04 Thread Carl Meyer
Hi Philip,

On 12/04/2014 02:28 PM, Philip Haynes wrote:
> Hi,
> I have tracked back through the messages in this group and examined the 
> documentation for version 1.7 of Django and I have a question.
> 
> The 1.7 documentation 
> (https://docs.djangoproject.com/en/1.7/howto/initial-data/) 
> describes the "Providing initial SQL data" functionality as deprecated. Is 
> that referring to using this hook for any SQL processing or just for the 
> loading of initial data? From the phrasing in the documentation it is not 
> clear to me if the entire hook for loading SQL code after the CREATE TABLE 
> statement is deprecated or whether it is just deprecated for initial data. 
> The deprecation comment refers to using Migrations to achieve the purpose, 
> I can do that, its just a bit more inconvenient than loading my sql 
> directly.
> 
> FWIW, my goal is to insert triggers into a few places in the database. I 
> would prefer triggers because I have non-Django processes that can interact 
> with the database and it is most robust for me to have the RDBMS itself 
> perform the work.
> 
> Anybody have a definitive understanding of the deprecation of the hook for 
> loading app/.sql ?

The entire mechanism is deprecated in favor of using a migration with a
RunSQL operation. Already in 1.7, for any app using migrations, initial
SQL files will be ignored.

In a world in which database tables are constructed entirely via
migrations (which is already the case for any app with migrations, and
will be the case for all apps in Django 1.9), the initial-SQL feature
just doesn't make sense: it duplicates the RunSQL operation, and it is
unclear when in the chain of migrations it would be expected to run.

Carl

-- 
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/5480D885.8090908%40oddbird.net.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: OpenPGP digital signature


Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-04 Thread Larry Martell
On Thu, Dec 4, 2014 at 4:54 PM, inoyon artlover KLANGRAUSCH
 wrote:
> Hi there, I got a following Form-Class:
>
>
> class CustomUserprofileInterestsForm(forms.ModelForm):
>
> interests = forms.ModelMultipleChoiceField(
> queryset=Interests.objects.all(),
> widget=forms.CheckboxSelectMultiple)
>
>
> I want to limit the choices for example to 6 of all displayed.
> Is it possible with some optional arguments I don't know somehow?
>

You can write your own clean method on the form, e.g.:

def clean_interests(self):
value = self.cleaned_data['interests']
if len(value) > 6:
raise forms.ValidationError("You can't select more than 6 items.")
return value

See: 
https://docs.djangoproject.com/en/1.7/ref/forms/validation/#form-and-field-validation

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


Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-04 Thread inoyon artlover KLANGRAUSCH
Great, it works with one form but not with an another... 
Btw. how is it possible to overwrite the 'this field is required' error 
message?

Many thanks and best regards! :)

Am Donnerstag, 4. Dezember 2014 23:01:15 UTC+1 schrieb larry@gmail.com:
>
> On Thu, Dec 4, 2014 at 4:54 PM, inoyon artlover KLANGRAUSCH 
> > wrote: 
> > Hi there, I got a following Form-Class: 
> > 
> > 
> > class CustomUserprofileInterestsForm(forms.ModelForm): 
> > 
> > interests = forms.ModelMultipleChoiceField( 
> > queryset=Interests.objects.all(), 
> > widget=forms.CheckboxSelectMultiple) 
> > 
> > 
> > I want to limit the choices for example to 6 of all displayed. 
> > Is it possible with some optional arguments I don't know somehow? 
> > 
>
> You can write your own clean method on the form, e.g.: 
>
> def clean_interests(self): 
> value = self.cleaned_data['interests'] 
> if len(value) > 6: 
> raise forms.ValidationError("You can't select more than 6 items.") 
> return value 
>
> See: 
> https://docs.djangoproject.com/en/1.7/ref/forms/validation/#form-and-field-validation
>  
>

-- 
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/9dcabe06-d3e1-44e1-80a0-f17bcff48a89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-04 Thread Larry Martell
On Thu, Dec 4, 2014 at 6:46 PM, inoyon artlover KLANGRAUSCH
 wrote:
> Great, it works with one form but not with an another...
> Btw. how is it possible to overwrite the 'this field is required' error
> message?

You can provide your custom set of default errors to the form field
definition, e.g.:

my_default_errors = {
'required': 'You better enter this field!',
'invalid': 'You can do better than that!'
}

class MyForm(forms.Form):
some_field = forms.CharField(error_messages=my_default_errors)


>
> Many thanks and best regards! :)
>
> Am Donnerstag, 4. Dezember 2014 23:01:15 UTC+1 schrieb larry@gmail.com:
>>
>> On Thu, Dec 4, 2014 at 4:54 PM, inoyon artlover KLANGRAUSCH
>>  wrote:
>> > Hi there, I got a following Form-Class:
>> >
>> >
>> > class CustomUserprofileInterestsForm(forms.ModelForm):
>> >
>> > interests = forms.ModelMultipleChoiceField(
>> > queryset=Interests.objects.all(),
>> > widget=forms.CheckboxSelectMultiple)
>> >
>> >
>> > I want to limit the choices for example to 6 of all displayed.
>> > Is it possible with some optional arguments I don't know somehow?
>> >
>>
>> You can write your own clean method on the form, e.g.:
>>
>> def clean_interests(self):
>> value = self.cleaned_data['interests']
>> if len(value) > 6:
>> raise forms.ValidationError("You can't select more than 6 items.")
>> return 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7MPWAchM0cFiKncTFxf7UYcb%3DDdck%3DXkKfraJybG5-NA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Python/Django programmers needed (telecommute)...

2014-12-04 Thread Fred Stluka

Django programmers,

Interested in a telecommute position for $80-100K/year?

I just forwarded this one to my "Job Wanted" and "Consultants"
mailing lists.  See email appended below.

Also, for anyone local to Philadelphia PA, I expect to be
recruiting onto my own team in about a month or so.
Telecommute with weekly status meetings in Radnor PA,
and ad-hoc local co-working sessions with the dev team.

Interested in either one, please let me know.

--Fred

Fred Stluka -- mailto:f...@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.



 Forwarded Message 
Subject:Python/Django programmer needed (telecommute)...
Date:   Thu, 4 Dec 2014 18:46:36 -0500 (EST)
From:   f...@bristle.com
To: f...@bristle.com



Job seekers and Consultants,

I'm hesitant to send this one out because I'm going to be trying
to recruit such people onto my own team in another month or so,
and I'd hate to lose the best of you to this guy, but...

It seems like a good offer.  The salary is pretty low, but the
rest of the job description sounds really appealing, and maybe
the right guy can get them to double the salary to get it up to
market rate.  So it would be selfish of me to not at least tell
you about it.

- Senior Python/Django programmer
- Educational software product company, start-up, college portal
  product, successful at one college and rolling it out across the
  country.
- Skills:
  - Python/Django
  - FOSS
  - Agile, demonstrative excellence, code quality, peer code reviews
  - Proficient and proactive communicator both written and oral
  - Python MVC frameworks: Django, Pyramid, Flask
  - Memcached, Celery
  - TDD, PyLint, Nose, Twill, Mechanize, Selenium
  - Jenkins, Bamboo
  - REST, Django-Rest-Framework, Tastypie, Web services
  - Django's ORM, SQLAlchemy, MySQL, PostgreSQL, MongoDB, DynamoDB
  - JSON, HTML5
  - JavaScript, jQuery, Ajax
  - RWD (Responsive Web Design), Bootstrap
  - Cloud, AWS S3, EC2, CloudFront, Route53, CloudFormation
  - Git
  - Redis, MongoDB
  - Salt, Ansible
  - DevOps
  - Node.JS
  - Ember.js, Backbone.js
  - ElasticSearch, Solr, Haystack
- Consultant becoming FTE (right to hire)
- 6+ months
- $80-100K/year
- Telecommute with 1-2 weeks/year onsite in Indianapolis

Interested?  Let me know.

--Fred
-
Fred Stluka -- mailto:f...@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.
-

Fred,

Thank you for your detailed response and good luck with your project.

I'll attempt to answer your questions and anyone interested can
contact me for more details -- thanks!

Some questions I always ask (some of which were answered
in your attached job description):
- Brief description of the company, what it does, what the
   work environment is like, etc?

Educational software product company, start-up, college portal
product that was successful at one college and rolling it out
across the country.

- Brief description of the responsibilities of the position you
   are trying to fill?

See JD, mid-senior level, some mentoring/coaching of junior
developers

- Technologies used and skills needed?

See JD

- Consultant or FTE?

Consultant at first under my firm, then fulltime with my client

- Full time or part time?

Fulltime

- How long is the initial contract?

6-month contract to hire, more or less based on client preference

- How long is the project likely to run?

Fulltime position after contract

- Approx salary or hourly rate offered?

Salary in the $80-100K for fulltime, some leeway higher if needed,
salary converted to hourly for contract period

- Location (Philly, western suburbs, Wilmington, telecommute, etc.)?

Telecommuting, client is located in Indy, occasional travel to
Indy required but should not exceed 1-2 weeks annually, 1-2 weeks
onsite at start of contract to meet team/etc.



Wow!  That is a REALLY good match for my skills and interests!

I particularly like these aspects (almost everything you described
-- my friends would say you wrote the job description for me
personally):

- Python/Django
- Telecommute
- Demonstrative excellence
- Participation in the open source community
- Provides expert knowledge and guides best practice
- Fanatically documents all code via docstrings and Sphinx
- Increases test coverage via Test Driven Development
- Writes unit tests
- Actively ensures code quality and conformance
- Improves UX via best practice

Re: How to set choice limit of given number on ModelMultipleChoiceField in Django?

2014-12-04 Thread inoyon artlover KLANGRAUSCH
Very cool! :) Many thanks, once more! :) Could be off-topic, but there is 
somethin more tricky:
Before a ManyToManyField there is one ForeignKeyField which has few of the 
same values. 
So the ForeignKey-value has to be excluded from the ManyToMany choices. For 
example 
the ForeignKey selection (labeld as: additional values) could trigger on 
submit a queryset and 
a view colud display the filterd ManyToManyField... (btw. I am very new to 
python/django so..
try'n error is the tedious way to go since two month... )


Am Freitag, 5. Dezember 2014 00:52:18 UTC+1 schrieb larry@gmail.com:
>
> On Thu, Dec 4, 2014 at 6:46 PM, inoyon artlover KLANGRAUSCH 
> > wrote: 
> > Great, it works with one form but not with an another... 
> > Btw. how is it possible to overwrite the 'this field is required' error 
> > message? 
>
> You can provide your custom set of default errors to the form field 
> definition, e.g.: 
>
> my_default_errors = { 
> 'required': 'You better enter this field!', 
> 'invalid': 'You can do better than that!' 
> } 
>
> class MyForm(forms.Form): 
> some_field = forms.CharField(error_messages=my_default_errors) 
>
>
> > 
> > Many thanks and best regards! :) 
> > 
> > Am Donnerstag, 4. Dezember 2014 23:01:15 UTC+1 schrieb 
> larry@gmail.com: 
> >> 
> >> On Thu, Dec 4, 2014 at 4:54 PM, inoyon artlover KLANGRAUSCH 
> >>  wrote: 
> >> > Hi there, I got a following Form-Class: 
> >> > 
> >> > 
> >> > class CustomUserprofileInterestsForm(forms.ModelForm): 
> >> > 
> >> > interests = forms.ModelMultipleChoiceField( 
> >> > queryset=Interests.objects.all(), 
> >> > widget=forms.CheckboxSelectMultiple) 
> >> > 
> >> > 
> >> > I want to limit the choices for example to 6 of all displayed. 
> >> > Is it possible with some optional arguments I don't know somehow? 
> >> > 
> >> 
> >> You can write your own clean method on the form, e.g.: 
> >> 
> >> def clean_interests(self): 
> >> value = self.cleaned_data['interests'] 
> >> if len(value) > 6: 
> >> raise forms.ValidationError("You can't select more than 6 
> items.") 
> >> return 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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/359a4ef8-5fa2-498e-ad33-127cc48cbe66%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Generic Views and Django.contrib.auth

2014-12-04 Thread Rootz
Thanks . It work using both the name and namespaces.

On Thursday, December 4, 2014 8:45:27 AM UTC-5, Collin Anderson wrote:
>
> Hi,
>
> Not sure about namespaces, but you can certainly use name:
>
> urlpatterns = patterns('',
> url(r'^about/', login_required(AboutView.as_view()), name='about'),
> )
>
> Or better yet, patterns() is deprecated so:
>
> urlpatterns = [
> url(r'^about/', login_required(AboutView.as_view()), name='about'),
> ]
>
> Collin
>
> On Wednesday, December 3, 2014 10:13:24 AM UTC-5, Rootz wrote:
>>
>> URL Reversing the view where login is required.
>>
>> On Tuesday, December 2, 2014 10:05:35 PM UTC-5, Collin Anderson wrote:
>>>
>>> Hi,
>>>
>>> It's probably possible. Do you mean url reversing the login view, or url 
>>> reversing the view where login is required?
>>>
>>> Collin
>>>
>>> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote:

 Hi can this work with url reversing namespaced urls?
 thanks

 On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote:
>
> If you are usign class based generic views you can use the decorators 
> in the URL config of your app, for example
>
> urlpatterns = patterns('',
> (r'^about/', login_required(AboutView.as_view())),
> )
>
>
> On Thu, Oct 16, 2014 at 12:49 PM, Rootz  wrote:
>
>> Can I use both Generic View and the Django.contrib.auth features 
>> (such as login_required decorator and other auth interface tool)? And if 
>> it 
>> is not possible to integrate auth into Generic Views then can you 
>> recommend 
>> alternative way of making the two work together? Adding to this I am 
>> using 
>> Django 1.7v and python 3.4v. 
>>
>> 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...@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/09fe215a-4572-418c-959f-567e9ab05b0b%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/9888440b-f10a-4474-bb37-595e612b3310%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django shell not respecting vi editing-mode in .inputrc

2014-12-04 Thread Michael Scheper

G'day peeps,

I somehow missed the Django shell (python manage.py shell) until 
somebody quite new to Django showed it to me. It's pretty and seems to 
have some nice tricks, but the vi editing commands I expect aren't 
working when I run it in my own environment.


The normal Python interpreter uses readline 
, and thus respects 
'set editing-mode vi' (and other settings) in my ~/.inputrc file. Can I 
get the Django shell to do the same, or do I just need to type 
django.setup() in the normal interpreter?


Thanks,
Michael Scheper.

--
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/54811A8D.4070202%40michaelscheper.com.
For more options, visit https://groups.google.com/d/optout.


Re: Mysql connector python 3

2014-12-04 Thread Collin Anderson
Hi Andréas,

If it helps, mysqlclient (python3-compatible fork of mysqldb) is Django's 
recommended connector/driver.

https://pypi.python.org/pypi/mysqlclient
https://docs.djangoproject.com/en/dev/ref/databases/#mysql-db-api-drivers

Collin


On Thursday, December 4, 2014 1:50:09 PM UTC-5, Andréas Kühne wrote:
>
> Hi all,
>
> We went live with a new website, completely rewritten in python 3 and with 
> django 1.6 (upgrade to 1.7 is in progress) on November the 18th. Of course 
> there were some minor issues, but most of them have been resolved and so 
> far everything is working really nice.
>
> HOWEVER... We are having major issues with the mysql-connector-python pip 
> package. We are running the latest stable version (2.0.2), but it seems as 
> if the connector looses it's connection every now and then. This is really 
> irritating as it can happen 10-15 times / day. This means that a lot of our 
> customers are probably having problems. The exception we are getting is:
> mysql.connector.errors.InterfaceError: 2013: Lost connection to MySQL 
> server during query
>
> We are running on AWS with a RDS instance for the mysql server. This 
> worked perfectly in our previous configuration with python 2.7 and the 
> mysqldb connector. 
>
> Is mysql-connector-python not ready for a production system? Is there 
> anyone else who has had the same problems? 
>
> Is there any other python 3 compatible connector that we can use instead? 
> We are also using south, so it has to be compatible with south as well.
>
> 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/8283294e-2d8d-487c-9bb1-f96c06ef46a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Does ticket 19866 apply to Django 1.4

2014-12-04 Thread yakkadesign
 

Does ticket 19866  apply to 
Django 1.4? Reading through the notes, it seems it does but I'm still 
getting a 500 error. If not, is there a way to keep Django from returning a 
500 error.  I've found other people filtering these out.  I don't want to 
filter them out. 


 I've got some hackers trying to exploit the wordpress /xmlrpc.php on my 
Django site. Most of the time they are coming back 404 but there are times 
I'm getting exceptions like:

---Traceback (most recent call last):

  File 
"/usr/local/python2p7/lib/python2.7/site-packages/django/core/handlers/base.py",
 line 87, in get_response
response = middleware_method(request)

  File 
"/usr/local/python2p7/lib/python2.7/site-packages/django/middleware/common.py", 
line 55, in process_request
host = request.get_host()

  File 
"*/usr/local/python2p7/lib/python2.7/site-packages/django/http/*__init__.py", 
line 223, in get_host
"Invalid HTTP_HOST header (you may need to set ALLOWED_HOSTS): %s" % host)

SuspiciousOperation: Invalid HTTP_HOST header (you may need to set 
ALLOWED_HOSTS)http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d1ba4c11-1158-474f-9a4b-91b288d25e93%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-04 Thread Shashwat singh
Django version -- 1, 7, 1

And yes doing this from my home directory.


-- 
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/b3ec99f6-fcfe-4fc2-b9c5-894c38aed415%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem Making New Django project - please help

2014-12-04 Thread Shashwat singh
No , it used to work perfectly on osx mavericks, then i did some stuff with 
opencv and since then i'm getting that error. I've tried each n every 
solution available on internet but nothing seems to solve that problem :/

-- 
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/c6734818-4362-4ac2-aa19-9f7fd5940030%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django development server crash on syntactic or indent error after check

2014-12-04 Thread Mario De Frutos Dieguez
If i understand you correctly, when an error occur the server should not 
stop, instead of that it will print the error trace to let you correct the 
problem but in my case when an error occur the server show the trace and 
stop working or at least it returns to the shell. :S

What i understand reading the official docuementation is that the expected 
behavior is not to exit instead of that the server should show the error 
trace to let you fix it

Am i right?

-- 
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/b341744b-d260-48de-b130-084b4859623e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.