Re: JSON serializable issue

2018-07-07 Thread Luis
Dear Melvyn,
I had a week with this issue. Thanks to you i could to find the problem. I
am working with AWS and it change some names for its instances (+3 or 4
letters). Then it couldnt write to the database. Before, i thinked in this
solution but i was not sure and went for other solution. I change the
length of the column and into the code. It is working very well.
Thanks,
Luis




2018-07-07 4:32 GMT-05:00 Melvyn Sopacua :

> Hi,
>
> > However i am not
> > sure about it and i cannt find where to looking for. I am sending an
> > attachment with the bug. I have many days with it.
> > Thanks for any idea.
>
>
> This looks like you're trying to store an exception in a session, using
> the
> JSON session backend. Since json doesn't know how to serialize an
> exception
> object, it bails out.
>
> The underlying problem is that you're trying to store more then 80 chars
> into
> a field with max lenght 80. Without code, it is impossible to tell how the
> two
> relate.
>
> --
> Melvyn Sopacua
>
> --
> 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/Td7D655GLKI/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/6363934.dWIXy7cGKv%40fritzbook.
> 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/CACnFoPpWrsr0xM%2BM07Y1qXb3AzamiNKbyxab-EgdN-2GQUc99g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Css and Images are missing

2008-11-15 Thread Luis Goncalves

Hello guys I need your help in here.

Sorry I am new in Django and I am having a problem, my css and jpgs
are missing.

I will write everything what i have and then maybe someone could give
me a hint :)


My settings.py:
MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
MEDIA_URL = 'http://127.0.0.1:8000/media/'
ADMIN_MEDIA_PREFIX = '/media/'


My urls.py:
(r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
'settings.MEDIA_ROOT'}),


And an example of base.html:
http://127.0.0.1:8000/media/
mm_health_nutr.css" type="text/css" />
http://127.0.0.1:8000/media/picture.jpg"; alt="Header image"
width="382" height="101" border="0" />


Thanks so much for your help.

Best Regards,

Luis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Css and Images are missing

2008-11-15 Thread Luis Goncalves

Well i saw this:

"With that said, Django does support static files during development.
You can use the django.views.static.serve() view to serve media files.
The big, fat disclaimer¶

Using this method is inefficient and insecure. Do not use this in a
production setting. Use this only for development.

For information on serving static files in an Apache production
environment, see the Django mod_python documentation.
How to do it

Here’s the formal definition of the serve() view:

def serve(request, path, document_root, show_indexes=False):

To use it, just put this in your URLconf:

(r'^site_media/(?P.*)$', 'django.views.static.serve',
{'document_root': '/path/to/media'}),
"
So there is support on development... And i have that on my urls.py...

So i still dont understand why doesnt work,

Thanks,

On Nov 15, 6:36 pm, Luke Seelenbinder <[EMAIL PROTECTED]> wrote:
> Django doesn't serve the media files, look 
> athttp://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs
>
> Luke
>
> On Nov 15, 10:49 am, Luis Goncalves <[EMAIL PROTECTED]> wrote:
>
> > Hello guys I need your help in here.
>
> > Sorry I am new in Django and I am having a problem, my css and jpgs
> > are missing.
>
> > I will write everything what i have and then maybe someone could give
> > me a hint :)
>
> > My settings.py:
> > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
> > MEDIA_URL = 'http://127.0.0.1:8000/media/'
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> > My urls.py:
> > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
> > 'settings.MEDIA_ROOT'}),
>
> > And an example of base.html:
> > http://127.0.0.1:8000/media/
> > mm_health_nutr.css" type="text/css" />
> > http://127.0.0.1:8000/media/picture.jpg"; alt="Header image"
> > width="382" height="101" border="0" />
>
> > Thanks so much for your help.
>
> > Best Regards,
>
> > Luis
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Css and Images are missing

2008-11-15 Thread Luis Goncalves

Thanks so much ;)

Its working :)

--
Luis


On Nov 15, 8:10 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sat, Nov 15, 2008 at 10:49 AM, Luis Goncalves
> <[EMAIL PROTECTED]>wrote:
>
>
>
>
>
> > Hello guys I need your help in here.
>
> > Sorry I am new in Django and I am having a problem, my css and jpgs
> > are missing.
>
> > I will write everything what i have and then maybe someone could give
> > me a hint :)
>
> > My settings.py:
> > MEDIA_ROOT = '/home/lgoncalves/Arquivos/MyVitaminesShop/media/'
> > MEDIA_URL = 'http://127.0.0.1:8000/media/'
> > ADMIN_MEDIA_PREFIX = '/media/'
>
> > My urls.py:
> > (r'^media/(?P.*)', 'django.views.static.serve',{'document_root':
> > 'settings.MEDIA_ROOT'}),
>
> > And an example of base.html:
> > http://127.0.0.1:8000/media/
> > mm_health_nutr.css" type="text/css" />
> > http://127.0.0.1:8000/media/picture.jpg"; alt="Header image"
> > width="382" height="101" border="0" />
>
> You've essentially got the same value for MEDIA_URL and ADMIN_MEDIA_PREFIX,
> which doesn't work 
> (see:http://docs.djangoproject.com/en/dev/ref/settings/#admin-media-prefix).  
> The
> development server has a built-in media server for admin which picks off
> anything starting with ADMIN_MEDIA_PREFIX and serves up the admin media
> files.  You've set things up so your own media files have that same prefix
> (thehttp://127.0.0.1:8000just serves to route it to a server, once at that
> server all that matters is what follows, in your case '/media/', which is
> the same as your ADMIN_MEDIA_PREFIX), so the request for your CSS, etc. are
> going to the built-in admin media server (which can't find them since it's
> looking among the admin media), not the static server.
>
> Karen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Template tag i18n failing

2008-09-01 Thread Luis Rodrigues

Thanks for the info.

2008/8/31 Ramiro Morales <[EMAIL PROTECTED]>:
>
> On Sun, Aug 31, 2008 at 2:09 PM, Ramiro Morales <[EMAIL PROTECTED]> wrote:
>>
>> This is a bug and has been reported as ticket |1] #7027, you can track
>> the advance of the issue there.
>>
>
> This is fixed as of revision 8769.
>
> cheers,
>
> --
>  Ramiro Morales
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Image thumbnail and save

2008-09-01 Thread Luis Rodrigues

Thanks,

allready got it to work.

2008/8/31 julianb <[EMAIL PROTECTED]>:
>
> On Aug 31, 6:45 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> Can someone please point me in the right direction
>
> I got problems after the refactoring, too:
>
> http://groups.google.com/group/django-users/browse_thread/thread/230a8601a4839bd9/b707f7fe40e03537#b707f7fe40e03537
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Django 1.0 - Form documentation

2008-09-21 Thread Luis Sanchez

Hi,

Do you know where can I find documentation about forms in django 1.0
specially for validations?


Luis.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Can I use request.user, in the limit_choices_to filter in Model class?

2010-02-24 Thread Luis Gonzalez
I need to filter a field by a UserProfile function, i.e. how can I do
something like this?

class Paquet(models.Model):
...
profiles = models.ManyToManyField(UserProfile, limit_choices_to =
{'country': request.user.userprofile.country})

Thanks in advance.

-- 
___
Luis González Medina
http://djangotips.blogspot.com
http://konatufe.blogspot.com
http://twitter.com/konatufe

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE

2008-03-25 Thread luis cota
I used to use Eclipse + PyDev - good setup, though extremely bloated.  Now I
use Komodo Edit (OpenKomodo) for my python coding.  Good autocomplete
support, much lighter than Eclipse and cleaner UI.

Good luck,

- Luis

On Tue, Mar 25, 2008 at 11:26 AM, meppum <[EMAIL PROTECTED]> wrote:

>
> I started out using eclipse with the python plugin, but have since
> moved to wingware, which I like better.
>
> On Mar 25, 6:32 am, Filipe Correia <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > On Mar 5, 2:32 pm, gabriel <[EMAIL PROTECTED]> wrote:
> >
> > > I am at the point of changingIDEbefore my next project ( a huge one ).
> > > So far I've used Geany for python but now I am supposed to use django.
> > > Is it anythong with special support for Django??
> >
> > There's pyscripter:http://pyscripter.googlepages.com/
> > It is a (open-source) window application, but I ear it runs on linux
> > using wine[1].
> > I've tried several editors, but this was the one that provided the
> > best user-experience for me.
> > The debugger is awesome, and there are instructions on how to get it
> > going with django[2].
> >
> > Cheers,
> > Filipe
> >
> >
> [1]http://groups.google.com/group/PyScripter/browse_frm/thread/abd430374...
>  > [2]http://pyscripter.googlepages.com/django
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



urls question

2008-07-04 Thread Luis Sanchez

Hi,

I want to do this:

www.domain.com/part1/

if part1 is :  someword1 , someword2 or someword3   go to the view:
view1
if part1 is :  someword6 , someword7 or someword9   go to the view:
view2

How can I do that using urls.py ??

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Problem loading a js file

2006-09-18 Thread Luis Gustavo

I am trying to use the calender code I found in
http://www.dynarch.com/projects/calendar/
in my form template, with a generic view.  I have copied the script
files to many places in my project and tried different configurations
in settings, but I always get the same error, Calendar is not defined.
My template starts with

@import url(calendar-win2k-1.css);





and has the date field

start: {{ form.data }} ...

  Calendar.setup(
{
  inputField  : "id_data", // ID of the input field
  ifFormat: "%m %d, %Y",// the date format
  button  : "trigger"   // ID of the button
}
  );


as described on the script site. What is wrong?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Completed Django Project

2006-10-26 Thread Luis Armendariz

[EMAIL PROTECTED] wrote:
> Hi django friends,
> 
> I just finished my first django project, http://asme.seas.ucla.edu . A
> little background: over summer, I started studying python, and after
> finishing a couple books I got seduced by django and at the same time
> was asked to make/design a website (im studying design), I figured it'd
> be a good way to learn django and 7 weeks later here it is. It's my
> first time doing any web-related programming, and I'm pretty proud of
> it, so if you guys would comment on it (good or bad), I'd really
> appreciate it!
> 
> thanks,
> Leon
> 
> 

Very nice site. Just to let you know though, I found one bug.
Clicking on the Login button without entering anything gives me an
exception traceback (I guess you didn't create a template for
an http 500 error)
-Luis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django captcha problems

2006-03-02 Thread Luis Armendariz

syhpoon wrote:
> Error occurs when I try to load template with form that is protected
> with captcha, i.e. when I put {%load captcha%} {%captcha%} into my
> template, without these lines it renders fine, but, naturally without
> captcha image. The strangest thing for me is that, as I've mentioned
> before, with django internal server it works as it required to: the
> image is generated and shown, validation passes as well. Thus I suspect
> mod_python to be the cause of errors like these. But the reason, and
> much more important, solution is still unknown.
> 
> Template code I use for this form is taken from captcha's class
> docstring.
> 
> 
> 

Hi Syhpoon,

I'm not too familiar with the captchas, but shouldn't you use the
template tags {% load captcha %} and {% captcha %} instead? The leading
and trailing spaces are important, I think.

-Luis

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



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: How to get the Exception Type

2012-05-14 Thread Luis Gonzalez
Hi as you can see here at http://docs.python.org/tutorial/errors.html
in 8.3 handling exceptions theres a piece of code that works as you
want.

for example try this:

try:
  int("a")
except Exception as e: #The key is using "as" and the variable name
you like for retrieving the exception because if you dont you will
only get
   #"Exception type" type

  print type(e) #This will give de exception type. In this case #'
  print e #This will print you the message exception.  #invalid
literal for int() with base 10: 'a'
  print e.message #This would give you the string message #invalid
literal for int() with base 10: 'a'


I hope this can help you, please forgive me for my grammar im mexican.

On 14 mayo, 18:29, LJ  wrote:
> I am trying to add exception handling to my application.
> I have been reading the documentation on Django 
> Exceptions:https://docs.djangoproject.com/en/dev/ref/exceptions/
> I also found the list of Exceptions (both Django and Python).
> But for testing purposes, I need a way to handle all exceptions and to
> log the exception types:
>
> try:
>    addresses = Address.objects.all()
> except Exception:
>   logger.debug(Exception.Type)
>
> How do I catch all types of exceptions?  And, how do I get the
> exception type?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: View decorator for common navigation elements?

2011-09-30 Thread Luis Morales
wouldn't a template tag work best in a case like this?

something like {% NavBar %} or {% GetNav NavName %}

that way you can have your own cache code inside you template tag
code, like storing the database result into memcached or redis and
avoid a relational db call each page. them you you modify you
navigation data model you can you invalidate the cache and recreate
it. it will also be a lot simplier to reuse in other projects as you
wont have to inlcude a decorator on each view.

On Sep 30, 2:59 am, Victor Hooi  wrote:
> Hi,
>
> We have a common navigation bar on nearly every page (view) that contains a
> dropdown - this dropdown is populated with items from a database table. This
> dropdown also has AJAX behaviour attached to it.
>
> I'm thinking I can create a decorator that will retrieve the list from the
> database, and return a Python list
>
> We can then wrap every single view in this decorator, and then pass the list
> to the template for rendering.
>
> Firstly - is there a more elegant alternative, rather than wrapping every
> single view in this decorator? (Middleware? Or is that a poor fit here?
> Anything else?).
>
> And secondly - are there are any performance issues here? We're making
> database calls with every single view, just to get a list for a navigation
> dropdown. Smarter way?
>
> I know I can use the caching middleware to cache entire pages, or even
> template fragments - but how about caching a single list() like this? What
> are other methods people are using to tackle this?
>
> Cheers,
> Victor

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Historical Records

2012-01-27 Thread luis sanchez
Hi everyone,

I want to know. how can I save a Historical record when an admin user
edit something using admin actions.

I mean, save the user and the field that was modified.

thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



pyodbc.connect timeout question

2012-01-27 Thread Luis Tavera
Hi all,

I have some code similar to the one below that runs slightly differently if
I run it outside Django and within Django. The difference is that within
Django it takes much longer to raise the pyodbc.Error (several minutes)
than outside Django (a few seconds). I am new to Django (and Python) and I
wonder why this may be happening.

Any hints will be appreciated.

thanks,

Luis



import pyodbc

def connect():
try:
cnxn = pyodbc.connect('DRIVER={SQL Server NATIVE Client
11.0};SERVER=%s;UID=uid;PWD=pwd' % '127.0.0.1',
  timeout=5)
except pyodbc.Error:
print "could not connect"
return None


connect()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: post_save signal not working in Django 1.7

2015-01-19 Thread Luis Matoso
Something similar is happening with me too: on a post_save of model it 
isn't created yet on database, so several 
error are raised by functions which expect that it is already on DB.

When the post_save handler ends, the object is saved normally.


On Friday, January 16, 2015 at 4:14:09 PM UTC-2, Zach LeRoy wrote:
>
> I have a block of code that works fine in Django 1.6.10 but does not work 
> at all in Django 1.7.3.  I would expect my log statement to print every 
> time a Django User is created and this is the behavior in 1.6.10:
>
> import logging
>
> from django.contrib.auth.models import User
> from django.db import models
> from django.db.models.signals import post_save
> from django.dispatch import receiver
>
> log = logging.getLogger(__name__)
>
>
> class UserProfile(models.Model):
> uuid = models.CharField(max_length=36)
> user = models.OneToOneField(User)
>
>
> @receiver(post_save, sender=User)
> def create_user_profile(sender, instance, created, **kwargs):
> """
> When a new user is created, add a UserProfile
> """
> log.debug('received post save signal: {}'.format(instance))
> if created:
> UserProfile.objects.create(user=instance)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/2aa39e20-a977-436c-9e21-586605ec7df6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Problem with sitemap.xml in django project.

2015-02-01 Thread José Luis


I am deploying a Django project with Gunicorn + Nginx. I create a 
sitemap.xml file with the sitemap framework 
. I use a 
127.0.0.1:8001 proxy so when i access to example.com/sitemap.xml the result 
is similar to this:






http://127.0.0.1:8001/service/item/gestionar_apertura_de_academia

monthly
0.5



When i add sitemap.xml to the Google index in Google Webmaster Tools, 
Google does not allow the sitemap.xml because the domain in location tag is 
127.0.0.1:8001 and not my domain.

Is there any solution to this problem?

I've posted this question in StackOverFlow too: 
http://stackoverflow.com/questions/28263869/sitemap-xml-file-in-django-gunicorn-nginx-web

Thank you so much for your help

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/685515fd-89f4-4a62-99e0-d13a1b7ca643%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Migrations force me to have, forever, any name/reference I use in field validators=, choices=, whatever, valid forever (even if the requirements change).

2015-02-25 Thread Luis Masuelli
I have an issue with migrations.

Suppose I declare (in my application, with name myapp) a field with a 
validators= declared. In such value (which is an iterable), I declare a 
function:

class MyModel(models.Model):
"""
This one is identifiable.
"""

identifier = models.CharField(max_length=10, unique=True, validators=[
valid_identifier])

Assume I created the migration with makemigrations:

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import django.core.validators
import micnt.models


class Migration(migrations.Migration):

dependencies = [
...
]

operations = [
migrations.CreateModel(
name='MyModel',
fields=[
('identifier', models.CharField(max_length=10, unique=True, 
validators=[myapp.models.valid_identifier])),
],
options={
},
bases=(models.Model,),
),
]

Assume valid_identifier is any external callable which will take one 
positional argument, and eventually raise ValidationError under certain 
conditions.

Now the requirements vary: The identifier may be national or foreign, so 
the country is required as an additional field, and also a discriminator 
field. Additionally, the validation I must perform is cross-field, so 
instead of using something in validators, I define a clean() method, and 
make the combination of country/identifier unique, instead of just the 
identifier unique:

class MyModel(models.Model):
"""
This one is identifiable.
"""

identifier_type = models.CharField(max_length=10, choices=(('passport', 
_(u'Passport')), ('national', _(u'National'))), null=False)
identifier = models.CharField(max_length=10)
country = models.ForeignKey(Country, null=False)  # assume Country 
model exists

class Meta:
unique_together = (('identifier', 'country'),)

def clean(self):
raise ValidationError('Implement this!')


And then, I don't need anymore the valid_identifier function, since my code 
does not use it anymore. So I delete it.

Now I will create the migration with makemigrations as usual. What will 
happen?

a. The command will succeed.
b. The command will explode (i. e. a normal Python exception).
c. The command will create an inconsistent migration, without exploding.
d. Jesus will come again.
e. The command will get into a kind of endless loop.

If you guesses "b", you were right. Django will report an error, since 
myapp.models.valid_identifier does not exist anymore (AttributeError).

So, once I set a value for validators= parameter and create a migration, I 
am forced to keep such reference valid for the rest of my life (e.g. by 
having valid_identifier=None, if I don't need the function anymore), or 
else the migrations will not work again since they will be traversed, 
imported, and will get such AttributeError.

Is this an expected, normal, behavior?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/0f186fe2-e37a-41ef-882f-9d509dd6c5cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrations force me to have, forever, any name/reference I use in field validators=, choices=, whatever, valid forever (even if the requirements change).

2015-02-27 Thread Luis Masuelli
Thanks :D Did not think about squashing migrations as solution for this 
problem! But it does the job.
OTOH the fact about historical models has nothing to do with my problem 
(since it is not related at all with instancing a model, but just about the 
definition and not getting a NameError).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/15bb8a96-18a5-432c-afeb-7a3299ca7a4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Using proxy kind of Table in Admin Interface

2015-03-04 Thread luis zarate
Maybe you can use get_queryset in the admin class and replace the query
manager

ref:
https://docs.djangoproject.com/en/1.7/ref/contrib/admin/#django.contrib.admin.ModelAdmin.get_queryset

https://docs.djangoproject.com/en/1.7/topics/db/managers/

you can do something like this:

def get_queryset(self, request):
"""
Returns a QuerySet of all model instances that can be edited by the
admin site. This is used by changelist_view.
"""
if request.user.is_superuser:
qs = self.model.superuser_manager.get_queryset()
else:
qs = self.model._default_manager.get_queryset()

ordering = self.get_ordering(request)
if ordering:
qs = qs.order_by(*ordering)
return qs

2015-03-01 17:06 GMT-06:00 Rootz :

> Question.
> How would one go about designing the django table(s) so that I can assign
> each user account/group a different Model Manager using the same table in
> the Django admin interface?
>
> After doing some reading the closest that comes to this is the Proxy Model
> but I tried adding the proxy model manually into the django admin and got
> an error while loading it.
>
> My goal is to create one table that returns a custom QuerySet unique to a
> user group or user account. Adding to this I would like for this to be
> visible in the admin interface. Can you guide me as to how can achieve this.
>
> thank you
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cd13f5ab-633e-4361-a621-cfc11d5d01a5%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%2B5VyNCYpSs0quBUVPSiTgUsApP9tD_F0JwnwLxwiuSpyM8nQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Form In modal

2015-03-04 Thread luis zarate
Fast solution:
In Javascritp you can do this:

element = document.getElementById("myinput");
window.open("http://127.0.0.1:8000/consulta/?consulta="+element.value,
"MsgWindow", "width=200, height=100");


but continue reading


Are you use ajax?
If the answer is not, then see https://github.com/yceruto/django-ajax.

A concept problem is there, modal is a interface view (in the browser) and
your method refresh the page (It is a GET Request).

I don't know what kind of framework you are using, but in general you can
do something like this:



Operadora  Tipo
CLAROMOVEL



$("#mymodal").modal();




for more information see
http://getbootstrap.com/javascript/#modals
http://jqueryui.com/dialog/

PD: You can do better implementation if you are using django ajax



2015-02-26 13:08 GMT-06:00 Emerson Luiz :

> Hi,
>
> I have the following problem:
>
> I need to set up a form, that when the OK button is clicked, it passes a
> parameter and open a modal with the result.
> Today the query works as follows:
>
> http://127.0.0.1:8000/consulta/?consulta=31
>
> The 31 is the parameter.
>
> return:
>
> Operadora  TipoCLAROMOVEL
>
>
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/9f8e5cbb-45a0-464d-9047-6ccfdc0a4757%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%2B5VyMbtAjJH30MYDMe4S1M%2Bdfo7w7gGB8SSc%3DrJBqaZFxaNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Embedding a compiler to my web page

2015-03-07 Thread luis zarate
You should want to read about subprocess

https://docs.python.org/3.4/library/subprocess.html

Install your favorite compiler and call it with subprocess as a comand line
program.

2015-03-07 9:01 GMT-06:00 Snehasish Sen :

> How can I embed a c/c++ compiler to my site which can host a programming
> competetion
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/2a2fae63-cb65-41e1-af5c-d67d30c21eb8%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%2B5VyM2yKJDZXLnndEHn%3DoVn1siTeVOeh5YsNuh5hwan2VFLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 tutorial part 4, url

2015-03-07 Thread luis zarate
2015-03-06 18:39 GMT-06:00 Collin Anderson :

> Hi,
>
> That seems strange. The error says that there's no question with id=1. Are
> you sure there's a question with id=1?
>
> The ending slash seems important to me. I don't know why it would work
> without it.
>
> Collin
>
>
> On Wednesday, March 4, 2015 at 2:15:32 PM UTC-5, Daniel Altschuler wrote:
>>
>> I ran into the following problem with the tutorial.
>>
>> When I'm at http://127.0.0.1:8000/polls/1/, I get the expected page:
>>
>> What's up? Not much
>>  The sky
>>
>>
>> However when I try to vote I get the error
>>
>> Page not found (404)Request Method:POSTRequest URL:
>> http://127.0.0.1:8000/polls/1/vote/
>>
>> No Question matches the given query.
>>
>> You're seeing this error because you have DEBUG = True in your Django
>> settings file. Change that to False, and Django will display a standard
>> 404 page.
>>
>> After some time I found that something is wrong with the urls. My
>> polls/urls.py file was:
>>
>> -
>> from django.conf.urls import patterns, url
>>
>> from polls import views
>>
>> urlpatterns = patterns('',
>> # ex: /polls/
>> url(r'^$', views.index, name='index'),
>> # ex: /polls/5/
>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>
>> url(r'^(?P\S+)/$', views.search, name='search'),
>> # ex: /polls/5/results/
>> url(r'^(?P\d+)/results/$', views.results,
>> name='results'),
>> # ex: /polls/5/vote/
>> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
>> )
>> --
>>
>> If I remove the "/" after "vote", then everything works. I had the same
>> error when attempting to view the results, so I also
>> removed the "/" after results. My urls.py now looks like
>>
>> ...
>> # ex: /polls/5/results
>> url(r'^(?P\d+)/results$', views.results,
>> name='results'),
>> # ex: /polls/5/vote
>> url(r'^(?P\d+)/vote$', views.vote, name='vote'),
>>...
>>
>> Can someone explain me what is going on? thanks.
>>
>> Note that the file mysite/urls.py is:
>>
>> --
>> from django.conf.urls import patterns, url
>>
>> from polls import views
>>
>> urlpatterns = patterns('',
>> # ex: /polls/
>> url(r'^$', views.index, name='index'),
>> # ex: /polls/5/
>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>
>> url(r'^(?P\S+)/$', views.search, name='search'),
>> # ex: /polls/5/results
>> url(r'^(?P\d+)/results$', views.results,
>> name='results'),
>> # ex: /polls/5/vote
>> url(r'^(?P\d+)/vote$', views.vote, name='vote'),
>> )
>> 
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/db705c9f-f8a1-46e6-add8-a637671a603e%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%2B5VyOWaZTFBsSR6uirUXu1ZX%3DLhx-jKnHuyLTGSBoYVx-AkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.7 tutorial part 4, url

2015-03-07 Thread luis zarate
Do you have APPEND_SLASH=False in your settings?

https://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#append-slash



2015-03-07 10:31 GMT-06:00 luis zarate :

>
>
> 2015-03-06 18:39 GMT-06:00 Collin Anderson :
>
> Hi,
>>
>> That seems strange. The error says that there's no question with id=1.
>> Are you sure there's a question with id=1?
>>
>> The ending slash seems important to me. I don't know why it would work
>> without it.
>>
>> Collin
>>
>>
>> On Wednesday, March 4, 2015 at 2:15:32 PM UTC-5, Daniel Altschuler wrote:
>>>
>>> I ran into the following problem with the tutorial.
>>>
>>> When I'm at http://127.0.0.1:8000/polls/1/, I get the expected page:
>>>
>>> What's up? Not much
>>>  The sky
>>>
>>>
>>> However when I try to vote I get the error
>>>
>>> Page not found (404)Request Method:POSTRequest URL:
>>> http://127.0.0.1:8000/polls/1/vote/
>>>
>>> No Question matches the given query.
>>>
>>> You're seeing this error because you have DEBUG = True in your Django
>>> settings file. Change that to False, and Django will display a standard
>>> 404 page.
>>>
>>> After some time I found that something is wrong with the urls. My
>>> polls/urls.py file was:
>>>
>>> -
>>> from django.conf.urls import patterns, url
>>>
>>> from polls import views
>>>
>>> urlpatterns = patterns('',
>>> # ex: /polls/
>>> url(r'^$', views.index, name='index'),
>>> # ex: /polls/5/
>>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>>
>>> url(r'^(?P\S+)/$', views.search, name='search'),
>>> # ex: /polls/5/results/
>>> url(r'^(?P\d+)/results/$', views.results,
>>> name='results'),
>>> # ex: /polls/5/vote/
>>> url(r'^(?P\d+)/vote/$', views.vote, name='vote'),
>>> )
>>> --
>>>
>>> If I remove the "/" after "vote", then everything works. I had the same
>>> error when attempting to view the results, so I also
>>> removed the "/" after results. My urls.py now looks like
>>>
>>> ...
>>> # ex: /polls/5/results
>>> url(r'^(?P\d+)/results$', views.results,
>>> name='results'),
>>> # ex: /polls/5/vote
>>> url(r'^(?P\d+)/vote$', views.vote, name='vote'),
>>>...
>>>
>>> Can someone explain me what is going on? thanks.
>>>
>>> Note that the file mysite/urls.py is:
>>>
>>> --
>>> from django.conf.urls import patterns, url
>>>
>>> from polls import views
>>>
>>> urlpatterns = patterns('',
>>> # ex: /polls/
>>> url(r'^$', views.index, name='index'),
>>> # ex: /polls/5/
>>> url(r'^(?P\d+)/$', views.detail, name='detail'),
>>>
>>> url(r'^(?P\S+)/$', views.search, name='search'),
>>> # ex: /polls/5/results
>>> url(r'^(?P\d+)/results$', views.results,
>>> name='results'),
>>> # ex: /polls/5/vote
>>> url(r'^(?P\d+)/vote$', views.vote, name='vote'),
>>> )
>>> 
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 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/db705c9f-f8a1-46e6-add8-a637671a603e%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/db705c9f-f8a1-46e6-add8-a637671a603e%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%2B5VyMdQLNS6Ms3%2B7VKa%2BjUpw8yL9Vwa07Z35WP%2BKzNaEm%3DfA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to track number of visitors on django site

2015-03-10 Thread luis zarate
I know django-statistics ( https://github.com/attuch/django-statistics )
but I have never used

2015-03-10 15:16 GMT-06:00 Andreas Kuhne :

> Hi Vijay,
>
> Thanks for the suggestion, and we are of course using GA (I should have
> mentioned that). The problem is our CEO doesn't like the way GA compiles
> the information and he also feels that it's too slow, he can't get the
> views that he would like.
>
> So we would like to add this information ourselves somehow.
>
> Regards,
>
> Andréas
>
> 2015-03-10 21:40 GMT+01:00 Vijay Khemlani :
>
>> Hmmm... what about the classic Google Analytics?
>>
>> On Tue, Mar 10, 2015 at 5:04 PM, Andreas Kuhne <
>> andreas.ku...@suitopia.com> wrote:
>>
>>> Hi all,
>>>
>>> I would like to be able to track the number of visitors on our website.
>>> We previously had django-tracking installed and a munin node that tracked
>>> the information. Unfortunately we weren't able to continue using it because
>>> it broke our website somehow (I don't remember how).
>>>
>>> Does anyone have any ideas for how to create a similar functionality or
>>> a similar plugin that can be used?
>>>
>>> Regards,
>>>
>>> Andréas
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CALXYUbnm0zqK9hpH%2BOoSt9tYYeTDu2dGXXhgaE-%2BYiO-9n-LGw%40mail.gmail.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CALn3ei10FoMMSTuqO_FdgEGFEEFXDFpiebZ_0hOVahiZs2aAfg%40mail.gmail.com
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CALXYUbnmDac3NTzv8iDFoUx-nfFegPFZDTa5Up4N2hLF%2BpTniQ%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%2B5VyM%3DD_q70FpUNZN2jnMbAC69Wx8Lf4vnFLOubh2qQX8ovg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django OperationalError

2015-03-12 Thread luis zarate
If you deleted your db and created again and the issue persist then maybe
the problem is in your apps.

Try removing db, comment 3th party apps in settings and run migrate with
only django core apps, put again 3th party apps and run migrate.

El jueves, 12 de marzo de 2015, Collin Anderson 
escribió:
> Hi,
> Do you have the correct file path set to your sqlite3 database? Does it
have proper permissions?
> I found a similar issue here:
> https://www.pythonanywhere.com/forums/topic/1814/
>
> Collin
> On Wednesday, March 11, 2015 at 2:04:45 AM UTC-4, Petar Pilipovic wrote:
>>
>> Hey Collin,
>> I have done what have you told me, but I still have that error, I even
created data base on www.pythonanywhere.com, and amend mine setting.py file
to use that db.
>> I have manually deleted database and done syncdb, migrate etc.
>> Here are the output for syncdb, and then I have made mine superuser,
this is the Operational Error.
>> Question: Why is he reporting this template rendering error on line 40?
>> Tank you
>> Best
>> Petar
>> On Tue, Mar 10, 2015 at 6:49 PM, Petar Pilipovic 
wrote:
>>>
>>> Heh, lol, Ok tax Collin I will do that. I was thinking that i need to
delete mine migration from the terminal, but I will try that, tnx
>>>
>>> 10.03.2015. 18.01, "Collin Anderson"  је написао/ла:

 Hi Petar,
 I'm actually not sure why you want to call sqlflush. If you're trying
to clear out the database, you may need to delete the migrations table
manually, but it just might be simpler to delete the either database and
re-create it, rather than the individual tables.
 Collin

 On Friday, March 6, 2015 at 11:24:19 PM UTC-5, Petar Pilipovic wrote:
>
> Hello Collin,
> No the problem is, i have tried to drop mine migrations whit python
manage sqlflush, then I have recreate the db whit
> python manage.py migrate.
> Here this is the all operation whit python manage sqlflush, syncdb,
migrate. I have notice that there was no migration to apply at the end, and
the error is still there.
> Is there something else I can do, or how can I approach this
differently.
> Best
> Petar
> On Fri, Mar 6, 2015 at 11:21 PM, Collin Anderson 
wrote:
>>
>> Hi,
>> The problem is that django_session doesn't exist in your database.
Either it was never created or it was created and then later deleted.
>> Does running manage.py migrate re-create it?
>> Collin
>>
>> On Monday, March 2, 2015 at 11:36:51 PM UTC-5, Petar Pilipovic wrote:
>>>
>>> Hello James, sorry for not uploading mine answer on this mater, I
was busy whit something else this day, ok now back to mine Operational
Error I have got.
>>> I tried to google some solution to this problem had no luck, and I
did what have you told me.
>>> I heave done some
>>> python manage.py sqlflush
>>> and that has gave me this output:
>>> (django17)04:20 ~/mineDjango$ python manage.py sqlflush
BEGIN;DELETE FROM "django_admin_log";DELETE FROM "auth_permission";DELETE
FROM "auth_group";DELETE FROM "auth_group_permissions";DELETE FROM
"django_session";DELETE FROM "auth_user_groups";DELETE FROM
"auth_user_user_permissions";DELETE FROM "account_emailaddress";DELETE FROM
"django_site";DELETE FROM "profiles_profile";DELETE FROM "auth_user";DELETE
FROM "profiles_userstripe";DELETE FROM "account_emailconfirmation";DELETE
FROM "django_content_type";COMMIT;
>>> Then I have done
>>> python manage.py syncdb python manage.py migrate
>>> Output of mine recreating tables are this:
>>> (django17)04:20 ~/mineDjango$ python manage.py syncdbOperations to
perform: Synchronize unmigrated apps: allauth, crispy_forms Apply all
migrations: account, sessions, admin, sites, profiles, contenttypes,
authSynchronizing apps without migrations: Creating tables... Installing
custom SQL... Installing indexes...Running migrations: No migrations to
apply.(django17)04:20 ~/mineDjango$ python manage.py migrateOperations to
perform: Synchronize unmigrated apps: allauth, crispy_forms Apply all
migrations: account, sessions, admin, sites, profiles, contenttypes,
authSynchronizing apps without migrations: Creating tables... Installing
custom SQL... Installing indexes...Running migrations: No migrations to
apply.
>>> Basically I have had no changes in mine attempt to drop and
recreate tables in mine application.
>>> The error is still there.
>>> Error:
>>> Environment:
>>>
>>>
>>>
>>>
>>> Request Method: GET
>>> Request URL: http://copser.pythonanywhere.com/
>>>
>>>
>>> Django Version: 1.7.2
>>> Python Version: 2.7.6
>>> Installed Applications:
>>> ('django.contrib.admin',
>>>  'django.contrib.auth',
>>>  'django.contrib.contenttypes',
>>>  'django.contrib.sessions',
>>>  'django.contrib.messages',
>>>  'django.contrib.staticfiles',
>>>  'profiles',
>>>  'crispy_forms',
>>>  'django.contrib.sites',
>>>  'allauth',
>>>  'all

Re: django beginner

2015-03-13 Thread luis zarate
what is the output of django-admin --version ?

Instructions:
 1) open cmd
2) change your current directory to your work directory
3) run django-admi --version
4) copy and paste the output  here.

The output will be like "1.7.2"

2015-03-13 11:47 GMT-06:00 :

> ok i put the folder that the django-admin file is in at the variables path
> of windows
> i hope that deals with later problems with files
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send 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/e8554c44-f7fa-4ee8-a5b7-52594bc97fb1%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%2B5VyPVyy8uBniqn9TZvBFxKRK2pLRBftka_70-Lu2%2B1EoAjw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make responsinator.com working with Django?

2015-03-13 Thread luis zarate
I have this problem with my site, if I put my public site
http://www.solvosoft.com in responsinator.com all iframes are empty.
I guest it's a security configuration to prevent Clickjacking protection.

A proof of concept is writting a simple html page with Iframe.


http://www.solvosoft.com";>


ref.
https://docs.djangoproject.com/en/1.7/ref/clickjacking/#clickjacking-prevention





2015-03-10 13:19 GMT-06:00 James Schneider :

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


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.


Internationalization to 3rd party Django apps

2015-03-26 Thread Luis Masuelli
I use django-rest-framework==3.0 in an application as an example case (*) 
of what I am talking about. Most of the messages in DRF are not 
internationalized, and had to use the following mechanism to create the 
internationalization for DRF messages:

   - Properly set LANGUAGES and locale directories, so `makemessages` knows 
   where to store the generated messages.
   - Add a symbolic link into my django root directory, pointing to the 
   directory being the rest_framework package (in site-packages).
   - Running `makemessages` adding the `--symlinks` options, so the 
   rest_framework would be inspected as well as the regular (project-wise) 
   applications are.
   - Removing the symbolic link I created, from my django root directory.
   
Finally, assuming the global locale dirs are set accordingly, I get the 
messages being generated for the desired locales (i.e. I only have to edit 
the .po files with the appropiate translations).

I don't like this method. Looks ugly. Isn't there another method to grab 
ugettexted messages from 3rd party applications and add them to django.po?
(* Please: don't attend my problem in terms of DRF since I could have 
another issue with another application and would need to ask the same 
question again)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 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/ce5a3555-3b70-4ded-99eb-ef37439dc8cf%40googlegroups.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

Grouped Select in admin django

2015-05-05 Thread Luis Salvay
I have a model "Company" having many to many relationships with Country and 
City while country and city have one to many relationship between them. The 
problem is that when loading an "enterprise" have to select the countries 
atienede the company and the cities they serve, but the list of cities is 
very long and also the cities are all mixed without distinguishing what 
country you are. What I'd like is to group the cities by country. It is 
exactly what django-smart-selects, only this plugin does not work in many 
to many relationships. Someone could help me adapt this plugin to work with 
many to many relationship or comment me if they think of another 
alternative. Thank you very much!

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


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: Allow the Prefetch queryset to be used with GenericForeignKey

2014-03-30 Thread Luis Matoso
That would be awesome, somebody has a solution for this?

On Sunday, February 16, 2014 2:53:55 PM UTC-3, Robert Kajic wrote:
>
> I would love it if the Prefetch object allowed me to pass in custom 
> querysets when prefetching related generic foreign fields. Specifically I 
> want this in order to call select_related on each subgroup.
> For now I've subclassed the GenericForiengKey class, overriding 
> get_prefetch_queryset, to allow me to use modelless querysets like this:
>
> .prefetch_related(
> Prefetch('obj', queryset=QuerySet().select_related(
> "user", "poem__user", "consumer", "producer"
> ))
>
> In get_prefetch_queryset, for each subgroup, I copy the select_related 
> options from the modelless queryset to the subgroup queryset:
>
> qs = ct.get_all_objects_for_this_type(pk__in=fkeys)
> # Copy any select related options from queryset to qs
> qs = self.combine_select_related(qs, queryset)
> ret_val.extend(qs)
>
> Initially I thought I would simply be able to combine the two querysets 
> using QuerySet.__or__, but I noticed that Query.combine refuses to run 
> unless both queries are on the same model. Would there be any harm in 
> allowing it to combine Queries even if the qeries are not on the same 
> model, as long as one of the queries doesn't have a model at all? Then the 
> above could be changed into:
>
> # Copy any select related options from queryset to qs
> qs |= queryset
>
> This would have the added benefit of copying other options other than 
> select_related.
>
> I know this is problematic because you may not want to combine the same 
> queryset with each individual group. Ideally, the developer would be able 
> to specify a different queryset for each group kind.
>
> .prefetch_related(
> Prefetch('obj', queryset=QuerySet().select_related(
> "user", "poem__user", "consumer", "producer"
> ))
>
> Does anyone have any thoughts on 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/7a7a4157-51b2-4e89-8cb0-ce25b5445b36%40googlegroups.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.


  1   2   3   >