Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
Also a recomendation, see that `dispatch` method call the view as

handler(request, *args, **kwargs)

So maybe is a good idea do something like:

class MyView(view):
 def put(self, request, *args, **kwargs):
...


Regards,

El vie, 12 abr 2024 a las 16:13, Luis Zárate ()
escribió:

> See
> https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods
> Also on view you have a variable called, where you can limit the available
> methods.
>
> http_method_names
>
>
> El vie, 12 abr 2024 a las 7:20, Mamadou Alpha Bah (<
> mamadoualphabah...@gmail.com>) escribió:
>
>> <https://stackoverflow.com/posts/78314829/timeline>
>>
>> I'm setting up a CRUD system with Django, using Class-Based Views.
>> Currently I'm trying to figure out how to handle HTTP PUT and DELETE
>> requests in my application. Despite searching the Django documentation
>> extensively, I'm having trouble finding concrete examples and clear
>> explanations of how to submit these types of queries to a class-based view.
>>
>> I created a view class named CategoryView, extending from:
>> django.views.View, in which I implemented the get and post methods
>> successfully. And I want to build my urls like this:
>>
>>1. New Category: 127.0.0.1:8000/backendapp/categories/create
>>2. List all Category: 127.0.0.1:8000/backendapp/categories/
>>3. Retrieve only one Category: 127.0.0.1:8000/backendapp/categories/1
>>4. Etc...
>>
>> However, when I try to implement the put and delete methods, I get stuck.
>>
>> For example :
>> from django.views import View
>>
>> class CategoryView(View):
>>  template_name = 'backendapp/pages/category/categories.html'
>>
>>  def get(self, request):
>>   categories = Category.objects.all()
>>   context = { 'categories': categories }
>>   return render(request, self.template_name, context)
>>
>>  def post(self, request):
>>   return
>>
>>  def delete(self, request, pk):
>>   return
>>
>>  def put(self, request):
>>   return
>>
>> I read through the Django documentation and found that Class-Based Views
>> support HTTP requests: ["get", "post", "put", "patch", "delete", "head ",
>> "options", "trace"].
>>
>> link:
>> https://docs.djangoproject.com/en/5.0/ref/class-based-views/base/#django.views.generic.base.View
>> <https://stackoverflow.com>
>>
>> Despite this, I can't figure out how to do it.
>>
>> So I'm asking for your help to unblock me.
>>
>> I looked at the Django documentation and searched online for examples and
>> tutorials on handling HTTP requests in class-based views. I also tried
>> experimenting with adding the put and delete methods to my CategoryView
>> view class, but without success. I expected to find resources that clearly
>> explain how to integrate these queries into my Django application, as well
>> as practical examples demonstrating their use. However, I haven't found a
>> working solution and am now seeking help from the community to overcome
>> this difficulty.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
> "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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyNQtHhV3TPMtB4qLyipdjcnZBZA8_mwf-1_j2F%2B_sER5g%40mail.gmail.com.


Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
See
https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods
Also on view you have a variable called, where you can limit the available
methods.

http_method_names


El vie, 12 abr 2024 a las 7:20, Mamadou Alpha Bah (<
mamadoualphabah...@gmail.com>) escribió:

> 
>
> I'm setting up a CRUD system with Django, using Class-Based Views.
> Currently I'm trying to figure out how to handle HTTP PUT and DELETE
> requests in my application. Despite searching the Django documentation
> extensively, I'm having trouble finding concrete examples and clear
> explanations of how to submit these types of queries to a class-based view.
>
> I created a view class named CategoryView, extending from:
> django.views.View, in which I implemented the get and post methods
> successfully. And I want to build my urls like this:
>
>1. New Category: 127.0.0.1:8000/backendapp/categories/create
>2. List all Category: 127.0.0.1:8000/backendapp/categories/
>3. Retrieve only one Category: 127.0.0.1:8000/backendapp/categories/1
>4. Etc...
>
> However, when I try to implement the put and delete methods, I get stuck.
>
> For example :
> from django.views import View
>
> class CategoryView(View):
>  template_name = 'backendapp/pages/category/categories.html'
>
>  def get(self, request):
>   categories = Category.objects.all()
>   context = { 'categories': categories }
>   return render(request, self.template_name, context)
>
>  def post(self, request):
>   return
>
>  def delete(self, request, pk):
>   return
>
>  def put(self, request):
>   return
>
> I read through the Django documentation and found that Class-Based Views
> support HTTP requests: ["get", "post", "put", "patch", "delete", "head ",
> "options", "trace"].
>
> link:
> https://docs.djangoproject.com/en/5.0/ref/class-based-views/base/#django.views.generic.base.View
> 
>
> Despite this, I can't figure out how to do it.
>
> So I'm asking for your help to unblock me.
>
> I looked at the Django documentation and searched online for examples and
> tutorials on handling HTTP requests in class-based views. I also tried
> experimenting with adding the put and delete methods to my CategoryView
> view class, but without success. I expected to find resources that clearly
> explain how to integrate these queries into my Django application, as well
> as practical examples demonstrating their use. However, I haven't found a
> working solution and am now seeking help from the community to overcome
> this difficulty.
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/b1ecd4a7-5946-4da5-80ae-5923b6648a70n%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%2B5VyNsQdYWD4W_Mfr%3DMfdP-DrbYeWf0qAgWDEN6TDbVOpR7A%40mail.gmail.com.


Re: DRF Trailing Slah

2024-04-12 Thread Luis Zárate
Check your URL.py and append the slash, also take a look of
https://docs.djangoproject.com/en/5.0/ref/settings/#append-slash


El vie, 12 abr 2024 a las 15:40, MISHEL HANNA ()
escribió:

> Hello
> i have endpoint when add / to the end of it i can not send request it
> return this
> Not Found: /api/v1/properties/user/
> [12/Apr/2024 20:19:03] "GET /api/v1/properties/user/ HTTP/1.1" 404 23
>
> but when remove / from the end of it return success
> [12/Apr/2024 20:19:09] "GET /api/v1/properties/user HTTP/1.1" 200 635
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "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/d5b533b0-e482-4db5-8a4d-ce925aefcbf4n%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%2B5VyNc9sNk_6qBoF9X7wMbEYtoLmj_Qo-9mXdHyHNSAkTWVQ%40mail.gmail.com.


Re: Help on Creating a Superuser account on render.

2024-04-10 Thread Luis Zárate
Maybe something like

python manage.py shell -c "from django.contrib.auth.hashers import
make_password;from django.contrib.auth.models import User; admin =
User(username='username', email='exam...@example.com',
password=make_password('password'),
is_superuser=True,is_staff=True);admin.save()"



El dom, 7 abr 2024 a las 2:13, ALINDA Fortunate ()
escribió:

> It's my external database is postgres on railway.
>
> Let me try your opinion and I see.
>
> On Sat, 6 Apr 2024, 20:33 Aniket Raj Singh, 
> wrote:
>
>> So you have used render to host your application, you might have
>> connected an external database (postgreSQL or any other) you might have
>> used the environment setup to set the database up with the postgreSQL
>> hosted either on render itself or on a different server, just connect the
>> database with your application on your local host and create a super user
>> since the database is same on the render's server's application the
>> superuser will be same as the superuser you created on the local server
>> thus you can access the admin panel
>>
>>
>> On Saturday 6 April, 2024 at 9:58:00 pm UTC+5:30 ALINDA Fortunate wrote:
>>
>>> Hello I have successfully a django project on render but i have failed
>>> to access the admin panel
>>>
>>> Any idea on how to create a superuser account on a free tier of render
>>>
>>> Below is my build.sh file
>>> #!/usr/bin/env bash
>>> # Exit on error
>>> set -o errexit
>>>
>>>
>>>
>>> # Modify this line as needed for your package manager (pip, poetry, etc.)
>>> pip install -r requirements.txt
>>>
>>> # Convert static asset files
>>> python manage.py collectstatic --no-input
>>>
>>> # Apply any outstanding database migrations
>>> python manage.py migrate
>>>
>>> if [[ $CREATE_SUPERUSER ]];
>>> then
>>>   python world_champ_2022/manage.py createsuperuser --no-input
>>> fi
>>>
>>>
>>>
>>>
>>>
>>>
>>> --
>>> ALINDA Fortunate
>>> Graduate Of Computer Science
>>> Gulu University
>>> Passionate about Software Development in Python
>>> If you can't explain it simply, you don't understand it well enough.
>>> alindafo...@gmail.com.
>>> +256 774339676 <+256%20774%20339676> / +256 702910041
>>> <+256%20702%20910041>
>>> Kagadi.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/9dabff6a-7f5a-4d30-a097-a128f68a6feen%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAPifpCsa%2BrmS3OWiycH_309ROvMcazv2Z_E76UcZiZKEb%3D3YPg%40mail.gmail.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%2B5VyOcJ%2BeL3dTgVHfgW1tjH5p6-qHUzKq83t3z8xK7iNFGdQ%40mail.gmail.com.


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: SChedule email

2021-07-01 Thread Luis Zárate
You can create a custom command using this doc
https://docs.djangoproject.com/en/3.1/howto/custom-management-commands/

Now, you can call it like

python manage.py mycustomcommandname

so in Linux environment  you can use crontab (with crontab -e) to execute
the command.


El jue, 1 jul 2021 a las 15:28, SKYLINE TV ()
escribió:

>
> *You can check out celery and how to integrate it with django. Once done,
> task scheduling is easy,first add your gmail configuration in settings.py
> as follows:*
>
> *EMAIL_BACKEND = 'django_smtp_ssl.SSLEmailBackend' *
> *EMAIL_USE_TLS = True *
> *EMAIL_HOST = 'smtp.gmail.com ' *
> *EMAIL_HOST_USER = 'your_email' *
> *EMAIL_HOST_PASSWORD = 'your password' *
> *DEFAULT_FROM_EMAIL = EMAIL_HOST_USER EMAIL_PORT = 465*
>
> Then in your tasks.py you can add the function for scheduling emails as
> follows:
>
> *from django.template.loader import render_to_string *
> *from django.core.mail import EmailMessage*
>
> @periodic_task
> ( run_every=(crontab(hour=3, minute=34)), #runs exactly at 3:34am every
> day
> name="Dispatch_scheduled_mail",
>  reject_on_worker_lost=True, ignore_result=True)
> def schedule_mail():
>  message = render_to_string('app/schedule_mail.html')
>  mail_subject = 'Scheduled Email' to_email = getmail email =
> EmailMessage(mail_subject, message, to=[to_email])
>  email.send()
>
> *Then finally your email template 'schedule_mail.html*
> {% autoescape off %}
> Hello ,
>  This is a test email if you are seeing this,
>  your email got delivered!
>  Regards, Coding Team.
>  {% endautoescape %}
> On Thursday, July 1, 2021 at 1:54:31 PM UTC+1 divyamu...@gmail.com wrote:
>
>> HI,
>>
>> I wanted to schedule a email every jan and aug 6 monthly basis without
>> celery using settings.py. Can anyone help?
>>
>> once in every 6months mail should be triggered
>>
> --
> You received this message because you are subscribed to the Google Groups
> "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/a87a8623-d123-404d-91b8-d30a01d91dc0n%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%2B5VyPk%3D31F3j1D%2BsH8AA_2DDtK6XQikKBK1aRcvpzEvJJR-A%40mail.gmail.com.


Re: can Django replace PHP ?

2021-06-28 Thread Luis Zárate
Hi, you can create several web applications with Django. So I guest you can
replace all web stuff with Django or other lib in python for web
development.

El lun, 28 jun 2021 a las 7:17, Krishna Adhikari ()
escribió:

> Hello all  my seniors
>
> I am doing Data Science programming (python) for 3 years now in my
> organization I also have to develop a Web Platform to deeply ML models and
> also to develop other web applications together.
>
> I searched a lot of information on google, but till now I did not make a
> decision should I learn PHP or I can handle it all with Django?
>
> *can we solve all kinds of web application problems with Django without
> learning PHP ?? *
> *or PHP also recommended.*
>
> Thank you all in advance
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f2007209-a90e-4a08-8d03-b2b3a1007e1en%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%2B5VyOqHw6jRfSu3WL97csjz2npODsO-anVRkGALOhD7fbrvw%40mail.gmail.com.


Re: django staticfiles problem

2020-10-15 Thread Luis Zárate
You have a problem here
{% static '/css/base.css' %}

the correct is
{% static 'css/base.css' %}

Also is a bad idea set media folder in static.
take a look here https://docs.djangoproject.com/en/3.1/howto/static-files/




El mié., 14 oct. 2020 a las 23:05, Farai M ()
escribió:

> Why have the media url if it's point to the same dir as static .Your can
> just specific it's separately in it's own dir as /media/ and have /static/
> .You are also missing a static root there .
>
> On Wed, Oct 14, 2020, 5:05 PM Chelsea Fan 
> wrote:
>
>> MEDIA_URL = '/images/'
>> MEDIA_ROOT = BASE_DIR / 'static/images'
>>
>>
>> On Wed, Oct 14, 2020 at 2:12 PM Anh Nguyen  wrote:
>>
>>> where is your STATIC_ROOT ?
>>>
>>>
>>> On Wed, Oct 14, 2020 at 5:43 PM Chelsea Fan <
>>> allaberdi16yazha...@gmail.com> wrote:
>>>
 hello everyone, I have an issue, I can't connect css style to my
 template, but I can upload images and see it , here is my code,  please
 help me, thanks  for attentions !!!

 STATIC_URL = '/static/'
 STATICFILES_DIR = [BASE_DIR / 'static']

 {% load static %}
 
 
 
 
 

 [image: image.png]

 --
 You received this message because you are subscribed to the Google
 Groups "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/CAJwZndd_SYaToM%3D6h1KL-WmXs7eR3e0sgwHqVPPFwo%3Dx2HW5xg%40mail.gmail.com
 
 .

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to django-users+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAKaoNbTN2-hiy71RS8H8i_wc9XeQqJBOLkR%3DOjEJxocorO1FRw%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAJwZnde%3D8xOePMK5L%2B9YvXtnW_U%2BHCpX2VVq5R%2BmQDZz39kBrQ%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMeub5PM26mY%2BDpB-xK0NorWxXOE1qahL-zf2WJrFirqeGL73A%40mail.gmail.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%2B5VyN%3DaboOu1c4h9OuaYac1UJeRkrSe7nRXrSHY65EZfuYAA%40mail.gmail.com.


Re: Inability to Connect django with MySQL database

2020-03-20 Thread Luis Zárate
This looks like your Mysql user can login without password in localhost
(are you sure, your user has correct permissions?).
Try to create a user with password and allow login from localhost, and
change your django settings, also try to connect with your user with mysql
client from localhost.



El vie., 20 mar. 2020 a las 14:55, Victor ()
escribió:

> What's the database variable in your settings.py file
>
> On Friday, March 20, 2020 at 2:54:05 PM UTC+1, Ifeanyi Chielo wrote:
>>
>> Hello,
>> I am new to Python django, I have been making efforts to connect a django
>> application to mysql without success. Bellow is the information that I got
>> PS C:\Users\IFEANYI CHIELO\divine> python manage.py migrate
>> Traceback (most recent call last):
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 216, in ensure_connection
>> self.connect()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 194, in connect
>> self.connection = self.get_new_connection(conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\base.py",
>> line 227, in get_new_connection
>> return Database.connect(**conn_params)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\__init__.py",
>> line 84, in Connect
>> return Connection(*args, **kwargs)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\MySQLdb\connections.py",
>> line 179, in __init__
>> super(Connection, self).__init__(*args, **kwargs2)
>> MySQLdb._exceptions.OperationalError: (1045, "Access denied for user
>> 'admin'@'localhost' (using password: NO)")
>>
>> The above exception was the direct cause of the following exception:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 15, in 
>> execute_from_command_line(sys.argv)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py",
>> line 381, in execute_from_command_line
>> utility.execute()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init__.py",
>> line 375, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 316, in run_from_argv
>> self.execute(*args, **cmd_options)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 350, in execute
>> self.check()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\base.py",
>> line 379, in check
>> include_deployment_checks=include_deployment_checks,
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\commands\migrate.py",
>> line 59, in _run_checks
>> issues = run_checks(tags=[Tags.database])
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\checks\registry.py",
>> line 71, in run_checks
>> new_errors = check(app_configs=app_configs)
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\checks\database.py",
>> line 10, in check_database_backends
>> issues.extend(conn.validation.check(**kwargs))
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\validation.py",
>> line 9, in check
>> issues.extend(self._check_sql_mode(**kwargs))
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\mysql\validation.py",
>> line 13, in _check_sql_mode
>> with self.connection.cursor() as cursor:
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 255, in cursor
>> return self._cursor()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 232, in _cursor
>> self.ensure_connection()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\backends\base\base.py",
>> line 216, in ensure_connection
>> self.connect()
>>   File "C:\Users\IFEANYI
>> CHIELO\AppData\Local\Programs\Python\Python37\lib\site-packages\django\db\utils.py",
>> line 89, in __exit__
>> raise dj_exc_value.with_traceback(traceback) from exc_value
>>   File "C:\Users\IFEANYI
>> 

Re: importar datos en tiempo real de una base de datos externa

2020-03-20 Thread Luis Zárate
Hola,

Revisa la siguienten documentación
- https://docs.djangoproject.com/en/3.0/topics/db/multi-db/
- https://docs.djangoproject.com/en/3.0/howto/legacy-databases/
La idea es que puede hacer una app que sea una conexión a la db a travez de
modelos creados con inspectdb (debe hacer algunas correcciones manuales), y
puede usar un router para saber en que database debe leer los datos.
Al final en el settings configurar ambas conexiones


Saludos.

El vie., 20 mar. 2020 a las 10:56, Shainny Martinez (<
shainnymarcruz...@gmail.com>) escribió:

> Django permite realizar SQL fuera de su ORM, es decir, puedes hacer una
> confección db externa con el correspondiente código SQL.
>
> Lo que te quiero decir es que, puedes escribir un queryset personalizado.
>
>
> Ese es el link directo a la documentación para que sepas cómo hacerlo:
> https://docs.djangoproject.com/en/3.0/topics/db/sql/
>
>
>
> Espero haberte ayudado.
>
>
>
> El vie., 20 de mar. de 2020 11:45 AM, wilmer urango 
> escribió:
>
>> Buenas
>>
>> Me gustaría saber si existe una herramienta en django capaz de llamar
>> datos de cualquier base de datos externa, coloco ejemplo especifico, estoy
>> haciendo una herramienta en un empresa y quiero sacar algunos datos de la
>> base de datos que tiene su ERP esto en tiempo real obviamente y hasta la
>> fecha no he encontrado nada.
>>
>> Les agradezco su ayuda.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "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/7d7950a7-6163-4c2c-923b-d080dc05a2ca%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CACPibpG4nN5DifH_Xo372sEPyf_jsUhLPEf4XhF0wHHuW9r6Pw%40mail.gmail.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%2B5VyOj6F97wq8dpTojgGsB4uwwz9sjozAA5HkXTGepkerFgA%40mail.gmail.com.


Alternatives to django ajax select

2019-10-30 Thread Luis Zárate
Hi Guys,

Do you know any alternative to django-ajax-selects, I am using it in a
project in django 2.2 but docs says that support <=2.1 and also has some
problems with the version on jquery used, so I am looking something that
help to remplace this lib.

https://github.com/crucialfelix/django-ajax-selects

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAG%2B5VyPzuPpPpm1QByKGjChPtN1-AnPcYkrNFfOR%2B203Hw43-Q%40mail.gmail.com.


Re: Update many to many django

2019-04-10 Thread Luis Zárate
Creo que zip está explicado acá


https://www.programiz.com/python-programming/methods/built-in/zip



El miércoles, 10 de abril de 2019, Karen Tatiana Mesa Lopez
 escribió:
> Hola Luis, tengo la ultima pregunta, te agradezco mucho tu ayuda
> voy a realizar un for doble, mi pregunta puntual seria,
> los arreglos del for doble tienen que llevar la misma cantidad de datos
ejemplo
> tema = ['1','2']
> otro  = ['1','2']
> for t ,o  in zip(tema,otro):
> print(t,o)
> ¿o pueden llevar diferentes longitudes?
> De que manera puedo recorrer dos Array al mismo tiempo, con diferentes
longitudes, para guardarlo en un solo save de Django.
> tema = ['1','2']
> otro  = ['1','2','3','4']
> for t ,o  in zip(tema,otro):
> print(t,o)
>
>
> Quedo muy agradecida por dedicar un poco de tu tiempo a mis preguntas.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAFC_1o5RgYd7s-JPYgt1O41t6tugnuY6C795skQKGb3pp%2BE2-Q%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%2B5VyOT0zLhB0eZCEjhTu-4FzYqi2V_Kr0NXukkksNGyR8t2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Update many to many django

2019-04-09 Thread Luis Zárate
Vamos a ver si entiendo ya que sus modelos no describen una relacion many
to many, voy a intentar decirlo con palabras y luego con código.

Un articulo puede tener varios articulos consolidados y un articulo
consolidado puede estar asociado a varios articulos.

Si esto es así sus modelos no representan eso.

Podrias pensar en algo como

Class Articulo:
   ...
   consolidados = models.ManyToManyField(Articulo_consolidado)

Ahora si lo que quieres es hacer una es insertar en la relación puedes
hacer algo como

articulo = Articulo(...)
articulo.save()
articulo.consolidados.add(instancia de articulo consolidado)

Saludos



El lunes, 8 de abril de 2019, Tatiana Mesa 
escribió:
> Hola Luis, eres muy amable en responderme tan rápido, mi pregunta puntual
es de que manera puedo hacer un update en una tabla de muchos a muchos.
>
> Estos son mis dos modelos
>
> class Articulo(models.Model):
> titulo = models.CharField(max_length=255, blank=True)
> texto = models.TextField()
> url = models.CharField(max_length=255)
> fuente = models.ForeignKey(Fuente, on_delete=models.CASCADE) #
> fecha = models.DateTimeField(null=True)
> created_at = models.DateTimeField(auto_now_add=True, auto_now=False,
verbose_name=u'Fecha de creación')
> ubicacion = models.CharField(max_length=255)
> tipo_facebook = models.CharField(max_length=255)
> id_articulo_facebook = models.CharField(max_length=255,blank=True,
null=True)
> 
>
> class Articulo_Consolidacion(models.Model):
> articulo =  models.ForeignKey(Articulo, on_delete=models.CASCADE)
> tag = models.ForeignKey(Tag, on_delete=models.CASCADE)
> tono = models.ForeignKey(Tono, on_delete=models.CASCADE)
> tema = models.ForeignKey(Tema, on_delete=models.CASCADE)
> quedo muy atenta a tu respuesta.
> Muchas gracias
>
> El lun., 8 de abr. de 2019 a la(s) 21:11, Luis Zárate (luisz...@gmail.com)
escribió:
>>
>> Hola,
>>
>> Las relaciones M2M pueden trabajarse de diferentes formas, acá está la
doc de django
>> https://docs.djangoproject.com/en/2.2/topics/db/examples/many_to_many/
>> Si lo que quieres es hacer algo rápido puedes usar un model form factory
>>
>>
https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/#modelform-factory-function
>> del  modelo que desear y luego relacionarlo con el objeto que quieras
por ejemplo
>>
>> Si lo único que necesita es relacionarlos porque los tiene ya creados
entonces puede hacer  un formulario y usar un campo como
ModelMultipleChoiceField (
https://docs.djangoproject.com/en/2.2/ref/forms/fields/#django.forms.ModelMultipleChoiceField
)
>>
>> Si puedes dar un mejor ejemplo de lo que quieres hacer le podemos ayudar
más.
>> Saludos.
>>
>>
>>
>>
>>
>> El lun., 8 abr. 2019 a las 17:40,  escribió:
>>>
>>> Hola, me gustaría saber de que manera se hace un update cuando tengo
una relación de muchos a muchos en django, apreciaría mucho sus ayudas :)
>>>
>>> --
>>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/64971258-aa7b-4a4b-9532-94f0272e94a3%40googlegroups.com
.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> "La utopía sirve para caminar" Fernando Birri
>>
>> <
https://ci3.googleusercontent.com/proxy/WdPtbUbeH_L4c__ddaOFaZN4KCPNu6PQbuGhVEbv2LEWA5AIuSpogax1BPPdwm7Y8d4gGqUtvXP2UyHT43Tpv7GDJ51fTZ3J_ndcwZFSnAgAF3vML7osyFtBZlU9weSVsJ1eV3K06I3nH1QnTj4L-nhYBv3uPs0zj3OzSiLW77J-VXUqalBUpU8mG3-RIUx6v6NJGxnxuDQ=s0-d-e1-ft#https://docs.google.com/uc?export=download=0B4-s_Bgz_-NSN0V3b24zU25fMW8=0B4-s_Bgz_-NSdy9OTkYzcDN6RGZITWl5amdqT3JxVnNVVSswPQ
>
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAG%2B5VyM2J5y9WrUC9YPwJ6PeH6zNboJK%3D4hAScVDFAB%2B6vsMjA%40mail.gmail.com
.
>> For more options, visit https://groups.google.com/d/optout.
>
>

Re: Update many to many django

2019-04-08 Thread Luis Zárate
Hola,

Las relaciones M2M pueden trabajarse de diferentes formas, acá está la doc
de django
https://docs.djangoproject.com/en/2.2/topics/db/examples/many_to_many/

Si lo que quieres es hacer algo rápido puedes usar un model form factory

https://docs.djangoproject.com/en/2.2/topics/forms/modelforms/#modelform-factory-function
del  modelo que desear y luego relacionarlo con el objeto que quieras por
ejemplo

Si lo único que necesita es relacionarlos porque los tiene ya creados
entonces puede hacer  un formulario y usar un campo como
ModelMultipleChoiceField
(
https://docs.djangoproject.com/en/2.2/ref/forms/fields/#django.forms.ModelMultipleChoiceField
)

Si puedes dar un mejor ejemplo de lo que quieres hacer le podemos ayudar
más.
Saludos.





El lun., 8 abr. 2019 a las 17:40,  escribió:

> Hola, me gustaría saber de que manera se hace un update cuando tengo una
> relación de muchos a muchos en django, apreciaría mucho sus ayudas :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/64971258-aa7b-4a4b-9532-94f0272e94a3%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%2B5VyM2J5y9WrUC9YPwJ6PeH6zNboJK%3D4hAScVDFAB%2B6vsMjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to upload pdf files in django

2019-03-03 Thread Luis Zárate
Files come on request.FILES and remember form need to be multipart .



El domingo, 3 de marzo de 2019, Hrishikesh K.B 
escribió:
>
>
> On Saturday, 2 March 2019 20:42:01 UTC+5:30, Akshay Gupta wrote:
>>
>> and to get back data from form  request.POST['file_name'] ??
>
> See https://docs.djangoproject.com/en/2.1/topics/http/file-uploads/
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6077d93d-96bc-4790-98fe-0b1788f3c23e%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%2B5VyMK_gFGQyyz0vXa3KdGUbT8VyyWTYT1vD9VU6C3kTXvog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Create a Celery task with Django

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

Clean code could be made with this library.

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

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

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


Re: Create a Celery task with Django

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

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

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

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

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


Re: The view blog.views.create didn't return an HttpResponse object. It returned None instead.can any one help me this issue please nooob here

2017-09-11 Thread Luis Zárate
if request.method == "GET":
if request.method == "POST":

Uppercase is needed.

2017-09-11 17:36 GMT-06:00 harsh sharma :

>  here i m learning django and i m stuck on one thing
> the web page returning
>
> The view blog.views.create didn't return an HttpResponse object. It returned 
> None instead.
>
>
>
> and here is my views.py  file
>
>
>
> def home(request):
>
> story = Story.objects.all()
> return render_to_response('show.html',{'story':story})
>
>
>
>
> def create(request):
> if request.method == "get":
> form = storyform()
> return render(request,'form.html',{'form':form})
> elif request.method == "post":
> form= storyform(request.POST)
> form.save()
> return HttpResponseRedirect('/home')
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/067af0b0-6761-4daf-a1c0-02fcd1585048%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%2B5VyMqn-Z%3Das%3DYxf_oph5yvDfUi%2BZWU1Uf_554fOTC2y3rsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Revert database scheme based on django migrations

2017-09-11 Thread Luis Zárate
Hello people,

I really would like you to help me with some thing I need to solve.

I have an app that do automated deployment of django apps, that also can
update existing deployments. So I need to revert my database to last state
if something went wrong.

So, my question is, how can I revert all the migrations that were applied
after run the migrate command?
It can have more than one migration and in different apps, so how can I
know where to go back and how to leave the database in the previous state
without having to do a backup of database and a restore? (some databases
can have a lot of registers).  How can I make a restore point of my
migrations or indicate django to go back in my database scheme?

Thanks in advance for the help you can provide me.

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


Re: Django search

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


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

Can be expressed as

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




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

 How do i implement search on django website with select menu and
checkbox? I've succeeded in adding basic text input and it works but I
didn't use django forms. How do I add this type of search?
 --
 You received this message because you are subscribed to the Google
Groups "Django users" group.
 To unsubscribe from this group and stop receiving emails from it, send
an email to django-users...@googlegroups.com.
 To post to this group, send email to django...@googlegroups.com.
 Visit this group at https://groups.google.com/group/django-users.
 To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/078841f1-a976-4c22-bb2f-ff5069bdce1d%40googlegroups.com
.
 For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users...@googlegroups.com.
>> To post to this group, send email to django...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9fc70bbe-487d-4c4b-8f9a-77ad79281193%40googlegroups.com
.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/642c076f-aafd-46b1-b63c-0a8d174e8595%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.
>

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

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


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

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

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

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

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

Re: File/Folder Sync API?

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

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

or something like dinamic dropbox storage

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


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

> I'm building a collection of apps that write custom .docx and .xlsx files,
> and store them to a users account. These files need to be in a specific
> hierarchy and each user will have their own files/folders they can view and
> edit. It would really be great if I could allow each user to sync their
> files/folders to their local hard drives so they can view, print, etc. them
> outside of the web app. Does anyone know of a good API for doing this? I
> know SugarSync has an API but they charge their users something like $7/mo
> for their cheapest subscription. I'd like to make my apps free if at all
> possible. Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/57b50b62-6bce-4197-8414-2afd5be7943b%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



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

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


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

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


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

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

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


Re: Adding view permission by default to auth_permission

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

Please let me know when your PR is merge.



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

Re: External access

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

python manage.py runserver 0.0.0.0:8000

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

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



So


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

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

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


Re: Setting up jQuery in debian with virtualenv

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

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

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

 Hello,

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

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

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

Re: Adding view permission by default to auth_permission

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

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

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

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




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

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

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


Re: How to use Django forms for surveys

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

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

So if you are interested in development let me know.



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

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

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


Re: Read Only by user in Django Admin

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


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

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

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

I



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

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



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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 

Re: How to: Django development and debugging

2016-10-25 Thread Luis Zárate
2016-10-23 17:08 GMT-06:00 Don Thilaka Jayamanne <don.jayama...@gmail.com>:

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

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

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

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

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


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

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


Re: How to: Django development and debugging

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

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

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

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

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

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


Re: Django software docs

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

Or something like blender with django ?

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

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

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


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

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

python setup.py sdist

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

pip install -u django-poll.tar.gz

Or you also can do

python setup.py install



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

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

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


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

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

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

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



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

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


Re: Custom form fields in admin site

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

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

https://github.com/luisza/onetooneForm

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

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

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





2016-09-09 2:01 GMT-06:00 ludovic coues <cou...@gmail.com>:

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



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

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


Re: Django group email in spam

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

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

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



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

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


Re: Python post to remote host

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

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

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



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

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


Custom form fields in admin site

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


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

class Meta:
  models = Mymodel
  fields = '__all__'

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

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


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

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



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

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


Re: multiple django installation in one server

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




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

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



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

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


Re: New to Django

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

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

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




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

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

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


Re: Installation

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


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

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

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


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

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

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

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

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


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

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

2016-07-08 10:58 GMT-06:00 Luis Zárate <luisz...@gmail.com>:

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


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

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


Re: Invalid HTTP_HOST header in shared server

2016-07-08 Thread Luis Zárate
nobody knows how to solve this problem?

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


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

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

A template example could be useful.

2016-07-03 12:20 GMT-06:00 Seti Volkylany <setivolkyl...@gmail.com>:

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



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

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


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

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

For example django.jQuery('body')



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

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

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


Re: django form data not saving to database

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

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

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





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

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

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


Re: Best way to implement list pattern

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


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

Especially with

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

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



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

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

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


Invalid HTTP_HOST header in shared server

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

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

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

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

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


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

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

Thanks

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

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


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


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

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

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

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


mkdir -p $PHOME

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

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

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




pip install -r requirements.txt

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

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


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

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

chmod u+x $PHOME/gunicorn_start

  TERMINAR ###

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

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.


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: 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: 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 <luisz...@gmail.com>:

> 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 <stephen.but...@gmail.com>:
>
>> Whats the stack trace?
>>
>> On Wed, Jun 8, 2016 at 3:01 AM, Luis Zárate <luisz...@gmail.com> wrote:
>>
>>> $ python manage.py shell
>>>
>>> >>> import sys
>>> >>> sys.getfilesystemencoding()
>>> 'utf-8'
>>>
>>>
>>>
>>> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler <stephen.but...@gmail.com>:
>>>
>>>> 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 <luisz...@gmail.com> 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://

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 <stephen.but...@gmail.com>:

> Whats the stack trace?
>
> On Wed, Jun 8, 2016 at 3:01 AM, Luis Zárate <luisz...@gmail.com> wrote:
>
>> $ python manage.py shell
>>
>> >>> import sys
>> >>> sys.getfilesystemencoding()
>> 'utf-8'
>>
>>
>>
>> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler <stephen.but...@gmail.com>:
>>
>>> 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 <luisz...@gmail.com> 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_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.c

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 <luisz...@gmail.com>:

> $ python manage.py shell
>
> >>> import sys
> >>> sys.getfilesystemencoding()
> 'utf-8'
>
>
>
> 2016-06-08 1:57 GMT-06:00 Stephen J. Butler <stephen.but...@gmail.com>:
>
>> 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 <luisz...@gmail.com> 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_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_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
$ python manage.py shell

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



2016-06-08 1:57 GMT-06:00 Stephen J. Butler <stephen.but...@gmail.com>:

> 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 <luisz...@gmail.com> 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_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_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.


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.


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.


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.


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: 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: 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: 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: 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: 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: 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: 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: 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.


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 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.


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: 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.


Re: How to customizing CSS in djangocms-table

2016-04-16 Thread Luis Zárate
You only need to overwrite the template

https://github.com/divio/djangocms-table/blob/master/djangocms_table/templates/cms/plugins/table.html

Django template engine find the template in the order of INSTALLED_APPS, so
you only need to put an app with your version of
templates/cms/plugins/table.html
before djangocms_table and django will load this file and not the
djangocms_table file



El sábado, 16 de abril de 2016, Derek  escribió:
> Is this project being maintained; looks like last change was nearly a
year ago..?
>
> On Friday, 15 April 2016 20:18:51 UTC+2, Régis Silva wrote:
>>
>> I use djangocms-table. And this plugin return
>> 
>>   Tabela exemplo
>>   
>> 
>>   2
>>   3
>>   5
>>   8
>>   
>> 
>> 
>>   a
>>   b
>>   c
>>   d
>>   e
>> 
>> 
>>   f
>>   g
>>   h
>>   i
>>   j
>> 
>>   
>> 
>>
>> But i need with Bootstrap style. I need
>> 
>>   
>> 
>>   
>>   2
>>   3
>>   5
>>   8
>> 
>> 
>>   a
>>   b
>>   c
>>   d
>>   e
>> 
>> 
>>   f
>>   g
>>   h
>>   i
>>   j
>> 
>>   
>> 
>> I'm not talking to insert the CSS properly, but extend the plugin so
that it returns this bootstrap style.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/df5af9aa-230e-4b94-8fd3-8bd2d4438be9%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%2B5VyPdOcch2mgfeE1041RkXD54uET5H%3Difax0GqKdcpZ3Jwg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Question about users system

2016-04-15 Thread Luis Zárate
I thing Sites framework do something similiar to you problem, so you could
study how is implemented.


https://docs.djangoproject.com/en/1.9/ref/contrib/sites/




El viernes, 15 de abril de 2016, Eduardo Leones <
edua...@ypytecnologia.com.br> escribió:
> Javier, thanks for the answer.
> Very interesting "multi-Tenat" solution, including found this really cool
below:
> https://github.com/bernardopires/django-tenant-schemas
> What worried me was his observation that is not a simple implementation
to be done in Django. What is the biggest difficulty in this method?
> I think your suggestion to create a separate table for fantastic company
and I think the best solution at the moment.
> tks
>
> Em sexta-feira, 15 de abril de 2016 10:27:43 UTC-3, Javier Guerra
escreveu:
>>
>> On 15 April 2016 at 12:17, Eduardo Leones 
wrote:
>> > I am developing a system in which my clients are companies. Every
company
>> > needs to have its isolated from other business data.
>>
>> google for "multi-tenant" web applications.  warning: there are quite
>> strong opinions about how it should be done.
>>
>> in particular, there's lots of advice of setting a separate database
>> for each tenant.  It does have some advantages, but in practice it's
>> not easy to do in Django.
>>
>>
>> > My reasoning is to register each client (company) as a group within the
>> > Django auth system. Users of them would be users connected to this
group.
>>
>> Yes, this can work.  Personally, instead of reusing the Group tabke, I
>> tend to create a specific 'Company' table, and add a 'company' foreign
>> key to users.  The reasoning is that you _will_ have other groups that
>> are not companies (maybe internal divisions, or for access-level
>> privileges, whatever), and then you have the problem of separating two
>> kinds of groups.
>>
>>
>> > This line of thinking is correct? There is a decorators to limit
access to
>> > the Group as a whole? In part of the Model link the data to a group is
a
>> > good practice?
>>
>> Make sure that every record can be traced to a specific Company, some
>> of them because they're linked to a User, or maybe by a direct
>> 'company' link.  Then be _absolutely_ sure that every database query
>> includes a company condition.
>>
>> something like this:
>>
>> @login_required
>> def getsomething(request, id):
>> thing = get_object_or_404(Thing,
>> department__company=request.user.company, id=id)
>>  build response ...
>>
>>
>> It's tempting to put the "current" company somewhere and patch all
>> requests to include that, but it gets very complex quickly, and also
>> you get the problem of managing what in effect is a global variable.
>> not worth it.
>>
>>
>> --
>> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/89dad6b7-4967-48af-8554-e1a53f2d584f%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%2B5VyNMsnNqRK2g%2BB2-JThE2dbAkzShUBF%3DuTjBGKwixNM-Kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: CKEditor

2016-04-11 Thread Luis Zárate
Supongo está usando django-ckeditor, si es así lo que tiene que hacer es
usar el field que ellos proporcionan.

https://github.com/django-ckeditor/django-ckeditor#field


además recuerde usar {{form.media}} en la plantilla, para que se cargue el
js.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group 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%2B5VyN3%3D1HKLw4VJO9odtkJ0oOz831qodUoC8awu9u-EaD9dA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dedicated pages for specific group members

2016-04-08 Thread Luis Zárate
Admin site is a great example of how to do that.  But in general you can
use in the view

if not request.user.has_perm("app name.perm name):
 Raise error like 404 or redirect to login

I think decorator is provide by django.

El jueves, 7 de abril de 2016, Larry Martell 
escribió:
> On Thu, Apr 7, 2016 at 3:56 AM, Luca Brandi  wrote:
>> Hi
>> is there a possibility to create some group members and let them have
some
>> secific url pages accessible to?
>> I am thinking to a kind of "if staff is member of group"open link
page..
>
> A quick google for this came up with:
>
>
http://stackoverflow.com/questions/4597401/django-user-permissions-to-certain-views
>
http://stackoverflow.com/questions/14335832/restrict-so-users-only-view-a-certain-part-of-website-django
>
http://stackoverflow.com/questions/12597864/how-to-restrict-access-to-pages-based-on-user-type-in-django
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CACwCsY5TeX8Tm-sCFzD89-aaQ6XK18V%2BSwS2W-2HbMCKjNyFLw%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%2B5VyML%3DazeoV-_auqErFUgHFb8yexkD1eNrE0Q6fXZf4a1Gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how shall I built online address book using Django

2016-04-06 Thread Luis Zárate
Maybe if you help us web could help you.

How do you design your problem?
What are your coding plans?
What problems do you identify?
What do you need to know ? ( models, views, urls, admin site)

Django and the other frameworks are only utilities, are in you the
responsability to solve the problem.

I know you are learning django and don't know a lot of things, but make a
design with all of things that you know of programing in general and
probably django has a solution for all.


El miércoles, 6 de abril de 2016, thumbi migwe 
escribió:
> Hi, Did you manage to this? i'm also new in django and would like to do
this. which tutorial did you use?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/72d220d3-bdce-4025-8022-72f6460355df%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%2B5VyN3D%2BKa%3DY_RBwn5nAAX%3DvKtcmnW469_UGDHRGq%3DufuMsg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: url redirect with kwargs no NoReverseMatch

2016-04-05 Thread Luis Zárate
reverse('yourDollData', args=(doll.id,))


El martes, 5 de abril de 2016, Luigi Mognetti 
escribió:
>
http://stackoverflow.com/questions/36411798/url-redirect-with-kwargs-no-noreversematch
>
> main-project urls.py :
> from django.conf.urls import include, url
> from django.contrib import admin
>
> urlpatterns = [
> url(r'^admin/', include(admin.site.urls)),
> url(r'', include('data.urls')),
> ]
>
>
>
>
>
> urls.py : (from the data_app)
>
> urlpatterns = [
> url(r'^doll/$', views.doll_describer),
> url(r'^yourdolldata/(?P\d+)/$', views.yourDollData),
> url(r'^connexion/$', views.connexion),
> url(r'^logout/$', views.deconnexion),
> ]
>
>
>
> views.py
> def doll_describer(request):
> # if this is a POST request we need to process the form data
> if request.method == 'POST':
> # create a form instance and populate it with data from the
request:
> form = DollForm(request.POST)
> print(form)
> # check whether it's valid:
> if form.is_valid():
> print("was valid")
> doll = form.save(commit=False)
> doll.save()
> print("DOG.ID=",doll.id)
> return HttpResponseRedirect(reverse('yourDollData',
kwargs={'id': doll.id}))
>
> else :
> print("form is not valid")
>
> # if a GET (or any other method) we'll create a blank form
> else:
> form = DollForm()
> print("wasn't valid")
>
> return render(request, 'data/doll.html', {'form':DollForm})
>
> def yourDollData(request,id):
> doll = DollData.objects.get(id=id)
> print("Doll=",doll)
> print("DOG_TYPE=",type(doll))
> return render(request, 'data/save.html', {'doll': doll})
>
>
> I can't understand why i'm getting the following error :
>
>> NoReverseMatch at /doll/
> And it concerns the
> `HttpResponseRedirect(reverse('yourDollData', kwargs={'id': doll.id}))`
> Tough, everything's fine with the `doll.id` which is printed out
correctly one line before.
> Of course when I hard access in my browser to
127.0.0.1:8000/yourdolldata/15/ it works perfectly. So it's all about this
reversing process. I guess it has something to do with my url regex not
matching what I think I'm reversing ...
> How can i get that fixed ? I know it's a common mistake but I can't see
any thing done the wrong way after I've done my internet research.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/91eb6688-9f83-4491-b871-58ad7bb65d49%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%2B5VyNMCbeqpJW8XiH3hou-%3Doay07_OOkwKAFsppBZ64ZR6mQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Busqueda de Django admin

2016-03-27 Thread Luis Zárate
https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields

Si no es eso tiene que explicar mejor que es lo que necesita.

Además recuerde que esta lista es en inglés.


2016-03-27 16:00 GMT-06:00 :

> Necesito saber como modificar la búsqueda que viene por defecto en el
> módulo de administración de Django.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8ef9f585-5114-41c1-8071-994c109d96fc%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%2B5VyME6NBFfYaQ2wZYJe-y6h4XbwyDQ3U%2B5M8wXTPz1DnoxA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hey guys can anyone let me know where I can get some of good Django base web apps

2016-03-21 Thread Luis Zárate
https://www.djangopackages.com/


El lunes, 21 de marzo de 2016, Tibin Geo k k 
escribió:
> I am looking for some good Django web applications,  if we have any site
to download some Django projects let me know
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f6f82ee9-653a-438f-920d-9e0c5572c627%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%2B5VyPmFURYv%3D4MvJvdZzxqPuZT-EfckJA61srzmj%3Dva%3DmANQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unhashable type: 'dict'

2016-03-15 Thread Luis Zárate
You are correct, your problem is in logout url , because you need to pass a
function not a duct as second parameter.

Are you using django auth views ?


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


El martes, 15 de marzo de 2016, Deepanshu Sagar 
escribió:
> Hello,
> i am getting below error while accessing http://localhost:8000/login/.
>

>
> Below are the chaining codes.
> boardgames\urls.py
>

> boardgames\templates\login.html
>

>
> NOTE: before adding "
>
> url(r'^logout/', {'next_page': 'boardgames_home'},
name='boardgames_logout')
>
> to boardgames\urls.py. the access was working fine.
> below is the settings.py
>
> """
> Django settings for boardgames project.
>
> For more information on this file, see
> https://docs.djangoproject.com/en/1.6/topics/settings/
>
> For the full list of settings and their values, see
> https://docs.djangopro ect.com/en/1.6/ref/settings/
> """
>
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>
>
> # Quick-start development settings - unsuitable for production
> # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
>
> # SECURITY WARNING: keep the secret key used in production secret!
> SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'
>
> # SECURITY WARNING: don't run with debug turned on in production!
> DEBUG = True
>
>
> ALLOWED_HOSTS = []
>
>
> # Application definition
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'main',
> 'tictactoe',
> )
>
> MIDDLEWARE_CLASSES = (
> 'django.contrib.sessions.middleware.SessionMiddleware',
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.csrf.CsrfViewMiddleware',
> 'django.contrib.auth.middleware.AuthenticationMiddleware',
> 'django.contrib.messages.middleware.MessageMiddleware',
> 'django.middleware.clickjacking.XFrameOptionsMiddleware',
> )
>
> ROOT_URLCONF = 'boardgames.urls'
>
> TEMPLATES = [
> {
> 'BACKEND': 'django.template.backends.django.DjangoTemplates',
> 'DIRS': [os.path.join(BASE_DIR, 'templates')],
> 'APP_DIRS': True,
> 'OPTIONS': {
> 'context_processors': [
> 'django.core.context_processors.request',
> 'django.template.context_processors.debug',
> 'django.template.context_processors.request',
> 'django.contrib.auth.context_processors.auth',
> 'django.contrib.messages.context_processors.messages',
> ],
> },
> },
> ]
>
>
> WSGI_APPLICATION = 'boardgames.wsgi.application'
>
>
> # Database
> # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
>
> DATABASES = {
> 'default': {
> 'ENGINE': 'django.db.backends.sqlite3',
> 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
> }
> }
>
> # Internationalization
> # https://docs.djangoproject.com/en/1.6/topics/i18n/
>
> LANGUAGE_CODE = 'en-us'
>
> TIME_ZONE = 'UTC'
>
> USE_I18N = True
>
> USE_L10N = True
>
> USE_TZ = True
>
>
> # Static files (CSS, JavaScript, Images)
> # https://docs.djangoproject.com/en/1.6/howto/static-files/
>
> STATIC_URL = '/static/'
> STATICFILES_DIRS = (os.path.join(BASE_DIR, "static"),)
>
> LOGIN_URL = 'boardgames_login'
> LOGOUT_URL = 'boardgames_logout'
> LOGIN_REDIRECT_URL = 'user_home'
>
> I am new to Django learning.
> Please let me know if more details are required.
> Regards
> Deepanshu
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/28da63f3-382c-4ff8-b698-79bc0b0d8b49%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%2B5VyPDxLVpu%2BAwM7z9gmEO5mLj5sNdrMEED0gDhwm3qpigsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django OVH

2016-03-06 Thread Luis Zárate
Take a look here

https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts


El viernes, 4 de marzo de 2016, Bob Gailer  escribió:
>
> On Mar 4, 2016 5:09 PM, "Cedric Vallee"  wrote:
>>
>> To whom it may concern,
>>
>> I followed my friends' advice and coded a website in Django, but now it
seems virtually impossible to find documentation about how to host a Django
website on 'classic' hosting servers like OVH.
> According to the OVH website you can host anything you want including
python so I would presume one would start out installing Python then
installing Django and going from there .
>> Could you please tell me what I have to do so that my website appears
when I type the URL, and not just a page with the folders I uploaded via
Filezilla?
>> sounds like you've already installed Django?
> Have you considered Python Anywhere? I have I've run django there with no
problem.
>> I thank you for your help.
>>
>> Best regards
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/41bba2fa-f0fd-4480-9fb3-2774d988579f%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/CAP1rxO4VoaeeZnZxePtEkO2yZ038N0L5GESUTvMVui-LhAAnxw%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%2B5VyMxss38HCPo1HWamsYjWTKZO9iRaTGgfUcrTWNjbRpPGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Encoding problem (Postgres)

2016-03-06 Thread Luis Zárate
The problem is in your __str__() function, because Python 2 use
__unicode__() instead of str to return Unicode string. By default p2 return
bytes in __str__ and p3 return Unicode.

python_2_unicode_compatible works and I thing it is the best approach
because you are support both version 3/2 .

I recommend use Python 3 because has less problems with non-ascii
characters, but p2 it's OK too.



El domingo, 6 de marzo de 2016, Georges H 
escribió:
> OK thanks
> Without the python_2_unicode_compatible decorator before my class, it
does not work.
>
> Le dimanche 6 mars 2016 14:11:41 UTC+1, Vijay Khemlani a écrit :
>>
>> Do you know why you had the problem in the first place or are you just
copy-pasting code?
>> If you only need to support one version of Python (either 2.x or 3.x)
there is no need to use the python_2_unicode_compatible decorator
>> On Sun, Mar 6, 2016 at 8:14 AM, Georges H  wrote:
>>>
>>> OK Thanks but I solved this little problem by adding at the top of my
models.py:
>>> django.utils.encoding import from python_2_unicode_compatible
>>>
>>>
>>> And always in models.py before each class:
>>> @ python_2_unicode_compatible
>>> Perfect!
>>> Le dimanche 6 mars 2016 03:16:35 UTC+1, Vijay Khemlani a écrit :

 The error you are seeing is at the application level, not database, so
I don't think postgres is at fault.
 Post the full stack trace for the error and the relevant part of your
code when it fails.
 On Sat, Mar 5, 2016 at 3:28 PM, Georges H  wrote:
>
> Hi to all the Django community !
> I started with Django.
> I have a small form that works pretty well, and that will store the
data in a Postgres database, that's fine.
> OK, except that when I have a special character to enter (like an
accent, I am french), I get an error (No problem without special
characters):
> 'Ascii' codec can not encode character u '\ xe9' in position 0:
ordinal not in range (128)
> Yet I thought the default Django was utf8...
> So I tried to add in settings.py:
> LANGUAGE_CODE = 'en-us'
> LANG = 'UTF-8'
> LC_ALL = 'UTF-8'
> DEFAULT_CHARSET = 'utf-8'
> But it does not change ...
> I notice that if my base postgres is encoded in UTF-8 (when I do a
"SHOW SERVER_ENCODING"); the "client" is it in Unicode (when I do a "SHOW
CLIENT_ENCODING").
> Is it linked?
> I also notice that the "local" command at the root of my Django
project returns me:
> LANG = en_US.UTF-8
> LC_CTYPE = "en_US.UTF-8"
> LC_NUMERIC = "en_US.UTF-8"
> LC_TIME = "en_US.UTF-8"
> LC_COLLATE = "en_US.UTF-8"
> LC_MONETARY = "en_US.UTF-8"
> LC_MESSAGES = "en_US.UTF-8"
> LC_PAPER = "en_US.UTF-8"
> Lc_name = "en_US.UTF-8"
> LC_ADDRESS = "en_US.UTF-8"
> LC_TELEPHONE = "en_US.UTF-8"
> LC_MEASUREMENT = "en_US.UTF-8"
> LC_IDENTIFICATION = "en_US.UTF-8"
> LC_ALL =
> With "LC_ALL" empty !!! So it is that I did not understand where to
put this setting...
> How can I force Django to operate only in UTF-8? Or another approach?
>
> THX!
>
> --
> You received this message because you are subscribed 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/bd87c68d-730a-49f6-892f-bb398ed4d1b1%40googlegroups.com
.
> For more options, visit https://groups.google.com/d/optout.

>>> --
>>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users...@googlegroups.com.
>>> To post to this group, send email to django...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b9b18216-e21f-4195-8ae3-b3cfbed70c31%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/d17cffcc-d595-485c-8203-ad8dfaeb7412%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 

Re: I don't understand this error - Django 1.9

2016-03-04 Thread Luis Zárate
Do not use the same name of the project in your apps.

It is possible to do what you are doing but really needs comprehension of
how python works and you need to do extra work to get ready.  So my
remendation is: start a clean project with other name and copy you app
folder. Put attention in what file are from settings and what is from app.

or better idea start again your app with clean project.



El viernes, 4 de marzo de 2016, Alex Heyden 
escribió:
> If you get longer stacktraces back, those might help in identifying what
exactly is going wrong.
> As a first pass cleanup, try:
> * remove 'ladynerds' from the bottom of INSTALLED_APPS. You're already
including it up top
> * change __init__.py to read "default_app_config =
'ladynerds.apps.LadyNerdsConfig'". No import apps, camel casing only at the
end.
> * change the name field of the app config to "ladynerds" instead of
"LadyNerds" (but the verbose name should be fine)
> On Fri, Mar 4, 2016 at 3:24 PM, Becka R.  wrote:
>>
>> Hi,
>> I'm building a pretty basic CRUD application for a community I'm part
of.   I'm now getting "ImportError: No module named [myappname]" when I run
the server, and an operational error in the admin.
>> I looked at the documentation, and followed the steps, but I'm not doing
something correctly.  I'd like to 1) fix this, and 2) propose some changes
to the docs to clarify this issue.
>> My project is called "ladynerds" (We're a professional association for a
bunch of women software engineers).
>> Here's the documentation I'm following:
>> https://docs.djangoproject.com/en/1.9/ref/applications/
>>
>> I'm using Django 1.9
>> Here's my file structure:
>> /ladynerds   (project file)
>>  /ladynerds  (app)
>>   __init__.py
>>   models.py
>>   forms.py
>>   settings.py
>>   urls.py
>>   views.py
>>   wsgi.py
>>   /static
>>   /templates
>>
>> Here's what I put into ladynerds/__init__.py:
>>
>> import apps
>> default_app_config = 'LadyNerds.apps.LadyNerdsConfig'
>>
>> I've also tried using 'ladynerds.apps.LadyNerdsConfig'
>>
>> Here's what I put into ladynerds/apps.py:
>> from django.apps import AppConfig
>> class LadyNerdsConfig(AppConfig):
>> name = "LadyNerds"
>> verbose_name = "LadyNerds"
>> Here's my settings.py INSTALLED_APPS
>>
>> INSTALLED_APPS = (
>> 'ladynerds.apps.LadyNerdsConfig',
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'ladynerds'
>> )
>>
>> I'm getting:  ImportError: No module named LadyNerds
>> What am I missing?
>> And, thanks.
>> Becka
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/2e9e6959-0dc6-4cfb-9fe1-5aaf77db852f%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/CA%2Bv0ZYXmk3ib7KaHA9J%2B4Jnp-LozAfSOd0d79wW5cPUHL3k%3D1Q%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%2B5VyOWSm%2BN5_-hf1QGYC%2B09a17Ab4zdy9%2BBGgh3HWQ%2BdneCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to create groups for users in Django

2016-03-04 Thread Luis Zárate
Años observation

Person.objects.create(name=request.user)

Lazy object is set but name is charfield.
M1is not saved.
form.save() create other group that is not used.



El jueves, 3 de marzo de 2016,  escribió:
> Hello!
>
> I have a problem, like in topic, with creating groups in django. I was
searching everywhere and nothing was so interested.
>
> What i want from this section: I would like to by filling a column with
the name of the group, formed a quite new group, on the occasion of adding
me as one of the members and preferably, as a leader, who can add other
users to the group.
>
> My problem: I did one form for name, and when i sending a request, i got
nothing, only the stie is re-loaded. I have some code but don;t know what
to do next..
>
> My code:
>
> models.py:
>
> class Person(models.Model):
>
> name = models.CharField(max_length=128)
>
> def __str__(self): # __unicode__ on Python 2
> return self.name
>
>
> class Group(models.Model):
> name = models.CharField(max_length=128)
> leader = models.CharField(max_length=50)
> members = models.ManyToManyField(Person, through='Membership')
>
> def __str__(self): # __unicode__ on Python 2
> return self.name
>
>
> class Membership(models.Model):
> person = models.ForeignKey(Person)
> group = models.ForeignKey(Group)
> date_joined = models.DateField()
> invite_reason = models.CharField(max_length=64)
>
> forms.py:
>
> class GroupForm(forms.ModelForm):
>
> class Meta:
> model = Group
> fields = ('name',)
>
> views.py:
>
> @login_required
> def groups(request):
>
> if request.method == "POST":
> form = GroupForm(request.POST)
> if form.is_valid():
>
> grupa = Group.objects.create(name="grupa")
> per = Person.objects.create(name=request.user)
> m1 = Membership(person=per, group=grupa, date_joined=(1999, 8, 8),
invite_reason="Needed programmer.")
> form.save()
>
>
> return render(request, 'groups.html', {'form':form})
>
> else:
> form = GroupForm()
>
> return render(request, 'groups.html', {'form': form})
>
> groups.html:
>
> {% block profile %}
>
> 
> 
> Create your new group !
> 
> {% csrf_token %}
> {{ form|crispy }}
> Go!
> 
> 
>
> {% endblock %}
>
> This is it... Can anyone could help me with that? I spend few days with
it and 0 progress.
>
> Thanks for any help!
>
> Damian
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b71b3e7e-a168-4f1c-aaf7-655bdee86212%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%2B5VyOH7A28WLKTQSjLzH8Ug1YSfG3hbjth%3DnNJB-L5WoY4HA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Hello

2016-03-04 Thread Luis Zárate
I am not in Cuba, but there are internet limitations (bandwidth)  and
restrictions (regional banned and site blacklist) expecially if servers are
in USA (not America), for this reason it is important to him download a
file.

El viernes, 4 de marzo de 2016, Luis Zárate <luisz...@gmail.com> escribió:
> In fat bellow says: I can send you some pdf split in files of 2mb.
>
>
> Hola, si quiere puedo envíarle por email algunos tutoriales en pdf .
>
> Yo uso linux por lo que puedo partirlos con split y Ud podrá unirlos con
cat.
>
> Django se basa en python Ud conoce este lenguaje.
>
> El viernes, 4 de marzo de 2016, Bruno Barbosa <bsbru...@gmail.com>
escribió:
>> But these tutorials are online.. you don't need download it..
>> --
>> Bruno Barbosa
>> Web Developer
>> brunobarbosa.com.br
>> On Fri, Mar 4, 2016 at 5:57 PM, <direco...@infomed.sld.cu> wrote:
>>>
>>> I have been seeing it but I just have acces
https://www.djangoproject.com/ and this one too
https://docs.djangoproject.com/en/1.9/intro/
>>>
>>> but just thouse one, I would like to get some tutorials but my big
problem is my email, I can not get a file bigger than 2 mb  haha I live in
Cuba
>>>
>>>
>>>
>>> 
>>> This message was sent using IMP, the Internet Messaging Program.
>>>
>>>
>>>
>>> --
>>> Este mensaje le ha llegado mediante el servicio de correo electronico
que ofrece Infomed para respaldar el cumplimiento de las misiones del
Sistema Nacional de Salud. La persona que envia este correo asume el
compromiso de usar el servicio a tales fines y cumplir con las regulaciones
establecidas
>>>
>>> Infomed: http://www.sld.cu/
>>>
>>> --
>>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/20160304155718.1243858fs518g7n2%40webmail.sld.cu
.
>>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAHxcCH6n9h4qmRdMqOY%3DV4xHnQU-wLU7Ru5MDVfjm5dxZy5iBQ%40mail.gmail.com
.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> "La utopía sirve para caminar" Fernando Birri
>
> <
https://ci3.googleusercontent.com/proxy/pleYFBjRTaqPzwl0QWV68XGbm9_iKE548G9HnZip6o7gk46Dni4svLKWIxqanv21wf4L-oDTIVyWUviHHYQOxYJ_VR-E2QHnDRBqrtZefM09Bgx09obS9PzSCP77HVIAehvKQVoH7RXKVRwJcXB8ZhPlAlEmO_2MsbjN1bH8rF0L8O0qa_FTVnBaZA84NQjOjE3lH9ACs5sERtY=s0-d-e1-ft#https://docs.google.com/uc?export=download=0B4-s_Bgz_-NSN0V3b24zU25fMW8=0B4-s_Bgz_-NSdy9OTkYzcDN6RGZITWl5amdqT3JxVnNVVSswPQ
>
>
>

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


Re: Django Hello

2016-03-04 Thread Luis Zárate
In fat bellow says: I can send you some pdf split in files of 2mb.


Hola, si quiere puedo envíarle por email algunos tutoriales en pdf .

Yo uso linux por lo que puedo partirlos con split y Ud podrá unirlos con
cat.

Django se basa en python Ud conoce este lenguaje.

El viernes, 4 de marzo de 2016, Bruno Barbosa  escribió:
> But these tutorials are online.. you don't need download it..
> --
> Bruno Barbosa
> Web Developer
> brunobarbosa.com.br
> On Fri, Mar 4, 2016 at 5:57 PM,  wrote:
>>
>> I have been seeing it but I just have acces
https://www.djangoproject.com/ and this one too
https://docs.djangoproject.com/en/1.9/intro/
>>
>> but just thouse one, I would like to get some tutorials but my big
problem is my email, I can not get a file bigger than 2 mb  haha I live in
Cuba
>>
>>
>>
>> 
>> This message was sent using IMP, the Internet Messaging Program.
>>
>>
>>
>> --
>> Este mensaje le ha llegado mediante el servicio de correo electronico
que ofrece Infomed para respaldar el cumplimiento de las misiones del
Sistema Nacional de Salud. La persona que envia este correo asume el
compromiso de usar el servicio a tales fines y cumplir con las regulaciones
establecidas
>>
>> Infomed: http://www.sld.cu/
>>
>> --
>> You received this message because you are subscribed to the Google
Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/20160304155718.1243858fs518g7n2%40webmail.sld.cu
.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/CAHxcCH6n9h4qmRdMqOY%3DV4xHnQU-wLU7Ru5MDVfjm5dxZy5iBQ%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%2B5VyMyvL3F8ji7ct5CTVbCWwXirK%2BHMN5rYdBmAzfpQCMgjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to implement lazy settings as django setting

2016-03-03 Thread Luis Zárate
Thanks,

El jueves, 3 de marzo de 2016, Daniel Chimeno  escribió:
> Hello,
> https://www.djangopackages.com/grids/g/live-setting/
>
>
> El miércoles, 2 de marzo de 2016, 16:53:09 (UTC+1), luisza14 escribió:
>>
>> I need to implement a lazy setting like django setting that could be
call globally in several apps but get his values from a model in database.
>>
>> I have some settings that need to be change by the admin user, so my
apps expect that settings but can not loaded on django setup because needs
populate with fields in db or something that user can change without
touching code.  So I thing I can implement a lazy setting that use database
in request process time and cached the result.
>>
>> So do you have some idea how to implement that.
>>
>> --
>> "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/ff317794-8928-4610-9dbe-2d480f986956%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%2B5VyPJ3xhWFAGRUPv6gkEKMJX7xHiWArjyqkaH7uLuNE-Z4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


how to implement lazy settings as django setting

2016-03-02 Thread Luis Zárate
I need to implement a lazy setting like django setting that could be call
globally in several apps but get his values from a model in database.

I have some settings that need to be change by the admin user, so my apps
expect that settings but can not loaded on django setup because needs
populate with fields in db or something that user can change without
touching code.  So I thing I can implement a lazy setting that use database
in request process time and cached the result.

So do you have some idea how to implement that.

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


how to implement lazy settings as django setting

2016-03-02 Thread Luis Zárate
I need to implement a lazy setting like django setting that could be call
globally in several apps but get his values from a model in database.

I have some settings that need to be change by the admin user, so my apps
expect that settings but can not loaded on django setup because needs
populate with fields in db or something that user can change without
touching code.  So I thing I can implement a lazy setting that use database
in request process time and cached the result.

So do you have some idea how to implement that.

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


Re: a question about django admin and language

2016-03-02 Thread Luis Zárate
You could write a middleware after language middleware than check if it is
a admin URL and change the language to English.

https://docs.djangoproject.com/en/1.9/topics/http/middleware/

https://docs.djangoproject.com/es/1.9/topics/i18n/translation/


El viernes, 26 de febrero de 2016, Will Harris 
escribió:
> Hi Paul,
> If you want the admin site to behave differently than the main site, you
could consider running two instances, one with the i18n activated for the
main site, and one for admin users with it disabled. In production, from a
security standpoint, it's a good idea to have the admin site running with
different settings/access in any case.
> Will
>
> On Thursday, February 25, 2016 at 2:37:54 PM UTC+1, Paul Z wrote:
>>
>>  Hi,
>>
>> I'm new to django, I try to set up a site that can select language
automatically.
>> So, I set as below:
>>
>> LANGUAGE_CODE = 'en'
>>
>> TIME_ZONE = 'UTC'
>>
>> USE_I18N = True
>>
>> USE_L10N = False
>>
>> USE_TZ = False
>>
>> For now, It can select language automatically, But, The question is:
>>
>> I don't want to it select language in Django Admin Interface, I want to
it always display in English.
>>
>> So, How to?
>>
>> Thanks
>> Paul Z
>>
>>



>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/b612e437-c093-4c06-b7ec-e53244402b2d%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%2B5VyNpEXRET5xHsabr_56RMH%3DL%2BaqtzLuh4zfn2whFf_5oYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: form as filter in admin site

2016-02-22 Thread Luis Zárate
I need something like this, of course magic is in FormFilter :), so I am
lookig for something in admin app with this behaivor


class MatriculaForm(forms.Form):
# I am using django-ajax-selects, lookups are out of scope
disciplina = AutoCompleteSelectMultipleField('disciplinas',
 required=False,
 help_text=None)
ciclo = forms.ModelMultipleChoiceField(queryset=Ciclo.objects.all(),
   required=False)
proyecto = AutoCompleteSelectMultipleField('proyectos',
   required=False,
   help_text=None)



class MatriculaFilter(FormFilter):
template = "matriculafilter/filter_template.html"
form = MatriculaForm
title = "Matricula Filter"
# Needs for autocomplete fields that insert other input
remove_params = ['filtro', 'disciplina_text', 'proyecto_text']
#Map form fields with model fields for example FK relations
map_parameters = {'ciclo': 'proyeccion__ciclo'}



class MatriculaAdmin(admin.ModelAdmin)
list_filter = (
   MatriculaFilter,
   )

2016-02-20 9:56 GMT-06:00 Luis Zárate <luisz...@gmail.com>:

> I am trying to insert a filter in the admin site that have 2 autocomplete
> inputs so I was thinking to do  passed a form  with a custom filter, but I
> only find a list filter documentation.
>
> I solved the problem writing a custom filter, with a little problem with
> css, because change list view  has few width space for filter so input
> looks terrible.
>
> i needed to search in the django code because i didn't find in
> documentation.
>
> I think my solution is generic so I am asking me if django has this
> functionally implemented, I didn't find but maybe you know something about.
>
> --
> "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%2B5VyN-aRsTn06BmFaJjG0JP_-f5X7J4eH0%3DyB5ziAEFRmd5A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
from django.contrib import admin

class FormFilter(admin.ListFilter):
template = "formfilter/filter_template.html"
form = None
form_instance = None
remove_params = []
map_parameters = None  # {}
delimeter = "|"

def _get_map_filter(self):
if self.map_parameters is None:
self.map_parameters = {}
for param in self._get_parameter_name():
if param not in self.map_parameters:
self.map_parameters[param] = param
return self.map_parameters

def get_map_filter(self):
""" Overwrite this function to provide new map params
def get_map_filter(self):
dev = super(MyClass, self).get_map_filter
dev['myparam'] = 'query_set_param'
return dev
"""
return self._get_map_filter()

def _get_parameter_name(self, request=None):
if self.form_instance is None:
if request is not None:
self.form_instance = self.form(request.GET)
else:
self.form_instance = self.form()
return self.form_instance.fields.keys()

def __init__(self, request, params, model, model_admin):

self.used_parameters = {}
# intentional comment this line
# super(FormFilter, self).__init__(
#request, params, model, model_admin)
if self.form is None:
raise ImproperlyConfigured(
"The form filter '%s' does not specify "
"a 'form'." % self.__class__.__name__)

for parameter_name in self._get_parameter_name(request):
if parameter_name in params:
value = params.pop(parameter_name)
self.used_parameters[parameter_name] = value

for param in self.remove_params:
if param in params:
params.pop(param)

def has_output(self):
return True

def value(self):
"""
Returns the value (in string format) provided in the request's
query string for this filter, if any. If the value wasn't provided then
returns None.
"""
return None  

Re: mathematical function and django connect

2016-02-21 Thread Luis Zárate
use render instead of render_to_response

from django.shortcuts import render


 return render(request, 'blog/calc.html', {
'a' :a,
})


2016-02-21 22:57 GMT-06:00 Xristos Xristoou :

> UserWarning: A {% csrf_token %} was used in a template, but the context
> did not provide the value.  This is usually caused by not using
> RequestContext.
>
> Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos
> Xristoou έγραψε:
>>
>> hello,
>>
>>
>> i create some python mathematical function on python idle,
>> i want to create website where the user import value numbers on the
>> function
>> and take the results from that.
>> question one,how to connect my mathematical function on the django?
>> question two,how to connect input and output from the scipts in the
>> website ?
>> the second question i ask because input and output from the function is a
>> dynamic define from the user
>>
>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bb2f0706-390a-4164-aad8-6c2777df68f0%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%2B5VyMHkEpM44AQqLa_Ho1%3D6ZeXk%2B_DTRtPQf54db3aE3XmWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


form as filter in admin site

2016-02-20 Thread Luis Zárate
I am trying to insert a filter in the admin site that have 2 autocomplete
inputs so I was thinking to do  passed a form  with a custom filter, but I
only find a list filter documentation.

I solved the problem writing a custom filter, with a little problem with
css, because change list view  has few width space for filter so input
looks terrible.

i needed to search in the django code because i didn't find in
documentation.

I think my solution is generic so I am asking me if django has this
functionally implemented, I didn't find but maybe you know something about.

-- 
"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%2B5VyOkJSdpB_YPeH%3DsW%2BM7qmef-xa-hFQECJxxtbKrPL6b2Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: key specification without a key length

2016-02-19 Thread Luis Zárate
I response in the other mail, but I am curious
changing TextField for. CharField with max_length has big impact in the
database performance.

I saw you have a lot of TextFields so are you sure that you need all those
TextFields ? Or y
could you change those TextFields for CharFields with a small max_length ?

#id = models.TextField(primary_key=True)

id = models.CharField(primary_key=True, max_length = 32)




El viernes, 19 de febrero de 2016, Mike Dewhirst 
escribió:
> On 20/02/2016 6:26 AM, Sammi Singh wrote:
>>
>> Hi,
>>
>> I'm new to Django and facing this error
>> "*/django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'id' used
>> in key specification without a key length")/*"
>>
>> Here is my code:
>>
>> class Steps(models.Model):
>>
>> Â  Â  author = models.ForeignKey(User)
>>
>> #Â  Â  id = models.TextField(primary_key=True)
>
> I don't think it makes sense to use a text field as a primary key. If you
don't want to use the default primary key (and you need a strong case to
want something else) and you really want a string as a primary key use
models.CharField(max_length=99, primary_key=True)
>
>
>>
>> Â  Â  id = models.CharField(primary_key=True, max_length = 32)
>>
>> Â  Â  text = models.TextField()
>>
>> Â  Â  status = models.TextField()
>>
>> Â  Â  step_id = models.TextField(null=True)
>>
>> Â  Â  release_id = models.TextField(null=True)
>>
>> Â  Â  region = models.TextField(null=True)
>>
>> Â  Â  # Time is a rhinocerous
>>
>> Â  Â  updated = models.DateTimeField(auto_now=True)
>>
>> Â  Â  created = models.DateTimeField(auto_now_add=True)
>>
>>
>> class UserConfig(models.Model):
>>
>> Â  Â  author = models.ForeignKey(User)
>>
>> #Â  Â  id = models.TextField(primary_key=True)
>>
>> Â  Â  id = models.CharField(primary_key=True, max_length = 32)
>>
>> Â  Â  co_range = models.TextField()
>>
>> Â  Â  tu_range = models.TextField()
>>
>> Â  Â  st_range = models.TextField()
>>
>> Â  Â  de_host = models.TextField()
>>
>> Â  Â  in_host1 = models.TextField()
>>
>> Â  Â  in_host2 = models.TextField()
>>
>> Â  Â  in_host3 = models.TextField()
>>
>> Â  Â  co_host = models.TextField()
>>
>> Â  Â  vp_name = models.TextField()
>>
>>
>> Â  Â  # Time is a rhinocerous
>>
>> Â  Â  updated = models.DateTimeField(auto_now=True)
>>
>> Â  Â Â created = models.DateTimeField(auto_now_add=True)
>>
>>
>> Any help would be appreciated..
>>
>>
>> Regards
>>
>> Sammi
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send
>> an email to django-users+unsubscr...@googlegroups.com
>> .
>> To post to this group, send email to django-users@googlegroups.com
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>>
https://groups.google.com/d/msgid/django-users/5100d863-f887-4b97-9ea4-95227ab99bdf%40googlegroups.com
>> <
https://groups.google.com/d/msgid/django-users/5100d863-f887-4b97-9ea4-95227ab99bdf%40googlegroups.com?utm_medium=email_source=footer
>.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/56C7A494.4060103%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%2B5VyPLG2Tnyqxz_6yHWDX_qHgjgRL2%2B-5wOHCa3b0GQYeiAw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 1170, "BLOB/TEXT column

2016-02-19 Thread Luis Zárate
Check your migrations, I think you use TextField the first time, run
makemigrations  and create the initial migrations, before you run migrate
django raise a exception so you change it for CharField and run
makemigrations  a second time and create the correction in the 002
migration but the initial migration has the problem so when you run migrate
again the problem persist.



El viernes, 19 de febrero de 2016, Sammi Singh 
escribió:
> Hi,
> I'm new wot Django and stuck with below error when run migrate. Any
suggestions??
>
> django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'id' used in
key specification without a key length")
>
> Here is my code:
>
> class Steps(models.Model):
>
> author = models.ForeignKey(User)
>
> #id = models.TextField(primary_key=True)
>
> id = models.CharField(primary_key=True, max_length = 32)
>
> text = models.TextField()
>
> status = models.TextField()
>
> step_id = models.TextField(null=True)
>
> release_id = models.TextField(null=True)
>
> region = models.TextField(null=True)
>
> # Time is a rhinocerous
>
> updated = models.DateTimeField(auto_now=True)
>
> created = models.DateTimeField(auto_now_add=True)
>
> class Meta:
>
> ordering = ['created']
>
> def __unicode__(self):
>
> return self.text+' - '+self.author.username
>
> class UserConfig(models.Model):
>
> author = models.ForeignKey(User)
>
> #id = models.TextField(primary_key=True)
>
> id = models.CharField(primary_key=True, max_length = 32)
>
> co_range = models.TextField()
>
> tu_range = models.TextField()
>
> st_range = models.TextField()
>
> de_host = models.TextField()
>
> in_host1 = models.TextField()
>
> in_host2 = models.TextField()
>
> in_host3 = models.TextField()
>
> co_host = models.TextField()
>
> vp_name = models.TextField()
>
> # Time is a rhinocerous
>
> updated = models.DateTimeField(auto_now=True)
>
> created = models.DateTimeField(auto_now_add=True)
>
> class Meta:
>
> ordering = ['created']
>
> def __unicode__(self):
>
> return self.text+' - '+self.author.username
>
> Regards
> Sammi
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7f1a4f9c-7a75-4202-ac3b-2e8f369ea2e6%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%2B5VyPF3dsu17qNbBDy4umNxD77Zd_Anmrawbv8dP8TVePP4A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Gmail Django

2016-02-19 Thread Luis Zárate
Those are your real credentials, hurry up and change the password, you must
never post your real credentials in public mail list.

M1chael is right you need to change the gmail settings for allow login with
insecure applications.

2016-02-19 16:03 GMT-06:00 Daniel Wilcox :

> You should generate a certificate to use TLS (even something self signed,
> or try Let's Encrypt and get a free cert from there).  Other than that we
> have the same settings and I've been sending mail successfully with almost
> identical settings the past day or so.
>
> I presume you are using an app-specific password.  Another difference I
> see is that I removed the default from setting since it doesn't match the
> host user (and I don't expect that google would deliver it).
>
> Best of luck!
>
> On Fri, Feb 19, 2016 at 12:17 PM,  wrote:
>
>> my settings
>>
>> EMAIL_USE_TLS = True
>> DEFAULT_FROM_EMAIL = 'webmaster@vaility'
>> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
>> EMAIL_FILE_PATH = None
>> EMAIL_HOST = 'smtp.gmail.com'
>> EMAIL_HOST_PASSWORD = 'lv210493'
>> EMAIL_HOST_USER = 'setivolkyl...@gmail.com'
>> EMAIL_PORT = 587
>> EMAIL_SUBJECT_PREFIX = '[Django] '
>> EMAIL_TIMEOUT = None
>> EMAIL_USE_TLS = True
>> SERVER_EMAIL = 'root@vaility'  # email for errors
>>
>> Every time I had next error
>>
>> SMTPAuthenticationError: (534, b'5.7.14 <
>> https://accounts.google.com/ContinueSignIn?sarp=1=1=AKgnsbsy1\n5.7.14
>> Hm68kFAtFDZroMBYjdIl_EN2We7HAeUt2puFzfziG5SUr_1ZyN9UgsCfV_M_RKiMRBEYw9\n5.7.14
>> F4k9yCuW8gTxTgcL5lV4ofXgDXumhhKkh7yc-BvkyqL1NBPZv_WXNPD7qQQUhUO8-KikpH\n5.7.14
>> ct0vd7ZvgpfIF48HMJKlSiICSCHsmwaqU9Atwc5dx4RlcMJ7Bcn63ePgmwruSeBHh4rKOB\n5.7.14
>> nGaIDTGZyrou7ao5k4lm5t6wxosA> Please log in via your web browser
>> and\n5.7.14 then try again.\n5.7.14  Learn more at\n5.7.14
>> https://support.google.com/mail/answer/78754 eb3sm1684842lbc.31 - gsmtp')
>>
>> I again sigin in my account, but not result
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/d2feb1b0-56c0-41ee-9a61-75acf91f5b90%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/CAGq7KhqUEhjqqnM5cNj1mCbTGXjLj5exJHNakwVnQdjAgaXrug%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%2B5VyNN%2BM8LBokFcEVCpRf2O38fbWFh_1RqJqKTm4qPk9-wwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploy Adagios web application

2016-02-16 Thread Luis Zárate
I don't know where is your problem, and I deployed django with apache time
ago, but if I remember well WSGIDaemonProcess is not a IP, It is the user
of process that run wsgi so I used like

WSGIDaemonProcess myuser
WSGIDaemonGroup myusergroup

I sorry if I am not in the truth.


El martes, 16 de febrero de 2016, Adriaan Wilmink 
escribió:
>
>
> Op dinsdag 16 februari 2016 14:03:20 UTC+1 schreef Adriaan Wilmink:
>>
>> I setup Nagios Core in a Centos 6.4 VM.
>> updated httpd.conf file:
>> WSGIScriptAlias / /opt/adagios/adagios/wsgi.py
>> WSGIPythonPath /opt/adagios/
>> WSGIDaemonProcess 10.149.21.79
python-path=/opt/adagios:/usr/lib64/python2.6/site-packages
>> WSGIProcessGroup 10.149.21.79
>>
>>
>> 
>> 
>> Order deny,allow
>> Allow from all
>> 
>> 
>>
>> Regardless of adding the actual python path, or when I leave out
daemonizing Django, I get a website error.
>
> If I use port number 8000 I get the error connection refused, if I use
default port 80 I get a service temporarily unavailable error.
>
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/3fe21c11-2225-4eff-bcf9-e634fc032973%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%2B5VyMyJXVGeXFefUDdEfuaFSWjJo78v%3Dmx1P_tNHQqi4V9Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Where is the issues page?

2016-02-16 Thread Luis Zárate
https://code.djangoproject.com/


El martes, 16 de febrero de 2016, shivam Agarwal 
escribió:
> I want to contribute to Django but i cannot find the issues page , can
someone help me find it?
>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/9e74ba39-0183-4ed4-968b-9b5d7ac6fd04%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%2B5VyMzW0Ckdc%2B6_TQE7SOz0uQt7eMQELNrhTBWDqdFJt4nTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: mathematical function and django connect

2016-02-16 Thread Luis Zárate
What is wrong in your code?

I suggested you some scripts changes that allows import and use in views.

Help us to help you, give us more information about what are you doing,
what are you planning to do? Why you think you code is wrong?.

Did you create the view as I suggested?

I think you need to do this steps.

1. Create a django view with some HTML template
2. Create a form ( search for django forms)
3. Insert the form in the HTML template
4. Validate and extract the data inside forms ( it is easy using django
forms)
5. Format the data for use in mathematic function (send data to script in
the correct way )
6. Get data from script
7. Insert the data into template context
8. Render in HTML the data in the HTML template

El lunes, 15 de febrero de 2016, Xristos Xristoou 
escribió:
> after read your toturial from the django docs and next page from
the django docs
> i think so my python code is wrong to get in views.py, i think so get in
form
> Τη Τρίτη, 9 Φεβρουαρίου 2016 - 9:47:30 μ.μ. UTC+2, ο χρήστης Xristos
Xristoou έγραψε:
>>
>> hello,
>>
>> i create some python mathematical function on python idle,
>> i want to create website where the user import value numbers on the
function
>> and take the results from that.
>> question one,how to connect my mathematical function on the django?
>> question two,how to connect input and output from the scipts in the
website ?
>> the second question i ask because input and output from the function is
a dynamic define from the user
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
"Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/f4806da4-886f-4562-8e46-4633693b333e%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%2B5VyOJ4H2mvjdaBRvmRizzCiwKB4vsXowKbwypAYJG%3DPp7-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >