Re: Send PDF as an email's attachment ( Working with xhtml2pdf library)

2021-10-25 Thread Luis Zárate
Hi,

Here is solved:
https://github.com/luisza/async_notifications/blob/master/async_notifications/tasks.py

El vie, 8 oct 2021 a las 7:45, MR INDIA ()
escribió:

> Answer to this query on stack overflow
> 
> Raw link:
> https://stackoverflow.com/questions/33218629/attaching-pdfs-to-emails-in-django
> Hope this helps,
> A fellow django developer
> On Friday, 8 October 2021 at 00:19:36 UTC+5:30 sreebas...@gmail.com wrote:
>
>> Did you solve it? I need a similar solution.
>>
>> On Saturday, May 1, 2021 at 5:13:21 AM UTC+6 wwran...@gmail.com wrote:
>>
>>> Hi Dudes, Im working with pisa from xhtml2pdf LIB in order to get a pdf.
>>> That works OK, but i cant figure out how to attach the generated pdf to  an
>>> email  in order to send it . Anyone dealt with this? I would appreciate any
>>> help on this!
>>>
>>> *View*:
>>>
>>>   def get(self,request,*args,**kwargs):
>>> try:
>>>
>>> mailServer = 
>>> smtplib.SMTP(settings.EMAIL_HOST,settings.EMAIL_PORT)
>>> print(mailServer.ehlo())
>>> mailServer.starttls()
>>> print(mailServer.ehlo())
>>>
>>> 
>>> mailServer.login(settings.EMAIL_HOST_USER,settings.EMAIL_HOST_PASSWORD)
>>> print("conectando...")
>>> email_to=[]
>>> email_to.append("emailto...@gmail.com")
>>> subject="ADICRA - Comprobrante de Pago"
>>> template= get_template('pagos/invoice.html')
>>> context={
>>> 'sale': PagosHead.objects.get(pk=self.kwargs['pk']),
>>>
>>> 'comp': {'name':'ADICRA','ruc':'Av. Directorio Adicra 
>>> 101','address':'C.A.B.A.'},
>>>
>>> 'icon': 
>>> '{}{}'.format(settings.STATIC_URL,'core/img/adicrareng.jpg'),
>>>
>>> 
>>> 'equis':'{}{}'.format(settings.STATIC_URL,'pagos/img/x.jpg'),
>>> }
>>> html=template.render(context)
>>> response= HttpResponse(content_type='application/pdf')
>>>
>>> #response['Content-Disposition']='attachment; 
>>> filename="pago.pdf"' #Para Descargar
>>>
>>> pisaStatus=pisa.CreatePDF(html, 
>>> dest=response,link_callback=self.link_callback)
>>>
>>> mensaje = EmailMessage(subject, body=pdf, 
>>> from_email=settings.EMAIL_HOST_USER, to=email_to)
>>> print("Acá antes del attach")
>>> mensaje.attach('pago.pdf', pisaStatus,'application/pdf')
>>> mensaje.content_subtype = "pdf"
>>> mensaje.encoding = 'us-ascii'
>>> mensaje.send()
>>> #mailServer.sendmail(settings.EMAIL_HOST_USER,
>>>  #   email_to,
>>>   #  mensaje.as_string())
>>> print("Correo enviado correcamente")
>>> return response
>>> except Exception as e:
>>> print(e)
>>> return HttpResponse(reverse_lazy('pagos:list'))
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7366b7b6-ae23-44cd-bceb-b7b340ecbefcn%40googlegroups.com
> 
> .
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyOY8%2BLdOL40ZHCy_ikhC3_e8cLQbmUYZth8kJEPp6VNuQ%40mail.gmail.com.


Re: django beginner

2015-03-13 Thread Luis Zárate
Your python configuration is ok. so I guest you have someone of this
problem.
 - Your work path has spaces and python confuse with them.
 - Your system mimetype for .py use notepad++ for open it.

I don't know if this solve your issue but I think that check this prevent
you a headache

I test doing a simple project and this is my result.

$ django-admin startproject mysite
$ tree
.
└── mysite
├── manage.py
└── mysite
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.py

2 directories, 5 files

2015-03-13 12:22 GMT-06:00 :

> the verson is 1.7.6 why?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/651d0668-ffaf-42ea-8f2e-76b242bcc67c%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyM1RkuSiM69JcN3BjOPRQoJFaQrF_ocOpfRqafxG1iSmg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django multiple application with common users

2015-03-16 Thread Luis Zárate
You maybe need to take a look documentation of using routes.
https://docs.djangoproject.com/en/1.7/topics/db/multi-db/#using-routers



2015-03-16 8:47 GMT-06:00 Domagoj Kovač :

> Hi Raphael,
>
> I also though this are may options, although first option is the easiest i
> would like to do something a bit more complex. I would also like to access
> my applications from different domains and this means options a and b cant
> satisfied my needs. If i use multiple databases this only means i will
> separate my applications on database level but not on the application
> level. I want them to be separate completely.
>
> I am thinking the best solution for now would be to use a combination of
> multiple databases and separate application. Lets say i have my application
> called "cost management" there i will be using two database connection:
> default one for the cost management and user-connection to connect to user
> database. Although the idea with external authentification provider is
> better, the best thing to do would be to create some kind of user API that
> i can use to authenticate any type of application mobile/web and use this
> api trough some kind of custom authentification provider - i know this is
> bit more complicated to do just for home apps but it could be fun :).
>
> Best,
> Domagoj
>
>
> On Monday, March 16, 2015 at 11:50:02 AM UTC+1, Raphael Michel wrote:
>>
>> Hi,
>>
>> Am Mon, 16 Mar 2015 01:23:22 -0700 (PDT)
>> schrieb Domagoj Kovač :
>> > I would like to have separate databases for every application
>> > including user management.
>>
>> I can think of:
>>
>> (a) You put all the application in the same database and share a user
>> model (look up 'reusable django apps')
>>
>> (b) You let all applications have their own database but share one
>> common user database (look up 'django multiple databases')
>>
>> (c) You set up the apps completely separated and use an external,
>> independent authentication provider (look up 'django ldap', 'django
>> openid', …)
>>
>> For 'small home apps', I'd absolutely go for (a).
>>
>> Best regards,
>> Raphael
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/3ea8828d-0f31-4654-bfdc-3753738080e5%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMXXRyuBRWK7LHzb8ZSSs9mbUyo2c%3DesgEwjGMu17i-xg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problem at server startup

2015-03-28 Thread Luis Zárate
What is your machine name? It had a non ASCII character?

Do you use __unicode___ ?  In python 3 is __str__



El sábado, 28 de marzo de 2015, Anderson Resende <
andersonresend...@gmail.com> escribió:
> Put this code on first line in your files.py:
>
> # -*- coding: utf-8 -*-
>
>
> Maybe work!
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/56961c03-87af-4f8d-8c18-1080b88d446c%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOAGKAubK8Sw1hy34t5EYao8DoO5WvtXD%2Bc-MA7L6n0NQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help on how to be able to properly install python 3.4.3 idle

2015-04-03 Thread Luis Zárate
Are you looking for IDE ?

Look here

https://code.djangoproject.com/wiki/DjangoResources#IntegratedDevelopmentEnvironments

2015-04-03 23:00 GMT-06:00 Sreenivasarao Pallapu :

> To kick start your Python learning go to
> https://www.udacity.com/course/ud036, (or)
> if you want to go through a book go for 'Learn Python the Hard Way' by Zed
> Shaw.
>
> Only going through a course will not help you to build programming skills,
> go for and solve challenges in sites like CodeEval, codechef, hackerearth
> etc..
>
> On Friday, April 3, 2015 at 3:56:21 PM UTC+5:30, Pythondjango wrote:
>>
>> I am python novice, please educates me and bring me up to a pro python
>> programmer, thank you.Also,how can i use python 3.4.3 version of Gui.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/cb7a69ff-0e0e-4f37-bba7-caa68292240a%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO3gzXi4sRYVF4xu%3DZVxatwsnXNoSjf2CQk69eJ6M_RrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Multiple Django Forms

2015-04-04 Thread Luis Zárate
mmm Maybe you should use form wizard if you have too many forms
https://docs.djangoproject.com/en/1.7/ref/contrib/formtools/form-wizard/




2015-03-31 5:11 GMT-06:00 Bill Blanchard :

> Hi Stephanie,
> Ping me offline, I might be able to help you out.
> On Mar 30, 2015 1:43 PM, "Stephanie Socias"  wrote:
>
>> Thank you for your suggestions!
>>
>> Unfortunately, as I am very green at the moment, I nee more help to
>> implement all of these new techniques. Given that what I'm trying to
>> accomplish requires more extensive Django and javascript knowledge, is
>> there anyone who would be willing to do a video screen share with me to
>> help me out?? I can pay you!
>>
>> Thank you,
>> Stephanie
>>
>> On Monday, March 30, 2015 at 7:47:48 AM UTC-4, François GUÉRIN wrote:
>>>
>>> 1/ use generic views : ProcessFormView by example
>>> 2/ use prefixes in your forms with there name (it's a param in form
>>> cctor)
>>> 3/ in your template, use the {%for form in forms %}{% form.as_p
>>> %}{%endfor %} if you put your forms into a
>>> list form forms
>>>
>>> Good coding !
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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/9d1c60b2-a194-40ef-8ef1-5065c1c8184e%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/CAP7uED%2BDyjCwTP%3DWnEK-M2SCy48CXdvvOZjLbG5BaGWj%3D36yzA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNzwmWGr-8e3ws01QCtF8WmHiL8aOOiLbtos6xzvr3MoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using Unicode in django

2015-04-04 Thread Luis Zárate
Are you runing python 2.7.x ?  Think in python 3 compatibility  and solve
your problem

This code can help you.

from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class MyModel(models.Model):
name = models.CharField(max_length=300)
importance = models.TextField()

def __str__(self):
return self.importance




2015-04-02 22:53 GMT-06:00 Mike Dewhirst :

> On 3/04/2015 12:01 AM, temiloluwa adesina wrote:
>
>> Hello
>> I just joined this group and i have problems with representing multiple
>> fields in admin using __unicode__, when i try to call this data it
>> returns just one of them:
>>
>> |
>> classCrop(models.Model):
>>  name =models.CharField(max_length=30)
>>  importance =models.TextField()
>>  cultivation =models.TextField()
>> def__unicode__(self):
>> returnu'%s %s %s'%(self.name,self.importance,self.cultivation)
>> |
>>
>> > AGY/AdVaYuoL6As/s1600/Screenshot%2B%2840%29.png>
>>
>> but rather than returning just the data in the importance field, it
>> returns all the data in each separate field together.
>>
>
> That __unicode__() return value is a concatenation of the three named
> fields and I assume that is what you want. When the object is returned its
> name is mentioned first (Yam) followed by a space followed by whatever data
> is in the importance field followed by a space then cultivation
>
> Your screenshot seems to be showing that.
>
> If all you want is the importance info, just make __unicode__() return
> that and nothing else.
>
> Whatever is returned by __unicode__ is the object's identification.
>
> You seem to have a good handle on that so I suspect I haven't understood
> your question.
>
> Mike
>
>
>> Pls i would appreciate anyone's assistance.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> 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/504bf928-
>> 7259-4d17-994c-115e98a78a4b%40googlegroups.com
>> > 7259-4d17-994c-115e98a78a4b%40googlegroups.com?utm_medium=
>> email&utm_source=footer>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/551E1CD3.7000906%40dewhirst.com.au.
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO28BC97iu7na3Ku7d1jbOxC5uJv-71PUSi1o9eQCbFrg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: authenticate() not working

2015-04-04 Thread Luis Zárate
It's because you need to login the user (authenticate don't login only get
the user )

It's something like this:

from django.contrib.auth import authenticate, login
def my_view(request):
username = request.POST['username']
password = request.POST['password']
user = authenticate(username=username, password=password)
if user is not None:
if user.is_active:
login(request, user)
# Redirect to a success page.
else:
# Return a 'disabled account' error message
...
else:
# Return an 'invalid login' error message.
...



2015-03-30 3:46 GMT-06:00 aRkadeFR :

>  Hello,
>
>
> Just by changing the type of your input, you're enable to
> authenticate inside your view then?
>
> Do a dump of your post data to see if anything has changed.
> ```
> print("data: {!s}".format(request.POST))
> ```
>
> Then you can see in a shell (manage.py shell) if the authenticate
> function works as expected with your data.
>
>
> On 03/28/2015 10:36 AM, Kishan Mehta wrote:
>
> Hi all,
>
> >>My html has following input type :
>
> Password: 
>
>
> >>  user = authenticate(username=username, password=password)
> is not able to authenticate in views.py...
>
> Not able to login.
>
> P.S :
> when i do :
>
> 
> authentication works...
>
> Please help.
> New to django.
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9b40bc4f-09ad-4697-b2a7-5d4881acd496%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/55191B65.4040804%40arkade.info
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNkjh0ORp1O88--Yxdiq1KCvSVHY_GMfwWkeBfWzXCv8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: authenticate() not working

2015-04-04 Thread Luis Zárate
Sorry I forget to send you a reference link

https://docs.djangoproject.com/en/1.7/topics/auth/default/#django.contrib.auth.login

2015-04-04 17:00 GMT-06:00 Luis Zárate :

> It's because you need to login the user (authenticate don't login only get
> the user )
>
> It's something like this:
>
> from django.contrib.auth import authenticate, login
> def my_view(request):
> username = request.POST['username']
> password = request.POST['password']
> user = authenticate(username=username, password=password)
> if user is not None:
> if user.is_active:
> login(request, user)
> # Redirect to a success page.
> else:
> # Return a 'disabled account' error message
> ...
> else:
> # Return an 'invalid login' error message.
> ...
>
>
>
> 2015-03-30 3:46 GMT-06:00 aRkadeFR :
>
>  Hello,
>>
>>
>> Just by changing the type of your input, you're enable to
>> authenticate inside your view then?
>>
>> Do a dump of your post data to see if anything has changed.
>> ```
>> print("data: {!s}".format(request.POST))
>> ```
>>
>> Then you can see in a shell (manage.py shell) if the authenticate
>> function works as expected with your data.
>>
>>
>> On 03/28/2015 10:36 AM, Kishan Mehta wrote:
>>
>> Hi all,
>>
>> >>My html has following input type :
>>
>> Password: 
>>
>>
>> >>  user = authenticate(username=username, password=password)
>> is not able to authenticate in views.py...
>>
>> Not able to login.
>>
>> P.S :
>> when i do :
>>
>> >
>> authentication works...
>>
>> Please help.
>> New to django.
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/9b40bc4f-09ad-4697-b2a7-5d4881acd496%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/9b40bc4f-09ad-4697-b2a7-5d4881acd496%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/55191B65.4040804%40arkade.info
>> <https://groups.google.com/d/msgid/django-users/55191B65.4040804%40arkade.info?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyM89dDpXzmsDwy2w85T0S1pnWhj3rOAA33vqqu0K%3DaKGA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding admin access for external users

2015-04-04 Thread Luis Zárate
Are you deploy your application ?
https://docs.djangoproject.com/en/1.8/howto/deployment/

It's important *Don't use development environment in production apps!!!*

It's simple to login user in admin site, create a user and check the *is
staff* option and set the user permissions. ( site admin chech user
permission and show only the models that the user has permission so if the
user don't has one he can't view nothing)



2015-03-27 7:25 GMT-06:00 Murthy Sandeep :

> Hi
>
> I am setting up an admin user account to manage my Django app on
> my local machine, but would it be possible for me to also give admin
> access to external users using their own machines?  My machine is
> not part of a LAN/WAN, just standalone, but I am thinking that to enable
> this I should provide the admin URL to another external user and then
> allow remote login access for them.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/E934EE83-6B33-4307-BF61-506A364698AB%40sandeepmurthy.is
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNnBDQuZAr-zRzkVEcMM3-P_8uOmRujUN%2BoaMoz7rYj_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
Hi,

Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded file,
for production used static deploy strategy, see the documentation about
static files.

Model file field has an url attribute that return a media url, you use in
template like {{obj.file.url}}


El martes, 7 de abril de 2015, Stephanie Socias 
escribió:
> Do I need to update/add something to my urls.py?
>
> On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
>>
>> Thank you very much for responding, Daniel.
>>
>> I'm sorry I don't quite follow- I've never done this before. I should
use the URL {{ datamine.image.url }} in the template?
>>
>> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman 
wrote:
>>>
>>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:

 I've implemented this same solution (using custom file storage and the
"upload_to" parameter) but now cannot get the uploaded files to display
from my template. I would normally use {{ STATIC_URL }} but, since I've now
specified a custom location, I'm not sure why my path, which I've
hard-coded in the template, isn't working...any ideas?

 fs = FileSystemStorage(location='/data/www/upload')

 def image_location(instance, filename):
 return '/'.join(['thumbnails', str(instance.dataset_id), filename])

 class DataModel(models.Model):
 name = models.CharField()
 date = models.DateField(blank=True)
 image = models.ImageField(storage=fs, upload_to=image_location,
blank=True)

 template.html

 
 
 
>>>
>>> But /data/www/upload/... is the file path of your upload, not the URL.
You still need an actual URL that is served by your webserver. Obviously, a
browser can't access arbitrary file paths on your server.
>>> --
>>> DR.
>>>
>>> --
>>> 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/aHa0WWHGreY/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/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%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/b015d26d-c95a-4435-bd93-107244d5a798%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNHO5H1m_dtE3WVrPE4FgSZ%3D%3Dckj-YFZWdoEWVxU4AKgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upload above apache web root?

2015-04-07 Thread Luis Zárate
You are not set base_url in FileSystemStorage so you are using MEDIA_URL by
default.

The imagefield url property is called like this

def _get_url(self):
self._require_file() # check if It is an object
return self.storage.url(self.name)
url = property(_get_url)

And self.storage.url throw exception if base_url is not set.


def url(self, name):
if self.base_url is None:
raise ValueError("This file is not accessible via a URL.")
return urljoin(self.base_url, filepath_to_uri(name))

So, I should try to call datamine.image.url() in shell and see what happen


2015-04-07 10:47 GMT-06:00 Stephanie Socias :

> Hi Luis,
>
> Yes, I used {{ datamine.image.url }} in my template but it doesn't work.
> I'm not sure how to format my urls.py since I haven't changed the MEDIA_URL
> and MEDIA_ROOT. I want to upload these images to a location not in my
> MEDIA_ROOT...?
>
> This is my urls.py:
> urlpatterns = patterns('',
> # Examples:
> # url(r'^$', 'tt.views.home', name='home'),
> # url(r'^blog/', include('blog.urls')),
>
> url(r'^admin/', include(admin.site.urls)),
> url(r'^', include('myproj.urls', namespace='myproj')),
> ) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
>
> On Tue, Apr 7, 2015 at 12:30 PM, Luis Zárate  wrote:
>
>> Hi,
>>
>> Django provide for development MEDIA_URL and MEDIA_ROOT for uploaded
>> file, for production used static deploy strategy, see the documentation
>> about static files.
>>
>> Model file field has an url attribute that return a media url, you use in
>> template like {{obj.file.url}}
>>
>>
>> El martes, 7 de abril de 2015, Stephanie Socias 
>> escribió:
>> > Do I need to update/add something to my urls.py?
>> >
>> > On Tuesday, April 7, 2015 at 9:51:56 AM UTC-4, Stephanie Socias wrote:
>> >>
>> >> Thank you very much for responding, Daniel.
>> >>
>> >> I'm sorry I don't quite follow- I've never done this before. I should
>> use the URL {{ datamine.image.url }} in the template?
>> >>
>> >> On Tue, Apr 7, 2015 at 5:36 AM, Daniel Roseman 
>> wrote:
>> >>>
>> >>> On Monday, 6 April 2015 22:38:36 UTC+1, Stephanie Socias wrote:
>> >>>>
>> >>>> I've implemented this same solution (using custom file storage and
>> the "upload_to" parameter) but now cannot get the uploaded files to display
>> from my template. I would normally use {{ STATIC_URL }} but, since I've now
>> specified a custom location, I'm not sure why my path, which I've
>> hard-coded in the template, isn't working...any ideas?
>> >>>>
>> >>>> fs = FileSystemStorage(location='/data/www/upload')
>> >>>>
>> >>>> def image_location(instance, filename):
>> >>>> return '/'.join(['thumbnails', str(instance.dataset_id), filename])
>> >>>>
>> >>>> class DataModel(models.Model):
>> >>>> name = models.CharField()
>> >>>> date = models.DateField(blank=True)
>> >>>> image = models.ImageField(storage=fs, upload_to=image_location,
>> blank=True)
>> >>>>
>> >>>> template.html
>> >>>>
>> >>>> 
>> >>>> 
>> >>>> 
>> >>>
>> >>> But /data/www/upload/... is the file path of your upload, not the
>> URL. You still need an actual URL that is served by your webserver.
>> Obviously, a browser can't access arbitrary file paths on your server.
>> >>> --
>> >>> DR.
>> >>>
>> >>> --
>> >>> 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/aHa0WWHGreY/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/e14088d0-7c4a-4965-b88a-2fd0b26ec3cb%40googlegroups.co

Re: show code in template

2015-04-07 Thread Luis Zárate
I don't understand what you want to do but I guest it's like verbatim

https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#verbatim

2015-04-07 12:18 GMT-06:00 Hanz :

> Hi everyone,
> i want to show some piece of code on my website. What is the best way to
> do it? (embed into template)
>
> >>> {{ object.name }}
>
> Regards,
> Hanz
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/681ea031-1078-4e5f-ab27-f806c4906663%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyN5WiMNeqiGnPO%3DPYGeKh9AKmjyOexfiaMUFpwWZFq-HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TIMEZONE

2015-04-08 Thread Luis Zárate
Do you have installed pytz ?  Django use it when  USE_TZ is  True.

2015-04-08 6:54 GMT-06:00 Olalla Galiñanes Feijoo <
olalla.galina...@gmail.com>:

> Time zone support is disabled by default. To enable it, set USE_TZ = True
>  in
> your settings file.
>
> https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/
>
> El miércoles, 8 de abril de 2015, 14:18:25 (UTC+2), akash...@ranosys.com
> escribió:
>>
>> Hi to all ,
>>
>> Previously my settings.py file was having time zone as
>>
>> TIME_ZONE = 'America/Chicago'
>>
>> now i have changed to
>> TIME_ZONE = 'Europe/London'
>>
>> that not getting reflected means date and time are getting stored in
>> database as of previous timezone...
>>
>>
>> Please suggest.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/58feb55f-04db-429d-b168-6302596ae00b%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP9bzN1nk7fXOLUE6kAV7bQUuXVLTN9m207Sbg%2BLbqq_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: TIMEZONE

2015-04-08 Thread Luis Zárate
Other thing that I forgot in the last mail is how use function now()

Wrong solution

from datetime import datetime
datetime.now()

Good solution

from django.utils import timezone
timezone.now()



2015-04-08 10:16 GMT-06:00 Luis Zárate :

> Do you have installed pytz ?  Django use it when  USE_TZ is  True.
>
> 2015-04-08 6:54 GMT-06:00 Olalla Galiñanes Feijoo <
> olalla.galina...@gmail.com>:
>
> Time zone support is disabled by default. To enable it, set USE_TZ = True
>> <https://docs.djangoproject.com/en/1.8/ref/settings/#std:setting-USE_TZ> in
>> your settings file.
>>
>> https://docs.djangoproject.com/en/1.8/topics/i18n/timezones/
>>
>> El miércoles, 8 de abril de 2015, 14:18:25 (UTC+2), akash...@ranosys.com
>> escribió:
>>>
>>> Hi to all ,
>>>
>>> Previously my settings.py file was having time zone as
>>>
>>> TIME_ZONE = 'America/Chicago'
>>>
>>> now i have changed to
>>> TIME_ZONE = 'Europe/London'
>>>
>>> that not getting reflected means date and time are getting stored in
>>> database as of previous timezone...
>>>
>>>
>>> Please suggest.
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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/58feb55f-04db-429d-b168-6302596ae00b%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/58feb55f-04db-429d-b168-6302596ae00b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyN_%3DxcKpnF%2B%3DD7zM2upTrTLTu8T1YCUOVaeCNB%2Bp5Bcow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Model with two e-mail fields uniques

2015-04-08 Thread Luis Zárate
I don't know if work with many to many is the best approach, because if you
know that only have two emails for user and you check his email a lot then
the cost of join in time and machine resources increase innecessarily  So
knowledge of you requirements determine your db scheme.

Using the first solution I thing in something like this.
in models.py

class Person(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
email1 = models.EmailField()
email2 = models.EmailField(null=True, blank=True)



in your forms forms.py

from django.forms import ModelForm
from myapp.models import Person

class PersonForm(ModelForm):

def clean(self):
cleaned_data = super(PersonForm, self).clean()
if cleaned_data['email1'] == cleaned_data['email2']:
raise forms.ValidationError("Emails are equals ")




class Meta:
model = Person
fields = ['first_name', 'last_name', 'email1', 'email2']


And if you want to use in admin site

class PersonAdmin(admin.ModelAdmin)
form = PersonForm


2015-04-08 9:01 GMT-06:00 Bruno A. :

> +1 for Javier's answer, use a simple Foreign key on the e-mail field, not
> a ManyToMany on the Person (M2M allows an email to belong to multiple
> users). The Foreign key ensures an e-mail belongs to only 1 user, and that
> 2 users cannot have the same e-mail, but lets a user have multiple.
>
> To force all users to have at least one e-mail, something like this would
> do the job:
>
> class Person(models.Model):
> first_name = models.CharField(max_length=100)
> last_name = models.CharField(max_length=100)
>
> def save(self, *args, **kwargs):
> if self.emails.count() == 0:
> raise ValueError("Need at least one email.")
> return super(Person, self).save(*args, **kwargs)
>
>
> class Email(models.Model):
> person = models.ForeignKey(Person, related_name='emails')
> email = models.EmailField(unique=True)
>
>
>
> On Wednesday, 8 April 2015 04:02:50 UTC+1, victor menezes wrote:
>>
>> Would it be a bad approach to use a ManyToMany with properties null/blank
>> False?
>>
>> class Email(models.Model):
>> email = models.EmailField(unique=True)
>> def __unicode__(self):
>> return self.email
>>
>> class Person(models.Model):
>> first_name = models.CharField(max_length=100)
>> last_name = models.CharField(max_length=100)
>> emails = models.ManyToManyField(Email, null=False, blank=False)
>> def __unicode__(self):
>> return self.last_name + ', ' + self.first_name
>>
>>
>> On Tuesday, April 7, 2015 at 6:48:22 PM UTC-4, victor menezes wrote:
>>>
>>> Thanks for the help, I end up doing it was easy to implement the email
>>> as TabularInline inside the Person form in the Admin but how would you make
>>> mandatory to have at least one e-mail?
>>> Should I validate inside the save() method of Person class?
>>>
>>>
>>> On Tuesday, April 7, 2015 at 3:55:26 PM UTC-4, Javier Guerra wrote:

 On Tue, Apr 7, 2015 at 2:20 PM, victor menezes 
 wrote:
 > What would be the best way to make a model with two e-mail fields
 uniques? I
 > was thinking about writing some validation in the save() method but
 would
 > like to know whether Django has some built-in way to deal with it.


 it's a very bad idea to have plurality by adding a number of similar
 fields.  instead, you should have a related table

 class Person(models.Model):
 first_name = models.CharField(max_length=100)
 last_name = models.CharField(max_length=100)

 class Email(models.Model):
 person = models.ForeignKey(Person)
 email = models.EmailField(unique=True)


 --
 Javier

>>>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/fe0288b9-9382-4163-b2cd-9d998f2e72f3%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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 
http

Re: django 1.8 and wsgi_mod

2015-05-07 Thread Luis Zárate
Your server log said this (loading my.wsgi)
Exception occurred processing WSGI script
'/code/projects/my_web/wsgi/my.wsgi'.


But your structure said that wsgi file is called different (idrac.wsgi).

Other thing, call core your app is not a good idea, do it if you understand
well how python import work, otherwise it is a pain in the ask



El jueves, 7 de mayo de 2015, Abhaya Agarwal 
escribió:
> On Tue, Apr 28, 2015 at 9:40 PM, dk  wrote:
>>
>> I check the apache httpd log  and do get this
>>
>> [Tue Apr 28 10:33:49.982311 2015] [:error] [pid 18060] [client
10.35.0.91:61408] from django.apps import apps
>> [Tue Apr 28 10:33:49.982336 2015] [:error] [pid 18060] [client
10.35.0.91:61408] ImportError: No module named apps
>> [Tue Apr 28 10:33:52.595973 2015] [:error] [pid 18061] [client
10.35.0.91:61410] mod_wsgi (pid=18061):
>> Target WSGI script '/code/projects/my_web/wsgi/my.wsgi' cannot be loaded
as Python module.
>> [Tue Apr 28 10:33:52.596033 2015] [:error] [pid 18061] [client
10.35.0.91:61410] mod_wsgi (pid=18061):
>> Exception occurred processing WSGI script
'/code/projects/my_web/wsgi/my.wsgi'.
>>
>> I think is the No module named apps is causing this =(
>
> It certainly is. It is hard to say anything more without looking at the
actual code/setup. But since runserver works, perhaps your production
environment is pointing to an older version of Django?
> Regards,
> Abhaya
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/CAFPF63SGNtRKwaWThd%2BS47dz9joGxqfg%3D%2BXuB4UOfKr0g0Erbw%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPU-J3LjPYsVGXYHWTxDo_0zUWZLcspETmuADP80ojQYA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: NoReverseMatch at /polls/1/results/

2015-05-08 Thread Luis Zárate
Which urls.py you paste here? The project URLs or the app urls .?

It is because you are using namespace in the url reverse so you need to
named in your project's URLs and put the code paste here in your app urls.

El jueves, 7 de mayo de 2015, James Schneider 
escribió:
> I'm guessing the issue is actually in your template if you are following
along that page. None of the code in your views would generate that error
from what I can see.
>
> The error indicates that you are trying to reverse('polls:detail') and
not providing any arguments for the URL resolver (or are passing an
empty/missing variable). In the template, this would probably look
something like {% url 'polls:detail' %}. I would guess that you are
forgetting question.id after the view name, assuming you are using the same
variable names as the tutorial.
>
> Check near the bottom of the stack trace on the page, I bet it has a {%
url %} tag highlighted as the culprit.
>
> -James
>
> On May 7, 2015 12:09 AM, "H M"  wrote:
>>
>> I am on part 4 django tutorial. The tutorial is very good and I easily
get on part 4 but
>>
>> I get error: Reverse for 'detail' with arguments '('',)' and keyword
arguments '{}' not found. 1 pattern(s) tried:
[u'polls/(?P\\d+)/$']
>>
>> Am I missing something?
>>
>> My code is following:
>>
>>> urlpatterns = patterns('',
>>> url(r'^$', views.index, name='index'),
>>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>> url(r'^(?P\d+)/results/$',views.results,
name='results'),
>>> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
>>
>>
>> views.py:
>>
>>> from django.shortcuts import get_object_or_404, render
>>> from django.http import HttpResponseRedirect, HttpResponse
>>> from django.template import RequestContext, loader
>>> from polls.models import Question, Choice
>>> from django.http import Http404
>>> from django.core.urlresolvers import reverse
>>>
>>>
>>> def index(request):
>>> latest_question_list =  Question.objects.order_by('-pub_date')[:5]
>>> template = loader.get_template('polls/index.html')
>>> context = RequestContext(request, {'latest_question_list' :
latest_question_list, })
>>> return HttpResponse(template.render(context))
>>>
>>> def detail(request, question_id):
>>> try:
>>> question = Question.objects.get(pk = question_id)
>>> except Question.DoesNotExist:
>>> raise Http404("Question ne postoji")
>>> return render(request, 'polls/detail.html', {'question': question})
>>>
>>> def results(request, question_id):
>>> question = get_object_or_404(Question, pk = question_id)
>>> return render(request, 'polls/results.html', {'guestion': question})
>>>
>>>
>>> def vote(request, question_id):
>>> p = get_object_or_404(Question, pk=question_id)
>>> try:
>>> selected_choice  = p.choice_set.get(pk=request.POST['choice'])
>>> except (KeyError, Choice.DoesNotExist):
>>> return render(request, 'polls/detail.html', {
>>> 'question': p,
>>> 'error_message': "Nijesi izabrao pitanje.",
>>>  })
>>> else:
>>> selected_choice.votes += 1
>>> selected_choice.save()
>>> return HttpResponseRedirect(reverse('polls:results', args=(p.id
,)))
>>
>>
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
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/2e2320f1-6813-4e01-8b32-76694dbd22f8%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/CA%2Be%2BciUv65UQLmJKjWwySKga08gvAa0OHwkZ39hOj4CjPBS3ww%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP-vOtdWzW%2BCJj5kFG_XwOFYi-EJfb3Toq31fD%2BKEiGuw%40m

Re: NoReverseMatch at /polls/1/results/

2015-05-08 Thread Luis Zárate
Sorry, James is right, your problem is like James described.

Sorry for the noise I read again and see that I understood bad your problem.

Sorry

El viernes, 8 de mayo de 2015, Luis Zárate  escribió:
> Which urls.py you paste here? The project URLs or the app urls .?
>
> It is because you are using namespace in the url reverse so you need to
named in your project's URLs and put the code paste here in your app urls.
>
> El jueves, 7 de mayo de 2015, James Schneider 
escribió:
>> I'm guessing the issue is actually in your template if you are following
along that page. None of the code in your views would generate that error
from what I can see.
>>
>> The error indicates that you are trying to reverse('polls:detail') and
not providing any arguments for the URL resolver (or are passing an
empty/missing variable). In the template, this would probably look
something like {% url 'polls:detail' %}. I would guess that you are
forgetting question.id after the view name, assuming you are using the same
variable names as the tutorial.
>>
>> Check near the bottom of the stack trace on the page, I bet it has a {%
url %} tag highlighted as the culprit.
>>
>> -James
>>
>> On May 7, 2015 12:09 AM, "H M"  wrote:
>>>
>>> I am on part 4 django tutorial. The tutorial is very good and I easily
get on part 4 but
>>>
>>> I get error: Reverse for 'detail' with arguments '('',)' and keyword
arguments '{}' not found. 1 pattern(s) tried:
[u'polls/(?P\\d+)/$']
>>>
>>> Am I missing something?
>>>
>>> My code is following:
>>>
>>>> urlpatterns = patterns('',
>>>> url(r'^$', views.index, name='index'),
>>>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>>> url(r'^(?P\d+)/results/$',views.results,
name='results'),
>>>> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
>>>
>>>
>>> views.py:
>>>
>>>> from django.shortcuts import get_object_or_404, render
>>>> from django.http import HttpResponseRedirect, HttpResponse
>>>> from django.template import RequestContext, loader
>>>> from polls.models import Question, Choice
>>>> from django.http import Http404
>>>> from django.core.urlresolvers import reverse
>>>>
>>>>
>>>> def index(request):
>>>> latest_question_list =  Question.objects.order_by('-pub_date')[:5]
>>>> template = loader.get_template('polls/index.html')
>>>> context = RequestContext(request, {'latest_question_list' :
latest_question_list, })
>>>> return HttpResponse(template.render(context))
>>>>
>>>> def detail(request, question_id):
>>>> try:
>>>> question = Question.objects.get(pk = question_id)
>>>> except Question.DoesNotExist:
>>>> raise Http404("Question ne postoji")
>>>> return render(request, 'polls/detail.html', {'question': question})
>>>>
>>>> def results(request, question_id):
>>>> question = get_object_or_404(Question, pk = question_id)
>>>> return render(request, 'polls/results.html', {'guestion':
question})
>>>>
>>>>
>>>> def vote(request, question_id):
>>>> p = get_object_or_404(Question, pk=question_id)
>>>> try:
>>>> selected_choice  = p.choice_set.get(pk=request.POST['choice'])
>>>> except (KeyError, Choice.DoesNotExist):
>>>> return render(request, 'polls/detail.html', {
>>>> 'question': p,
>>>> 'error_message': "Nijesi izabrao pitanje.",
>>>>  })
>>>> else:
>>>> selected_choice.votes += 1
>>>> selected_choice.save()
>>>> return HttpResponseRedirect(reverse('polls:results', args=(p.id
,)))
>>>
>>>
>>>
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, se

Re: httml form to django

2015-05-20 Thread Luis Zárate
And you need to put inside the form the csrf token .

{% csrf_token %} ...

See: https://docs.djangoproject.com/en/1.8/ref/csrf/



2015-05-20 16:40 GMT-06:00 술욱 :

> Hi,
>
> just make sure you match your input names with what Django expects. For
> example:
>
> If the HTML is  your Form will need a "username"
> field.
>
> HTH,
> Norberto
>
> 2015-05-20 18:24 GMT-03:00 dk :
> > i have a regular form in the template.   the user and the password since
> the
> > web designer did it like that.
> > can I still use it in django view?
> >
> > any particular way that's need to be use?  or we need to change it to use
> > django forms?
> >
> > =)
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To unsubscribe from this group and stop receiving emails from it, send 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/8070bda1-e549-4a3a-89ee-7c1e1df9ff2c%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/CADut3oAaXtGjzK9repN_waOzn0SsuWkT3Mp5DYhzMWTzosUk3g%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOS6PFAy0GwGggR7_wgYYMxcevrKvsSMQtyvKFXxa5SQg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Kivy and Djangp

2015-05-20 Thread Luis Zárate
Take a look at this http://kivy.org/docs/api-kivy.network.urlrequest.html
for Kivy
and http://www.django-rest-framework.org/ for django.

You need to do a web service with django I suggest a restfull service and
with kivy urlrequest create a client.



2015-05-13 18:07 GMT-06:00 john :

>  Kivy is the client side of the project.  Like any client (that includes
> Kivy) you would use http (that's the normal setup) or maybe pycurl (not to
> sure pycurl is pure python and you need pure python to work with Kivy) to
> access the URL (the address of your django URL).  On the django side the
> URL points to the view and the view will process the request and return
> your data.  The return data format will be up to you - maybe json or xml.
> Have you taken a look at django-restful- framework?
>
> Johnf
>
>
> On 05/13/2015 03:12 PM, steven kyalo wrote:
>
>  Hello everyone,
>
>  Am doing a mobile app using Kivy. The app should be getting some data
> from a server, for which i have used Django to develop the server side
> requirements.
>
>  My problem is where do i put my Kivy scripts so that i can access the
> Django application web services. Which scripts of Django do i have to
> access? - the urls or the views? Kindly help me understand this.
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9d3c53ed-3dad-4a57-9e7d-8fe7a6673205%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/5553E726.5010509%40jfcomputer.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPTr_qQ7LmccchsTkZqhTEu%3DiJRT1p%3D2%2B96cvxH3Vwo0Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: change the style of the forms been render in the httml?

2015-05-21 Thread Luis Zárate
It is easy, you only need to put id attribute to form statement like this

 {{form.as_p}}

In CSS use cascade starting by #myform.

Other thing I was used form.as_p for printing as , but you could used
form.as_ul or form.as_table too.  By default as_table is set when you do
{{form}}



El jueves, 21 de mayo de 2015, dk  escribió:
> Thanks Galia, since I only have 2 fields, I think the second options will
be the faster,   do you have an example? no how to override the id? or the
class?
> in the template I am doing  {{ form }}   I even try to do something
like   {{ form }}
> but that doesn't change it =(  thanks.
> On Thursday, May 21, 2015 at 2:42:12 AM UTC-5, Galia Ladiray wrote:
>>
>> What you want to do is to add a class attribute to your django widget
using attrs so that they will be rendered with this class, then to add the
style you want to this class in your CSS section,
>> This doc shows how to do it:
>> https://docs.djangoproject.com/en/1.8/ref/forms/widgets/
>> You can of course override the style as well, for example using the
rendered id of your field, but it is less cleaner, since you will need to
repeat this for every field
>>
>> On Thursday, May 21, 2015 at 1:00:50 AM UTC+2, dk wrote:
>>>
>>> I did a form class and renders fine in the html.
>>> but look ugly, I do have another field directly done directly in the
HTML with a style like this and look pretty how can I put it to the form?
>>> can I override the "style"? or can I change the class? so I can change
the look?   thanks guys.
>>> .text_line {
>>>  -moz-box-shadow:inset 0px 1px 0px 0px #ff;
>>>  -webkit-box-shadow:inset 0px 1px 0px 0px #ff;
>>>  box-shadow:inset 0px 1px 0px 0px #ff;
>>>  background-color:#ededed;
>>>  -moz-border-radius:6px;
>>>  -webkit-border-radius:6px;
>>>  border-radius:6px;
>>>  border:1px solid #dcdcdc;
>>>  display:inline-block;
>>>  cursor:pointer;
>>>  color:#77;
>>>  font-family:arial;
>>>  font-size:20px;
>>>  font-weight:bold;
>>>  padding:6px 24px;
>>>  text-decoration:none;
>>>  text-shadow:0px 1px 0px #ff;
>>> }
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/2824dccf-ac12-4183-8ced-f4ec1917e49a%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMdVUa%2Bp_Nd5%2B%3DtcnGnvVKzFS-OqJ8_2ac7QVKGH%3DAW0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


httml form to django

2015-05-21 Thread Luis Zárate
You don't need to alter any model, only need to create a form class
(better) or using request.POST.get("username").

If you want to do in right way
See
https://docs.djangoproject.com/en/1.8/topics/forms/


El jueves, 21 de mayo de 2015, dk  escribió:
> I am not going to update any models for the database or anything I just
need some info from the user that will be process by the view.
> I could put that info in the url as a variable such /?=variable.
> and then get it with
> info = request.GET.get("info", "")
> but its little ugly since you display it on the url.
>
> On Wednesday, May 20, 2015 at 9:07:11 PM UTC-5, luisza14 wrote:
>>
>> And you need to put inside the form the csrf token .
>>
>> {% csrf_token %} ...
>>
>> See: https://docs.djangoproject.com/en/1.8/ref/csrf/
>>
>>
>> 2015-05-20 16:40 GMT-06:00 술욱 :
>>>
>>> Hi,
>>>
>>> just make sure you match your input names with what Django expects. For
example:
>>>
>>> If the HTML is  your Form will need a "username"
field.
>>>
>>> HTH,
>>> Norberto
>>>
>>> 2015-05-20 18:24 GMT-03:00 dk :
>>> > i have a regular form in the template.   the user and the password
since the
>>> > web designer did it like that.
>>> > can I still use it in django view?
>>> >
>>> > any particular way that's need to be use?  or we need to change it to
use
>>> > django forms?
>>> >
>>> > =)
>>> >
>>> > --
>>> > You received this message because you are subscribed 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/8070bda1-e549-4a3a-89ee-7c1e1df9ff2c%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...@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/CADut3oAaXtGjzK9repN_waOzn0SsuWkT3Mp5DYhzMWTzosUk3g%40mail.gmail.com
.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/cbe6f8ba-c31e-4fe7-93b2-309178a038b8%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyN8ntB%3DNs-1zyoe1E7d0yDUMMcOR9gpS%2BEAgRE6J%3DBXTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to concatenate two variables in a template for evaluation..

2015-05-21 Thread Luis Zárate
Mmm maybe creating a tag
https://docs.djangoproject.com/en/1.8/howto/custom-template-tags/#writing-custom-template-tags


In template {% mytag obj prop %}

In tag function

def mytag(obj, prop):
 return getattr(obj, prop)



El miércoles, 20 de mayo de 2015, rishi sijariya 
escribió:
> Hi Hayyan Rafig,
>
>  did you find your solution of adding two variable , if yes pls share
with us, or any one can help pls
>
> On Wednesday, 10 August 2011 03:07:25 UTC+5:30, Hayyan Rafiq wrote:
>>
>> Okay then which way do u recommend that i should follow in case
>> i need to displays objects with different no of properties
>> Example obj has propA and PropB
>> {{obj.propA}}
>> {{obj.propB}}
>> would work but i want it to be dynamic since the no and name of
properties may vary..
>> I tried writing all the properties of an object in a list and passing
that list obj to template
>> but it seems this is not just possible.. since
>> {% for prop in properties %}
>>   {{obj}}+{{.prop}}
>>  {% endfor %}
>> or other things similar to above do not work
>>
>> Any suggestions..
>>
>> > Date: Tue, 9 Aug 2011 17:25:42 -0400
>> > Subject: Re: How to concatenate two variables in a template for
evaluation..
>> > From: sh...@milochik.com
>> > To: django...@googlegroups.com
>> >
>> > You have to write it as {{ obj.title }} in your template. Django
>> > templates are designed to allow very little in the way of logic; that
>> > should take place in your views.
>> >
>> > --
>> > You received this message because you are subscribed to the Google
Groups "Django users" group.
>> > To post to this group, send email to django...@googlegroups.com.
>> > To unsubscribe from this group, send email to
django-users...@googlegroups.com.
>> > For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.
>> >
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/bbe5399f-15e3-43b5-ae7d-d79e5f54191b%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMVdUVzhFzVsj54SZoiR5NDLx9RYZoqgYJ0Am6za%3D3pHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to use unlocalize in views

2015-05-25 Thread Luis Zárate
Set in yours Settings
USE_I18N = FalseUSE_L10N = False
See:
https://docs.djangoproject.com/en/1.8/ref/settings/#use-i18n

2015-05-25 7:01 GMT-06:00 :

> Hello guys!
>
> Is there a way to use unlocalize in views? I know that I can use this in
> template (
> https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#localize)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/767e0d4e-9671-4363-a09c-1e67839994cc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNLG4kN9u44eRnGFdvyAunjUMJiL%2B6ZOjZ-ZJZe_mikiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrating from sqllite3 to postgres

2015-05-25 Thread Luis Zárate
Mmm probably you are looking for export /import data in django.

For export :
python manage.py dumpdata --format=json myapp > data.json

For import:
python manage.py loaddata data.json

See

https://docs.djangoproject.com/en/1.8/ref/django-admin/#loaddata-fixture-fixture

El lunes, 25 de mayo de 2015, Peter of the Norse 
escribió:
>
>> On May 21, 2015, at 11:24 PM, jaspinder singh 
wrote:
>>
>> I have developed an app using sqllite. But my Heroku doesn't support
sqllite and the data keeps leaking every 24 hours. Can someone list the
steps how to change from sqllite3 to postgres
>>
>
>
> From sqlite:
> sqlite> .output backup.sql
> sqlite> .dump
>
> From the command line:
> $ psql django_db -1f backup.sql
>
> You may have to edit the .sql file to make it work. Good luck.
>
> Peter of the Norse
> rahmc...@radio1190.org
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/53FD5433-F4CA-4684-9BF5-E9FA4EA786C4%40Radio1190.org
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyONP3Cw%2BKrGYd%2BzLVcNrCBEr1YH3eW6PhOY7UMsYZN1wQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gmail oAUTH application for Django

2015-05-26 Thread Luis Zárate
Why don't you use django-allauth?

http://www.intenct.nl/projects/django-allauth/





2015-05-26 7:48 GMT-06:00 Great Avenger Singh :

> Hello Django-People,
>
> I am writing a Gmail oAuth2 application with Django so  one can login to
> Gmail. (I have Desktop Python script ready with me)
>
> After doing some Google I am able to find following Tutorial:
>
>
> http://www.artandlogic.com/blog/2014/04/tutorial-adding-facebooktwittergoogle-authentication-to-a-django-application/
>
> This explains everything I need but I guess there is some change in Django
> Working system from the time when this tutorial is written, Please correct
> me if I am wrong?
>
> Do I need to create Django Project for Gmail oAUTH or I should make it
> Django app?
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/86054741-65e6-4422-aad6-d3c9ccbc1cdc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyORjtV%3D58Hd3X68wk1__b6Y0_BPBm%2BsC9gngX_P1uo4cg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django formset hidden id field

2015-05-29 Thread Luis Zárate
Mmm I am not sure of this but I guest that this number is not a primary key
(pk start in 1 not in 0 in  postgres and mysql), it is a formset control
number used by formset for group fields in the server side ( for create
forms in correct order also)


El miércoles, 27 de mayo de 2015, Matthias Müller 
escribió:
>> Just in general, is it a good idea to expose primary keys like this?
sometimes you can see them in urls too, like: www.yoursite/blog/1/,  1
would be the primary key of a blog.
>
> It's an easy way to refer to an object. Unless there is a secure
connection it's this is IMHO the best way to refer to the object.
> Of cause you can do it complicated ( with look up tables on the server
etc. )  but the result matters.
> And I like to keep my life and my apps simple <
https://mail.google.com/mail/e/softbank_ne_jp/337>
> 2015-05-27 16:05 GMT+02:00 Cheng Guo :
>>
>> Thank you! Yes, I forgot about the csrf. You are right, it would be
difficult to fake the CSRF string.
>> Just in general, is it a good idea to expose primary keys like this?
sometimes you can see them in urls too, like: www.yoursite/blog/1/,  1
would be the primary key of a blog.
>> On Wednesday, 27 May 2015 22:01:37 UTC+8, Matthias Müller wrote:
>>>
>>> Without looking at the link I guess that you explantion is more or less
correct.
>>> But it's not a security issue that the database is updated by a form.
It has to be updated by a form. To make it a correct django form there is a
hidden field with the CSRF token. This protects the database being updated
from any illegal source.
>>> In your example there is this csrf missing, Most probably for
didactical reasons.
>>> Refer to https://docs.djangoproject.com/en/1.8/ref/csrf/
>>> Cheers
>>> Matthias
>>> 2015-05-27 15:47 GMT+02:00 Cheng Guo :

 Hello,

 I have a formset and when I render it, Django would include this line
in the HTML:

 

 I am curious what is the purpose of having an id field here.

 I mean in what situation would you use it. I did look through
Django's documentation on formsetbut cannot find much documentation on this.

 One answer I got is that this id field is the value of the primary key
of the model bound to this form. It is there so that when the formset
updates, people can use it to retrieve the corresponding record from the
database.
 Is the above explaination correct?
 If this explaination is correct, then my next question is, wouldn't it
be dangerous to expose the primary key like that? I can make a post call to
your server with a modified pk which can mess up your database.
 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/18e0d250-c4a9-4060-ae4f-19afb57566e0%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/285ee494-8b28-42cd-8af9-4cb33983a82c%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/CAA2xsHSSy03DSHaBfT4RNxv4zYJUBTdySLvg__mjMDheSemE4w%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMWvzFEYCR9KESXpqFYErbmX0XmYtOW_oReu4qs35b7Uw%40mail.gmail.com.
For more options, v

Re: I am pretty Good with Django Now but wondered how to program with python with django

2015-06-06 Thread Luis Zárate
If you want open source IDE maybe aptana is the best option for me.
I also usted to progam with ninja ide and eclipse + pydev, but now i use
pluma in small projects and aptana in big projects, and obviously django
shell and admin commands on console.


El lunes, 1 de junio de 2015, James Schneider 
escribió:
> I've never used IDLE, but from a glance I don't see why not. I'm not sure
if/how it will handle the HTML files, but it would probably work fine. I
would highly recommend PyCharm, though. The paid version has extra goodies
specific to Django, but it works just fine without it. I use it exclusively
if I have a GUI available, and vim when I'm connecting in via a shell. I
even have the community version of PyCharm spawning the Django server for
me.
>
> Django apps are primarily made up of plain python files. How you create
them is up to you. Use the tool that you're comfortable with, or give a few
others a shake.
>
> -James
>
> On Jun 1, 2015 8:19 PM, "djangocharm2020" 
wrote:
>>
>> I use django for web dev and have been getting good but started out with
python and wondered if i could just program my websites with the idle ?
Just curious Im sure you can but want to see if someone has done it and has
some tips . Thank you
>>
>> Robert
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
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/ce3e5895-62f6-44c1-8950-d7e8decca88f%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/CA%2Be%2BciX8hoYP7AwxZaLJ_KbfVnuoEXnj%3Dx6zzKmLNtpmFd0S8A%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMHk3kMCk1fY5DdrB_1rN-j1NtLbdGU57BaU6KfmQKn-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-06-06 Thread Luis Zárate
Did you serch for something like this https://www.*odoo*.com/, It is not
django but it is in python and  released under the AGPL license.

If you want to build your software stack based in django then start
searching in https://www.djangopackages.com/.


1. *CRM* system
 -> client database
 -> ticket system (client communication including sending emails from
backend)


 2. *Shop*
 -> calender booking system
 -> PDF billing generation
https://github.com/burke-software/django-report-builder

 3. email *autoresponder* system
 4. *CMS* functionality would also help


django-oscar is interesting software, take a look at
https://github.com/django-oscar/django-oscar




2015-06-02 11:23 GMT-06:00 ThomasTheDjangoFan <
stefan.eichholz.ber...@googlemail.com>:

> Hi guys,
>
> I am planning on a bigger django project with a lot of functionality.
>
> The thing is that I have NO experience with existing django-apps that
> might fit and definetly need your help.
>
> Can you give me a hint which existing (and stable) django-apps I could use
> as a foundation for my project?
>
> Those are the functions that I would like to implement (ordered by
> priority)
>  1. *CRM* system
>  -> client database
>  -> ticket system (client communication including sending emails from
> backend)
>  2. *Shop*
>  -> calender booking system
>  -> PDF billing generation
>  3. email *autoresponder* system
>  4. *CMS* functionality would also help
>
> I would be really thankful if you could guide me to the right direction.
> Which way shall I go?
>
> Kind regards
> Thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOurKKtj%3DkJpcf2%2B4VBz4ZCJVocPaAnAk4Z0Zj0OD64Zg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help needed for big django project (crm+shop+cms+autoresponder). What apps shall I build on?

2015-06-06 Thread Luis Zárate
Some useful links:

1. CRM system
>
https://github.com/kunitoki/nublas

 -> client database
>
 -> ticket system (client communication including sending emails from
> backend)
>

https://github.com/wyldebeast-wunderliebe/mrwolfe
https://github.com/rossp/django-helpdesk

 2. Shop

>  -> calender booking system
>

https://github.com/llazzaro/django-scheduler

 -> PDF billing generation
>

https://github.com/burke-software/django-report-builder
https://github.com/hirokiky/django-reportmail
Create your own report using html with https://github.com/ebar0n/xhtml2pdf

3. email autoresponder system
>

https://github.com/wreckah/django-mailz

4. CMS functionality would also help
>

https://github.com/divio/django-cms
https://github.com/torchbox/wagtail
https://github.com/stephenmcd/mezzanine

If you need to create addicional software or library then we (my company)
could offer you commercial support or we could be your partner.
Contact me privately (see my email in the email header) and talk me about
your plans.


2015-06-02 11:23 GMT-06:00 ThomasTheDjangoFan <
stefan.eichholz.ber...@googlemail.com>:

> Hi guys,
>
> I am planning on a bigger django project with a lot of functionality.
>
> The thing is that I have NO experience with existing django-apps that
> might fit and definetly need your help.
>
> Can you give me a hint which existing (and stable) django-apps I could use
> as a foundation for my project?
>
> Those are the functions that I would like to implement (ordered by
> priority)
>  1. *CRM* system
>  -> client database
>  -> ticket system (client communication including sending emails from
> backend)
>  2. *Shop*
>  -> calender booking system
>  -> PDF billing generation
>  3. email *autoresponder* system
>  4. *CMS* functionality would also help
>
> I would be really thankful if you could guide me to the right direction.
> Which way shall I go?
>
> Kind regards
> Thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/14165632-4db7-4d8c-a30e-827c3730ca3a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMLi%3DsdDKcrWjSD2JFog9RvR%2BjJKpX-d1HaHYVifuShuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to uninstall the django version

2015-06-06 Thread Luis Zárate
If you do a virtual environment with pip it is easy.

$ pip uninstall django



2015-06-02 23:45 GMT-06:00 Siddharth Tanna :

> copy the file named django-admin from django folder in c: and paste it in
> python folder[root 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/d60f805e-edab-44c4-918f-28eb2152f8e0%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMUqeaAEyeKQHEidp8g1j5i%3DVSiebZgncSc6TFRVRRm_A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: No Email field in the User Registration Form

2015-06-06 Thread Luis Zárate
Where is your meta class ?

It is not in __init__() function, is it?
if it is then problem is there.

class Meta:
> model = CustomUser
> fields = ['email',]
>



del self.fields['username']
>

this is wrong, use exclude in Meta class to remove fields




-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNk6Zbw7nZwaELzpxD9FLN5-Kh35herfak5Z9rc9RhRYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where can I find the admin/base_site.html

2015-06-07 Thread Luis Zárate
python -c "
import sys
sys.path = sys.path[1:]
import django
print(django.__path__[0] +'contrib/admin/templates/admin/base_site.html')"

2015-06-07 1:18 GMT-06:00 shimanyi valentino :

> python -c "import syssys.path = sys.path[1:]import 
> djangoprint(django.__path__)"
>
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMO5szjy0ousM1R%2BG8K4Era1c_%3DwD8LZuYpWgg77YMdzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to test email-verification in django-registration-redux application on localhost?

2015-06-09 Thread Luis Zárate
Put  SITE_ID = 1 in your settings file to fix this error


2015-06-09 7:01 GMT-06:00 akshat :

> You're using the Django "sites framework" without having set the SITE_ID 
> setting. Create a site in your database and set the SITE_ID setting or pass a 
> request to Site.objects.get_current() to fix this error
>
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyM3sv4pf3Hs%3DjSzqeh5XsaRhMNLd-7-w4grG8Dr8AaAWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Forum app

2015-06-14 Thread Luis Zárate
Those links maybe can help you

https://github.com/vicalloy/LBForum
https://github.com/nitely/Spirit


For more see

https://www.djangopackages.com/grids/g/forums/


2015-06-14 4:32 GMT-06:00 Arindam :

> What are the stable forum apps ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/0011nou1sf8nkt4yxvseugcs.1434277926253%40email.android.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOROeO93SVRSF0HvYh38GXjATku_HbuXTFN8Z4BJ%3DBz8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Errors with django-rest-auth and django-allauth

2015-06-20 Thread Luis Zárate
As say Stephen Butler you need to install django.contrib.sites (it not
enable by default) and set

SITE_ID = 1 in your settings.

Here is the reference:
https://docs.djangoproject.com/en/1.8/ref/contrib/sites/#enabling-the-sites-framework



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOFoMOBQnRXpdmH1W%3D9THLv8KmuqY6xJqZo98h_Y2Se9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Best Queryset Practice

2015-06-22 Thread Luis Zárate
Querysets are lazy,  so Model.objects.all().filter(...) execute a same
query that Model.objects.filter(...).all()  and Model.objects.filter(...).
For check this tray  in shell

str(Model.objects.all().filter(pk=1).query)

str(Model.objects.filter(pk=1).all().query)

str(Model.objects.filter(pk=1).query)


2015-06-22 10:32 GMT-06:00 Tim Graham :

> Have you had a look at the documentation?
>
> https://docs.djangoproject.com/en/stable/topics/db/optimization/#understand-querysets
>
> On Monday, June 22, 2015 at 11:28:51 AM UTC-4, Paritosh Gupta wrote:
>>
>> Hello,
>>
>> Do advice me on:
>>
>> queryset = User.objects.all()
>> user = get_object_or_404(pk=id)
>>
>>
>>
>> > Is it better to call the list in queryset and then apply filter or
>> directly use .filter() in the first step.
>>
>> > If so, when we call all the object frequently does it cache and from
>> cache we do filter or does it db everytime.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/6879eaf6-d906-40ff-8ff1-bed514621856%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPS4NBuqqGx_D9OAiEBLyPjAq8QMWy%3DbAht1%2B3PDnNRZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModelAdmin.save_as integrity error

2015-06-23 Thread Luis Zárate
Can I see your Substance save method?  Maybe there are something wrong.



El martes, 23 de junio de 2015, Mike Dewhirst 
escribió:
> I commented out the save() method in the Substance model (the master
model with a number of 1:1 and 1:n relationships) and it started saving as
new successfully. Unfortunately I do a lot of stuff in that save() method
so I have to figure out how to do that another way.
>
> Mike
>
> On 23/06/2015 12:57 PM, Mike Dewhirst wrote:
>>
>> The following is all I could find in the docs about ModelAdmin.save_as
>>
>> ModelAdmin.save_as
>> (
https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_as
)
>>
>>
>>  Set save_as to enable a “save as† feature on admin change forms.
>>
>>  Normally, objects have three save options: “Save†, “Save and
>> continue editing† and “Save and add another†. If save_as is True,
>> “Save and add another† will be replaced by a “Save as† button.
>>
>>  “Save as† means the object will be saved as a new object (with
>> a new ID), rather than the old object.
>>
>>  By default, save_as is set to False.
>>
>>
>>
>> I'm having problems with [save as new] when the model has inlines. Is
>> there a known gotcha in this area?
>>
>> The particular error I'm seeing is ...
>>
>>
>>
>> IntegrityError at /admin/substance/substance/20/
>>
>> duplicate key value violates unique constraint
>> "substance_liquid_substance_id_key"
>> DETAIL:  Key (substance_id)=(54) already exists.
>>
>> Request Method: POST
>> Request URL: http://localhost:8000/admin/substance/substance/20/
>> Django Version: 1.7.8
>> Exception Type: IntegrityError
>> Exception Value:
>>
>> duplicate key value violates unique constraint
>> "substance_liquid_substance_id_key"
>> DETAIL:  Key (substance_id)=(54) already exists.
>>
>> Exception Location:
>> C:\Users\mike\env\xxex3\lib\site-packages\django\db\backends\utils.py in
>> execute, line 65
>> Python Executable: C:\Users\mike\env\xxex3\Scripts\python.exe
>> Python Version: 3.4.3
>> Python Path:
>>
>> ['/var/www/ssds',
>>   'C:\\Users\\mike\\env\\xxex3\\ssds',
>>
>>
'C:\\Users\\mike\\env\\xxex3\\lib\\site-packages\\psycopg2-2.5.4-py3.4-win32.egg',
>>
>>
>>
'C:\\Users\\mike\\env\\xxex3\\lib\\site-packages\\pillow-2.7.0-py3.4-win32.egg',
>>
>>   'C:\\WINDOWS\\SYSTEM32\\python34.zip',
>>   'C:\\Users\\mike\\env\\xxex3\\DLLs',
>>   'C:\\Users\\mike\\env\\xxex3\\lib',
>>   'C:\\Users\\mike\\env\\xxex3\\Scripts',
>>   'C:\\Python34\\Lib',
>>   'C:\\Python34\\DLLs',
>>   'C:\\Users\\mike\\env\\xxex3',
>>   'C:\\Users\\mike\\env\\xxex3\\lib\\site-packages',
>>   'C:/Users/mike/env/xxex3/ssds']
>>
>> Server time: Tue, 23 Jun 2015 12:08:44 +1000
>>
>>
>> The relationship between substance and liquid is 1:1 and the error is
>> highlighted in my liquid.save() method. However, when I comment that
>> whole save() method out and try [save as new] again the error doesn't
>> change, just the substance pk which increments from 54 (as above) to 55
>> and none of my code seems to be involved. Or at least the traceback
>> doesn't highlight any.
>>
>> There appear to be no problems with the code saving normally and there
>> are hundreds of unit tests all passing successfully.
>>
>> I would really appreciate any help. Is there more info I can provide?
>>
>> Python 3.4 (Windows 8.1)
>> Django 1.7.8 (Windows 8.1)
>> Postgres 9.1 (Ubuntu 12.04)
>>
>> Thanks for any hints.
>>
>> Mike
>>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/5588F7B9.1030906%40dewhirst.com.au
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPKTdDLEMdU5RoeA-Q2CFK42DhPQ5ooqGVCKrHKq447Rw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Push Pics on to Website page?

2015-06-28 Thread Luis Zárate
Take a look this:
https://github.com/caioariede/django-location-field

2015-06-28 9:03 GMT-06:00 :

> Hi Everyone,
>
> Within Django is there a module to push picture files, i.e., jpeg, gif,
> or an interface to Google's Map.API, onto a web site page?
>
> Regards,
> Hal
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/7fd61f33-37df-40fc-ab22-e493b7b90307%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMve%2B1ib1SM9aA_vwvL_D4Deh-Dah1oV1npRYk55Gn3LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Búsquedas en una aplicacion

2015-07-07 Thread Luis Zárate
¿Que tipo de búsquedas desea hacer?

Si son consultas en la base de datos puede usar el ORM de django para
construir la consulta adecuada

https://docs.djangoproject.com/en/1.8/topics/db/queries/

Si lo que busca es hacer un buscador para contenido de una página (blog,
web page)  entonces puede ser haystack  o si quiere algo más crudo puede
ser whoosh (https://pypi.python.org/pypi/Whoosh/)

¿Busca algo como esto http://haystacksearch.org/ ?

Saludos

2015-07-06 10:16 GMT-06:00 Mario R. Osorio :

> Carlos, este grupo es en inglés.
>
> Puedes buscar duda en español en:
>
> https://mail.python.org/mailman/listinfo/python-es
>
> Yo no te ayudo porque no tengo experiencia en el tema además, tu pregunta
> es un poco escueta. Falta mucha información
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/0926dbbb-f27e-44bc-808a-4bb4225c65a6%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPfWL1KF%2B_0vouyYCeZi7eW4LM6HScauW7i7zk1vhgQ6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Django 1.8 feature in 1.7.9?

2015-07-09 Thread Luis Zárate
Maybe you need to uninstall django first, clear pip cache and install again.

pip uninstall django==1.7.9
rm ~/.cache/pip/*# or wherever it is pip cache folder
pip install django==1.7.9




El jueves, 9 de julio de 2015, Tim Graham  escribió:
> The consequences of replacing the bad wheel file weren't entirely clear.
Knowing what we know now, I guess next time (hopefully there won't be one)
I will just roll a new version. If you think I should do that at this
point, let me know.
>
> On Thursday, July 9, 2015 at 10:56:07 AM UTC-4, Rebecca Muraya wrote:
>>
>> I had this error. Pip caches things in a few places, maybe more:
>>   ~/.pip/
>>   /tmp/
>>   ~/.cache/pip/
>>
>> On Thursday, July 9, 2015 at 10:21:45 AM UTC-4, Karen Tracey wrote:
>>>
>>> On Thu, Jul 9, 2015 at 9:17 AM, Tim Graham  wrote:

 The 1.7.9 wheel file that was first uploaded to PyPI was corrupted. I
uploaded a corrected file about 2 hours after the initial release. Sorry
for inconvenience and confusion!

>>>
>>> Any guidance on how to recover from a "cached" corrupted wheel?
>>>
>>> e.g.:
>>>
>>> Collecting Django<1.8,>=1.7.0
>>> Using cached Django-1.7.9-py2.py3-none-any.whl
>>> Hash of the package
https://pypi.python.org/packages/py2.py3/D/Django/Django-1.7.9-py2.py3-none-any.whl#md5=2df76c904...
(from https://pypi.python.org/simple/django/)
(52358ac5f48fd514d6c4eb9e08830985) doesn't match the expected hash 2df76c904
>>> 53477a9d0bb6a1608f0dfa5!
>>> Bad md5 hash for package
https://pypi.python.org/packages/py2.py3/D/Django/Django-1.7.9-py2.py3-none-any.whl#md5=2df76c90453477a9d0bb6a1608f0dfa5
(from https://pypi.python.org/simple/django/)
>>>
>>> Would it be better in general to replace "bad" versions with new
releases with new numbers rather than creating a 2nd differing released
version of supposedly the same thing?
>>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/9a51a562-7729-400c-88f7-84a827ff88ef%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP3JKdMqjeOJDjyEAdWGZAy-grcvpJYpGjsQrUMPQB4sw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: STATIC_URL with thumbnail_url Template Tag

2015-07-10 Thread Luis Zárate
Hi, Stephanie

Your are using easy-thumbnails, right?
so, are you sure that Pillow are right installed ?

http://easy-thumbnails.readthedocs.org/en/latest/usage/

As I see your questions is same that this question
http://stackoverflow.com/questions/12956788/how-to-thumbnail-static-files


thumbnail_url is a wrapper for get-thumbnailer, so are you configure
static_root in your settings ?


http://easy-thumbnails.readthedocs.org/en/latest/usage/#get-thumbnailer



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNbTgt8MweY0ZCJLGK9zKv_9kD-9NA6Az9BD7jFA5zfaw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: design decision tree survey using django admin interface

2015-07-14 Thread Luis Zárate
I know it is not the answer of your question but for your survey design it
is important that you see this links.

https://github.com/chrisglass/django_polymorphic
https://github.com/django-mptt/django-mptt/

I know that because I did a survey app years ago, but unfortunately it is
not free and it is in spanish too.



2015-07-14 17:32 GMT-06:00 anc :

> I need to build a survey tool which provides an interface to the survey
> administrator to add/edit/delete questions. I understand we can do it
> through the admin interface. But can we modify the admin interface to
> provide branched/skip logic feature so that the administrator can design a
> survey where the next question to be displayed will depend on the answer of
> the previous question? I mean this branch logic feature will allow the
> survey administrator to create a decision tree survey.
>
>
> Thanks,
> Ananya
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/c869-d9a2-4bf2-a370-efd77ad2e925%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMxpBuaMXm728DuaTh-TXmQ2jrjjiZ9qjTw7i7%3DBoFF0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: my mysite/templates/admin/base_site.html is ignored (tutorial unclear?)

2016-04-25 Thread Luis Zárate
Sory for not answer before, but I think I could help.

First you need to know how django find the templates, so take a look
template loaders

https://docs.djangoproject.com/en/1.9/ref/templates/api/#django.template.loaders.filesystem.Loader

There are two default loaders (filesystem and app )

['django.template.loaders.filesystem.Loader',
 'django.template.loaders.app_directories.Loader']

so take a look 
https://docs.djangoproject.com/en/1.9/ref/settings/#template-loaders

So is important the app order.




2016-04-22 3:21 GMT-06:00 woodz :

> Aloha Andreas Ka,
>
> have you been able to get this to work? I am currently going through the
> version 1.9 and facing the same issue. Is the suggestion of Marc Moncrief
> * a way to go? Did you go for your own solution and would you mind to
> share?*Thanks a lot, woodz
>
>
> On Sunday, November 16, 2014 at 7:15:59 PM UTC+1, Andreas Ka wrote:
>>
>> I am working through
>> https://docs.djangoproject.com/en/1.7/intro/tutorial02
>> so far all went fine - but now *templates changes just don't work.*
>>
>>
>>
>> I think there must be a flaw in that tutorial, something missing,
>> or something different in django 1.7.1 ?
>>
>> https://docs.djangoproject.com/en/1.7/intro/tutorial02/#customize-the-admin-look-and-feel
>>
>>
>> my versions:
>>
>> python -c "import django; print(django.get_version())"
>> 1.7.1
>>
>> python --version
>> Python 2.7.3
>>
>>
>>
>> *SYMPTOM:*
>>
>> my changes in
>> mysite/templates/admin/base_site.html
>> are simply ignored.
>>
>>
>>
>> These are my files:
>>
>> mysite# tree
>> .
>> ├── db.sqlite3
>> ├── manage.py
>> ├── mysite
>> │   ├── __init__.py
>> │   ├── settings.py
>> │   ├── urls.py
>> │   └── wsgi.py
>> ├── polls
>> │   ├── admin.py
>> │   ├── __init__.py
>> │   ├── migrations
>> │   │   ├── 0001_initial.py
>> │   │   └── __init__.py
>> │   ├── models.py
>> │   ├── tests.py
>> │   └── views.py
>> └── templates
>> └── admin
>> └── base_site.html
>>
>>
>>
>> mysite/settings.py:
>>
>> TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
>>
>>
>> *Whatever I do, the page*
>> *http://myserver:8000/admin/polls/question/
>> *
>> *still keeps the old title 'Django administration'*
>>
>>
>> I want to understand how templates work, because I need them for my real
>> project.
>>
>> Thanks a lot!
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/7dd97c54-6128-4aa9-aab6-165a7c0c41ac%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMHGK%3DM6KYZfiy45UrxiAkzC2JF2HsgbJ5DrzpMy%3DeSDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django middleware process exception not call

2016-05-18 Thread Luis Zárate
Hi,

I was working with middleware that catch exceptions and redirect to other
view depending of except type.

My idea was raise custom exceptions in several parts of the code and catch
in middlewaware with proces exception function, but I have an exception
raise in template tag when template is render and after process exception
call, so this function is never call.

I surft in django code an understand what happen but I thing that django
could call process exception if exception occurred in template o have some
way to catch template exceptions, something like a function named process
template exception.







-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyONUKK2rsVRpAjYa4Yty3%2B4-m8ZMP4VcO-uaiWEbMVuyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is there a spanish version of Two Scoops of Django?

2016-05-18 Thread Luis Zárate
That sound very good, so if you need help with translations I could help
you in my few free time.

Break language barrier is so important for me, I think more people could
learn django faster and without discrimination.

So ViVa la libertad. :)

El martes, 17 de mayo de 2016, David Alejandro Reyes Milian <
davidreyesmilia...@gmail.com> escribió:
> Thanks for asking. I could like to make a full Spanish translation  of
this amazing book, how can I speak to Audrey or Danny? Can you help?
>
> Greetings!
>
> El martes, 17 de mayo de 2016, 17:09:22 (UTC-4), Russell Keith-Magee
escribió:
>>
>> Hi David,
>> To the best of my knowledge, there aren’t any translations of Two Scoops
available - but I’ve asked Audrey and Danny to confirm. If there is, I’ll
report back and let you know.
>> Yours,
>> Russ Magee %-)
>> On Tue, May 17, 2016 at 9:03 PM, David Alejandro Reyes Milian <
davidreye...@gmail.com> wrote:
>>>
>>> Do you know if there is a Spanish version of Two Scoops of Django?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users...@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/9548ab5d-d529-4eda-a84b-37c14780fd68%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/75d8bb7e-b610-4ade-b3cb-a351594be04e%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOo-BTYT6HHxh81bS6yxmM3-2j18rp7Mos%2Bc0cm92MkiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


is there any django app for opendata

2016-05-19 Thread Luis Zárate
Hi,

I interested in opendata and open government so I am looking for tools to
build a platform for a local government.

I really like django, I like to build system with it so I want to implement
something useful that help to create and transparent and eficient for free

Do you have some recommendation ?

Thanks


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPWH5ap%2BhVRb3C%3Dhtvh406it7ngCROCdzpV87yh0fioMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: is there any django app for opendata

2016-05-20 Thread Luis Zárate
Sure, I need something like CKAN, I saw it time ago and I forget it. Thanks
you.

I have not problem if I is not in Django, I like Python too and can learn
other frameworks.

Thanks you.

El viernes, 20 de mayo de 2016, Derek  escribió:
> Not to discourage you, but there is already a large Python project called
CKAN that tries to do exactly that: make data open and transparent.
> Its built on Pylons and SQLAlchemy, but maybe it will suit your needs,
and maybe you can contribute to improving it, rather than starting a new
project from scratch.
>
> On Friday, 20 May 2016 01:00:25 UTC+2, luisza14 wrote:
>>
>> Hi,
>>
>> I interested in opendata and open government so I am looking for tools
to build a platform for a local government.
>>
>> I really like django, I like to build system with it so I want to
implement something useful that help to create and transparent and eficient
for free
>>
>> Do you have some recommendation ?
>>
>> Thanks
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>> <
https://lh6.googleusercontent.com/proxy/8iqZANA8T-JlL2wQi5lEHRd-whdN6RJo8n0XbyX8BoycJFMGbhH6T-bhP0QOm-Q4oV4TE9rQPrATwAa1cO3rIb1FLPUUY_r5iM3pGkti34V9FaUp7Frah009olDr7HyrCUPdAny_5tnzwv9cvpqOxJoU7WphUmkSzvLoWRE4VWkYSvbkDrc0j0uPPhE92REFBYU8Vsdx0AQ=w5000-h5000
>
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/d295c3c3-bcb6-4c48-b2e0-9adf9b3e1531%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMU_n_e59ofJxZbMKO9%2BLLSQfWKCKU01fK2iwvkhJod7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Displaying a document

2016-05-21 Thread Luis Zárate
Do you have a model  with a fileField?


I think you are wrong passing file to template, if  you have a model with
filefield you can use media url something like

class Mymodel(Model):
  myfile = models.FileField(upload_to="my_file_path_in_media")


so you can use a form

class Myform(forms.ModelForm):

 class Meta:
 model=Mymodel
 fields = '__all__'

so in the view you have

if request.method=='POST':
   form = MyForm(request.POST, request.FILE)
   if form.is_valid():
instance=form.save()


so you can pass instance in template context

   render(request, 'mytemplate.html', {'instance': instance}

in your template you can put a link or whatever you want.

 download


take a look https://docs.djangoproject.com/en/1.9/topics/http/file-uploads/
form more info




2016-05-21 10:43 GMT-06:00 Wilfredo Rivera :

> Hello:
>
> I want to display an uploaded file in the browser. My website save the
> file in the database, but i don't have idea of how can the website display
> it once the user click on the link. I am new to django and programming in
> general so i am learning on a trial and error basis.
>
> The view that handles this is the following:
>
> def File_Open(request):
> if (request == request.FILES):
>file = request.FILES.open()
>return render(request, 'recruitment/open_file.html', {file : 'file'
> })
>
> and the url is this:
>
> url(r'^candidatelist/'
> r'resume-view/'
> r'(?P/$',
> views.File_Open,
> name = 'resume_view'
>
> I have search for how can i do this, but haven't found a satisfying
> answer. Please i will appreciate the help.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/b2cf38b0-6a6a-45c1-84b9-c4cf678b6c9d%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNDNt-9U3wCuqKzhuu6f61LmRFDt5DzyHvDFYyZUFoCGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Displaying a document

2016-05-21 Thread Luis Zárate
2016-05-21 13:21 GMT-06:00 Wilfredo Rivera :

> {{candidate.resumeFile}}"



{{candidate.resumeFile.name}}
"

Looking in your code probably you could be interested in
https://docs.djangoproject.com/ja/1.9/ref/class-based-views/generic-editing/



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP8_aZQ9FyL-q0ezyxuK8C1h3f6_ZjT_1zrxve0hVRX3A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to send e-mail asynchronously

2016-05-28 Thread Luis Zárate
I wrote something for send async notification that works with celery

https://github.com/luisza/async_notifications

There is a demo project and some ideas about how to implement it.

If you like you can use it and if you want to extend do it and let me know
for incorporate you're code.

El sábado, 28 de mayo de 2016, Akhil Lawrence 
escribió:
> You can create a celery task fro this. See this link for more details.
>
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
>
>
>
> On Saturday, 28 May 2016 19:51:49 UTC+5:30, 2me wrote:
>>
>> I have to implement a thread in order to test if (temperature>maximmum)
it sends an email .
>> I have done a python file which reads temperature and as  a begining I
have tested an aplication that  sends email when I access to its URL .
>> BUt I have no idea how to this into a thread !!! please help me
>>
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b1b51b16-2318-4022-9b20-495547931635%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPV_E8Q9S_y9f%2BCGjUhVih-c%2BUcn1m-kEWi63ZA9Z5%2BKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hi - I'm new to Python and DJango

2016-06-02 Thread Luis Zárate
Sure,

It's good enough and more.

There is some development in ERP but nothing stable or usable (not that I
known).

So if you are interested in develop something could be great know about.

Note: I thing first step is search what programs exists and try to
collaborate with one, but if nothing is good enough then start with new
develop and look for help.



El miércoles, 1 de junio de 2016, Notty Smurfy 
escribió:
> Hi all,
> i'm new to Django. Can anyone advise if this framework is good enough to
develop for an ERP system?
> 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/14504a53-e11b-4d01-915f-5e545ae93f91%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMJoCkY12F-7hcMUMyhBHd7yHwaCwJCbXBQJzYYRt8xhg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Suit admin panel - Static files configuration Django 1.6 not working

2016-06-02 Thread Luis Zárate
Where is  STATIC_ROOT ?

static_root path needs to match with nginx /static location.



El miércoles, 1 de junio de 2016, Roger Lanoue jr 
escribió:
> Hi Django users group.
> I am test and learning django out. I have a testing server and got my
test page up.
> Started to play with the Django suit control panel and ran in to some
problems with my setup.
> Server: Digital Ocean one click install.
> Ubuntu 14.04
> Nginx
> Postgres
> python 2.7
> django 1.6
> Test server
> http://162.243.201.237/
>
> Admin panel: http://django-suit.readthedocs.io/en/develop/
> http://162.243.201.237/admin/
> user: demo
> pasword: demo
> Static file command I ran
> python manage.py collectstatic
>
> results: 0 static files copied, 116 unmodified.
> Setting.py: Basics
> DEBUG = False
> TEMPLATE_DEBUG = False
> ALLOWED_HOSTS = ['*']
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = [
> os.path.join(BASE_DIR, "static"),
> '/home/django/django_project/static/',
> Nginx setting:
>  # Your Django project's media files - amend as required
> location /media  {
> alias /home/django/django_project/django_project/media;
> }
> # your Django project's static files - amend as required
> location /static {
> alias /home/django/django_project/django_project/static;
> }
> # Proxy the static assests for the Django Admin panel
> location /static/admin {
>alias
/usr/lib/python2.7/dist-packages/django/contrib/admin/static/admin/;
> }
> location / {
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_set_header Host $http_host;
> proxy_redirect off;
> proxy_pass http://app_server;
> }
>  My goal is to get the Django suit working. I do not see anything in my
static files directory for the admin suit so the css can be applied.
> I am missing something very simple to get this working.
> Thank you for taking time to look at this and wish to get some clues.
> Roger
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/f0c19816-b477-43ba-9953-d4793bdfac80%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNMVuY1ju8w8%2BQpK33eHjPBjyKKBzK7b7yZP74Mo8wHHA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CSS question for the Admin

2016-06-02 Thread Luis Zárate
Include your own CSS en admin meta


class myAdmin(admin.ModelAdmin):

 class Meta:
   css ={'all': ['yourcss.css']}



El jueves, 2 de junio de 2016, Mike Dewhirst 
escribió:
> On 2/06/2016 7:31 PM, Michal Petrucha wrote:
>>
>> On Thu, Jun 02, 2016 at 07:22:16PM +1000, Mike Dewhirst wrote:
>>>
>>> I have a varchar field of 300+ chars and I'd like to know how to provide
>>> space to wrap it on screen without resorting to a TextField
>>>
>>> Any CSS ideas?
>>>
>>> Thanks
>>>
>>> Mike
>>
>> Perhaps you could override the widget to a Textarea with the right
>> maxlength attribute? That should be fine if you don't target IE<10...
>
> I'm guessing I have to first inherit the admin form for the page involved
then tweak the widget.
>
> Haven't played there before. Back to the docs ...
>
> Thank you Michal
>
> Cheers
>
> Mike
>
>>
>> Cheers,
>>
>> Michal
>>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/c15c5d17-075a-542c-31c3-35cc1f1d3120%40dewhirst.com.au
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPuSvK0n2OcLOm%2BhguE44iSc32rNMq%2BCvRie%3DUQkowCYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why is my Django template not displaying?

2016-06-03 Thread Luis Zárate
Use  plays as a list in form.

You are passing context_list as context object so all variable inside
context_list are available in template but not context_list.

Other option is
return render(request,'live.html',
{"context_list": context_list})


El viernes, 3 de junio de 2016, Dave N 
escribió:
> That absolutely did it James - I thought I was accessing the instance,
but what I needed was to access the template context contents of the
instance. Also, great tip with the django debug toolbar - I've had it
installed, but didn't know how much it actually shows!
>
> On Friday, June 3, 2016 at 8:58:33 AM UTC-7, Dave N wrote:
>>
>> Assuming my model contains data, I have myapp/views.py:
>>
>> from django.template import RequestContext
>> from django.shortcuts import render
>> from .models import History
>> import datetime
>>
>> def live_view(request):
>> context = RequestContext(request)
>> plays_list = History.objects.filter(date=datetime.date(2016,04,22))
>> context_list = {'plays':plays_list}
>> return render(request,'live.html',context_list)
>>
>> myapp/templates/live.html:
>>
>> {% extends 'base.html' %}
>> {% block content %}
>> {% for key, value in context_list.items %}
>> {{ value }}
>> {% endfor %}
>> {% endblock %}
>>
>> myapp/urls.py:
>>
>> from myapp.views import live_view
>> urlpatterns = [url(r'^live/$', live_view, name="live"),]
>>
>> The output is a page that renders only the base.html template, with no
content in the body. What's wrong with my view function or template
rendering? Should I be inheriting from TemplateView?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/2dc2c249-66bd-4466-bc45-2d5dee2ba4b9%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO1F9pkXF_rMbtPeZayHmui3xtsGnBZhN%3Dri0nsM2zJ7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Is a good practice to put app inside another?

2016-06-03 Thread Luis Zárate
Django contrib is a good example of how put app inside other package.

El viernes, 3 de junio de 2016, Carl Meyer  escribió:
> On 06/03/2016 01:37 PM, Neto wrote:
>> My project has several apps, some of them depend on others, it is ok to
>> add for example 3 apps within another app?
>
> Yep, there's nothing wrong with this. An "app" is just a Python package;
> nesting Python packages to achieve a logical grouping/hierarchy is a
> perfectly reasonable thing to do.
>
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/575209E6.6080709%40oddbird.net
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPT5gFgQebxLMTrwUh6ModO-HNh%3DYkn-k0HhvPqGwkunw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: URL design

2016-06-03 Thread Luis Zárate
I can test this right now but based in my experience in re I think could be
like this

url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P([a-zA-Z0-9_\-]+)/){7})$',
views.item_list)

Be worry with / in views

El viernes, 3 de junio de 2016, Горобец Дмитрий 
escribió:
> Hello, guys.
> I have the following URL patterns in my urls.py module and I'd like to
refactor them:
>
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list, name="item_location_category"),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list),
>
url(r'^(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/(?P[a-zA-Z0-9_\-]+)/$',
views.item_list)
>
> Example:
>
> http://mysite.com/london/cars/
>
> http://mysite.com/london/cars/new/
>
> http://mysite.com/london/cars/new/audi/
>
> http://mysite.com/london/cars/new/audi/a4/
>
> http://mysite.com/london/cars/new/audi/a4/2016/
>
> http://mysite.com/london/cars/new/audi/a4/2016/white/ etc...
>
> And it shouldn't be query parameter.
>
> Does anyone have any suggestions?
>
> Thank you.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/123e209e-3921-4399-affc-be8b4c67c6d9%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNpneVSXBhz3FN%3DmmuOL%2Bcoe6Z4s0p-kh4B1B0M1P_B6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Network scan tool.

2016-06-07 Thread Luis Zárate
Hi,

With your deadline is too difficult (impossible), but if you are a crack in
django and celery and nmap this tool could be useful
https://pypi.python.org/pypi/python-nmap


El martes, 7 de junio de 2016, James Schneider 
escribió:
>
>
> On Tue, Jun 7, 2016 at 6:01 AM, Mahesh Kss  wrote:
>>
>> Hi all,
>>
>>
>> Need some of your thoughts for the below mentioned exercise. I am
planning to do it using Django. But I am not sure where i can place the
python script which monitors the network for connected hosts.
>>
>> Kindly share your thoughts and questions. I need to complete this as
soon as possible(max 2weeks from now).
>>
>>
>> Scanning tool:
>> > Create a python script to extract and maintain list of all host names
connected to a network. There should be a mechanism to determine newly
added host in network (by maintaining new and old host list).
>> (You may use virtual machines as client systems preferably Linux
systems).
>> > This list of hosts should be moved to database.
>> > There should be an admin user across the network to access systems
remotely.
>> > There should be a provision in python script to reset password for
newly added hosts.
>> > The python script should then scan all the discovered systems in
network for the following information:
>> system name, operating system details, CPU details, RAM details, hard
disk details.
>> On each system, list of all major softwares found along with
installation directory, version, license expiry date, etc.
>> > All the extracted information should be stored in database.
>> > There should be a mechanism to delete unreachable host names from host
list and database.
>> > Create a python web interface to display this information from DB
nicely using graphs, charts, etc.
>>
>
> Not to disillusion you, but IMHO writing such an application within two
weeks is highly, highly improbable. Since you have a tight deadline, I'm
assuming this is either for a customer, or for a class assignment. Either
way, the timeline is too aggressive to be feasible for a production-ready
application (or really even a working alpha application).
> You might want to consider integrating with an existing monitoring system
(such as Nagios, monit, etc.) or perhaps a configuration management system
such as Ansible, SaltStack, Puppet, or Chef for communicating with the
hosts and handling discovery. It's unlikely that you'll reinvent the wheel
and come up with something better than any of those purpose-built packages
that have been in development for years. Unless of course you are doing
this for your own learning purposes (but I think not given the timeline).
> Django actually has a very small part to play in this entire application.
You'll probably need Celery to process the commands for adding/removing
hosts from the backend and other management tasks.
> If it were me, and since you have all Linux hosts, I would start with
Ansible (and Cobbler for the DB integration). I have limited experience
with it (I'm still researching it for my own purposes), but it should be
able to handle all of the requirements except for the last couple, which
Django should be able to handle (probably in combination with Celery).
> http://docs.ansible.com/ansible/developing_api.html
> http://docs.ansible.com/ansible/intro_dynamic_inventory.html
>
http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
>
> -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%2BciU6KDfXSkYX99ATFDDm%3DWf%2BPifnH-3vSgkw7fBoQd7SgQ%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOjvDV2rsCcMQKv0jsG9qe58ovFDriTAPxx71Z08zGmWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Non Ascii character in upload file crash in python 3

2016-06-08 Thread Luis Zárate
Hi,

I am having this issue in server production, I developed with python 3
and with others fields work great but when file is involved I don't
know how to intermediate and remove non ascii characters.

Part of my stack trace is:

Internal Server Error: /vistapublica/perfil/editar

UnicodeEncodeError at /vistapublica/perfil/editar
'ascii' codec can't encode character '\xd1' in position 74: ordinal
not in range(128)

FILES:
foto = 

So, how can I fix this issue?.



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Non Ascii character in upload file crash in python 3

2016-06-08 Thread Luis Zárate
$ python manage.py shell

>>> import sys
>>> sys.getfilesystemencoding()
'utf-8'



2016-06-08 1:57 GMT-06:00 Stephen J. Butler :

> Have you tried this?
>
> https://docs.djangoproject.com/en/1.9/ref/unicode/#files
>
> You probably have a system setup where ASCII is the filesystem encoding.
> It tells you a way to fix that on Linux/Unix.
>
> On Wed, Jun 8, 2016 at 2:44 AM, Luis Zárate  wrote:
>
>> Hi,
>>
>> I am having this issue in server production, I developed with python 3 and 
>> with others fields work great but when file is involved I don't know how to 
>> intermediate and remove non ascii characters.
>>
>> Part of my stack trace is:
>>
>> Internal Server Error: /vistapublica/perfil/editar
>>
>> UnicodeEncodeError at /vistapublica/perfil/editar
>> 'ascii' codec can't encode character '\xd1' in position 74: ordinal not in 
>> range(128)
>>
>> FILES:
>> foto = 
>>
>> So, how can I fix this issue?.
>>
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAD4ANxUNNePQXj16Z_dOAgpueSobT%2BP0SJSN09J%2B8B3D7qUGrg%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAD4ANxUNNePQXj16Z_dOAgpueSobT%2BP0SJSN09J%2B8B3D7qUGrg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO_utrotMx%2B6mHs3r3ttA09Vinkd4o0yi1168gTxYHGMw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Non Ascii character in upload file crash in python 3

2016-06-08 Thread Luis Zárate
I am in Debian,

in /etc/locale.gen
es_CR.UTF-8 UTF-8

 $ locale -a
C
C.UTF-8
es_CR.utf8
POSIX


2016-06-08 2:01 GMT-06:00 Luis Zárate :

> $ python manage.py shell
>
> >>> import sys
> >>> sys.getfilesystemencoding()
> 'utf-8'
>
>
>
> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler :
>
>> Have you tried this?
>>
>> https://docs.djangoproject.com/en/1.9/ref/unicode/#files
>>
>> You probably have a system setup where ASCII is the filesystem encoding.
>> It tells you a way to fix that on Linux/Unix.
>>
>> On Wed, Jun 8, 2016 at 2:44 AM, Luis Zárate  wrote:
>>
>>> Hi,
>>>
>>> I am having this issue in server production, I developed with python 3 and 
>>> with others fields work great but when file is involved I don't know how to 
>>> intermediate and remove non ascii characters.
>>>
>>> Part of my stack trace is:
>>>
>>> Internal Server Error: /vistapublica/perfil/editar
>>>
>>> UnicodeEncodeError at /vistapublica/perfil/editar
>>> 'ascii' codec can't encode character '\xd1' in position 74: ordinal not in 
>>> range(128)
>>>
>>> FILES:
>>> foto = 
>>>
>>> So, how can I fix this issue?.
>>>
>>>
>>>
>>> --
>>> "La utopía sirve para caminar" Fernando Birri
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> 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/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAD4ANxUNNePQXj16Z_dOAgpueSobT%2BP0SJSN09J%2B8B3D7qUGrg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAD4ANxUNNePQXj16Z_dOAgpueSobT%2BP0SJSN09J%2B8B3D7qUGrg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNXDR-BkQLYKBdptD4CePNyO1%3DqP5Qh6xW6FSh_5sp98A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Non Ascii character in upload file crash in python 3

2016-06-08 Thread Luis Zárate
After obj.save().

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
in save_base
  736. updated = self._save_table(raw, cls, force_insert,
force_update, using, update_fields)

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
in _save_table
  798.   for f in non_pks]

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
in 
  798.   for f in non_pks]

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/fields/files.py"
in pre_save
  311. file.save(file.name, file, save=False)

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/fields/files.py"
in save
  93. self.name = self.storage.save(name, content,
max_length=self.field.max_length)

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
in save
  53. name = self.get_available_name(name, max_length=max_length)

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
in get_available_name
  89. while self.exists(name) or (max_length and len(name) >
max_length):

File 
"/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
in exists
  294. return os.path.exists(self.path(name))

File "/home/fondomutual/entornos/fomeucr/lib/python3.4/genericpath.py" in exists
  19. os.stat(path)

Exception Type: UnicodeEncodeError at /vistapublica/perfil/editar
Exception Value: 'ascii' codec can't encode character '\xd1' in
position 74: ordinal not in range(128)
Request information:
GET: No GET data



2016-06-08 2:06 GMT-06:00 Stephen J. Butler :

> Whats the stack trace?
>
> On Wed, Jun 8, 2016 at 3:01 AM, Luis Zárate  wrote:
>
>> $ python manage.py shell
>>
>> >>> import sys
>> >>> sys.getfilesystemencoding()
>> 'utf-8'
>>
>>
>>
>> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler :
>>
>>> Have you tried this?
>>>
>>> https://docs.djangoproject.com/en/1.9/ref/unicode/#files
>>>
>>> You probably have a system setup where ASCII is the filesystem encoding.
>>> It tells you a way to fix that on Linux/Unix.
>>>
>>> On Wed, Jun 8, 2016 at 2:44 AM, Luis Zárate  wrote:
>>>
>>>> Hi,
>>>>
>>>> I am having this issue in server production, I developed with python 3 and 
>>>> with others fields work great but when file is involved I don't know how 
>>>> to intermediate and remove non ascii characters.
>>>>
>>>> Part of my stack trace is:
>>>>
>>>> Internal Server Error: /vistapublica/perfil/editar
>>>>
>>>> UnicodeEncodeError at /vistapublica/perfil/editar
>>>> 'ascii' codec can't encode character '\xd1' in position 74: ordinal not in 
>>>> range(128)
>>>>
>>>> FILES:
>>>> foto = 
>>>>
>>>> So, how can I fix this issue?.
>>>>
>>>>
>>>>
>>>> --
>>>> "La utopía sirve para caminar" Fernando Birri
>>>>
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> 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/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyPwsBhF_YSp-Htg_P24x9R2L0nzGgb9bOxsLBRmOr%2BP6w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email

Re: Non Ascii character in upload file crash in python 3

2016-06-08 Thread Luis Zárate
I am using supervisor and gunicorn for production run as fondomutual user.

$ env | grep LANG
LANG=es_CR.UTF-8
LANGUAGE=es_CR:es


2016-06-08 2:09 GMT-06:00 Luis Zárate :

> After obj.save().
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
>  in save_base
>   736. updated = self._save_table(raw, cls, force_insert, 
> force_update, using, update_fields)
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
>  in _save_table
>   798.   for f in non_pks]
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/base.py"
>  in 
>   798.   for f in non_pks]
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/fields/files.py"
>  in pre_save
>   311. file.save(file.name, file, save=False)
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/db/models/fields/files.py"
>  in save
>   93. self.name = self.storage.save(name, content, 
> max_length=self.field.max_length)
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
>  in save
>   53. name = self.get_available_name(name, max_length=max_length)
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
>  in get_available_name
>   89. while self.exists(name) or (max_length and len(name) > 
> max_length):
>
> File 
> "/home/fondomutual/entornos/fomeucr/lib/python3.4/site-packages/django/core/files/storage.py"
>  in exists
>   294. return os.path.exists(self.path(name))
>
> File "/home/fondomutual/entornos/fomeucr/lib/python3.4/genericpath.py" in 
> exists
>   19. os.stat(path)
>
> Exception Type: UnicodeEncodeError at /vistapublica/perfil/editar
> Exception Value: 'ascii' codec can't encode character '\xd1' in position 74: 
> ordinal not in range(128)
> Request information:
> GET: No GET data
>
>
>
> 2016-06-08 2:06 GMT-06:00 Stephen J. Butler :
>
>> Whats the stack trace?
>>
>> On Wed, Jun 8, 2016 at 3:01 AM, Luis Zárate  wrote:
>>
>>> $ python manage.py shell
>>>
>>> >>> import sys
>>> >>> sys.getfilesystemencoding()
>>> 'utf-8'
>>>
>>>
>>>
>>> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler :
>>>
>>>> Have you tried this?
>>>>
>>>> https://docs.djangoproject.com/en/1.9/ref/unicode/#files
>>>>
>>>> You probably have a system setup where ASCII is the filesystem
>>>> encoding. It tells you a way to fix that on Linux/Unix.
>>>>
>>>> On Wed, Jun 8, 2016 at 2:44 AM, Luis Zárate  wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am having this issue in server production, I developed with python 3 
>>>>> and with others fields work great but when file is involved I don't know 
>>>>> how to intermediate and remove non ascii characters.
>>>>>
>>>>> Part of my stack trace is:
>>>>>
>>>>> Internal Server Error: /vistapublica/perfil/editar
>>>>>
>>>>> UnicodeEncodeError at /vistapublica/perfil/editar
>>>>> 'ascii' codec can't encode character '\xd1' in position 74: ordinal not 
>>>>> in range(128)
>>>>>
>>>>> FILES:
>>>>> foto = 
>>>>>
>>>>> So, how can I fix this issue?.
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> "La utopía sirve para caminar" Fernando Birri
>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> 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/CAG%2B5VyPwsB

Re: choices field language

2016-06-21 Thread Luis Zárate
Use in the first line

#- coding: utf-8
from __future__ import unicode_literals

And put in models



from django.utils.encoding import python_2_unicode_compatible

@python_2_unicode_compatible
class MyClass(object):
   def __str__(self):
   return "Instance of my class"

See more in

https://docs.djangoproject.com/en/1.9/topics/python3/



El martes, 21 de junio de 2016, ludovic coues  escribió:
> Python 3 have a better support of international alphabet.
>
> 2016-06-20 23:44 GMT+02:00 Xristos Xristoou :
>> hello i want to use choices in my field but not work if i write in my
>> language(greek) only work in the england language.
>> if i writing choices in my language show me error message in the admin
mode
>> (this choose is not valid),any idea how to fix that ?i have python 2.7
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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/5bfdb5b9-e286-40e1-aa8b-2a0e68878204%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%2BTaq-wqgpk1k2B%2BiGWesPdo32OvRhFGAEHu%2BwC7p25%2BmHQ%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNZF6SjWdN4y5Q9zs8rWisy4%3D6KOj2G3NngiomsFn1dow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django urls.py reload (not from database)

2016-06-23 Thread Luis Zárate
I put all in urls and check permissions with

https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.decorators.user_passes_test

so if not

config.L7V_INITIALIZATED


I raise a 404 exception.

No need to reload urls.


2016-06-23 8:02 GMT-06:00 Thomas :

> Hy django lovers,
>
> it's my first post for being helped, sorry if I miss something.
>
> I want two list of urls available :
>
>- one (limited) before initializing (verify licence, etc...)
>- one (large) after initializing success
>
>
> Here is my settings.ROOT_URLCONF :
>
> from constance import config
>
> if not config.L7V_INITIALIZATED:
> urlpatterns = [
> url(r'^admin/', admin.site.urls),
> url(r'^initialization/', include('apps.initialization.urls'), 
> name='initialization'),
> ]
> else:
> urlpatterns = [
> url(r'^admin/', admin.site.urls),
> url(r'^dashboard/', include('apps.dashboard.urls')),
> url(r'^vmAPI/', include('apps.vmAPI.urls')),
> url(r'^protobook/', include('apps.protobook.urls')),
> ]
>
>
> config.L7V_INITIALIZATED is just a boolean updated if initialization has been 
> success.
>
> So, in my initialization view, I set the boolean to True and need to reload 
> settings.ROOT_URLCONF to understand the new list of urlpatterns.
>
>
> I saw a snippet but doesn't work under django 1.9 (says working under django 
> 1.4) :
>
>
> import sys
> from django.conf import settings
>
> def reload_urlconf(urlconf=None):
> if urlconf is None:
> urlconf = settings.ROOT_URLCONF
> if urlconf in sys.modules:
> reload(sys.modules[urlconf])
>
>
> I also tried the method 'django.core.urlresolvers.set_urlconf' but
> doesn't works..
>
>
> Any suggestions ?
>
>
> Thanks a lot !
>
>
> Thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/2ac2ea9e-55eb-479f-9e30-271aeece1c26%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMeYSsGq6g2h2niY9Kde%2BZevHdq6hnddSuLBV8L14iqTQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: python manage.py runserver error

2016-06-24 Thread Luis Zárate
Check running

python manage.py migrate

other thing, are you sure that you have a correct database setup?

El viernes, 24 de junio de 2016, Gary Roach 
escribió:
> Hi Saranyoo
>
> I noticed that you are using python 2.7 with django 1.9.7. I would check
the django docs to see whether the two are compatible. You may want to
switch to Python 3.5.. If you are in the manage.py directory when you fired
off runserver it should have worked.
>
> Gary R.
>
> On 06/23/2016 06:56 PM, Saranyoo Tiaakekalap wrote:
>
> Guys - I am new to django, need some advise .
> I am trying to learn how to use django from official web, while I am
running through step by step .
> Just the beginning of the first step while I try to start server I hit
into issue .
> There is no change in any python after start project .
> Appreciate all the advice .
> [root@jpetetis mysite]# python manage.py runserver
> Performing system checks...
> System check identified no issues (0 silenced).
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/utils/aut
 oreload.py", line 226, in wrapper
> fn(*args, **kwargs)
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana
 gement/commands/runserver.py", line 117, in
inner_run
> self.check_migrations()
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/core/mana
 gement/commands/runserver.py", line 163, in
check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat
 ions/executor.py", line 20, in __init__
> self.loader = MigrationLoader(self.connection)
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat
 ions/loader.py", line 49, in __init__
> self.build_graph()
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat
 ions/loader.py", line 176, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat
 ions/recorder.py", line 65, in applied_migrations
> self.ensure_schema()
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/migrat
 ions/recorder.py", line 56, in ensure_schema
> with self.connection.schema_editor() as editor:
>   File
"/usr/lib/python2.7/site-packages/Django-1.9.7-py2.7.egg/django/db/backen
 ds/sqlite3/schema.py", line 25, in __enter__
> self._initial_pragma_fk = c.fetchone()[0]
> TypeError: 'NoneType' object has no attribute '__getitem__'
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/CAF7bBPAP5cqVpqt824ub4kh76podidLKRZnxFrVKtHQzr4D%2BCw%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/c44a8ff3-27a7-64f9-5ee2-a80d1001c03d%40verizon.net
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNUvqGZGqNiGxPsrtNaRrvdxC%2BJZaqAigqvTysEMSv5yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Invalid HTTP_HOST header in shared server

2016-06-27 Thread Luis Zárate
Hi,

I am having some issue with gunicorn/nginx configuration. I have a shared
server that support several sites (all based in Django)  with the same ip
address.

Invalid HTTP_HOST header: 'www.mysite.com'. You may need to add '
www.mysite.com' to ALLOWED_HOSTS.

I checked and all projects have ALLOWED_HOSTS well configured, so I read
with attention the exception and notice that all exception are send by the
same gunicon socket
'gunicorn.socket': /gunicorn.sock>.

So, I think are a nginx bad configuration, but I don't know what is wrong.


I followed this tutorial
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/

I use this attach file as script to create new projects in my server.

Thanks

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOwE1%2BpG-zZ6x3769BmTvsRByy6h3bhmCK9uxSTy4y%3DEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
#!/bin/bash


# ./sites_installer.sh -n  -h  -u  -r  
-g https://.git -b 


NAME=""
BASE="~"
VHOME="/environment/"
PHOME="/projects/"
PYTHON="/usr/bin/python3"
PROJECT_NAME="project"
USER=`whoami`
SERVER_NAME="project"
BRANCH=''
REPO=""

while getopts ":pfg:b:n:r:h:u:" optname
  do
case "$optname" in
  "p")
PYTHON="/usr/bin/python2"
;;
  "n")
PROJECT_NAME=$OPTARG
NAME=$PROJECT_NAME
;;
  "r")
BASE=$OPTARG
;;
  "h")
SERVER_NAME=$OPTARG
;;
  "u")
USER=$OPTARG
;;
  "g")
REPO=$OPTARG
;;
  "b")
BRANCH=$OPTARG
;;
  "?")
echo "-p use python2" 
echo "-n name of project"
echo "-h server name ej. example.com"
echo " ? help"
return 0

;;
  *)
  # Should not occur
echo "Unknown error while processing options"
;;
esac
done

mkdir -p $BASE
VHOME=$BASE$VHOME$PROJECT_NAME
PHOME=$BASE$PHOME$PROJECT_NAME


mkdir -p $PHOME

virtualenv -p $PYTHON $VHOME
source $VHOME/bin/activate
pip install gunicorn
cd $PHOME
git clone $REPO

cd ..
mv $NAME $NAME.old
mv $NAME.old/$NAME .
rm -rf $NAME.old
cd $NAME

if [ -n $BRANCH ]
then
git checkout $BRANCH
fi




pip install -r requirements.txt

mkdir -p $PHOME/static/
mkdir -p $PHOME/media/
mkdir -p $PHOME/logs/
mkdir -p $PHOME/certs/

openssl req -subj '/CN='$PROJECT_NAME'/O=SOLVO./C=CR' -new -newkey rsa:2048 
-days 365 -nodes -x509 -keyout $PHOME/certs/$NAME.key -out 
$PHOME/certs/$NAME.crt


echo -e `cat << EOF
\n[program:$PROJECT_NAME]
\ncommand = $PHOME/gunicorn_start ; Command to start app
\nuser = $USER ; User to run as
\nstdout_logfile = $PHOME/logs/gunicorn_supervisor.log 
\nredirect_stderr = true ; Save stderr in the same log
\nenvironment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 
EOF` > $PHOME/supervisor.txt
touch $PHOME/logs/gunicorn_supervisor.log

echo -e `cat << EOF #!/bin/bash
\n
\nNAME="$PROJECT_NAME" # Name of the application
\nDJANGODIR=$PHOME # Django project directory
\nSOCKFILE=$PHOME/gunicorn.sock # we will communicte using this unix socket
\nUSER=$USER # the user to run as
\nGROUP=webapps # the group to run as
\nNUM_WORKERS=3 # how many worker processes should Gunicorn spawn
\nDJANGO_SETTINGS_MODULE=$NAME.settings # which settings file should Django use
\nDJANGO_WSGI_MODULE=$NAME.wsgi # WSGI module name
\n 
\necho "Starting \\$NAME as \`whoami\`"
\n 
\n# Activate the virtual environment
\ncd \\$DJANGODIR
\nsource $VHOME/bin/activate
\nexport DJANGO_SETTINGS_MODULE=\\$DJANGO_SETTINGS_MODULE
\nexport PYTHONPATH=\\$DJANGODIR:$PYTHONPATH
\n
\nRUNDIR=$(dirname \\$SOCKFILE)
\ntest -d \\$RUNDIR || mkdir -p \\$RUNDIR
\n 
\n# Start your Django Unicorn
\n# Programs meant to be run under supervisor should not daemonize themselves 
(do not use --daemon)
\nexec $VHOME/bin/gunicorn \\${DJANGO_WSGI_MODULE}:application 
 --name \\$NAME 
 --workers \\$NUM_WORKERS 
 --user=\\$USER --group=\\$GROUP 
 --bind=unix:\\$SOCKFILE 
 --log-level=info 
 --log-file=- 
EOF` > $PHOME/gunicorn_start

chmod u+x $PHOME/gunicorn_start

  TERMINAR ###

echo -e `cat << EOF
\nupstream $NAME._app_server {
\n# fail_timeout=0 means we always retry an upstream even if it failed
\n# to return a good HTTP response (in case the Unicorn master nukes a
\n# single worker for timing out).
\n 
\nserver unix:$PHOME/gunicorn.sock fail_timeout=0;
\n}
\nserver {
\n   listen :80;
\n   server_name$SERVER_NAME www.$SERVER_NAME;
\n   return 301 https://\\$s

Re: Best way to implement list&detail pattern

2016-06-28 Thread Luis Zárate
Maybe with generic view


https://docs.djangoproject.com/en/1.9/topics/class-based-views/

Especially with

https://docs.djangoproject.com/en/1.9/topics/class-based-views/generic-display/

There is a lot information about how to implement what you need.



El martes, 28 de junio de 2016, Jean-Noël Colin 
escribió:
> Hi
> I'm rather new to Django, but familiar with Java based web framework; I'd
like to implement a simple list&detail screen, so in the top part, have a
list of objects, and when selecting one of them, loading the details in a
form at the bottom where you can edit; there should also be a link in the
list to allow to delete an object (after confirmation) as well as the
possibility to create a new one. All that in a single screen.
> Is it feasible? Is it good practice or is it better to have different
screens (one for the list, one for the different actions)?
> Thanks
> Jean-Noël
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/646ba4ea-e5c9-4022-a511-105c694695d3%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOGQwPzCwyT4KUUUaE50DywOB%3DyDmUzVButdUmodt2gAg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django form data not saving to database

2016-06-28 Thread Luis Zárate
models.OneToOneField(Category,default='category')

This is not set in form and not set in view and is not null so when you do
post.save() error was raised and post is not saved.

I don't sure that you can pass str as default for OnetoOne and I am not
sure that you need a OnetoOne field I think foreignkey us better for you,
because have not sense have one category for every post, I think you want
several post in one category.





El martes, 28 de junio de 2016, kaustubh tripathi 
escribió:
> Hi everyone!
>
> I am creating a simple webapp using django where a user can login, choose
one of the given category and create a post under the chosen category.
>
> I am having trouble in creating a post. When I create a  new post through
django form the date isn't saved to database. I log in to the django-admin
to check if the post is created but the 'post' table remains empty.
>
> Here are the necessary code snippets:
>
> "Category model"
> class  Category(models.Model):
>
> name = models.CharField(max_length=128,unique=True)
> slug = models.SlugField()
> def save(self,*args,**kwargs):
> self.slug = slugify(self.name)
> super(Category,self).save(*args,**kwargs)
>
> def __unicode__(self):
> return self.name
>
> "Post Model"
> class Post(models.Model):
> category = models.OneToOneField(Category,default='category')
> title = models.CharField(max_length=128,null=True)
> content = models.TextField(blank=True,null=True)
>
> def __unicode__(self):
> return self.title
>
> "Postform/forms.py"
>
> class PostForm(forms.ModelForm):
> title = forms.CharField(max_length=128)
> content = forms.CharField(widget=forms.Textarea)
> class Meta:
> model = Post
> fields = ('title','content')
>
> "create_post function/views.py"
>
> def create_post(request,category_name_slug):
>
> created = False
> instance = get_object_or_404(Category,slug=category_name_slug)
> if request.method == 'POST':
> form = PostForm(data=request.POST or None,instance=instance)
> if form.is_valid():
> post = form.save(commit=False)
> post.save()
> created = True
> else:
> print form.errors
> else:
> form = PostForm()
> context={
> 'form':form,
> 'instance':instance,
> 'created':created
> }
> return render(request,"add_post.html",context)
>
>
> Any solution??
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/cdf3882e-636e-4d2b-b626-6b60aaea9f5c%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNpkULru70Wk3vOa2Sqkwd1HyX9Xy8X-Yt%3Du8gdDPZVTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How I can access to the jQuery, it is build-in Django-Admin, in my custom views?

2016-07-03 Thread Luis Zárate
Replace $ by django.jQuery

For example django.jQuery('body')



El domingo, 3 de julio de 2016, Seti Volkylany 
escribió:
>
> The Django`s docs tell next:
> To avoid conflicts with user-supplied scripts or libraries, Django’s
jQuery (version 2.1.4) is namespaced as django.jQuery. If you want to use
jQuery in your own admin JavaScript without including a second copy, you
can use the django.jQuery object on changelist and add/edit views.
> (see https://docs.djangoproject.com/es/1.9/ref/contrib/admin/…)
>
> But, how using this build-in jQuery. When I am tring to use $ in my
custom view I had:
>
> $('body')
> Uncaught TypeError: $ is not a function(…)
>
> But it is successfully worked in main page of the Django-Admin
>
> $('body')
> …
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/3c5ab528-05fa-4446-88c3-c2a2419d24fe%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNqyiFpL87i2rHiui4ahQqMes2_pvR1QbSbqTXUHS2k6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How I can access to the jQuery, it is build-in Django-Admin, in my custom views?

2016-07-04 Thread Luis Zárate
Are you using django admin template?
Where are your Jquery call? in the header ?

A template example could be useful.

2016-07-03 12:20 GMT-06:00 Seti Volkylany :

> It is not worked even the main admin page
>
> django.jQuery('body')
> Uncaught ReferenceError: django is not defined(…)(anonymous function) @
> VM9451:1
> $()
> null
> $django.jQuery('body')
> Uncaught ReferenceError: $django is not defined(…)
>
> On Sun, Jul 3, 2016 at 9:08 PM, Luis Zárate  wrote:
>
>> Replace $ by django.jQuery
>>
>> For example django.jQuery('body')
>>
>>
>>
>> El domingo, 3 de julio de 2016, Seti Volkylany 
>> escribió:
>> >
>> > The Django`s docs tell next:
>> > To avoid conflicts with user-supplied scripts or libraries, Django’s
>> jQuery (version 2.1.4) is namespaced as django.jQuery. If you want to use
>> jQuery in your own admin JavaScript without including a second copy, you
>> can use the django.jQuery object on changelist and add/edit views.
>> > (see https://docs.djangoproject.com/es/1.9/ref/contrib/admin/…)
>> >
>> > But, how using this build-in jQuery. When I am tring to use $ in my
>> custom view I had:
>> >
>> > $('body')
>> > Uncaught TypeError: $ is not a function(…)
>> >
>> > But it is successfully worked in main page of the Django-Admin
>> >
>> > $('body')
>> > …
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> 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/3c5ab528-05fa-4446-88c3-c2a2419d24fe%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>>
>>
>> --
>> 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/h4QKC2xHY60/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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAG%2B5VyNqyiFpL87i2rHiui4ahQqMes2_pvR1QbSbqTXUHS2k6Q%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyNqyiFpL87i2rHiui4ahQqMes2_pvR1QbSbqTXUHS2k6Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGWd_9%2BsrUg805xAFvu90PGNrYPzm92W6Lax3Rz8Upafwie_pw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGWd_9%2BsrUg805xAFvu90PGNrYPzm92W6Lax3Rz8Upafwie_pw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOgDnq%2BEwKYgoZ-tAuoeO_aRdJ3aXtqfJhR6mfzhybVKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Invalid HTTP_HOST header in shared server

2016-07-08 Thread Luis Zárate
nobody knows how to solve this 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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyPjP3shHFu5vhmKNzBNneb3xEZUCJ%2BUE6jHsDiTiv1ghQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin - customize use jquery inside and custom fields.

2016-07-08 Thread Luis Zárate
2016-07-08 10:24 GMT-06:00 :

> and save the new im


You can start reading how to set css and js to form and admin site.

See



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMJupCshE8twXpg7vefRBCbOMs1MTi7%3DjPtb_wA3CK76A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Admin - customize use jquery inside and custom fields.

2016-07-08 Thread Luis Zárate
See https://docs.djangoproject.com/en/1.9/topics/forms/media/

2016-07-08 10:58 GMT-06:00 Luis Zárate :

>
> 2016-07-08 10:24 GMT-06:00 :
>
>> and save the new im
>
>
> You can start reading how to set css and js to form and admin site.
>
> See
>
>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
>
>


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPjeoHV7OOEQefN9gDpxB_97TF5h2mLMFF4GUUax3EHew%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Any way to force Django to commit a write so another process can read the correct data from DB?

2016-07-27 Thread Luis Zárate
I thing java apps have a cache and it is java who is not looking in the
database.  I was a similar problem with hirbernate time ago. But I never
solved other person solved it and I don't know how.

El miércoles, 27 de julio de 2016, Constantine Covtushenko <
constantine.covtushe...@gmail.com> escribió:
> Hi Stodge,
> As said in Django current version of documentation, 'post_delete' signal
is sent after record is deleted. This means also that transaction is closed
at that moment. And DB should not has deleted instance any more.
> I have double checked the Django code and can say that Django send that
signal just before transaction is committed.
> So technically instance should be inside DB for Hibernate processing.
> I can suggest you to create a custom signal and send it after transaction
closed.
> That should solve your problem.
> Regards,
> On Wed, Jul 27, 2016 at 5:27 PM, Stodge  wrote:
>>
>> My website uses a combination of Django + Java apps to function. For
this particular problem, a record is deleted from the DB via a TastyPie
resource DELETE operation. A Django signal post_delete handleris invoked,
which submits a DELETE request to Jetty running in the Java app. The Java
app then performs a query using Hibernate.
>>
>> What appears to be happening is that Django thinks the record was
deleted:
>>
>> DynamicVolume.objects.filter(user=instance.user).count()
>>
>> Returns ZERO.
>>
>> However, the Java app thinks the record still exists unless I make it
sleep for several seconds before asking Hibernate to query the DB.
>>
>> I've tried forcing Hibernate to clear its cache with no success. Is
there a way to force Django to commit the deletion (flush the cache)?
>>
>> 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/e76d5cfa-f4bc-41db-a322-0d44aa0719dd%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/CAK52boWeFYGOhk0CL%2BoEimreb2k%2BgFwL2rBb0imoPbmfpwo5Yw%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP4FfD5hdMYnd5jw0agx_u4nyDRH5U6mG9wvwxXxOQCnA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Installation

2016-07-28 Thread Luis Zárate
Take a look this
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor


El miércoles, 27 de julio de 2016, Sergiy Khohlov 
escribió:
> Take a look at
https://jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/
this is perfect doc related to your situation s.
>
> 27 лип. 2016 12:04 "Its Eternity"  пише:
>
> Hey, a friend recently wrote my a web-app for me to use however I am not
sure how I deploy the web app onto my VPS. I've looked at the tutorials on
Django but it says that  I can only use it for development. Is there a
method for me to get Django for public use?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/95e91756-b960-4021-8603-e3ee21c3b4b9%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CADTRxJMBN2Voi0pqOoc7iY_rjzbwX9e99kSktsWqXjN3GrRQPQ%40mail.gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMH2dRnL7-tv8vm4F7C5yzqdNFM-dFhkA%2B9_U6%3DkjWA3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: New to Django

2016-08-16 Thread Luis Zárate
Hi,

Try to implement a custom tag that can print
Any dictionary in the form that you want.

https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/




El martes, 16 de agosto de 2016, Wolf Painter 
escribió:
> Anyone have any ideas? I'm really stuck here...
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/dee8a26d-adee-4567-84a0-fccd4de478be%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNzeD5ux4bam80%2Bfrrq2xkBTuBihRzi2wp%2BBRvuGWFeYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: multiple django installation in one server

2016-09-07 Thread Luis Zárate
Take a look
http://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
,
You can do this steps for ever  django project in the same server




2016-09-07 7:28 GMT-06:00 miarisoa sandy :

> Hi guys,
>
> I hope you are doing fine.
> I have googled it but no fruitful results.
> I am a newbie in django and I wonder what is the number maximum django
> that I can install in one server??
> I have a lot of projects that I would like to check with django ( one
> project -> one django) to avoid some confusion with each project (PHP
> project).
> Or what is the best way for me??
>
> The server is: Ubuntu 12.04, intel core i5 3.2Ghz, 4Go of RAM
>
> Waiting to hear from you, thanks for your help.
>
> Best
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/33008438-92bf-4283-ab52-b6909eb81193%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMbnbixBovR10kTJgyHiW70BT4ijLu_boyJLLsftm3EOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Custom form fields in admin site

2016-09-08 Thread Luis Zárate
Hi,  I am trying to do something like


class MyForm(forms.ModelForm):
 myextra_field = forms.IntegerField()

class Meta:
  models = Mymodel
  fields = '__all__'

class MymodelAdmin(admin.ModelAdmin):
  form = MyForm
  fields = ["name", 'myextra_field']

def save(self, *args, **kwargs)
do something with myextra_field


I know that is possible to specify readonly_fields and fields works but in
readonly mode that is not what i want.

So is there any way to have extra form fields in admin.ModelAdmin in edit
mode?



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNVmNPzjkd-9bV_j35%2BNn5PYdjvMzi6GQv%2BhaDFZLrbug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python post to remote host

2016-09-08 Thread Luis Zárate
see http://docs.python-requests.org/en/master/

2016-09-08 5:57 GMT-06:00 alireza Rahmani khalili <
sanfrancisco.alir...@gmail.com>:

>
>
> down votefavorite
> 
>
> Hi I want to write robot to register in toefl test , I send request to
> remote web site as:
>
> from django.http import HttpResponse
> import requests
> from bs4 import BeautifulSoupfrom django.middleware import csrf
>
> def index(request):
> session = requests.Session()
> page = 
> session.get('https://toefl-registration.ets.org/TOEFLWeb/extISERLogonPrompt.do')
>
>
> if request.method == 'POST':
> url = 'https://toefl-registration.ets.org/TOEFLWeb/logon.do'
> data = {
> 'password': request.POST.get('password', ''),
> 'username': request.POST.get('username', ''),
> 'org.apache.struts.taglib.html.TOKEN': 
> request.POST.get('org.apache.struts.taglib.html.TOKEN', '')
>}
>
> page = session.post(url, data=data)
>
>
> return HttpResponse(request,page.text)
>
> My post request is not same as post request made by toefl original web
> site and instead of login shows error as : We are sorry, our servers are
> currently busy. Please wait a few minutes and retry your request.
>
> what is the problem? someone in other corporation did this without error
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/75c2e724-5616-41d6-9c0d-cdef3887d3e1%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO3rPwNDDk28vYamTzVfW44GiKSAh3PKGxkR7t-OAPfTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django group email in spam

2016-09-08 Thread Luis Zárate
I have the same behavior

2016-09-08 7:06 GMT-06:00 Uri Even-Chen :

> Same here, and the problem is I filtered the group messages to skip my
> inbox in Gmail, and I can't filter them never to send them to spam, because
> then they will not skip my inbox (it's a bug in Gmail). So I have to enter
> my spam folder manually and mark each message as "not spam". By the way,
> also messages to Django developers mailing list are marked as spam.
>
>
> *Uri Even-Chen*
> [image: photo] Phone: +972-54-3995700
> Email: u...@speedy.net
> Website: http://www.speedysoftware.com/uri/en/
> 
> 
>   
>
> On Wed, Sep 7, 2016 at 11:05 PM, sylvain_grodes 
> wrote:
>
>> Same problem here, I have to check my spam and unset the spam flag.
>>
>>
>>
>> Le vendredi 2 septembre 2016 02:12:18 UTC-4, Lachlan Musicman a écrit :
>>>
>>> Hey,
>>>
>>> I've been seeing a lot of Django group email going into my spam folder
>>> over the last 48 hours.
>>>
>>> Have there been any changes to the group that may have caused this?
>>>
>>> cheers
>>> L.
>>> --
>>> The most dangerous phrase in the language is, "We've always done it this
>>> way."
>>>
>>> - Grace Hopper
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/de7b0239-ff49-4c83-acb8-53308a1178e2%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/CAMQ2MsHCqeD8wgg_EEwfj69bwCHBSu8BSDpY09waVbs3zM
> WRGg%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPLJq%2BsidqhQgsTeRtjgzNXeQh0UQm3jPTO6ZG0n8GjkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Custom form fields in admin site

2016-09-09 Thread Luis Zárate
Hi,

I started to make a test project, and review the django code in options,
but I see the problem and started to code in other way  the result is in

https://github.com/luisza/onetooneForm

Now is more interesting because I try to provide a way to update onetoone
fields in the same form.  I made an elegant solution rewriting __new__
function of modelform, but I have son dudes about my implementation and I
really need to test it.  (Finished coding a few minutes ago)

In the REAME are the to issues that make me ask for help those are:

   - If I use RelToParentFrom in onetooneForm/forms.py works ok, but I
   wanted something like in onetooneForm/forms_wanted.py
   - No way to sort fields
   - How can I use formfield_callback? it's necesary





2016-09-09 2:01 GMT-06:00 ludovic coues :

> It's not easy to understand what you are trying to do and in which way it
> is failing. It would require us setting up a test project.
> I am assuming you want that the Admin display a form with a field for each
> of Mymodel field plus the myextra_field attribute and what you get is
> either only the name fields and maybe the myextra_field. If that not the
> case, plus give us more information about your problem.
>
> MymodelAdmin.fields is overriding MyForm.fields. If you are curious, it's
> around line 594 of django/contrib/admin/options.py. If fields is set,
> get_fields return that. Else, it will return the form base_fields and the
> modeladmin readonly_fields.
>
>
>
> 2016-09-08 18:41 GMT+02:00 Luis Zárate :
>
>> Hi,  I am trying to do something like
>>
>>
>> class MyForm(forms.ModelForm):
>>  myextra_field = forms.IntegerField()
>>
>> class Meta:
>>   models = Mymodel
>>   fields = '__all__'
>>
>> class MymodelAdmin(admin.ModelAdmin):
>>   form = MyForm
>>   fields = ["name", 'myextra_field']
>>
>> def save(self, *args, **kwargs)
>> do something with myextra_field
>>
>>
>> I know that is possible to specify readonly_fields and fields works but
>> in readonly mode that is not what i want.
>>
>> So is there any way to have extra form fields in admin.ModelAdmin in edit
>> mode?
>>
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/CAG%2B5VyNVmNPzjkd-9bV_j35%2BNn5PYdjvMzi6GQ
>> v%2BhaDFZLrbug%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAG%2B5VyNVmNPzjkd-9bV_j35%2BNn5PYdjvMzi6GQv%2BhaDFZLrbug%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>> 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%2BTZHhNTu1MXqCq_YXNxbKqX5SjCXeH3VJvV8Me_
> zmXpLXw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAEuG%2BTZHhNTu1MXqCq_YXNxbKqX5SjCXeH3VJvV8Me_zmXpLXw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOhBkVXfeOWEh0Y0mA3eHkUs%3DeEV1xaPqoDocE%2BW3uCDw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Can't create editable foreign key field in Django admin: going to give up on django

2016-09-12 Thread Luis Zárate
See https://github.com/django-parler/django-parler

2016-09-12 23:02 GMT-06:00 Hanh Kieu :

> Hey guys, I'm creating a translation app that allows you to translate from
> one object to the other. My translation model has two foreign keys that
> links to two words, and on the admin site I want the Admin to be able to
> input two different words. The words they enter should be saved as
> individual words, as well as a translation. However, it looks like this
> isn't possible at all in Django. I've been trying so hard to read
> documentation but I am struggling. My Models look like this:
>
> class Language(models.Model):
> language_text = models.CharField(max_length=200)
>
> def __str__(self):
> return self.language_text
>
>
> class Word(models.Model):
> language = models.ForeignKey(Language, on_delete=models.CASCADE)
> word_text = models.CharField(max_length=200)
>
> def __str__(self):
> return self.word_text
>
>
> class Translation(models.Model):
> #word1 belongs to one word
> word1 = models.OneToOneField(Word, on_delete=models.CASCADE, 
> related_name="Translation_word1")
> #word2 belongs to another word
> word2 = models.OneToOneField(Word, on_delete=models.CASCADE, 
> related_name="Translation_word2")
>
>
>
>
> I want the admin page for Translation to be able to take in two words and two 
> languages and create a translation from them (rather than individually 
> creating one word, then individually creating another word, then indiviudally 
> creating a translation)
>
> I've tried using TranslationForm(models.ModelForm), however when I submit it 
> gives me an error that there are NULL values for my models :C. Help I am 
> really lost and no one has been of help, I'm getting really frustrated with 
> this aspect of django.
>
> If someone could take time to actually understand my problem and help out 
> that would be great please :C
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/9ab72b11-b7b3-4c1a-bf26-3ed4befb212f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNZOT2-Hp2i2yC_MO7R73P%2BBiDoP%3D%3DrX-aiy35THfxO%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Help] Advanced tutorial: How to install my Python package with Virtualenv

2016-09-30 Thread Luis Zárate
You need to create a setup.py file (see setuptools doc) it's a simple file
find examples. Then do

python setup.py sdist

This will create dist file then surft to the .tar.gz file

pip install -u django-poll.tar.gz

Or you also can do

python setup.py install



El martes, 27 de septiembre de 2016, Aline C. R. Souza <
linecrso...@gmail.com> escribió:
> Hi everybody,
> Pip was working, but I did not know how to use it. Now, I figured out.
> Inside the project directory:
>
> pip install ../django-polls/dist/django-polls-0.1.zip
> Worked fine, the app is running.
> Thank you, guys.
>
> Em terça-feira, 27 de setembro de 2016 08:21:54 UTC-3, Aline C. R. Souza
escreveu:
>>
>> Hello Guys,
>> I need some help to install my Python package with virtualenv. I follow
the 'Advanced tutorial: How to write reusable apps' and moved the polls
directory out of the project. Now I want to install my package using
virtualenv and pip, but I don't know how.
>> Consider I am inside of my project diretory (where the manage.py is) and
I am working on a virtual environment. What would be the right pip command
to install my package, considering that the polls directory is out of the
project.
>> Please help!
>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/66dc1093-dced-4d3b-8a34-3e1c250fbee0%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyPUrx5HOHSojrUD9Y%2BNxetTWvwaLgXzf1h6ZyZ-uS-fSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django software docs

2016-09-30 Thread Luis Zárate
Are you looking for something like
https://d3js.org/ ?

Or something like blender with django ?

El lunes, 26 de septiembre de 2016, Jani Tiainen 
escribió:
> Hi,
>
> What you expect Django to do for you?
>
> Django has been successfully used to write great variety of webapps like
e-commerce, blogs, cms etc.
>
> So you have to be a bit more spesific what you're looking for.
>
> On 26.09.2016 18:14, Dave Baas wrote:
>
> All,
> Can anyone point me to some software documentation, (I work with 3D
visualization software) that utilizes Django?
> Manuals, tutorials, video links and such?
> thanks / 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/e1bb770a-3b6e-4be2-806f-0e01302d3c7b%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>
> --
> Jani Tiainen
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/024af0bd-bab9-3bb0-8732-cd158965051e%40gmail.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNTPkALqu%2B9sMuppwtHHQ4WuyvVP-vufxAzWBmKSd13qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to: Django development and debugging

2016-10-23 Thread Luis Zárate
I rarelly debug code with django, with external utility, just trace stack
when errors appears, buy when I need it I use pydev over Aptana,  it has
heap monitor, breakpoints, step by step run and other debugger functions.

One important thing is that I need to say to pydev that  run django with
--no-autoreload parameter, so then works well because when I am debugging I
am not coding and I can start or stop the server when I want.

I always run django in external terminal when I am coding, I really like
the autoreload, I think it's better if the IDE can reload, but I really
hate when Aptana is configured wrong and server never die, because I need
to user $ killall python (or some like that) to stop django.

I dislike VS as IDE but, great if you want to support Django there.

El viernes, 21 de octubre de 2016, Muizudeen Kusimo 
escribió:
> Hello Folks,
> PyCharm makes debugging Django (and other Python) applications very easy.
Some of the features which are very helpful include:
>
> Ability to choose specific Python Interpreter you want to run the code
base against. Useful if you use virtualenv and need to test your code in
different Python versions
> Standard debugging tools - Step Into, Step Over, Step Out, Watches
> Support for debugging other Python libraries tied to your Django
application e.g. Lettuce BDD tests, Unit Tests e.t.c
>
> It's definitely worth a try as you can get a lot from the Community
Edition
> Regards
> On Thursday, October 20, 2016 at 8:30:45 PM UTC-4, Don Thilaka Jayamanne
wrote:
>>
>> Hi Everyone, I'm the author of a Python plugin for the VS Code editor (
https://github.com/DonJayamanne/pythonVSCode). Basically it provides
intellisense, code navigation, debugging (django, multi threads, etc), data
science and the like.
>> When it comes to debugging django applications, today the extension
disables (doesn't support) live reloading of django applications.
>> I'm thinking of having a look at this particular area. Before I do so,
I'd like to get an idea of how developers actually develop and debug django
applications.
>> Most of the people i've spoken to say they develop as follows:
>> - Fire up the django application with live reload
>> - Start codeing
>> - Test in the browser
>> - Very rarely would they debug an application
>> - i.e. majority of the time they don't launch the application in debug
mode
>> How do you work on django applications?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/d5c69cfc-7bec-4df9-9112-3b0f74c0ab5d%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/CAG%2B5VyNKobt0SZ49pvbbAJWptHjw7ALSQ2kg9sRAR8atgfmOdA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to: Django development and debugging

2016-10-25 Thread Luis Zárate
2016-10-23 17:08 GMT-06:00 Don Thilaka Jayamanne :

> @Luis Zárate
> >I dislike VS as IDE but
> Please remember, this is Visual Studio Code (cross platform, open source,
> free) and not to be confused with Visual Sutdio IDE (full blown IDE runs
> only on Windows)
> Visual Studio Code <https://code.visualstudio.com/>
>

Sorry I was confused, I was thinking in Microsoft Visual Studio (MVS).

I didn't test VSC, but I will.  I am looking for a IDE because Aptana is
not updated for a while, so I am having compatibility issues.

33 Mb size it's like i want :) great for Debian installer.

It's any relation with MVS? because you are using the same icon and the
same colors.


-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyO6MExAfA76_du78BABqd2%3DjZs-GmOyeL0SKiM6QJfq_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Read Only by user in Django Admin

2016-10-25 Thread Luis Zárate
you are looking something like
https://code.djangoproject.com/ticket/7150
https://code.djangoproject.com/attachment/ticket/7150/admin_view-permission-1.0.patch
https://code.djangoproject.com/attachment/ticket/7150/newforms-admin-view-permission-r7737.patch
https://code.djangoproject.com/ticket/8936
https://code.djangoproject.com/ticket/22452
https://code.djangoproject.com/ticket/18814
https://code.djangoproject.com/ticket/17295
https://code.djangoproject.com/ticket/3984
https://code.djangoproject.com/ticket/2058
https://code.djangoproject.com/ticket/820


I don't know why Django doesn't support readonly view, various proposal was
summit and always was reject.

Django Admin needs Readonly View functionality for a complete
implementation of CRUD.

There is a lot of scenarios where you need readonly view for your staff.
And yes you can implement a readonly  in django admin without modify django
core admin with some tricks.

I



2016-10-24 7:26 GMT-06:00 Derek :

> Would it be possible to add these extra admin methods into a parent class;
> and then have all your individual model admins inherit from it?  Ditto for
> the models.py
>
> On Sunday, 8 February 2015 21:15:42 UTC+2, Hangloser Firestarter wrote:
>>
>> Solved.
>>
>> In __init__.py
>> ...
>> from django.db.models.signals import post_syncdb
>> from django.contrib.contenttypes.models import ContentType
>> from django.contrib.auth.models import Permission
>>
>> def add_view_permissions(sender, **kwargs):
>> """
>> This syncdb hooks takes care of adding a view permission too all our
>> content types.
>> """
>> # for each of our content types
>> for content_type in ContentType.objects.all():
>> # build our permission slug
>> codename = "view_%s" % content_type.model
>>
>> # if it doesn't exist..
>> if not Permission.objects.filter(content_type=content_type,
>> codename=codename):
>> # add it
>> Permission.objects.create(content_type=content_type,
>>   codename=codename,
>>   name="Can view %s" %
>> content_type.name)
>> print("Added view permission for %s" % content_type.name)
>>
>> # check for all our view permissions after a syncdb
>> post_syncdb.connect(add_view_permissions)
>> ...
>>
>> In admin.py
>> ...
>> class MyAdmin(admin.ModelAdmin):
>> def has_change_permission(self, request, obj=None):
>> ct = ContentType.objects.get_for_model(self.model)
>> salida = False
>> if request.user.is_superuser:
>> salida = True
>> else:
>> if request.user.has_perm('%s.view_%s' % (ct.app_label,
>> ct.model)):
>> salida = True
>> else:
>> if request.user.has_perm('%s.change_%s' % (ct.app_label,
>> ct.model)):
>> salida = True
>> else:
>> salida = False
>> return salida
>>
>> def get_readonly_fields(self, request, obj=None):
>> ct = ContentType.objects.get_for_model(self.model)
>> if not request.user.is_superuser and
>> request.user.has_perm('%s.view_%s' % (ct.app_label, ct.model)):
>> return [el.name for el in self.model._meta.fields]
>> return self.readonly_fields
>> ...
>>
>> in models.py
>> ...
>> class City(models.Model):
>> nome_cidade = models.CharField(max_length=100)
>> estado_cidade = models.CharField(max_length=100)
>> pais_cidade = models.CharField(max_length=100)
>>
>> def __str__(self):
>> return self.nome_cidade
>>
>> class Meta:
>> permissions = (
>> ('view_city', 'Can view city'),
>> )
>> ...
>>
>> Thank's for help!
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/74f952fe-f0f5-4fb3-abd4-d6736cbd2743%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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

Re: How to use Django forms for surveys

2016-10-26 Thread Luis Zárate
Hi, we are developing something like you want, but it's a premature project
right now, maybe in few months we launch our first stable version (survey
monkey be aware...), the project home page is

https://github.com/solvo/derb , see development branch for a updated
version.

So if you are interested in development let me know.



El jueves, 20 de octubre de 2016, Diego De La Vega 
escribió:
>
> El miércoles, 19 de octubre de 2016, 21:11:18 (UTC-3), James Schneider
escribió:
>>
>> On Sun, Oct 16, 2016 at 7:37 PM, Diego De La Vega 
wrote:
>>>
>>> Hi. This is my first question in this group.
>>> My problem is that I have to program a survey application and I would
like to have a hint about forms.
>>> The survey is +200 questions long and is divided in multiple subjects
(every subject is independent from the others) and mainly consists of
numeric (implemented as combo boxes) and text fields..
>>> The main problem is how to do for showing the relevant fields and not
the unwanted.
>>> Let me explan this: suppose that when the answer to question 1 is 1,
the survey continues with question 2, but if the answer is 2, then the
survey continues with question 16 and all the in between questions are
skipped.
>>> This is a very simple scenario, but almost all the flow of the survey
goes like this, making it complex to follow the order. Sometimes one must
skip a few questions but some others, one must skip only one, or a full
section of the questions, depending on the answer.
>>> Is there a recommended way to do so? Thanks in advance and sorry for my
English, I'm not a native English speaker (I hope all this mess can be
understood).
>>
>> Django FormTools may be another option, specifically the FormWizard:
https://django-formtools.readthedocs.io/en/latest/wizard.html
>> However, unless you have a very simple and deterministic way to figure
out the next question, it will likely turn in to a coding nightmare. The
step skipping has a bit of a learning curve to it. The FormWizard was
likely built with shorter and more linear workflows in mind.
>> Note that this package was included in Django core up until 1.7, this
package is (literally) the same thing, just broken out into a separate
package (most users did not use this functionality and it bloated the code
base if I remember the comments in the release notes).
>> While this can be super robust, it will probably not be easy.
>> -James
>>
>>
>
>
> I'll take a look to FormTools also. The next question is always
deterministic and going forward in the survey, but the path maybe a little
trickier, depending on ranges of answers of one or more questions.
> Thanks a lot.
> Diego
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/235bd523-c4bc-4849-b0fb-24f53b7094b3%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMGRmKo4HZbL68UaAAMrTNPTeyajRmESkerJUN3Ofjrbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding view permission by default to auth_permission

2016-10-27 Thread Luis Zárate
This is alive in

https://github.com/django/django/pull/6734

The other PR was close because this have not merge conflict.

I think this functionality is needed an will be included soon.




El jueves, 27 de octubre de 2016, mmatt  escribió:
> On another note, I believe django dev team needs to understand life is
rarely boolean. That is, even the staff that you trust, you don't always
trust 100% :) actually almost never trust 100% so good to have options.
> Mehmet
>
> On Wednesday, June 1, 2016 at 4:59:47 AM UTC-5, Derek wrote:
>>
>> My own observation, from years on this mailing list, is that the dev
team do not consider this a must-have for Django; their view (as far as I
understand it!) is that the admin is designed for trusted users, so simply
do not let them have access at all.  Having said that, there is a pull
request underway for a feature that seems similar to what you want:
>>
>> https://github.com/django/django/pull/5297
>>
>> (P.S. Also bear in mind that Django, like most FOSS projects, is not
actually a democracy - so something 'the people want" does not necessarily
get done; not understanding this trips many people up...)
>>
>> On Monday, 30 May 2016 20:13:18 UTC+2, Ander Ustarroz wrote:
>>>
>>> I am surprised this feature is not implemented yet, at the moment when
we create a new model  three permissions are created automatically:
>>>
>>> add_permission
>>> change_permission
>>> delete_permission
>>>
>>> We really missing the view_permission here, when we want staff to be
able to see the content but not being able to modify it. Searching a bit,
 you can find many different implementations to achieve this, but all of
them are extending django.contrib.admin.ModelAdmin. Having so many people
rewriting these methods in my opinion is a clear sign that this feature
should be part of the core.
>>>
>>> Regards,
>>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/3c4931c3-453f-4a80-a62d-16bc9873817b%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNvMr6Ch5zdDz%2Bb%3DWX5%3D0-pnmnj%3DTykkU3N_KXQibHgiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up jQuery in debian with virtualenv

2016-11-10 Thread Luis Zárate
Mmm why not just download Jquery and create a folder called static inside
one controlled app, maybe pone inside the project.

If you want, you can use django admin jquery but $ is not available because
django use django.JQuery for prevent conflict with custom user jquery

El jueves, 10 de noviembre de 2016, Gary Roach 
escribió:
> Hi,
>
> Sorry about the confusion. I misspoke. I was trying to imply that there
was a jquery.min.js file in the venv (djenv)  file. As you implied, it was
installed with pip django. A very bad choice of words.
>
> I am trying to set up my project so that I am not using a system version
of jquery since the system version is subject to change every time I update
my debian system (whiich I do about once a week). I suppose what I really
want to know is how do I get a "sequestered" version of jquery.min.js
installed.  I have tried to use a pointer to the copy in the djenv
directory (Eclipse allows this).  After doing this there is a file
jquery.min.sj shows up in my static file directory. Unfortunately, when I
do a runserver I still get a - "GET /static/jquery.min.js HTTP/1.1" 404
1652 - error. What's next?
>
> Gary R.
>
> On 11/09/2016 11:56 PM, Antonis Christofides wrote:
>>
>> Hi,
>>
>> If, as you say, you "have a jquery file under version control inside
[your]
>> virtual environment wrapper", I believe you are doing something wrong. We
>> normally don't put jquery files in virtualenv (although `pip install
django`
>> will do so), and we normally do not version control the virtualenv.
>>
>> If virtualenv is not clear to you, I'd propose to take a look at
>> http://djangodeployment.com/2016/11/01/virtualenv-demystified/ and then
re-ask
>> your question.
>>
>> Regards,
>>
>> Antonis Christofides
>> http://djangodeployment.com
>>
>> On 2016-11-09 23:54, Gary Roach wrote:
>>>
>>> Ludovic
>>>
>>> Thank you for the reply but I know how to use static files. The problem
is
>>> that I already have a jquery file under version control inside my
virtual
>>> environment wrapper and do not wish to use an external file . Use of a
normal
>>> static file will open my application up to uncontrolled version shifts.
I want
>>> to know how to use the pip installed version of the jquery file if
possible.
>>>
>>> Gary R.
>>>
>>> On 11/09/2016 01:41 PM, ludovic coues wrote:

 Hello,

 Django provide tools to deals with static files like javascript or
 css. The documentation is at [1].

 [1] https://docs.djangoproject.com/en/1.10/howto/static-files/

 2016-11-09 21:26 GMT+01:00 Gary Roach :
>
> Hi all,
>
> I am just starting to use jQuery and Ajax in my project and am having
> trouble setting things up.
>
> I am using Eclipse + pyDev as an IDE. This setup stores everything in
a
> workspace directory in my home directory. Instead of putting the whole
> project inside a virtualenv wrapper, things work better if the venv is
> external to the actual project files and the venv contents referenced
in the
> Eclipse setup. In that venv file (djenv) there is the following:
>
>>
/home/gary/workspace/djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js
>>
>
> Now to the setup of my main html page. According to W3schools.com I
should
> include one of the following in the html head section:
>
>>
>> 
>> 
>
>or
>
>>
>> > src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
">
>>
>> 
>
> Neither of these fit my situation. I don't have a separate
> jquery-3.1.1.min.js file and don't want to use the google source.
>
> What I wish to know is can I use something like:
>>
>> 
>> >
"djenv/lib/python3.5/site-packages/django/contrib/admin/static/admin/js/vendor/jquery/jquery.min.js"
>>
>> 
>
> or can I use just 

Re: External access

2016-11-10 Thread Luis Zárate
First, start testing you machine port is available in your local network run

python manage.py runserver 0.0.0.0:8000

In other machine in the same network test it
Suppose your django machine has  internal ip address 192.168.1.100, then
try to access 192.168.1.100:8000 from your web browser in the other machine.

If works then your problem is the NAT on router, if don't your problem is
your firewall in the machine, so try to shutdown firewall and try again if
works then test external IP if works then configure your firewall for
incoming traffic and start it again.



So


El jueves, 10 de noviembre de 2016, Antonis Christofides <
anto...@djangodeployment.com> escribió:
> When you reply to a message please include the previous emails of that
thread.
> People who read this list on a mail client might have deleted them and
they are
> probably not going to look them up elsewhere in order to remember what the
> problem was.
>
> So, how are you running the Django development server? "python manage.py
> runserver 0.0.0.0:8000"?
>
> Antonis Christofides
> http://djangodeployment.com
>
> On 2016-11-09 23:39, bob gailer wrote:
>> Here is an update on my situation.
>>
>> Windows firewall - I setup in and outbound rules for port 8000 (UDP and
TCP)
>> Router - I set up port forwarding for port 8000 (UDP and TCP)
>> Using example code in the socket module documentation I ram
socket_client and
>> socket_server on my local machine with the port=8000  and host=my
external IP
>> . It worked just fine.
>> When I run the django server instead of the socket server and attempt
browser
>> access thru my external IP I get a timeout.
>> Nothing appears on the console running the server.
>>
>> So something is different . Any ideas?
>>
>> I presume that the browser - django server communication at most uses TCP
>> and/or UDP.
>>
>> Any ideas are welcome.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/c9803196-8a68-04e2-1fe8-086b43b9e7d5%40djangodeployment.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyNLdvtDaSZCd7WbJLEOCvPELq3nwSmDL2AAu--c1nDYkw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding view permission by default to auth_permission

2016-11-10 Thread Luis Zárate
Great I have been waiting this functionality for years :).

Please let me know when your PR is merge.



El sábado, 29 de octubre de 2016, Olivier Dalang 
escribió:
> Indeed I just have to squash the commits then it can be merged. I'm out
of office until next week but will do so when back.
>
> Bests
>
> On 27 Oct 2016 23:23, "Luis Zárate"  wrote:
>>
>> This is alive in
>>
>> https://github.com/django/django/pull/6734
>>
>> The other PR was close because this have not merge conflict.
>>
>> I think this functionality is needed an will be included soon.
>>
>>
>>
>>
>> El jueves, 27 de octubre de 2016, mmatt  escribió:
>> > On another note, I believe django dev team needs to understand life is
rarely boolean. That is, even the staff that you trust, you don't always
trust 100% :) actually almost never trust 100% so good to have options.
>> > Mehmet
>> >
>> > On Wednesday, June 1, 2016 at 4:59:47 AM UTC-5, Derek wrote:
>> >>
>> >> My own observation, from years on this mailing list, is that the dev
team do not consider this a must-have for Django; their view (as far as I
understand it!) is that the admin is designed for trusted users, so simply
do not let them have access at all.  Having said that, there is a pull
request underway for a feature that seems similar to what you want:
>> >>
>> >> https://github.com/django/django/pull/5297
>> >>
>> >> (P.S. Also bear in mind that Django, like most FOSS projects, is not
actually a democracy - so something 'the people want" does not necessarily
get done; not understanding this trips many people up...)
>> >>
>> >> On Monday, 30 May 2016 20:13:18 UTC+2, Ander Ustarroz wrote:
>> >>>
>> >>> I am surprised this feature is not implemented yet, at the moment
when we create a new model  three permissions are created automatically:
>> >>>
>> >>> add_permission
>> >>> change_permission
>> >>> delete_permission
>> >>>
>> >>> We really missing the view_permission here, when we want staff to be
able to see the content but not being able to modify it. Searching a bit,
 you can find many different implementations to achieve this, but all of
them are extending django.contrib.admin.ModelAdmin. Having so many people
rewriting these methods in my opinion is a clear sign that this feature
should be part of the core.
>> >>>
>> >>> Regards,
>> >>>
>> > --
>> > You received this message because you are subscribed to the Google
Groups "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
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/3c4931c3-453f-4a80-a62d-16bc9873817b%40googlegroups.com
.
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>> <
https://ci3.googleusercontent.com/proxy/pleYFBjRTaqPzwl0QWV68XGbm9_iKE548G9HnZip6o7gk46Dni4svLKWIxqanv21wf4L-oDTIVyWUviHHYQOxYJ_VR-E2QHnDRBqrtZefM09Bgx09obS9PzSCP77HVIAehvKQVoH7RXKVRwJcXB8ZhPlAlEmO_2MsbjN1bH8rF0L8O0qa_FTVnBaZA84NQjOjE3lH9ACs5sERtY=s0-d-e1-ft#https://docs.google.com/uc?export=download&id=0B4-s_Bgz_-NSN0V3b24zU25fMW8&revid=0B4-s_Bgz_-NSdy9OTkYzcDN6RGZITWl5amdqT3JxVnNVVSswPQ
>
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
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/CAG%2B5VyNvMr6Ch5zdDz%2Bb%3DWX5%3D0-pnmnj%3DTykkU3N_KXQibHgiw%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.
>

Re: How to hook into the admin site to count login attempts with REST API / proxy?

2016-11-20 Thread Luis Zárate
Hi
You can override the admin login page overwriting the URLs, you can put
your own login view in admin/account/login after admin include in URLs


El domingo, 20 de noviembre de 2016, Reza Shalbafzadeh <
rezashal...@gmail.com> escribió:
> Hi
> you still can use Django axes as described in Django axes  documentation:
>
> django-axes requires a supported Django version. The application is
intended to work around the Django admin and the regular
django.contrib.auth login-powered pages.
>
> Also you can manually register urls for Django axes
>
http://django-axes.readthedocs.io/en/latest/issues.html#not-being-locked-out-after-failed-attempts
> add watch_login to your admin url
>
> On Friday, November 4, 2016 at 8:16:20 PM UTC+3:30, Daniel Grace wrote:
>>
>> Hello, I have a REST API which is not publicly accessible as it is
behind a proxy.  However the admin site is publicly available through an
NGINX server.  The REST API already has functionality to count failed login
attempts and I would like to duplicate that functionality on the admin
login page.  How do I hook into the admin login page and add the
appropriate code?  Can I still use Django Axes or should I create my own
login form as a replacement?
>> 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/1d87fca9-1d1d-4a6f-ba10-30c47152917b%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyOrAyKEJNux3%3DRjFQ2sonWEzJKmQmFXGOSoO5k4AOrtxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: File/Folder Sync API?

2016-12-29 Thread Luis Zárate
Are you looking for something like webdav

https://github.com/meteozond/djangodav
http://django-webdav-storage.readthedocs.io/en/latest/

or something like dinamic dropbox storage

https://github.com/andres-torres-marroquin/django-dropbox


2016-12-28 12:15 GMT-06:00 Alexander Joseph :

> I'm building a collection of apps that write custom .docx and .xlsx files,
> and store them to a users account. These files need to be in a specific
> hierarchy and each user will have their own files/folders they can view and
> edit. It would really be great if I could allow each user to sync their
> files/folders to their local hard drives so they can view, print, etc. them
> outside of the web app. Does anyone know of a good API for doing this? I
> know SugarSync has an API but they charge their users something like $7/mo
> for their cheapest subscription. I'd like to make my apps free if at all
> possible. 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/57b50b62-6bce-4197-8414-2afd5be7943b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyP-F47D7wXOy2uR4H9ctgBJaa3tMMi2mSFF1z9XwbCeSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django doesn't email reporting an internal server error (HTTP status code 500)

2016-12-29 Thread Luis Zárate
try to change de django loggin

https://docs.djangoproject.com/en/1.10/topics/logging/#examples

2016-12-28 9:45 GMT-06:00 Philip Lee :

> Please help! The question are also posted here
> http://stackoverflow.com/questions/41363888/django-
> doesnt-email-reporting-an-internal-server-error-http-status-code-500
>
> I could send mail using the following code
>
> E:\Python\django-test\LYYDownloaderServer>python manage.py shell
> Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit 
> (In
> tel)] on win32Type "help", "copyright", "credits" or "license" for more 
> information.(InteractiveConsole)>>> from django.core.mail import 
> send_mail>> send_mail(... 'Subject here',... 'Here is the 
> message.',... 'redstone-c...@163.com',... ['2281570...@qq.com'],...   
>   fail_silently=False,... )1>>>
>
> According to the doc
> 
> :
>
> When DEBUG is False, Django will email the users listed in the ADMINS
> setting whenever your code raises an unhandled exception and results in an
> internal server error (HTTP status code 500). This gives the administrators
> immediate notification of any errors. The ADMINS will get a description of
> the error, a complete Python traceback, and details about the HTTP request
> that caused the error.
>
> but in my case, Django doesn't email reporting an internal server error
> (HTTP status code 500) [image: enter image description here]
> 
>
> what's the problem? please help fix the problem
>
>
> settings.py
>
> """
> Django settings for LYYDownloaderServer project.
>
> Generated by 'django-admin startproject' using Django 1.9.1.
>
> For more information on this file, 
> seehttps://docs.djangoproject.com/en/1.9/topics/settings/
>
> For the full list of settings and their values, 
> seehttps://docs.djangoproject.com/en/1.9/ref/settings/
> """
> import os
> ADMINS = [('Philip', 'r234327...@163.com'), ('Philip2', '768799...@qq.com')]
> EMAIL_HOST = 'smtp.163.com'  # 'localhost'#'smtp.139.com'# EMAIL_PORT = 25# 
> EMAIL_USE_TLS = True
>
> EMAIL_HOST_USER = 'r234327...@163.com'  # '13529123...@139.com'
> EMAIL_HOST_PASSWORD = '**'# DEFAULT_FROM_EMAIL = 'r234327...@163.com'# 
> Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
> # Quick-start development settings - unsuitable for production# See 
> https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = 's4(z8qzt$=x(2t(ok5bb58_!u==+x97t0vpa=*8bb_68baekkh'
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = False
>
> ALLOWED_HOSTS = ['127.0.0.1']#, '.0letter.com'
>
> # Application definition
>
> INSTALLED_APPS = [
> 'VideoParser.apps.VideoparserConfig',
> 'FileHost.apps.FilehostConfig',
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',]
>
> MIDDLEWARE_CLASSES = [
> 'django.middleware.common.BrokenLinkEmailsMiddleware',
> 'django.middleware.security.SecurityMiddleware',
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',]
>
> ROOT_URLCONF = 'LYYDownloaderServer.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },]
>
> WSGI_APPLICATION = 'LYYDownloaderServer.wsgi.application'
>
> # Database# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> }}
>
> # Password validation# 
> https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
>
> AUTH_PASSWORD_VALIDATORS = [
> {
> 'NAME': 
> 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
> },
> {
> 'NAME': 
> 'django.contrib.auth.password_validation.MinimumLengthValidator',
> },
> {
> 'NAME': 
> 'django.co

Re: Django search

2017-01-18 Thread Luis Zárate
This could be usefull


Model.objects. filter(q='hello', b='world')

Can be expressed as

params ={'q': 'hello', 'b': 'world')
Model.objects.filter (**params)




El martes, 17 de enero de 2017, Branko Zivanovic <
international11...@gmail.com> escribió:
> Yes that is true, and I have succeeded in making select menu and checkbox
by using Django's forms and their widgets.
> Thanks anyway!
>
> уторак, 17. јануар 2017. 21.04.51 UTC+1, Fred Stluka је написао/ла:
>>
>> Branko,
>>
>> You may need to explain a little more.
>>
>> It sounds like you have search working when you type the search
>> string into a HTML text box.  True?
>>
>> What do you want to do with the menu and checkbox?  Are you
>> trying to arrange for the text of the menu label and the text of the
>> checkbox label to be combined somehow to form the search
>> string?
>>
>> --Fred
>> 
>> Fred Stluka -- mailt...@bristle.com -- http://bristle.com/~fred/
>> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
>> Open Source: Without walls and fences, we need no Windows or Gates.
>> 
>> On 1/17/17 9:32 AM, Branko Zivanovic wrote:
>>
>> Thank you for reply!
>> I'm fine with text input but I also want select menu and checkbox. I
want to use it to somehow filter my search.
>> I'm not sure how it fits anyway in bigger picture. How do people make
search with select menu and checkbox?
>> Best,
>> Branko
>>
>> понедељак, 16. јануар 2017. 07.13.44 UTC+1, Constantine Covtushenko је
написао/ла:
>>>
>>> Hi Branco,
>>> Sorry, but can you be more specific?
>>> If you've got the result what is your concern?
>>> Do you only need to switch into forms?
>>> Regards,
>>> Constantine C.
>>> On Sun, Jan 15, 2017 at 2:41 PM, Branko Zivanovic <
internati...@gmail.com> wrote:

 How do i implement search on django website with select menu and
checkbox? I've succeeded in adding basic text input and it works but I
didn't use django forms. How do I add this type of search?
 --
 You received this message because you are subscribed 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/078841f1-a976-4c22-bb2f-ff5069bdce1d%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...@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/9fc70bbe-487d-4c4b-8f9a-77ad79281193%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/642c076f-aafd-46b1-b63c-0a8d174e8595%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMzx9xCN7pmAHnH%3D_OC3DzvOXEgVeu5f_GeJjMMpMkCaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create a Celery task with Django

2019-02-13 Thread Luis Zárate
As Andreas suggest I try to create a function that receive a file object
and save the excel content there, Django response works like a file so when
you have a less than 7 then pass the http response and change the
headers.  With celery you can store your firters on str as json file and
pass to celery delay, then create a temporary file and pass to the excel
function with the filters decoded.

Django support Media Fields, so you can create a special file and add to a
model and send to a view that check and return de media url.  Also
important to delete the file after a period of time.

El miércoles, 13 de febrero de 2019, valentin jungbluth <
valentin.a...@gmail.com> escribió:
> Thank you Andréas !
>
> I understand your comment, but it could be possible to illustrate it with
my code ? I spent 1 week and up to now I don't find any way to solve my
issue and execute my Celery task :/
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/c15b2681-a630-4691-960d-2897f914a553%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMFMnUWWF1fk6jAjddiNvqjRyh5PEY-VsG1RL1eFriLNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create a Celery task with Django

2019-02-13 Thread Luis Zárate
See http://django.pyexcel.org/en/latest/

Clean code could be made with this library.

El miércoles, 13 de febrero de 2019, valentin jungbluth <
valentin.a...@gmail.com> escribió:
> Thank you Andréas !
>
> I understand your comment, but it could be possible to illustrate it with
my code ? I spent 1 week and up to now I don't find any way to solve my
issue and execute my Celery task :/
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/c15b2681-a630-4691-960d-2897f914a553%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
"La utopía sirve para caminar" Fernando Birri

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/CAG%2B5VyMdaQ3s7ZDegwQxY_oYCxaxBPQooNg7X1VYgEhuKqiLJA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >