Re: Django's search

2016-03-28 Thread Mario Gudelj
http://stackoverflow.com/questions/3538999/django-admin-search-how-to-override-the-default-handler

On Monday, 28 March 2016,  wrote:

> I need know how change the search that come with Django's Admins.
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/82788600-1519-4347-8634-6420b166ca93%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/CAHqTbjmig0LsoyCj7kH4%3D1TsY5Gwiu3d4FgfewfTaKb9r9nG8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Getting NoReverseMatch at /logout/

2016-03-28 Thread Deepanshu Sagar
Hello,

I am getting below error while clicking on logout button on webpage: 


boardgames/url.py contains: 


main/urls.py and views.py are below. 




please guys, any help is appreciated. 

Regards
Deepanshu

-- 
You received this message because you are subscribed to the Google Groups 
"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/8fbe6e38-84c9-4ccb-b0e1-b91eade1b036%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread monoBOT
That url doesnt exist on your urls.py

looks like you are trying to navigate to "boardgames_home"
when trying to access the "/" url

name is for reverse lookups from inside the django app not for the urls.

2016-03-28 10:49 GMT+01:00 Deepanshu Sagar :

> Hello,
>
> I am getting below error while clicking on logout button on webpage:
>
>
> boardgames/url.py contains:
>
>
> main/urls.py and views.py are below.
>
>
>
>
> please guys, any help is appreciated.
>
> Regards
> Deepanshu
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/8fbe6e38-84c9-4ccb-b0e1-b91eade1b036%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*monoBOT*
Visite mi sitio(Visit my site): monobotsoft.es/blog/

-- 
You received this message because you are subscribed to the Google Groups 
"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%2BxOsGBGYT8QODVwHP5okqt79GnAnJJ_Hag5sH2oyCOu%3DBy8AQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread Deepanshu Sagar
Oh okay, 

So, If I want to navigate to home page, which is at '/', how do it give the 
parameter for this along with next_page key-value pair?

url(r'^logout/$', auth_views.logout, {'next_page': 'boardgames_home'}, 
name='boardgames_logout'),


Thank you for the reply though.

Regards
Deepanshu


On Monday, March 28, 2016 at 4:39:34 PM UTC+5:30, monoBOT monoBOT wrote:

> That url doesnt exist on your urls.py
>
> looks like you are trying to navigate to "boardgames_home"
> when trying to access the "/" url
>
> name is for reverse lookups from inside the django app not for the urls.
>
> 2016-03-28 10:49 GMT+01:00 Deepanshu Sagar  >:
>
>> Hello,
>>
>> I am getting below error while clicking on logout button on webpage: 
>>
>>
>> boardgames/url.py contains: 
>>
>>
>> main/urls.py and views.py are below. 
>>
>>
>>
>>
>> please guys, any help is appreciated. 
>>
>> Regards
>> Deepanshu
>>
>> -- 
>> You received this message because you are subscribed 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/8fbe6e38-84c9-4ccb-b0e1-b91eade1b036%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> *monoBOT*
> Visite mi sitio(Visit my site): monobotsoft.es/blog/
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/ccf6f3ee-34a0-476d-b44f-8d5d4c9ea55d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread ludovic coues
Your problem might be mixing include and name in the urls.py file.
reverse("home") should give you better result.

2016-03-28 13:31 GMT+02:00 Deepanshu Sagar :

> Oh okay,
>
> So, If I want to navigate to home page, which is at '/', how do it give
> the parameter for this along with next_page key-value pair?
>
> url(r'^logout/$', auth_views.logout, {'next_page': 'boardgames_home'}, 
> name='boardgames_logout'),
>
>
> Thank you for the reply though.
>
> Regards
> Deepanshu
>
>
> On Monday, March 28, 2016 at 4:39:34 PM UTC+5:30, monoBOT monoBOT wrote:
>
>> That url doesnt exist on your urls.py
>>
>> looks like you are trying to navigate to "boardgames_home"
>> when trying to access the "/" url
>>
>> name is for reverse lookups from inside the django app not for the urls.
>>
>> 2016-03-28 10:49 GMT+01:00 Deepanshu Sagar :
>>
>>> Hello,
>>>
>>> I am getting below error while clicking on logout button on webpage:
>>>
>>>
>>> boardgames/url.py contains:
>>>
>>>
>>> main/urls.py and views.py are below.
>>>
>>>
>>>
>>>
>>> please guys, any help is appreciated.
>>>
>>> Regards
>>> Deepanshu
>>>
>>> --
>>> You received this message because you are subscribed 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/8fbe6e38-84c9-4ccb-b0e1-b91eade1b036%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> *monoBOT*
>> Visite mi sitio(Visit my site): monobotsoft.es/blog/
>>
> --
> You received this message because you are subscribed to the Google Groups
> "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/ccf6f3ee-34a0-476d-b44f-8d5d4c9ea55d%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%2BTb0HJoYg%3Dvokvkte-0RjkHqT17fQcrBXN70z9K%3DvaQC0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Forms vs Angularjs

2016-03-28 Thread Gorkem Tolan

I was working on it last couple of days. Basically I came up with what 
Fabio's solution. Thanks Daniel for 'disabled' field comment as well.  

On Saturday, March 26, 2016 at 8:49:17 AM UTC-4, Daniel Hepper wrote:
>
> Fabio,
>
> if you are using Django 1.9, you can use the newly introduced disabled 
> attribute on forms.Field, see 
> https://docs.djangoproject.com/ja/1.9/ref/forms/fields/#disabled
>
> On Tuesday, March 22, 2016 at 3:36:34 PM UTC+1, Fabio Caritas Barrionuevo 
> da Luz wrote:
>>
>>
>> self.fields[name].widget.attrs['disabled'] = 'disabled'
>> self.fields[name].widget.attrs['readonly']=True
>>
>> is not make real readonly to field, because if user can edit the html on 
>> client side, and remove disabled="disabled" and readonly input atributtes
>>
>> to problem of readonly fields, i currently use this:
>>
>>
>> https://github.com/luzfcb/django-simple-history/blob/wip-generic-views2/simple_history/forms.py
>>
>>
>> I prevent it here 
>> https://github.com/luzfcb/django-simple-history/blob/wip-generic-views2/simple_history/forms.py#L24
>>
>> Usage:
>>
>> class FooBar(models.Model):
>> foo = models.TextField(blank=True)
>> bar = models.TextField(blank=True)
>>
>> class MyFooBarForm(forms.ModelForm):
>> class Meta:
>> object = FooBar
>> fields = ('foo', 'bar')
>>
>> class MyReadOnlyBarForm(ReadOnlyFieldsMixin, forms.ModelForm):
>> readonly_fields = ('bar')
>> class Meta:
>> object = FooBar
>> fields = ('foo', 'bar')
>>
>> my_all_field_readonly_foobarForm = new_readonly_form_class(MyFooBarForm)
>>
>> my_foo_field_readonly_foobarForm = new_readonly_form_class(MyFooBarForm, 
>> readonly_fields=('foo',))
>>
>>
>> I do not know if this is the best approach, but it was what I got so far.
>>
>>
>>
>>
>>
>> On Tue, Mar 22, 2016 at 10:57 AM, Gorkem Tolan  
>> wrote:
>>
>>> Actually I do to set permission to each field. A field in the form can 
>>> be viewable and editable, only viewable, or hidden.  So if user has a 
>>> permission to see the form, but edit some fields in the form, it gets very 
>>> tricky especially for validation.
>>> For example I used these statements to make readonly field :
>>> self.fields[name].widget.attrs['disabled'] = 'disabled'
>>> self.fields[name].widget.attrs['readonly']=True
>>> Then the problem rises not to be able send disabled fields in the post. 
>>>
>>> On Tuesday, March 22, 2016 at 9:31:43 AM UTC-4, bobhaugen wrote:

 Maybe you already know this, but you can do a lot of form tinkering in 
 __init__, like so:

 def __init__(self, permissions_parameter=None, *args, **kwargs):
 super(FormName, self).__init__(*args, **kwargs)
 if permissions_parameter:
 #do a bunch of form tinkering

>>> -- 
>>> You received this message because you are subscribed 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/877bb8f8-4b59-4353-a0e5-99e95f55811b%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> -- 
>> Fábio C. Barrionuevo da Luz
>> Palmas - Tocantins - Brasil - América do Sul
>>
>> http://pythonclub.com.br/
>>
>> Blog colaborativo sobre Python e tecnologias Relacionadas, mantido 
>> totalmente no https://github.com/pythonclub/pythonclub.github.io .
>>
>> Todos são livres para publicar. É só fazer fork, escrever sua postagem e 
>> mandar o pull-request. Leia mais sobre como publicar em README.md e 
>> contributing.md.
>> Regra básica de postagem:
>> "Você" acha interessante? É útil para "você"? Pode ser utilizado com 
>> Python ou é útil para quem usa Python? Está esperando o que? Publica logo, 
>> que estou louco para ler...
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"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/7342bff0-ddc5-4f6d-ab51-9a664a245d3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread Vadim Serdiuk
Hello.
The exception raises because 'boardgames_home' name is defined for group of 
patterns, and not one.
So it was skiped and is undefined in runtime. 
Use 'name' parameter only for individual pattern, don't use it when include 
other patterns. 

Also don't use blank string in url pattern. Use '/' for home page instead 
of ''.

понедельник, 28 марта 2016 г., 12:49:20 UTC+3 пользователь Deepanshu Sagar 
написал:
>
> Hello,
>
> I am getting below error while clicking on logout button on webpage: 
>
>
> boardgames/url.py contains: 
>
>
> main/urls.py and views.py are below. 
>
>
>
>
> please guys, any help is appreciated. 
>
> Regards
> Deepanshu
>

-- 
You received this message because you are subscribed to the Google Groups 
"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/7072fd3a-2858-4c38-84c7-e68d2b9aa990%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Help me! Error in Django. Migrate mysql, datetime and more.

2016-03-28 Thread Ricardo Felipe Ríos Higueras


Hi.

I am learning Django, but, I have major problems because I don´t know much 
about python/Django.

Here this problem:

*problem one : the databases backend does not accept 0 as a ' valueError: 
The databases backend does not accept 0 as value for AutoField.*
*problem two: TypeError: int() argument must be a string or a number, not 
'datetime.datetime'*

Here my models.py


*from __future__ import unicode_literals*
*from django.db import models*
*from django.contrib import admin*
*from django.contrib import **
*from tinymce import models as tinymce_models*
*from PIL import Image*
*from django.contrib.auth.models import User*


*ESTADO_VISIBLE = [1,2]*

*class ManejadorPost(models.Manager):*
* def get_query_set(self):*
* default_queryset = super(ManejadorPost, self).get_query_set()*
* return default_queryset.filter(status__in=ESTADO_VISIBLE)*

*class Categorias(models.Model):*
* nombre = models.CharField(max_length=50)*
* slug = models.SlugField(max_length=50, unique=True, default='slug')*
* descripcion = models.TextField()*

* creada_en = models.DateTimeField(auto_now_add=True)*
* actualizada_al = models.DateTimeField(auto_now=True)*


*class Meta:*
* db_table = 'categorias'*
* verbose_name_plural = 'Categorias'*

*def __unicode__(self):*
* return self.nombre*


*class BlogPost(models.Model):*
* ESTADOS=((1,"Publicado"), (2, 'Archivado'), (3,'Nesecita editarse'), 
(4,'Nesecita aprobacion'))*
* status = models.IntegerField(choices=ESTADOS,default=4)*
* objetos_panel = models.Manager()*
* objects = ManejadorPost()*
* title=models.CharField(max_length=150)*
* author = models.ForeignKey(User)*
* time = models.DateTimeField(auto_now=True)*
* categorias_post = models.ManyToManyField(Categorias)*
* body = tinymce_models.HTMLField()*
* imagen = models.ImageField(upload_to = "photos")*

*class Meta:*
* db_table = 'entradas'*
* verbose_name_plural = 'Posts'*

*def __unicode__(self):*
* return self.title*

*def __unicode__(self):*
* return self.body*



I hope you will join 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/c4825eb7-ab86-4835-88a3-d24ed14495a0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.contrib import admin
from django.contrib import *
from tinymce import models as tinymce_models
from PIL import Image
from django.contrib.auth.models import User
import time
from datetime import date

# Create your models here.

ESTADO_VISIBLE = [1,2]

class ManejadorPost(models.Manager):
	def get_query_set(self):
		default_queryset = super(ManejadorPost, self).get_query_set()
		return default_queryset.filter(status__in=ESTADO_VISIBLE)

class Categorias(models.Model):
	nombre = models.CharField(max_length=50)
	slug = models.SlugField(max_length=50, unique=True, default='slug')
	descripcion = models.TextField()

	creada_en = date.today()
	actualizada_al = date.today()


class Meta:
	db_table = 'categorias'
	verbose_name_plural = 'Categorias'

def __unicode__(self):
	return self.nombre


class BlogPost(models.Model):
	ESTADOS=((1,"Publicado"), (2, 'Archivado'), (3,'Nesecita editarse'), (4,'Nesecita aprobacion'))
	status = models.IntegerField(choices=ESTADOS,default=4)
	objetos_panel = models.Manager()
	objects = ManejadorPost()
	title=models.CharField(max_length=150)
	author = models.ForeignKey(User)
	time = date.today()
	categorias_post = models.ManyToManyField(Categorias)
	body = tinymce_models.HTMLField()
	imagen = models.ImageField(upload_to = "photos")

class Meta:
	db_table = 'entradas'
	verbose_name_plural = 'Posts'

def __unicode__(self):
	return self.title

def __unicode__(self):
	return self.body













django dynamically updating dashboard

2016-03-28 Thread Becka R.
Hi,

I suspect this calls for celery, which I've never used.   Can someone point 
me in a direction of docs or a tutorial?

App examples would be amazing.  Thank you. 

Becka

-- 
You received this message because you are subscribed to the Google Groups 
"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/da22c396-04a3-4377-be5f-57357908ce99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django dynamically updating dashboard

2016-03-28 Thread Daniel Roseman
You're going to need to give much more detail. What do you mean by a dashboard? 
What data do you want to update, and where is it coming from? What is dynamic 
about it? Why do you think you need Celery?
-- 
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"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/852f0590-db6b-4c7e-8ff3-cd3b235c4437%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help me! Error in Django. Migrate mysql, datetime and more.

2016-03-28 Thread James Schneider
>
>
> *problem one : the databases backend does not accept 0 as a ' valueError:
> The databases backend does not accept 0 as value for AutoField.*
> *problem two: TypeError: int() argument must be a string or a number, not
> 'datetime.datetime'*
>
>
When or where do you get these errors? The models themselves look correct.
Do you have code that runs that generates these errors?

Can you please post the entire traceback that you are receiving for both
errors?

-James

-- 
You received this message because you are subscribed to the Google Groups 
"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%2Be%2BciUvVYtKK3LX6X05-Ydzv8D2aNTPZMhyGDyJUafSGXWPng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread James Schneider
On Mon, Mar 28, 2016 at 6:26 AM, Vadim Serdiuk  wrote:

> Hello.
> The exception raises because 'boardgames_home' name is defined for group
> of patterns, and not one.
> So it was skiped and is undefined in runtime.
> Use 'name' parameter only for individual pattern, don't use it when
> include other patterns.
>

That's not entirely accurate. It is perfectly valid to assign a name to an
included set of URL's. This creates a namespace for the URL's that are
being included. See here:

https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces

The OP is incorrectly trying to reverse the parent namespace
('boardgames_home') rather than the full name of the URL in question
('boardgames_home:home' per the current namespace setup), which can't be
resolved directly because the parent namespace refers to an include() for
zero or more other patterns.


>
> Also don't use blank string in url pattern. Use '/' for home page instead
> of ''.
>
>
Correct, using an empty string will definitely cause you problems down the
road. With an empty string and the current ordering of the URL definitions,
I believe URL matching for login/ and logout/ will fail consistently.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"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%2Be%2BciVn-yeMcZXbsuagtAuDXvgRTsQ_b%2Bt4%3DwOS8sZ1cNx89A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread James Schneider
On Mon, Mar 28, 2016 at 2:49 AM, Deepanshu Sagar 
wrote:

> Hello,
>
> I am getting below error while clicking on logout button on webpage:
>
>
>

Hmm, you cut off the interesting stuff underneath this section. The
traceback information below is usually super helpful.



> boardgames/url.py contains:
>
>
>
As mentioned in the other responses, an empty string should not be used in
your regular expression list of URL's. It will match every single URL
search, which is likely not what you want. You'll want to use just a '/' as
others have suggested. However, if you only plan to have the single URL as
part of your include, you may want to consider just importing the view from
your app back into the above urls.py file and referencing it directly.

You may also want to move that particular entry to the bottom of the list
so that your auth URL's are searched first, in the event there is any
overlap down the road.



> main/urls.py and views.py are below.
>
>
>
Combine this with your boardgames/urls.py above, and the name of this URL
is actually 'boardgames_home:home' give the URL namespacing you've created.

I included this link in my other response, but I'll put it here for
completeness:

https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces



>
>
>

This particular snippet doesn't appear to be relevant. The culprit causing
the error is likely in your template code (probably a {% url 'home' %}
tag). You'll need to either


   - Tweak your urls.py files to eliminate the namespacing (remove the
   name= reference on your include() URL.
   - Update your {% url %} and reverse() calls to include the namespace
   that you've provided ('boardgames_home:home').

-James

-- 
You received this message because you are subscribed to the Google Groups 
"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%2Be%2BciWjnpmvKJ-rBRQekd-MGqhM4gJr1P%3DUeMcwBiGfRwkSng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread Prasanthi Paladugu
It's a namespace collision

Kindly take a look over it "home" and boardgames_homes tearing a part.

simply remove the namespace that is occurring at the include section.

On Mon, Mar 28, 2016 at 11:46 PM, James Schneider 
wrote:

>
>
> On Mon, Mar 28, 2016 at 2:49 AM, Deepanshu Sagar 
> wrote:
>
>> Hello,
>>
>> I am getting below error while clicking on logout button on webpage:
>>
>>
>>
>
> Hmm, you cut off the interesting stuff underneath this section. The
> traceback information below is usually super helpful.
>
>
>
>> boardgames/url.py contains:
>>
>>
>>
> As mentioned in the other responses, an empty string should not be used in
> your regular expression list of URL's. It will match every single URL
> search, which is likely not what you want. You'll want to use just a '/' as
> others have suggested. However, if you only plan to have the single URL as
> part of your include, you may want to consider just importing the view from
> your app back into the above urls.py file and referencing it directly.
>
> You may also want to move that particular entry to the bottom of the list
> so that your auth URL's are searched first, in the event there is any
> overlap down the road.
>
>
>
>> main/urls.py and views.py are below.
>>
>>
>>
> Combine this with your boardgames/urls.py above, and the name of this URL
> is actually 'boardgames_home:home' give the URL namespacing you've created.
>
> I included this link in my other response, but I'll put it here for
> completeness:
>
> https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces
>
>
>
>>
>>
>>
>
> This particular snippet doesn't appear to be relevant. The culprit causing
> the error is likely in your template code (probably a {% url 'home' %}
> tag). You'll need to either
>
>
>- Tweak your urls.py files to eliminate the namespacing (remove the
>name= reference on your include() URL.
>- Update your {% url %} and reverse() calls to include the namespace
>that you've provided ('boardgames_home:home').
>
> -James
>
> --
> You received this message because you are subscribed to the Google Groups
> "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%2Be%2BciWjnpmvKJ-rBRQekd-MGqhM4gJr1P%3DUeMcwBiGfRwkSng%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/CAAhZuZ69GQD6uZTOENrPZR8gKwfzCUTkDF9WO-nKX%2BOTy0RSOA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread knbk


On Monday, March 28, 2016 at 7:23:22 PM UTC+2, James Schneider wrote:
>
> That's not entirely accurate. It is perfectly valid to assign a name to an 
> included set of URL's. This creates a namespace for the URL's that are 
> being included. See here:
>

Actually, the name parameter is completely ignored[1] when using include(). 
You can set a namespace by passing the namespace (and app_name) parameter 
to include()[2], or in 1.9+, by setting the app_name attribute in the 
target URLconf[3]. That means the name that should be used with the current 
code is just 'home'.

[1] 
https://github.com/django/django/blob/859fc64338f760508f9618c100ad92b925802b18/django/conf/urls/__init__.py#L78
[2] 
https://docs.djangoproject.com/en/1.8/topics/http/urls/#url-namespaces-and-included-urlconfs
[3] 
https://docs.djangoproject.com/en/1.9/topics/http/urls/#url-namespaces-and-included-urlconfs

-- 
You received this message because you are subscribed to the Google Groups 
"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/dd0f1587-ea92-43d2-bba0-1bdd0723afab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting NoReverseMatch at /logout/

2016-03-28 Thread James Schneider
>
>
> On Monday, March 28, 2016 at 7:23:22 PM UTC+2, James Schneider wrote:
>>
>> That's not entirely accurate. It is perfectly valid to assign a name to
>> an included set of URL's. This creates a namespace for the URL's that are
>> being included. See here:
>>
>
> Actually, the name parameter is completely ignored[1] when using include().
> You can set a namespace by passing the namespace (and app_name) parameter
> to include()[2], or in 1.9+, by setting the app_name attribute in the
> target URLconf[3]. That means the name that should be used with the current
> code is just 'home'.
>
>
I really need to read the code closer. I simply read it as 'namespace' in
my head. You are correct.

-James

-- 
You received this message because you are subscribed to the Google Groups 
"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%2Be%2BciXNp%2B2V6jNjN0Z5WfxB3Zr8WzhmAddE1%2BfPQyT7DG7wCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


EMAIL_BACKEND doesn't works with Amazon SES!?

2016-03-28 Thread Neto
I'm trying to send emails with Amazon SES, but when I use default 
EMAIL_BACKEND raise error:

Config:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # this is 
default
EMAIL_HOST = 'email-smtp...amazonaws.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = '...'
EMAIL_HOST_PASSWORD = '...'
EMAIL_USE_TLS = True

Error:

raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed

If I use:
  
EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend'

from https://github.com/bancek/django-smtp-ssl, works right.

Code of this backend:

import smtplib
 
from django.core.mail.utils import DNS_NAME
from django.core.mail.backends.smtp import EmailBackend
 
class SSLEmailBackend(EmailBackend):
  def open(self):
if self.connection:
  return False
try:
  self.connection = smtplib.SMTP_SSL(self.host, self.port, 
local_hostname=DNS_NAME.get_fqdn())
  if self.username and self.password:
self.connection.login(self.username, self.password)
  return True
except:
  if not self.fail_silently:
raise

What the problem with default EMAIL_BACKEND? Why I can't use him?

-- 
You received this message because you are subscribed to the Google Groups 
"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/d71c947b-db14-4373-b412-41e5dc5a7cff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: EMAIL_BACKEND doesn't works with Amazon SES!?

2016-03-28 Thread Raffaele Salmaso
On Tue, Mar 29, 2016 at 2:56 AM, Neto  wrote:
>
> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' # this is
> default
> EMAIL_HOST = 'email-smtp...amazonaws.com'
> EMAIL_PORT = 465
> EMAIL_HOST_USER = '...'
> EMAIL_HOST_PASSWORD = '...'
> EMAIL_USE_TLS = True
>

My config
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = "email-smtp.$zone.amazonaws.com"
EMAIL_PORT = 587
EMAIL_HOST_USER = "$USER"
EMAIL_HOST_PASSWORD = "$PASSWORD"
EMAIL_USE_TLS = True

Different port.
I'm using python 3.4

-- 
| Raffaele Salmaso
| https://salmaso.org
| https://bitbucket.org/rsalmaso
| https://github.com/rsalmaso

-- 
You received this message because you are subscribed to the Google Groups 
"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/CABgH4JtaLbpDdFo7JzBA7R9BjEE6kU9nKRPT406N9SAttdC%2B9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.