Wednesday, August 31, 2016

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

Thanks
Jani Tiainen

On Thu, Sep 1, 2016 at 11:30 AM, Jani Tiainen <redetin@gmail.com> wrote:

There exists a bit more detailed tutorial for Django:

http://www.marinamele.com/taskbuster-django-tutorial


On 01.09.2016 08:58, rajeshkmr9583 wrote:
Hi,

   I have completed the tutorial my friend and by using the tutorial we are working with admin site only. I'm planning to work with my own HTML page. I have with worked Admin site but when i try to work with my own HTML page I'm not able to work. And now only started learning Django So i don't know all the concept from Django. Please help to achieve my target.

Thanks my friend,

On Wednesday, 31 August 2016 21:20:19 UTC+5:30, Abraham Varricatt wrote:
This might be silly to ask but - can we assume you've completed the django tutorial?

On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote:
Hi,

     i'm new to Django i need some mini project which contain at least 4 page for go through how it works..

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6e0c989c-6b20-44c0-930a-67f3a0fac3f9%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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/48c21005-90f6-567d-a2fc-fe75b80e16d4%40gmail.com.

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

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

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

There exists a bit more detailed tutorial for Django:

http://www.marinamele.com/taskbuster-django-tutorial


On 01.09.2016 08:58, rajeshkmr9583 wrote:
Hi,

   I have completed the tutorial my friend and by using the tutorial we are working with admin site only. I'm planning to work with my own HTML page. I have with worked Admin site but when i try to work with my own HTML page I'm not able to work. And now only started learning Django So i don't know all the concept from Django. Please help to achieve my target.

Thanks my friend,

On Wednesday, 31 August 2016 21:20:19 UTC+5:30, Abraham Varricatt wrote:
This might be silly to ask but - can we assume you've completed the django tutorial?

On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote:
Hi,

     i'm new to Django i need some mini project which contain at least 4 page for go through how it works..

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6e0c989c-6b20-44c0-930a-67f3a0fac3f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--   Jani Tiainen

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

Hi,

   I have completed the tutorial my friend and by using the tutorial we are working with admin site only. I'm planning to work with my own HTML page. I have with worked Admin site but when i try to work with my own HTML page I'm not able to work. And now only started learning Django So i don't know all the concept from Django. Please help to achieve my target.

Thanks my friend,

On Wednesday, 31 August 2016 21:20:19 UTC+5:30, Abraham Varricatt wrote:
This might be silly to ask but - can we assume you've completed the django tutorial?

On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote:
Hi,

     i'm new to Django i need some mini project which contain at least 4 page for go through how it works..

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6e0c989c-6b20-44c0-930a-67f3a0fac3f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

Hi,

   I have completed my frnd and by the tutorial we are working with admin site i'm planning to work with my own html and css page. With i'll work Admin site but when i try to work with my own html page i'm not able to work.

Thanks my frnd,


On Wed, Aug 31, 2016 at 9:20 PM, 'Abraham Varricatt' via Django users <django-users@googlegroups.com> wrote:
This might be silly to ask but - can we assume you've completed the django tutorial?

On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote:
Hi,

     i'm new to Django i need some mini project which contain at least 4 page for go through how it works..

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/30c9a6ac-a9aa-4490-a636-c218c7fba254%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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOg8cE%2B1QFTJwvbpRqsEBFS95W-uEoQAiwKrnpgdbFCdQUt6Hw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Custom Template Tag

Hi Django Users,

I want to make a custom template tag where the tag's renderer needs to make a POST request.


Is it possible to render the nodes of a template in multiple threads? I would ideally like those POST requests to happen at the same time.

Does anyone know of some similar project?

Thanks,

Al

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/84ccc6dc-ae1d-404c-9a05-1b72fc36a778%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Possible bug in AlterField migration with spatial_index

Hi,

I have a model with a PointField, created with the spatial_index set as True
(the default value). Doing a \d table_name on postgresql revealed the index
that was created, as expected.

I updated the spatial_index to False and ran the migrations, which *did not*
drop the index in the db.

I was also able to repro this with a PointField created with spatial_index as
False. When the field was updated to set spatial_index as True, an index was
not created in the database. Looks like AlterField migration is not working
with PointField and spatial_index.

I'm running Django 1.9.9 and PostgreSQL 9.5.1

Best,
Arjun

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

Re: Getting Start Django

It's nice that you are on Ubuntu. :)  Here is a quick and dirty way to get up to speed, (going to assume you will use python3)

# Installing virtualenv globally
$ sudo apt-get update
$ sudo apt
-get install python3-pip
$ sudo pip3 install virtualenv

Once you have that done, navigate to an empty directory to create a new virtualenv folder, activate it, and install django!

$ mkdir test
$ cd test
$ virtualenv
--python=python3 VENV
$ source VENV
/bin/activate
(VENV)$ pip install django
(VENV)$ django-admin startproject mysite


...


(VENV)$ deactivate     # to turn off the virutualenv, or just close the terminal session
$



Yours,
Abraham V.








On Wednesday, 31 August 2016 17:47:18 UTC+5:30, jsroyal wrote:
Hello guys,
    I am newbie in Django and started learning with Standard Documentation version: 1.10.
I
already Install
Django 1.10 and Python 3.4 in Linux Ubuntu 15.04  But in first phage I got some problem
I type command

django-admin startproject mysite
error:
Cannot find installed version of python-django or python3-django
Need some help to get out.
Stay strong
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/28f0e8f0-9183-42f9-97fd-365286f432d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Hi, i'm new to django i need some mini project which contain atleast 4 page for go through how it works

This might be silly to ask but - can we assume you've completed the django tutorial?

On Monday, 29 August 2016 16:56:33 UTC+5:30, rajeshkmr9583 wrote:
Hi,

     i'm new to Django i need some mini project which contain at least 4 page for go through how it works..

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/30c9a6ac-a9aa-4490-a636-c218c7fba254%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Error: int() argument must be a string or a number, not 'SimpleLazyObject'

Following is the dispatch function:

 def dispatch(self, request, *args, **kwargs):
        try:
            user_check_id = self.request.session.get("user_checkout_id")
            user_checkout = UserCheckout.objects.get(id=user_check_id)
        except UserCheckout.DoesNotExist:
            user_checkout = UserCheckout.objects.get(user=request.user)
        except:
            user_checkout = None

        obj = self.get_object()
        if obj.user == user_checkout and user_checkout is not None:
            return super(OrderDetail, self).dispatch(request, *args, **kwargs)
        else:
            raise Http404

On line 27 color is red. Usually the error related to SimpleLazyObject means that it's not able to grab the field with reference. I don't know what to replace it with.

On Wed, Aug 31, 2016 at 5:31 AM, Andromeda Yelton <andromeda.yelton@gmail.com> wrote:
I think the key line of the traceback is this - 
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27.             user_checkout = UserCheckout.objects.get(user=request.user)

And the error is being thrown during your redirect to /orders/4/ at the end of the post. What does your orders/views.py look like around line 27?

Unrelated to this error, but I'm also wondering what happens in CheckoutFinalView if the paymethod is CashOnDelivery or CreditCard - neither of those branches of your if statement actually return any sort of http response.

On Wed, Aug 31, 2016 at 7:27 AM, Shazia Nusrat <shazianusra@gmail.com> wrote:
Hi I am having this error while I am trying to delete session and cart by IDs after order fulfillment.

carts/views.py

class CheckoutFinalView(CartOrderMixin, View):
    def post(self, request, *args, **kwargs):
        order = self.get_order()
        order_id = order.id
        print order_id

        pay_method = request.POST.get("paymethod")
        print pay_method
        order.save()

        if request.POST.get('paymethod') == "CashOnDelivery":
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session["cart_id"]
            del request.session["order_id"]
        elif request.POST.get("paymethod") == 'CreditCard':
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session['order_id']
            del request.session['cart_id']
        else:
            return redirect("order_detail", pk=order.pk)

In my orders/models.py:

order_id = models.CharField(max_length=20, null=True, blank=True)
    paymethod = models.CharField(max_length=16, choices=CHOICES, default='CashOnDelivery')


My orders/views.py:

class CashOnDelivery(FormView):
    model = Order
    form_class = PaymentForm
    template_name = 'orders/payment_method.html'
    success_url = '/checkout/final'

My orders/forms.py:

class PaymentForm(forms.ModelForm):
    class Meta:
        model = Order
        fields = [
            'paymethod'
        ]

My carts/checkout.html:

{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% block content %}

<form method='POST' action="{% url 'checkout_final' %}">{% csrf_token %}
 <!--<input type='hidden' name='payment_token' value='ABC' />-->
<!--if method selected then cod should not display-->

    {{ paymentform|crispy }}


 <p><b><button type='submit'>Complete Order</button></b>
    </p>

    </form>
{% endblock %}.

Finally my complete traceback:

> Traceback:
> File "C:\Users\Shazia\dd\lib\site-packages\django\core\handlers\base.py" in get_response
>   132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\views\generic\base.py" in view
>   71.             return self.dispatch(request, *args, **kwargs)
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27.             user_checkout = UserCheckout.objects.get(user=request.user)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\manager.py" in manager_method
>   127.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in get
>   325.         clone = self.filter(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in filter
>   679.         return self._filter_or_exclude(False, *args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
>   697.             clone.query.add_q(Q(*args, **kwargs))
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in add_q
>   1310.         clause, require_inner = self._add_q(where_part, self.used_aliases)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in _add_q
>   1338.                     allow_joins=allow_joins, split_subq=split_subq,
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in build_filter
>   1200.                                                     lookups, value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\related.py" in get_lookup_constraint
>   1745.                     lookup_class(target.get_col(alias, source), val), AND)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in __init__
>   101.         self.rhs = self.get_prep_lookup()
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
>   139.         return self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_lookup
>   727.             return self.get_prep_value(value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
>   985.         return int(value)
>
> Exception Type: TypeError at /orders/4/
> Exception Value: int() argument must be a string or a number, not 'SimpleLazyObject'

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



--
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology Association: http://www.lita.org

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

Re: Error: int() argument must be a string or a number, not 'SimpleLazyObject'

I think the key line of the traceback is this - 
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27.             user_checkout = UserCheckout.objects.get(user=request.user)

And the error is being thrown during your redirect to /orders/4/ at the end of the post. What does your orders/views.py look like around line 27?

Unrelated to this error, but I'm also wondering what happens in CheckoutFinalView if the paymethod is CashOnDelivery or CreditCard - neither of those branches of your if statement actually return any sort of http response.

On Wed, Aug 31, 2016 at 7:27 AM, Shazia Nusrat <shazianusra@gmail.com> wrote:
Hi I am having this error while I am trying to delete session and cart by IDs after order fulfillment.

carts/views.py

class CheckoutFinalView(CartOrderMixin, View):
    def post(self, request, *args, **kwargs):
        order = self.get_order()
        order_id = order.id
        print order_id

        pay_method = request.POST.get("paymethod")
        print pay_method
        order.save()

        if request.POST.get('paymethod') == "CashOnDelivery":
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session["cart_id"]
            del request.session["order_id"]
        elif request.POST.get("paymethod") == 'CreditCard':
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session['order_id']
            del request.session['cart_id']
        else:
            return redirect("order_detail", pk=order.pk)

In my orders/models.py:

order_id = models.CharField(max_length=20, null=True, blank=True)
    paymethod = models.CharField(max_length=16, choices=CHOICES, default='CashOnDelivery')


My orders/views.py:

class CashOnDelivery(FormView):
    model = Order
    form_class = PaymentForm
    template_name = 'orders/payment_method.html'
    success_url = '/checkout/final'

My orders/forms.py:

class PaymentForm(forms.ModelForm):
    class Meta:
        model = Order
        fields = [
            'paymethod'
        ]

My carts/checkout.html:

{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% block content %}

<form method='POST' action="{% url 'checkout_final' %}">{% csrf_token %}
 <!--<input type='hidden' name='payment_token' value='ABC' />-->
<!--if method selected then cod should not display-->

    {{ paymentform|crispy }}


 <p><b><button type='submit'>Complete Order</button></b>
    </p>

    </form>
{% endblock %}.

Finally my complete traceback:

> Traceback:
> File "C:\Users\Shazia\dd\lib\site-packages\django\core\handlers\base.py" in get_response
>   132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\views\generic\base.py" in view
>   71.             return self.dispatch(request, *args, **kwargs)
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27.             user_checkout = UserCheckout.objects.get(user=request.user)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\manager.py" in manager_method
>   127.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in get
>   325.         clone = self.filter(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in filter
>   679.         return self._filter_or_exclude(False, *args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
>   697.             clone.query.add_q(Q(*args, **kwargs))
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in add_q
>   1310.         clause, require_inner = self._add_q(where_part, self.used_aliases)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in _add_q
>   1338.                     allow_joins=allow_joins, split_subq=split_subq,
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in build_filter
>   1200.                                                     lookups, value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\related.py" in get_lookup_constraint
>   1745.                     lookup_class(target.get_col(alias, source), val), AND)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in __init__
>   101.         self.rhs = self.get_prep_lookup()
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
>   139.         return self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_lookup
>   727.             return self.get_prep_value(value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
>   985.         return int(value)
>
> Exception Type: TypeError at /orders/4/
> Exception Value: int() argument must be a string or a number, not 'SimpleLazyObject'

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



--
Andromeda Yelton
Vice President/President-Elect, Library & Information Technology Association: http://www.lita.org

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

Getting Start Django

Hello guys,
    I am newbie in Django and started learning with Standard Documentation version: 1.10.
I
already Install
Django 1.10 and Python 3.4 in Linux Ubuntu 15.04  But in first phage I got some problem
I type command

django-admin startproject mysite
error:
Cannot find installed version of python-django or python3-django
Need some help to get out.
Stay strong
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2fc42b55-e9da-46cc-8762-06265deb6b43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Error: int() argument must be a string or a number, not 'SimpleLazyObject'

Hi I am having this error while I am trying to delete session and cart by IDs after order fulfillment.

carts/views.py

class CheckoutFinalView(CartOrderMixin, View):
    def post(self, request, *args, **kwargs):
        order = self.get_order()
        order_id = order.id
        print order_id

        pay_method = request.POST.get("paymethod")
        print pay_method
        order.save()

        if request.POST.get('paymethod') == "CashOnDelivery":
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session["cart_id"]
            del request.session["order_id"]
        elif request.POST.get("paymethod") == 'CreditCard':
            order.mark_completed(order_id)
            messages.success(request, "Thank you for your order")
            del request.session['order_id']
            del request.session['cart_id']
        else:
            return redirect("order_detail", pk=order.pk)

In my orders/models.py:

order_id = models.CharField(max_length=20, null=True, blank=True)
    paymethod = models.CharField(max_length=16, choices=CHOICES, default='CashOnDelivery')


My orders/views.py:

class CashOnDelivery(FormView):
    model = Order
    form_class = PaymentForm
    template_name = 'orders/payment_method.html'
    success_url = '/checkout/final'

My orders/forms.py:

class PaymentForm(forms.ModelForm):
    class Meta:
        model = Order
        fields = [
            'paymethod'
        ]

My carts/checkout.html:

{% extends 'base.html' %}
{% load crispy_forms_tags %}
{% block content %}

<form method='POST' action="{% url 'checkout_final' %}">{% csrf_token %}
 <!--<input type='hidden' name='payment_token' value='ABC' />-->
<!--if method selected then cod should not display-->

    {{ paymentform|crispy }}


 <p><b><button type='submit'>Complete Order</button></b>
    </p>

    </form>
{% endblock %}.

Finally my complete traceback:

> Traceback:
> File "C:\Users\Shazia\dd\lib\site-packages\django\core\handlers\base.py" in get_response
>   132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\views\generic\base.py" in view
>   71.             return self.dispatch(request, *args, **kwargs)
> File "C:\Users\Shazia\dd\src\orders\views.py" in dispatch
>   27.             user_checkout = UserCheckout.objects.get(user=request.user)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\manager.py" in manager_method
>   127.                 return getattr(self.get_queryset(), name)(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in get
>   325.         clone = self.filter(*args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in filter
>   679.         return self._filter_or_exclude(False, *args, **kwargs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\query.py" in _filter_or_exclude
>   697.             clone.query.add_q(Q(*args, **kwargs))
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in add_q
>   1310.         clause, require_inner = self._add_q(where_part, self.used_aliases)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in _add_q
>   1338.                     allow_joins=allow_joins, split_subq=split_subq,
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\sql\query.py" in build_filter
>   1200.                                                     lookups, value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\related.py" in get_lookup_constraint
>   1745.                     lookup_class(target.get_col(alias, source), val), AND)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in __init__
>   101.         self.rhs = self.get_prep_lookup()
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\lookups.py" in get_prep_lookup
>   139.         return self.lhs.output_field.get_prep_lookup(self.lookup_name, self.rhs)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_lookup
>   727.             return self.get_prep_value(value)
> File "C:\Users\Shazia\dd\lib\site-packages\django\db\models\fields\__init__.py" in get_prep_value
>   985.         return int(value)
>
> Exception Type: TypeError at /orders/4/
> Exception Value: int() argument must be a string or a number, not 'SimpleLazyObject'

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

Re: get_available_name() got an unexpected keyword argument 'max_length'

I thought that I've checked all my dependecies, and effectively I forget to update one of them. Now it's working, thank you very much.

El martes, 30 de agosto de 2016, 18:45:23 (UTC+2), Tim Graham escribió:
You need to update your own code or one of your dependencies as per https://docs.djangoproject.com/en/stable/releases/1.8/#support-for-the-max-length-argument-on-custom-storage-classes.

If you follow https://docs.djangoproject.com/en/stable/howto/upgrade-version/ with an older version of Django (1.8 or 1.9), you should see a helpful deprecation warning.

On Tuesday, August 30, 2016 at 9:39:46 AM UTC-4, manolo gomez wrote:
Hi,
   
   I've updated from django 1.8 to 1.10, and now when save a ImageFile I'm getting the next error:
  
   get_available_name() got an unexpected keyword argument 'max_length'

  
This is the end of the Traceback:
File "/home/dev/Documents/web/children/views/views.py" in post
  73.                     ob.avatar.save(t[0], t[1])     File "/home/securekids/Documents/enviroments/dev/local/lib/python2.7/site-packages/django/db/models/fields/files.py" in save    91.         self.name = self.storage.save(name, content, max_length=self.field.max_length)    File "/home/securekids/Documents/enviroments/dev/local/lib/python2.7/site-packages/django/core/files/storage.py" in save
53. name = self.get_available_name(name, max_length=max_length)

  I've tried to remove  "max_length=max_length", and then it's working fine, but I don't like so much to touch the django core :)
  
   Anyone can 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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3f3ec039-3feb-4b58-b597-b56c84634624%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cache.get_or_set : function name is misleading

Hi,

I wanted to refactor my code using cache.get_or_set instead of using
cache.get and then check for None and so on

However, after a few tests, it seems that get_or_set does not work as
its name suggests: it is more get_or_add than get_or_set

Looking at the source code, it indeed does a get, then a add, not a set.

To my mind, the function name is misleading, even if after a careful
reading of the doc, it explains that the value is added (not set) if not
in the cache.

I haven't found anything about this, so i may be the only one astonished
by the difference between function name and function main behaviour.
However, i think it's useful to live a comment about this for other devs.

Cheers

Florian

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

Re: A tricky query in one to many relationship - atleast for me:)

Hi Michal,

Thanks for the solution. I tried the solution in a different way:

A.objects.annotate( max_date_created=Max('b__date_created')).filter(b__date_created=F('max_date_created'), b__text='ABCD') 

Hope the above amounts to the same thing as you have suggested.

Thanks.
    

On Wednesday, August 31, 2016 at 1:48:38 PM UTC+5:30, Michal Petrucha wrote:
On Tue, Aug 30, 2016 at 11:46:14PM -0700, Web Architect wrote:
> Hi Erik,
>
> I tried your solution but there are some issues:
>
> .filter(date_created=Max('a__b__date_created'))  - this is throwing error
> saying not proper use of group function.
>
> If I remove the above, the result isn't correct where when I go through
> each 'a' in the result, associated latest B.text isn't always 'ABCD' - if
> there are multiple instances of B associated with an instance of A and one
> of the instances of B has text='ABCD' (might not be the latest
> date_created), that instance of B is also there in the query result.

Hmm, I haven't actually tried to run any code, but I'd try reordering
some of the method calls, and using an explcit field alias for the
annotation, which should let you then use an F() expression in
subsequent filters; something like this:

A.objects.filter(
    b__in=B.objects
        .annotate(max_date_created=Max('a__b__date_created'))
        .filter(date_created=F('max_date_created'), text='ABCD')
)

Good luck,

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/88d20adc-6375-425c-88a5-870d0244471f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: A tricky query in one to many relationship - atleast for me:)

On Tue, Aug 30, 2016 at 11:46:14PM -0700, Web Architect wrote:
> Hi Erik,
>
> I tried your solution but there are some issues:
>
> .filter(date_created=Max('a__b__date_created')) - this is throwing error
> saying not proper use of group function.
>
> If I remove the above, the result isn't correct where when I go through
> each 'a' in the result, associated latest B.text isn't always 'ABCD' - if
> there are multiple instances of B associated with an instance of A and one
> of the instances of B has text='ABCD' (might not be the latest
> date_created), that instance of B is also there in the query result.

Hmm, I haven't actually tried to run any code, but I'd try reordering
some of the method calls, and using an explcit field alias for the
annotation, which should let you then use an F() expression in
subsequent filters; something like this:

A.objects.filter(
b__in=B.objects
.annotate(max_date_created=Max('a__b__date_created'))
.filter(date_created=F('max_date_created'), text='ABCD')
)

Good luck,

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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20160831081747.GF6601%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

Tuesday, August 30, 2016

Re: A tricky query in one to many relationship - atleast for me:)

Hi Erik,

I tried your solution but there are some issues:

.filter(date_created=Max('a__b__date_created'))  - this is throwing error saying not proper use of group function.

If I remove the above, the result isn't correct where when I go through each 'a' in the result, associated latest B.text isn't always 'ABCD' - if there are multiple instances of B associated with an instance of A and one of the instances of B has text='ABCD' (might not be the latest date_created), that instance of B is also there in the query result.

Thanks.

On Tuesday, August 30, 2016 at 3:59:20 PM UTC+5:30, Erik Cederstrand wrote:

> Den 30. aug. 2016 kl. 11.20 skrev Erik Cederstrand <erik+...@cederstrand.dk>:
>
> I'm not even sure that's possible to express in SQL, but it would probably be quite convoluted if it is. Here's an easier-to-understand solution:
>
> res = set()
> for b in B.objects.all().select_related('a').annotate(Max('date_created')):
>    if b.date_created != b.date_created__max:
>        continue
>    if b.text != 'ABCD':
>        continue
>    res.add(a)

I did some more experimenting. I think this actually does what you want:

res = [
    b.a for b in B.objects
    .filter(date_created=Max('a__b__date_created'))
    .annotate(Max('a__b__date_created'))
    .filter(text='ABCD')
    .select_related('a')
]

which you can rewrite as:

A.objects.filter(
    b__in=B.objects
        .filter(date_created=Max('a__b__date_created'))
        .annotate(Max('a__b__date_created'))
        .filter(text='ABCD')
)

Erik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/13a40885-4cce-46af-ba50-368942608c37%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: ti possible CommaSeparatedIpField

Hello,

although it is possible, I'd go with an IP field and generate a list of them, comma separated, at run time. This will make it easier to search and manage the list.

Best,

Gergely


On Wed, Aug 31, 2016, 00:29 Jorge Cadena <jorge.cadena@gmail.com> wrote:
Hi

I have a idea CommaSeparatedIpField, it possible ?

this for validacion IP ACL list in FreeSWITCH.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d5d8359-ce30-41c8-8d88-2733b32ad76d%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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBUJvNiyC7QZ1NFjYkx97i1tB7%3D7QKGwu49PVsfaWr%2BZg7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django template iterating through two dictionaries/variables

This is why i ask this group.

Everyone helped out, but  Nate's link pushed me in the right direction.

Sometimes I don't even know what to ask stack overflow, but the google group always helps out.

Thanks

On Tuesday, August 30, 2016 at 11:28:37 AM UTC-5, Nate Granatir wrote:
You could also just join the dicts before passing them to the template. It looks like it's relatively straightforward (scores is just a list that contains dicts of a 'Number' and a 'score', right?) Then you could turn scores into a dict, assuming Numbers are unique:

scores_new = {score['Number']:score['score'] for score in scores}

And then update the persons dict to include the score:
for person in persons:
    person.update({'score': scores_new.get(person['Number'])})

Then in your persons list in the template you'll just need to display person.score.

If you want to get really fancy (if, say, there's more than just a score you need to pull from the dicts in scores) you can see how to merge two lists of dicts on a common key 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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/49018a13-680a-4b6d-8d1e-be5c5444c2d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django documentation release 1.10.1a1

On Tue, 30 Aug 2016, Tim Graham wrote:

> I don't think there have been any recent changes to the styling, but if
> you'd like to contribute, the place to look is probably
> https://github.com/django/django/tree/master/docs/_theme.

Tim,

I don't know what to do once I'm on that page but when time permits I'll
look around and see if I can find the source. Wonder if it's written in
LaTeX; if so, the typefaces can easily be change.

Thanks,

Rich

Re: django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'treebeard.templatetags.admin_tree_list': cannot import name 'patterns'

On second thoughts I just tried django 1.9.9 and it worked like a charm.
Good luck with the 1.10 porting everyone!


On Tuesday, 30 August 2016 21:22:19 UTC+1, Richard C wrote:
Hi,

I'm pretty new to this and (probably naively) trying to get django-shop working with django 1.10.
I have run into a few libraries that needed patterns() removing which I've done and raised issues with the appropriate owners, but now have run into this:

django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'treebeard.templatetags.admin_tree_list': cannot import name 'patterns'


I've been through treebeard and the django backend but can't seem to find any reference to patterns. What am I doing wrong?

Thanks in advance for the clues!

pip freeze:
 beautifulsoup4==4.5.1
defusedxml==0.4.1
Django==1.10
django-admin-sortable2==0.6.4
django-allauth==0.27.0
django-angular==0.8.4
django-appconf==1.0.2
django-classy-tags==0.8.0
django-cms==3.3.2
django-compressor==2.1
django-filer==1.2.4
django-filter==0.14.0
django-formtools==1.0
django-fsm==2.4.0
django-fsm-admin==1.2.3
django-haystack==2.5.dev1
django-ipware==1.1.5
django-mptt==0.8.6
django-parler==1.6.5
django-polymorphic==1.0b1
django-post-office==2.0.8
django-rest-auth==0.8.1
django-sass-processor==0.4.6
django-sekizai==0.10.0
Django-Select2==5.8.9
-e git+https://github.com/awesto/django-shop@c8b7f1fe0db4aa0e16c39e0ceff736a964fa7a3a#egg=django_shop
django-treebeard==4.0.1
djangocms-admin-style==1.2.3
djangocms-bootstrap3==0.1.1
djangocms-cascade==0.9.2
djangocms-text-ckeditor==3.2.0rc3
djangorestframework==3.4.6
djangoshop-stripe==0.1.4
drf-haystack==1.5.6
easy-thumbnails==2.3
elasticsearch==2.4.0
html5lib==0.999999
jsonfield==1.0.3
libsass==0.11.1
oauthlib==1.1.2
Pillow==3.3.1
pluggy==0.3.1
py==1.4.31
Pygments==2.1.3
python-dateutil==2.5.3
python-openid==2.2.5
python3-openid==3.0.10
pytz==2016.6.1
rcssmin==1.0.6
requests==2.11.1
requests-oauthlib==0.6.2
rjsmin==1.0.12
six==1.10.0
stripe==1.37.0
Unidecode==0.4.19
urllib3==1.16
webencodings==0.5

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

ti possible CommaSeparatedIpField

Hi

I have a idea CommaSeparatedIpField, it possible ?

this for validacion IP ACL list in FreeSWITCH.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9d5d8359-ce30-41c8-8d88-2733b32ad76d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

How to create a database for my website in Django

I have little knowledge when it comes to the creation of databases. I would like to know if someone can help me set a database for my website step by step since I have a deadline due to next month to finish a project that requires that kind of knowledge. The idea is to input information on the website and save them into an internal database. I already have MySql and Sequel Pro installed but don't know how to link them to my website.

I appreciate 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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/500d5d57-6c92-4f3e-947d-cfb5d74092d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Django documentation release 1.10.1a1

I don't know how this PDF displays in other viewers, but in xpdf, mupdf,
and acroread important strings in the text are very difficult to read
because they have very low contrast with the white background.

For example, comments are in a light grey and important strings are in a
very pale yellow. Page 14 has many examples of this.

Perhaps for very young eyeballs it's not an issue, but for those of us
with many miles on our eyes it's extremely hard to read this light text on
the white background.

It would be very helpful if this situation was quickly remedied and a
revised version released.

Thanks in advance,

Rich

Re: error in installing django[argon2] -regarding

argon2 required lidfi 

in ubuntu install manuall 

$ sudo apt-get install libffi5 libffi-dev

2016-08-28 13:43 GMT-03:00 sabari rangan <sabari.rangan11@gmail.com>:
Collecting argon2-cffi>=16.1.0; extra == "argon2" (from django[argon2])
  Downloading argon2_cffi-16.1.0.tar.gz (1.2MB)
    Complete output from command python setup.py egg_info:
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    Package libffi was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libffi.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'libffi' found
    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
    compilation terminated.
    Traceback (most recent call last):
      File "/usr/lib/python3.5/distutils/unixccompiler.py", line 118, in _compile
        extra_postargs)
      File "/usr/lib/python3.5/distutils/ccompiler.py", line 909, in spawn
        spawn(cmd, dry_run=self.dry_run)
      File "/usr/lib/python3.5/distutils/spawn.py", line 36, in spawn
        _spawn_posix(cmd, search_path, dry_run=dry_run)
      File "/usr/lib/python3.5/distutils/spawn.py", line 159, in _spawn_posix
        % (cmd, exit_status))
    distutils.errors.DistutilsExecError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 161, in run
        cmd = self.call_command('install_lib', warn_dir=0)
      File "/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py", line 147, in call_command
        self.run_command(cmdname)
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/install_lib.py", line 23, in run
        self.build()
      File "/usr/lib/python3.5/distutils/command/install_lib.py", line 109, in build
        self.run_command('build_ext')
      File "/usr/lib/python3.5/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python3.5/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 49, in run
        _build_ext.run(self)
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 338, in run
        self.build_extensions()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 447, in build_extensions
        self._build_extensions_serial()
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 472, in _build_extensions_serial
        self.build_extension(ext)
      File "/usr/lib/python3/dist-packages/setuptools/command/build_ext.py", line 174, in build_extension
        _build_ext.build_extension(self, ext)
      File "/usr/lib/python3.5/distutils/command/build_ext.py", line 532, in build_extension
        depends=ext.depends)
      File "/usr/lib/python3.5/distutils/ccompiler.py", line 574, in compile
        self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
      File "/usr/lib/python3.5/distutils/unixccompiler.py", line 120, in _compile
        raise CompileError(msg)
    distutils.errors.CompileError: command 'x86_64-linux-gnu-gcc' failed with exit status 1
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-epo8th_s/cffi-1.7.0/setup.py", line 192, in <module>
      File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1087, in run_setup
        run_setup(setup_script, args)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 246, in run_setup
        raise
      File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3.5/contextlib.py", line 77, in __exit__
        self.gen.throw(type, value, traceback)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 166, in save_modules
        saved_exc.resume()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 141, in resume
        six.reraise(type, exc, self._tb)
      File "/usr/lib/python3/dist-packages/pkg_resources/_vendor/six.py", line 685, in reraise
        raise value.with_traceback(tb)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 154, in save_modules
        yield saved
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 195, in setup_context
        yield
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 243, in run_setup
        DirectorySandbox(setup_dir).run(runner)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 273, in run
        return func()
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 242, in runner
        _execfile(setup_script, ns)
      File "/usr/lib/python3/dist-packages/setuptools/sandbox.py", line 46, in _execfile
        exec(code, globals, locals)
      File "/tmp/easy_install-epo8th_s/cffi-1.7.0/setup.py", line 192, in <module>
      File "/usr/lib/python3.5/distutils/core.py", line 163, in setup
        raise SystemExit("error: " + str(msg))
    SystemExit: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
   
    During handling of the above exception, another exception occurred:
   
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-vuihdm69/argon2-cffi/setup.py", line 160, in <module>
        extras_require=EXTRAS_REQUIRE,
      File "/usr/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 269, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 313, in fetch_build_eggs
        replace_conflicting=True,
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 826, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1092, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1104, in obtain
        return installer(requirement)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 380, in fetch_build_egg
        return cmd.easy_install(req)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 663, in easy_install
        return self.install_item(spec, dist.location, tmpdir, deps)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 693, in install_item
        dists = self.install_eggs(spec, download, tmpdir)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 873, in install_eggs
        return self.build_and_install(setup_script, setup_base)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1101, in build_and_install
        self.run_setup(setup_script, setup_base, args)
      File "/usr/lib/python3/dist-packages/setuptools/command/easy_install.py", line 1089, in run_setup
        raise DistutilsError("Setup script exited with %s" % (v.args[0],))
    distutils.errors.DistutilsError: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
   
    ----------------------------------------

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



--

Ricardo Daniel Quiroga

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