Re: Debugging DJango app on production for High CPU Usage

2016-02-29 Thread Web Architect
The load is low - around 4-5 rps. I don't think that should effect the CPU 
usage so much.



On Friday, February 26, 2016 at 9:57:42 PM UTC+5:30, Nikolas 
Stevenson-Molnar wrote:
>
> What sort of load are you experiencing in production? Is it possible that 
> you're simply running into a hardware limitation and need to scale?
>
> On Thursday, February 25, 2016 at 9:29:22 PM UTC-8, Web Architect wrote:
>>
>> Hi Nikolas,
>>
>> Cache backend is Redis. The CPU usage is directly proportional to the 
>> load (increases with the increase in load). Memory usage seems to be fine.
>>
>> Thanks.
>>
>> On Friday, February 26, 2016 at 3:32:23 AM UTC+5:30, Nikolas 
>> Stevenson-Molnar wrote:
>>>
>>> Which cache backend are you using? Also, how's your memory usage? Do the 
>>> spikes in CPU correlate with load? I.e., does the CPU use increase/decrease 
>>> consistently with the number of users?
>>>
>>> On Wednesday, February 24, 2016 at 10:17:24 PM UTC-8, Web Architect 
>>> wrote:

 Hi Nikolas,

 I am new to uwsgi. Top is showing CPU consumption by uwsgi. Following 
 is my uwsgi configuration:

 master=True

 socket=:7090

 max-requests=5000

 processes = 4

 threads = 2

 enable-threads = true

 #harakiri = 30 (not sure if using this would be a good idea)

 stats = 127.0.0.1:9191

 HW is a dual core processor with CentOS 6 linux. I am not sure if there 
 is a better way to configure uwsgi. uwsgitop is showing only one worker 
 process being heavily used and that is the one spiking to 100% + cpu 
 usage. 

 Thanks.


 On Thursday, February 25, 2016 at 1:47:43 AM UTC+5:30, Nikolas 
 Stevenson-Molnar wrote:
>
> Just to be clear: is is the uwsgi process(es) consuming the CPU? I ask 
> because you mention DB queries, which wouldn't impact the CPU of uwsgi 
> (you'd see that reflected in the database process).
>
> On Tuesday, February 23, 2016 at 8:59:28 PM UTC-8, Web Architect wrote:
>>
>> Hi,
>>
>> We have an ecommerce platform based on Django. We are using uwsgi to 
>> run the app. The issue the CPU usage is hitting the roof (sometimes 
>> going 
>> beyond 100%) for some scenarios. I would like to debug the platform on 
>> Production to see where the CPU consumption is happening. We have used 
>> Cache all over the place (including templates) as well - hence, the DB 
>> queries would be quite limited. 
>>
>> I would refrain from using Django-debug toolbar as it slows down the 
>> platform further, increases the CPU usage and also need to turn the 
>> DEBUG 
>> on. Is there any other tool or way to debug the platform? Would 
>> appreciate 
>> any recommendations/suggestions. 
>>
>> Also, does the Django ORM increase the CPU usage? Does it block the 
>> CPU? Would appreciate if anyone could throw some light on this.
>>
>> 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/5f751bd7-a679-4ab8-b4a8-0ec9f503259a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner question -- recipes

2016-02-29 Thread James Schneider
On Sun, Feb 28, 2016 at 11:45 PM, Rahul Gandhi 
wrote:

> I might be wrong here, but this is what I understand:
>
> Let's say you have something like this:
>
>
> class Recipe(models.Model):
> name = models.CharField(max_length=255)
> description = models.TextField()
>
>
> class Step(models.Model):
> step_number = models.IntegerField()
> description = models.TextField()
> recipe = models.ForeignKey(Recipe)
>
>
> now, if I do the following in the shell:
>
> recipe = Recipe.objects.get(id=1)
> recipe.steps
>
> wouldn't this give an error?
>

> To get the step, I could do something like
> recipe.step_set
>
> but I don't think I'll be able to do recipe.steps
>
>
Given that model, you're right, sorry about that. My brain was moving
faster than my fingers. All of my mentions of recipe.steps were meant as a
reference to recipe.step_set. In my head I had already set the related_name
to 'steps', like so:

recipe = models.ForeignKey(Recipe, related_name='steps')

This way you can use recipe.steps rather than recipe.step_set. Both are
equivalent, but the custom related_name is easier to track for a human. The
relation does act like its own manager though, so you would actually have
to say recipe.steps.all() to get all of the steps (since a separate query
is used to pull all of the steps). The template code would also have to be
adjusted to include the .all (no parenthesis there). Also be sure to
determine whether or not you should use prefetch_related for your list
views (
https://docs.djangoproject.com/en/1.9/ref/models/querysets/#prefetch-related
).

However, this model does match what I assumed you had. I'm also assuming
that you have a M2M relationship with Ingredient with a custom 'through'
table so that you can match steps with ingredients and store other things
like measurements on that relation?

I would make a suggestion, though. Instead of using a 'step_number', you
should look at using django-ordered-model instead. It does a very good job
of keeping things, well, ordered. It also has other functionality like
performing a renumber automatically if you decide that step 2 should
actually be step 18 (and renumbers all of the other steps appropriately).
The 'order' that is uses is zero-based, but you can add a simple property
step_number that returns self.order + 1 (and sets the order correctly if
you are renumbering by step). You'll also need to implement their
'order_with_respect_to', probably point it at the recipe field.

https://github.com/bfirsh/django-ordered-model

-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%2BciUw-Yqv3cK-M_n%2B%2BqutU8BDzbbYGhqJYxS3M%3DmX%2BqKYwA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging DJango app on production for High CPU Usage

2016-02-29 Thread James Schneider
On Tue, Feb 23, 2016 at 8:59 PM, Web Architect  wrote:

> Hi,
>
> We have an ecommerce platform based on Django. We are using uwsgi to run
> the app. The issue the CPU usage is hitting the roof (sometimes going
> beyond 100%) for some scenarios. I would like to debug the platform on
> Production to see where the CPU consumption is happening. We have used
> Cache all over the place (including templates) as well - hence, the DB
> queries would be quite limited.
>

Have you validated that your cache is actually being used, and not just
populated? I've seen that before.



> I would refrain from using Django-debug toolbar as it slows down the
> platform further, increases the CPU usage and also need to turn the DEBUG
> on. Is there any other tool or way to debug the platform? Would appreciate
> any recommendations/suggestions.
>


Have you looked into profiling the code or adding logging statements
throughout your code to determine when/where particular segments are being
run? I would definitely start with logging. I'm assuming you have
suspicions on where your pain points might be:

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

I would put them in places that may be part of large loops (in terms of
number of objects queried or depth of relationships traversed), or
sprinkled within complex views. You have to start narrowing down which
page/pages are causing your angst.


Also, does the Django ORM increase the CPU usage? Does it block the CPU?
> Would appreciate if anyone could throw some light on this.
>

I'm not sure about blocking, but if deployed correctly, the ORM should have
a negligible (and acceptable) hit to the CPU in most cases, if you notice
one at all. I've seen spikes from bad M2M relationships where
prefetch_related() was needed (>200 queries down to 3 with
prefetch_related, and ~1-2s total response down to <80ms if I recall
correctly). The most common case I run into is as part of nested {% for %}
loops within a template that dig down through relationships.

I would also consider increasing the logging levels of your cache and DB to
see if you are getting repetitive queries. The ORM does cause those from
time to time since it has non-intuitive behavior in some edge cases. You
can try that during low activity periods to keep the extra logging from
overwhelming the system. Sometimes you can still catch the issue with a
single end-user for something like repetitive/multiple queries, and are
actually much easier to diagnose on a low usage server.

Do you have any other jobs that run against the system (session cleanup,
expired inventory removal, mass mailing, etc.)? Would it be possible for
those to be the culprit?

Have you figured out any reproducible trigger?

-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%2BciW9v%2BK-mbu_%3DeeLT5gT59AxkNrz9Xb4uKO6iBsgoAPqsA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Debugging DJango app on production for High CPU Usage

2016-02-29 Thread Sithembewena Lloyd Dube
New Relic.

On Wed, Feb 24, 2016 at 6:59 AM, Web Architect  wrote:

> Hi,
>
> We have an ecommerce platform based on Django. We are using uwsgi to run
> the app. The issue the CPU usage is hitting the roof (sometimes going
> beyond 100%) for some scenarios. I would like to debug the platform on
> Production to see where the CPU consumption is happening. We have used
> Cache all over the place (including templates) as well - hence, the DB
> queries would be quite limited.
>
> I would refrain from using Django-debug toolbar as it slows down the
> platform further, increases the CPU usage and also need to turn the DEBUG
> on. Is there any other tool or way to debug the platform? Would appreciate
> any recommendations/suggestions.
>
> Also, does the Django ORM increase the CPU usage? Does it block the CPU?
> Would appreciate if anyone could throw some light on this.
>
> 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/c2699791-6de9-4b94-975b-fd1d4f8bbd3c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Sithembewena

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


Re: Absolute beginner question -- recipes

2016-02-29 Thread Simon Gunacker
Hey everybody,

thank you very much for your answers. I think I have already learned a lot 
from you! Well - there is quite a difference between stepping through a 
tutorial and trying to do something on my own. Regarding Mikes question 
whether a step of a recipe should be a sub-recipe. Well, as far as I know 
hierarchical relationships are hard to model in relational databases; 
that's why I kept my hands off! My decision to create a recipe app has a 
simple reason: I read some comparisons between django and ruby on rails and 
I decided to go for django since it seems to leave more freedom. I found a 
RoR tutorial on creating a recipe app some time ago and I am trying to do 
the same thing in django now. 

Concerning my model - this is how it looks like:

from __future__ import unicode_literals

from django.db import models

class Unit(models.Model):
abbreveation = models.CharField(max_length=5, primary_key=True)
description = models.CharField(max_length=50)

def __str__(self):
return "%s (%s)" % (self.description, self.abbreveation)

class Ingredient(models.Model):
name = models.CharField(max_length=255)

def __str__(self):
return self.name

class Step(models.Model):
name = models.CharField(max_length=255, blank=True)
recipe = models.ForeignKey('Recipe', related_name='steps', on_delete=
models.CASCADE, null=True)
description = models.TextField()
ingredient = models.ManyToManyField(Ingredient, through='StepIngredient'
)

def __str__(self):
if (self.name == ''):
return "Step %d" % self.id
else:
return "Step %d (%s)" % (self.id, self.name)

# additional information for many to many relationship between schritt and 
zutat
class StepIngredient(models.Model):
class Meta:
unique_together = (('step', 'ingredient'),)
step = models.ForeignKey(Step, null=True)
ingredient = models.ForeignKey(Ingredient, null=True)
amount = models.DecimalField(max_digits=7, decimal_places=3)
unit = models.ForeignKey(Unit, null=True)

def __str__(self):
return "%d %s %s" % (self.amount, self.unit.abbreveation, self.
ingredient)

class Recipe(models.Model):
name = models.CharField(max_length=255)

# file will be uploaded to MEDIA_ROOT/images
# TODO: Upload works but link fails. Maybe sth. wrong with MEDIA_URL???
photo = models.ImageField(upload_to='images/', null=True)
portionen = models.IntegerField(default=2)

def __str__(self):
return self.name

Thank you James for pointing me at how to do my queries with django; I can 
finally list my steps using:

{% for step in recipe.steps.all %}

within my template. However, given the model above I am still not sure how 
to access a single steps ingredients ... any ideas or suggestions on my 
current model?

Thanks, Simon



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


Re: Debugging DJango app on production for High CPU Usage

2016-02-29 Thread Gabriel - Iulian Dumbrava
Hi!

I have seen such a behavior on a couple of sites running an older version 
of Zinnia. It simply hit the 100% CPU usage on some queries.
I would also suggest integrating New Relic. It gives you a pretty detailed 
information on where the CPU is spending most of the time.

miercuri, 24 februarie 2016, 06:59:28 UTC+2, Web Architect a scris:
>
> Hi,
>
> We have an ecommerce platform based on Django. We are using uwsgi to run 
> the app. The issue the CPU usage is hitting the roof (sometimes going 
> beyond 100%) for some scenarios. I would like to debug the platform on 
> Production to see where the CPU consumption is happening. We have used 
> Cache all over the place (including templates) as well - hence, the DB 
> queries would be quite limited. 
>
> I would refrain from using Django-debug toolbar as it slows down the 
> platform further, increases the CPU usage and also need to turn the DEBUG 
> on. Is there any other tool or way to debug the platform? Would appreciate 
> any recommendations/suggestions. 
>
> Also, does the Django ORM increase the CPU usage? Does it block the CPU? 
> Would appreciate if anyone could throw some light on this.
>
> 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/13d4f568-2b1c-44a4-90c1-219a21bb66c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner question -- recipes

2016-02-29 Thread James Schneider
> Thank you James for pointing me at how to do my queries with django; I
can finally list my steps using:
>
> {% for step in recipe.steps.all %}
>
> within my template. However, given the model above I am still not sure
how to access a single steps ingredients ... any ideas or suggestions on my
current model?

Sure, just have another nested {% for ingredient in step.ingredients.all %}

You should also change the 'ingredient' field to 'ingredients' in your Step
model (reflected in my loop above). Makes it easier to read and indicate
that you'll need the .all in the template (or elsewhere) if the attribute
name is plural. Otherwise you are querying using step.ingredient, and
expecting a list of multiple ingredients back.

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


Re: Absolute beginner question -- recipes

2016-02-29 Thread Simon Gunacker
Ok ... but how can I access the additional information stored in 
StepIngredient then? 
And - to ask more general - is there a way to find all the "nested objects" 
attached to my current objects? Something to enter in the shell to see 
__all__ attributes; not just _meta.fields?

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


Re: Absolute beginner question -- recipes

2016-02-29 Thread Mike Dewhirst

On 29/02/2016 8:54 PM, Simon Gunacker wrote:

Well, as far as I know hierarchical relationships are hard to model in
relational databases;


Definitely incorrect. Hierarchical is merely a subset of relational. 
Relational can handle hierarchical 1:n:m very easily plus n:1, n:m as well.


Relational databases are the most widely used today because they can 
solve most real world modelling.


On that topic you should try to ignore database design initially and 
instead try to understand the real world relationships between your data 
types. Only then should you model the solution you need to provide.


I would be surprised if you couldn't solve most real world design 
problems with 1:1, 1:n, n:1 and n:m relationships.


The closer your schema is to the real world, the easier it will be to 
represent it in a relational (ie Django ORM) database. I believe best 
practice is to ignore shortcuts aimed at performance initially and make 
your design perfectly represent the real world. Only when it displays 
performance problems not fixable with caching should you try and 
introduce corner cutting in your design.




Mike


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


Re: Absolute beginner question -- recipes

2016-02-29 Thread Simon Gunacker
@Mike: the attempts (at least the ones I have seen) to store hierarchical 
data in relations [1] don't seem very intuitive to me. At least when it 
comes to query the data. Anyway: I would appreciate to be convinced by 
something else. However, I am afraid to kick off a completely different 
(yet interesting) discussion here. My current issue is how to access the 
additional fields of my M2M relationship. In addition to that I will think 
about hierarchical data in relational databases ;-)

Thanks, Simon

--

http://www.slideshare.net/billkarwin/models-for-hierarchical-data

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


Re: Absolute beginner question -- recipes

2016-02-29 Thread Florian Schweikert
On 28/02/16 20:14, Simon Gunacker wrote:
> |
> def detail(request, pk):
> recipe = Recipe.objects.get(id=pk)
> recipe['steps'] = Steps.objects.filter(recipe_id=pk)
> template = loader.get_template('recipe/recipe_detail.html')
> context = {
> 'recipe': recipe,
> }
> return HttpResponse(template.render(context,request))
> |

OT:
Have a look at the render shortcut:
https://docs.djangoproject.com/en/1.9/topics/http/shortcuts/#render

| return render(request, 'recipe/recipe_detail.html', context)

Maybe you can simply use a generic DetailView:
https://docs.djangoproject.com/es/1.9/ref/class-based-views/generic-display/#detailview

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


Translate permissions Django

2016-02-29 Thread Marcos Serrano
Hello,

How yo translate the default permissions django. Keywords (Add, Delete ... 
) 

http://stackoverflow.com/questions/29398900/django-permissions-and-contenttypes-translations

I tried to do something like this but it has not worked for me.

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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27e16901-8fb3-49fc-a803-449e490290c8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2016-02-29 Thread jorrit787
Did you add 'polls' to your list of INSTALLED_APPS in your settings.py? After 
that you should run > python manage.py migrate like the terminal is suggesting 
to 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/b4f497cd-4653-47ae-a935-33358b3a7569%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Absolute beginner question -- recipes

2016-02-29 Thread Simon Gunacker
Thank you Florian. After James pointed out that I can access my steps (and 
the ingredients in some way) by just passing the recipe object to the 
templates context, I thought of reducing the view to a DetailView again. 
But I have to somehow access the ingredients from my template for now ...

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


Re: empty request object

2016-02-29 Thread Larry Martell
So does anyone know why there would be a no user attr? I would expect this:

(Pdb) request.user


But I get this:

(Pdb) request.user
*** AttributeError: 'WSGIRequest' object has no attribute 'user'

On Sat, Feb 27, 2016 at 6:31 PM, Larry Martell  wrote:
> Yes, you are absolutely correct. Thanks for directing me away from
> that red herring. But it seems request.user no longer exists.
>
> There is code that does this:
>
> if request.user.is_authenticated():
>
> which throws:
>
> AttributeError: "'WSGIRequest' object has no attribute 'user'"
>
> On Sat, Feb 27, 2016 at 5:48 PM, knbk  wrote:
>> I was referring to the wrong release notes. The rights one can be found in
>> the 1.8 release notes in the miscellaneous section[1]:
>>
>>> HttpRequest now has a simplified repr (e.g. >> '/somepath/'>). This won’t change the behavior of
>>> theSafeExceptionReporterFilter class.
>>
>>
>> Printing the request in your debugger is nothing more than calling repr on
>> the request and displaying the result. The conclusion is the same: the
>> request is not empty, but the string representation of the request has
>> changed. This is unrelated to whatever issue you're facing.
>>
>> [1] https://docs.djangoproject.com/en/1.9/releases/1.8/#miscellaneous
>>
>> On Saturday, February 27, 2016 at 11:21:18 PM UTC+1, larry@gmail.com
>> wrote:
>>>
>>> On Sat, Feb 27, 2016 at 5:14 PM, knbk  wrote:
>>> > The `__repr__` method on HttpRequest was simplified in 1.9[1]. It is not
>>> > an
>>> > accurate description of what is actually contained in the request, and I
>>> > doubt it has anything to do with the actual issues you're facing.
>>> >
>>> > [1]
>>> >
>>> > https://docs.djangoproject.com/en/1.9/releases/1.9/#httprequest-details-in-error-reporting
>>>
>>> I am printing the request object from the debugger:
>>>
>>> (Pdb) request
>>> 
>>>
>>> This is not in the debug page. I'm pretty sure it's empty as when I
>>> call login(request) I get a blank page with a 200 back.
>>>
>>> >
>>> > On Saturday, February 27, 2016 at 11:09:28 PM UTC+1, larry@gmail.com
>>> > wrote:
>>> >>
>>> >> On Sat, Feb 27, 2016 at 5:02 PM, James Schneider
>>> >>  wrote:
>>> >> >
>>> >> > On Feb 27, 2016 1:55 PM, "Larry Martell"  wrote:
>>> >> >>
>>> >> >> Anyone have any insights on this? Is there anything special I need
>>> >> >> to
>>> >> >> do get the request structure? The way this 1.9 site is now, it
>>> >> >> doesn't
>>> >> >> work at all because the request structure is not getting passed in.
>>> >> >>
>>> >> >
>>> >> > I'd be most suspicious of middle ware not handling the request
>>> >> > correctly.
>>> >>
>>> >> I tried removing all the middleware, but I got the same result. This
>>> >> is the middleware that was in place:
>>> >>
>>> >> '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',
>>> >> 'django.middleware.security.SecurityMiddleware',
>>> >>
>>> >>
>>> >> > Have you tried moving to a fresh venv to ensure Django and other
>>> >> > packages
>>> >> > aren't damaged?
>>> >> >
>>> >> > Can you replicate the issue on a separate test server?
>>> >>
>>> >> No, I haven't tried either one yet. I guess I will have to do that,
>>> >> but I really would like to just get this setup working.

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


Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
Jorr,

No, I did not modify the settings.py file, because the tutorial 
specifically states: 

Note

Ignore the warning about unapplied database migrations for now; we’ll deal 
with the database shortly.


Here is a link to the tutorial: 
https://docs.djangoproject.com/en/1.9/intro/tutorial01/





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


Re: Translate permissions Django

2016-02-29 Thread Marcos Serrano





El lunes, 29 de febrero de 2016, 14:14:42 (UTC+1), Marcos Serrano escribió:
>
> Hello,
>
> How yo translate the default permissions django. Keywords (Add, Delete ... 
> ) 
>
>
> http://stackoverflow.com/questions/29398900/django-permissions-and-contenttypes-translations
>
> I tried to do something like this but it has not worked for me.
>
> 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+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/300eb70b-2965-4010-92ee-cc860856a5fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: empty request object

2016-02-29 Thread knbk
That would happen if the AuthenticationMiddleware hasn't run. In what 
context is request.user missing?

On Monday, February 29, 2016 at 3:54:24 PM UTC+1, larry@gmail.com wrote:
>
> So does anyone know why there would be a no user attr? I would expect 
> this: 
>
> (Pdb) request.user 
>  
>
> But I get this: 
>
> (Pdb) request.user 
> *** AttributeError: 'WSGIRequest' object has no attribute 'user' 
>
> On Sat, Feb 27, 2016 at 6:31 PM, Larry Martell  > wrote: 
> > Yes, you are absolutely correct. Thanks for directing me away from 
> > that red herring. But it seems request.user no longer exists. 
> > 
> > There is code that does this: 
> > 
> > if request.user.is_authenticated(): 
> > 
> > which throws: 
> > 
> > AttributeError: "'WSGIRequest' object has no attribute 'user'" 
> > 
> > On Sat, Feb 27, 2016 at 5:48 PM, knbk > 
> wrote: 
> >> I was referring to the wrong release notes. The rights one can be found 
> in 
> >> the 1.8 release notes in the miscellaneous section[1]: 
> >> 
> >>> HttpRequest now has a simplified repr (e.g.  >>> '/somepath/'>). This won’t change the behavior of 
> >>> theSafeExceptionReporterFilter class. 
> >> 
> >> 
> >> Printing the request in your debugger is nothing more than calling repr 
> on 
> >> the request and displaying the result. The conclusion is the same: the 
> >> request is not empty, but the string representation of the request has 
> >> changed. This is unrelated to whatever issue you're facing. 
> >> 
> >> [1] https://docs.djangoproject.com/en/1.9/releases/1.8/#miscellaneous 
> >> 
> >> On Saturday, February 27, 2016 at 11:21:18 PM UTC+1, 
> larry@gmail.com 
> >> wrote: 
> >>> 
> >>> On Sat, Feb 27, 2016 at 5:14 PM, knbk  wrote: 
> >>> > The `__repr__` method on HttpRequest was simplified in 1.9[1]. It is 
> not 
> >>> > an 
> >>> > accurate description of what is actually contained in the request, 
> and I 
> >>> > doubt it has anything to do with the actual issues you're facing. 
> >>> > 
> >>> > [1] 
> >>> > 
> >>> > 
> https://docs.djangoproject.com/en/1.9/releases/1.9/#httprequest-details-in-error-reporting
>  
> >>> 
> >>> I am printing the request object from the debugger: 
> >>> 
> >>> (Pdb) request 
> >>>  
> >>> 
> >>> This is not in the debug page. I'm pretty sure it's empty as when I 
> >>> call login(request) I get a blank page with a 200 back. 
> >>> 
> >>> > 
> >>> > On Saturday, February 27, 2016 at 11:09:28 PM UTC+1, 
> larry@gmail.com 
> >>> > wrote: 
> >>> >> 
> >>> >> On Sat, Feb 27, 2016 at 5:02 PM, James Schneider 
> >>> >>  wrote: 
> >>> >> > 
> >>> >> > On Feb 27, 2016 1:55 PM, "Larry Martell"  
> wrote: 
> >>> >> >> 
> >>> >> >> Anyone have any insights on this? Is there anything special I 
> need 
> >>> >> >> to 
> >>> >> >> do get the request structure? The way this 1.9 site is now, it 
> >>> >> >> doesn't 
> >>> >> >> work at all because the request structure is not getting passed 
> in. 
> >>> >> >> 
> >>> >> > 
> >>> >> > I'd be most suspicious of middle ware not handling the request 
> >>> >> > correctly. 
> >>> >> 
> >>> >> I tried removing all the middleware, but I got the same result. 
> This 
> >>> >> is the middleware that was in place: 
> >>> >> 
> >>> >> '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', 
> >>> >> 'django.middleware.security.SecurityMiddleware', 
> >>> >> 
> >>> >> 
> >>> >> > Have you tried moving to a fresh venv to ensure Django and other 
> >>> >> > packages 
> >>> >> > aren't damaged? 
> >>> >> > 
> >>> >> > Can you replicate the issue on a separate test server? 
> >>> >> 
> >>> >> No, I haven't tried either one yet. I guess I will have to do that, 
> >>> >> but I really would like to just get this setup working. 
>

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


Why not working ?

2016-02-29 Thread setivolkylany

my model
.

class Translator(models.Model):
"""
Model for dictionaries tranlations
"""

def dispatch_dictionary_media_files(instance, filename):
return 'app_dictionaries/{0}/{1}'.format(instance.name.__str__(), 
filename)

author = models.ForeignKey(settings.AUTH_USER_MODEL)
*name = models.CharField('Name of translator', max_length=50, 
unique=True)*
language_origin = models.CharField('Origin language', max_length=30, 
choices=LANGUAGES)
language_translation = models.CharField('Language of translation', 
max_length=30, choices=LANGUAGES)
picture = models.ImageField('Picture for translator', 
upload_to=dispatch_dictionary_media_files, blank=True, null=True)
description = models.TextField('Description of translator', null=True, 
blank=True)
*slug_name = models.SlugField('Name for link', unique=True)*
rating = models.DecimalField('Rating', max_digits=4, decimal_places=2, 
editable=False, default=0)
date_added = models.DateTimeField('Date added', auto_now_add=True)


my admin.py
--

class AdminTranslator(admin.ModelAdmin):
fieldsets = [
('Requred fields', {
'fields': ['name', 'author', ('slug_name', 
'language_translation')],
}),
('Not required fields', {
'classes': ('collapse',),
'fields': ['description', 'picture'],
'description': 'It is fields nor required. And you may skip 
it.',
}),
]
date_hierarchy = 'date_added'
actions_on_top = True
actions_on_bottom = True
empty_value_display = '-empty-'
  *  prepopulated_fields = {"slug_name": ("name",)}*

inlines = [AddTranslationInline]

# -
list_display = ['name', 'author', 'language_origin', 
'language_translation', 'rating', 'was_added_recently', 'date_added']
list_filter = ['date_added']
search_fields = ['name']

*admin.site.register(Translator, AdminTranslator)*







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


parallel test running throwing pickleError

2016-02-29 Thread girish ramnani
when running the django test in parallel using the runner.py . 
_pickle.PicklingError: Can't pickle : attribute lookup 
ModuleImportFailure on unittest.loader failed

error is thrown, and when the runner is run using a single process. the 
test suite executes.

I am using a new virtualenv with django installed in editable mode.

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


Re: parallel test running throwing pickleError

2016-02-29 Thread Simon Charette
Hi Girish,

I think you didn't to install the `tblib` package[1].

Cheers,
Simon

[1] 
https://docs.djangoproject.com/en/1.9/ref/django-admin/#cmdoption-test--parallel

Le lundi 29 février 2016 12:13:08 UTC-5, girish ramnani a écrit :
>
> when running the django test in parallel using the runner.py . 
> _pickle.PicklingError: Can't pickle  'unittest.loader.ModuleImportFailure'>: attribute lookup 
> ModuleImportFailure on unittest.loader failed
>
> error is thrown, and when the runner is run using a single process. the 
> test suite executes.
>
> I am using a new virtualenv with django installed in editable mode.
>

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


Re: Ajax + Django + jQuery + HTML5

2016-02-29 Thread 'Tom Evans' via Django users
On Sun, Feb 28, 2016 at 9:46 PM,   wrote:
>
> I need get path to local file in  for ImageField.
> Next, transfer path to my view thought Ajax request, update in database and
> almost  all.
>
> I need will make it manually, for my goals.
>
> May be, anyone known how it make?
>
> I am tried already django-ajaximage, Ajaxfileupload and many other, but it
> not working correct for me.

You cannot retrieve the path of the submitted file server side, it is
simply not possible - browsers will not share that information with
you, neither via HTTP requests, nor by poking at the DOM with
javascript.

If it is absolutely necessary, you must provide a second text input
and have the user manually put the information in there. Bear in mind
that there would be no way of verifying that what the user put in that
box is at all correct.

Can you explain what you are trying to do rather than what is going
wrong, because I think that would be illuminating.

Cheers

Tom

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


Re: Why not working ?

2016-02-29 Thread Nikolas Stevenson-Molnar
Please be more specific. What isn't working? What is the desired vs actual 
result?

On Monday, February 29, 2016 at 8:39:54 AM UTC-8, setivo...@gmail.com wrote:
>
>
> my model
> .
>
> class Translator(models.Model):
> """
> Model for dictionaries tranlations
> """
>
> def dispatch_dictionary_media_files(instance, filename):
> return 'app_dictionaries/{0}/{1}'.format(instance.name.__str__(), 
> filename)
>
> author = models.ForeignKey(settings.AUTH_USER_MODEL)
> *name = models.CharField('Name of translator', max_length=50, 
> unique=True)*
> language_origin = models.CharField('Origin language', max_length=30, 
> choices=LANGUAGES)
> language_translation = models.CharField('Language of translation', 
> max_length=30, choices=LANGUAGES)
> picture = models.ImageField('Picture for translator', 
> upload_to=dispatch_dictionary_media_files, blank=True, null=True)
> description = models.TextField('Description of translator', null=True, 
> blank=True)
> *slug_name = models.SlugField('Name for link', unique=True)*
> rating = models.DecimalField('Rating', max_digits=4, decimal_places=2, 
> editable=False, default=0)
> date_added = models.DateTimeField('Date added', auto_now_add=True)
>
>
> my admin.py
> --
>
> class AdminTranslator(admin.ModelAdmin):
> fieldsets = [
> ('Requred fields', {
> 'fields': ['name', 'author', ('slug_name', 
> 'language_translation')],
> }),
> ('Not required fields', {
> 'classes': ('collapse',),
> 'fields': ['description', 'picture'],
> 'description': 'It is fields nor required. And you may skip 
> it.',
> }),
> ]
> date_hierarchy = 'date_added'
> actions_on_top = True
> actions_on_bottom = True
> empty_value_display = '-empty-'
>   *  prepopulated_fields = {"slug_name": ("name",)}*
>
> inlines = [AddTranslationInline]
>
> # -
> list_display = ['name', 'author', 'language_origin', 
> 'language_translation', 'rating', 'was_added_recently', 'date_added']
> list_filter = ['date_added']
> search_fields = ['name']
>
> *admin.site.register(Translator, AdminTranslator)*
>
>
>
> 
>
>
>
>
>

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


Re: Error running Django tutorial

2016-02-29 Thread jorrit787
Well that's strange... The problem appears to be that your polls.urls file 
is not getting included in your project's URLConf (since the error message 
in your first post says that the only URL tried was *admin/* ). I'm not 
sure if adding the app to INSTALLED_APPS is necessary for an app's URLConf 
to be able to be included, but it's worth a try. In FirstApp/settings.py 
add 'polls' to the list of INSTALLED_APPS so that it looks something like 
this:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls.apps.PollsConfig',
]



Otherwise it does seem like it could be a file refresh problem.


On Monday, February 29, 2016 at 4:03:42 PM UTC+1, Mike Kipling wrote:
>
> Jorr,
>
> No, I did not modify the settings.py file, because the tutorial 
> specifically states: 
>
> Note
>
> Ignore the warning about unapplied database migrations for now; we’ll deal 
> with the database shortly.
>
>
> Here is a link to the tutorial: 
> https://docs.djangoproject.com/en/1.9/intro/tutorial01/
>
>
>
>
>
>

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


Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
I added polls to settings.py :
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls.apps.PollsConfig',
]

Then I tried the migration:
C:\Data\Django_Code\FirstApp\mysite>python manage.py migrate
Operations to perform:
  Apply all migrations: admin, sessions, contenttypes, auth
Running migrations:
  No migrations to apply.

Then I started the server and tried going to the address, but got the same 
results:
C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
Performing system checks...

System check identified no issues (0 silenced).
February 29, 2016 - 14:16:37
Django version 1.9.2, using settings 'mysite.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
Not Found: /polls/
[29/Feb/2016 14:16:46] "GET /polls/ HTTP/1.1" 404 1921

I am working on a Windows OS, so I thought that perhaps changing the '/' in 
the mysite\urls.py to '\\' might help, but it did not.

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


Re: parallel test running throwing pickleError

2016-02-29 Thread girish ramnani
Sorry i forgot to mention that, i have installed the tblib. this is my pip 
list output

Django (1.10.dev20160216200705, /home/girish/Documents/Github/django)
fancycompleter (0.4)
ordereddict (1.1)
pdbpp (0.8.3)
pip (8.0.3)
py (1.4.31)
Pygments (2.1.2)
pytest (2.8.7)
setuptools (18.2)
tblib (1.2.0)
wheel (0.24.0)
wmctrl (0.3)


On Monday, February 29, 2016 at 11:07:37 PM UTC+5:30, Simon Charette wrote:
>
> Hi Girish,
>
> I think you didn't to install the `tblib` package[1].
>
> Cheers,
> Simon
>
> [1] 
> https://docs.djangoproject.com/en/1.9/ref/django-admin/#cmdoption-test--parallel
>
> Le lundi 29 février 2016 12:13:08 UTC-5, girish ramnani a écrit :
>>
>> when running the django test in parallel using the runner.py . 
>> _pickle.PicklingError: Can't pickle > 'unittest.loader.ModuleImportFailure'>: attribute lookup 
>> ModuleImportFailure on unittest.loader failed
>>
>> error is thrown, and when the runner is run using a single process. the 
>> test suite executes.
>>
>> I am using a new virtualenv with django installed in editable mode.
>>
>

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


Re: empty request object

2016-02-29 Thread Larry Martell
Yes, I'm an idiot. I had commented out the middleware when debugging
and forgot to put them back.

On Mon, Feb 29, 2016 at 10:09 AM, knbk  wrote:
> That would happen if the AuthenticationMiddleware hasn't run. In what
> context is request.user missing?
>
> On Monday, February 29, 2016 at 3:54:24 PM UTC+1, larry@gmail.com wrote:
>>
>> So does anyone know why there would be a no user attr? I would expect
>> this:
>>
>> (Pdb) request.user
>> 
>>
>> But I get this:
>>
>> (Pdb) request.user
>> *** AttributeError: 'WSGIRequest' object has no attribute 'user'
>>
>> On Sat, Feb 27, 2016 at 6:31 PM, Larry Martell 
>> wrote:
>> > Yes, you are absolutely correct. Thanks for directing me away from
>> > that red herring. But it seems request.user no longer exists.
>> >
>> > There is code that does this:
>> >
>> > if request.user.is_authenticated():
>> >
>> > which throws:
>> >
>> > AttributeError: "'WSGIRequest' object has no attribute 'user'"
>> >
>> > On Sat, Feb 27, 2016 at 5:48 PM, knbk  wrote:
>> >> I was referring to the wrong release notes. The rights one can be found
>> >> in
>> >> the 1.8 release notes in the miscellaneous section[1]:
>> >>
>> >>> HttpRequest now has a simplified repr (e.g. > >>> '/somepath/'>). This won’t change the behavior of
>> >>> theSafeExceptionReporterFilter class.
>> >>
>> >>
>> >> Printing the request in your debugger is nothing more than calling repr
>> >> on
>> >> the request and displaying the result. The conclusion is the same: the
>> >> request is not empty, but the string representation of the request has
>> >> changed. This is unrelated to whatever issue you're facing.
>> >>
>> >> [1] https://docs.djangoproject.com/en/1.9/releases/1.8/#miscellaneous
>> >>
>> >> On Saturday, February 27, 2016 at 11:21:18 PM UTC+1,
>> >> larry@gmail.com
>> >> wrote:
>> >>>
>> >>> On Sat, Feb 27, 2016 at 5:14 PM, knbk  wrote:
>> >>> > The `__repr__` method on HttpRequest was simplified in 1.9[1]. It is
>> >>> > not
>> >>> > an
>> >>> > accurate description of what is actually contained in the request,
>> >>> > and I
>> >>> > doubt it has anything to do with the actual issues you're facing.
>> >>> >
>> >>> > [1]
>> >>> >
>> >>> >
>> >>> > https://docs.djangoproject.com/en/1.9/releases/1.9/#httprequest-details-in-error-reporting
>> >>>
>> >>> I am printing the request object from the debugger:
>> >>>
>> >>> (Pdb) request
>> >>> 
>> >>>
>> >>> This is not in the debug page. I'm pretty sure it's empty as when I
>> >>> call login(request) I get a blank page with a 200 back.
>> >>>
>> >>> >
>> >>> > On Saturday, February 27, 2016 at 11:09:28 PM UTC+1,
>> >>> > larry@gmail.com
>> >>> > wrote:
>> >>> >>
>> >>> >> On Sat, Feb 27, 2016 at 5:02 PM, James Schneider
>> >>> >>  wrote:
>> >>> >> >
>> >>> >> > On Feb 27, 2016 1:55 PM, "Larry Martell" 
>> >>> >> > wrote:
>> >>> >> >>
>> >>> >> >> Anyone have any insights on this? Is there anything special I
>> >>> >> >> need
>> >>> >> >> to
>> >>> >> >> do get the request structure? The way this 1.9 site is now, it
>> >>> >> >> doesn't
>> >>> >> >> work at all because the request structure is not getting passed
>> >>> >> >> in.
>> >>> >> >>
>> >>> >> >
>> >>> >> > I'd be most suspicious of middle ware not handling the request
>> >>> >> > correctly.
>> >>> >>
>> >>> >> I tried removing all the middleware, but I got the same result.
>> >>> >> This
>> >>> >> is the middleware that was in place:
>> >>> >>
>> >>> >> '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',
>> >>> >> 'django.middleware.security.SecurityMiddleware',
>> >>> >>
>> >>> >>
>> >>> >> > Have you tried moving to a fresh venv to ensure Django and other
>> >>> >> > packages
>> >>> >> > aren't damaged?
>> >>> >> >
>> >>> >> > Can you replicate the issue on a separate test server?
>> >>> >>
>> >>> >> No, I haven't tried either one yet. I guess I will have to do that,
>> >>> >> but I really would like to just get this setup working.

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


Re: Error running Django tutorial

2016-02-29 Thread jorrit787
Can you attach your entire project's code in a ZIP file? I'm curious to 
test this myself...


On Monday, February 29, 2016 at 9:23:20 PM UTC+1, Mike Kipling wrote:
>
> I added polls to settings.py :
> INSTALLED_APPS = [
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'polls.apps.PollsConfig',
> ]
>
> Then I tried the migration:
> C:\Data\Django_Code\FirstApp\mysite>python manage.py migrate
> Operations to perform:
>   Apply all migrations: admin, sessions, contenttypes, auth
> Running migrations:
>   No migrations to apply.
>
> Then I started the server and tried going to the address, but got the same 
> results:
> C:\Data\Django_Code\FirstApp\mysite>python manage.py runserver
> Performing system checks...
>
> System check identified no issues (0 silenced).
> February 29, 2016 - 14:16:37
> Django version 1.9.2, using settings 'mysite.settings'
> Starting development server at http://127.0.0.1:8000/
> Quit the server with CTRL-BREAK.
> Not Found: /polls/
> [29/Feb/2016 14:16:46] "GET /polls/ HTTP/1.1" 404 1921
>
> I am working on a Windows OS, so I thought that perhaps changing the '/' 
> in the mysite\urls.py to '\\' might help, but it did not.
>
>

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


[no subject]

2016-02-29 Thread Aaron C. de Bruyn
A simple annotation broke when I migrated by app from Django 1.8.x to
1.9.2, and I can't figure out why for the life of me.

Calling Company.objects.all().annotate(ticketcount=Count('srservice'))

throws an error "ProgrammingError: column "company.owner_id" must appear in
the GROUP BY clause or be used in an aggregate function"

Rolling back to Django 1.8.5 fixes the problem.
The DB backend is Postgres.

Please ignore the horrible DB schema.  It's not mine.  It's an
introspection of a horrible Windows ticketing app.

Models and traceback here:
https://gist.github.com/darkpixel/e8f494038d5192225901

Am I missing something?

-A

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


Re: Error running Django tutorial

2016-02-29 Thread Mike Kipling
I found the problem.

When the mysite\urls.py file is created, it has this line already in it.

from django.conf.urls import url

The tutorial asks you to add the following lines to the file.

from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
url(r'^polls/', include('polls.urls')),
url(r'^admin/', admin.site.urls),
]

I must did not notice that the 'include' was different, and so I had not 
placed it into the file.  I changed the file to add the 'include' and 
everything worked.

Thank you for 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/baedaefb-d570-4154-9ed1-95fba413ff71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How force DJANGo choice MEDIA_URL or STATIC_URL in template?

2016-02-29 Thread setivolkylany

I need choice base url MEDIA_URL (/media/) - for uploaded user picture, or 
STATIC_URL (/static/) - picture by default

I am try next:

p>

, but result is MEDIA_URL(STATIC_URL) and path to file.

I am next try:

{% templatetag openvariable %} url 'entry_list' {% templatetag closevariable %}


but result is {{ MEDIA_URL }} or {{ STATIC_URL }} (not working)

may by anyone known how solved this problem
---

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/72159edf-e841-41ce-8513-571b142d4f24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re:

2016-02-29 Thread Simon Charette
Hi Aaron,

I think this could be related to the version of your PostgreSQL server.

Django 1.9 dropped support for PostgreSQL 9.0[1] which doesn't support
GROUP BY selected primary keys[2].

Cheers,
Simon

[1] 
https://docs.djangoproject.com/en/1.9/releases/1.9/#dropped-support-for-postgresql-9-0
[2] 
https://github.com/django/django/commit/dc27f3ee0c3eb9bb17d6cb764788eeaf73a371d7

Le lundi 29 février 2016 15:56:07 UTC-5, Aaron C. de Bruyn a écrit :
>
> A simple annotation broke when I migrated by app from Django 1.8.x to 
> 1.9.2, and I can't figure out why for the life of me.
>
> Calling Company.objects.all().annotate(ticketcount=Count('srservice'))
>
> throws an error "ProgrammingError: column "company.owner_id" must appear 
> in the GROUP BY clause or be used in an aggregate function"
>
> Rolling back to Django 1.8.5 fixes the problem.
> The DB backend is Postgres.
>
> Please ignore the horrible DB schema.  It's not mine.  It's an 
> introspection of a horrible Windows ticketing app.
>
> Models and traceback here: 
> https://gist.github.com/darkpixel/e8f494038d5192225901
>
> Am I missing something?
>
> -A
>

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


Re: mathematical function and django connect

2016-02-29 Thread James Schneider
On Sun, Feb 28, 2016 at 2:06 PM, Xristos Xristoou  wrote:

> update my project now
>
> my view.py code
>
> def calc(request):
> a = []
> NList = []
> y=0
> member=0
> member = request.POST.get ('member', False)
> for i in range(int(member)):
> input = request.POST.get ('input', False)
> NList.append(int(input))
> for k in NList:
> if k is 1:
> y = 1
> elif (k > 1) and (k < 5):
> y = (k - 1) + 2
> a.append(y)
> return render_to_response ('blog/calc.html', {'a' :a, 
> 'member':member}, context_instance=RequestContext(request))
>
>
>
Have you verified that 'member' and 'input' are populated with values when
the form is submitted? You should be able to put print() statements at
various points in your code and watch the output on the dev server console.
You should also check that the 'a' variable is populated just before it is
placed into the context.

Also, be careful using input as a variable name. That clashes with the
input() function in Python 3.

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


Re: Absolute beginner question -- recipes

2016-02-29 Thread James Schneider
On Mon, Feb 29, 2016 at 5:57 AM, Simon Gunacker 
wrote:

> Thank you Florian. After James pointed out that I can access my steps (and
> the ingredients in some way) by just passing the recipe object to the
> templates context, I thought of reducing the view to a DetailView again.
> But I have to somehow access the ingredients from my template for now ...
>


The related models using a 'through' table also have access to the
'through' table itself. With your current setup, I think you can do this:


{% for steping in step.stepingredient_set.all %}
{{ steping.amount }} {{ steping.unit }} - {{ steping.ingredient
}}
{% empty %}
No ingredients needed for this step.
{% endfor %}


Optionally, for style points (and better human readability of the code),
you can also add a 'related_name' parameter to the FK's in the 'through'
table:

step = models.ForeignKey(Step, null=True,
related_name='step_ingredients')
ingredient = models.ForeignKey(Ingredient, null=True,
related_name='ingredient_steps')

That way, depending on the direction you are going, the call makes sense to
a human:


{% for steping in step.step_ingredients.all %}
{{ steping.amount }} {{ steping.unit }} - {{ steping.ingredient
}}
{% empty %}
No ingredients needed for this step.
{% endfor %}


I think that will work, although I haven't exactly tested this.

I'd highly recommend going with DetailView if you can. That makes your view
a whopping 2 or 3 lines.

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


more than one field for aggregates? (ArrayAgg, StringAgg)

2016-02-29 Thread Tomasz Nowak
Hi!

Module django.contrib.postgres.aggregates provides classes for ARRAY_AGG 
and STRING_AGG PostgreSQL aggregates.

Is it possible to provide more than one field to these aggregates? 
Like in SQL, where you can provide more fields ("row" is optional):

ARRAY_AGG(row(table.field1, table.field2))

Best wishes,
Tomasz

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


Re: bootstrap django crispy forms

2016-02-29 Thread James Schneider
On Fri, Feb 26, 2016 at 7:39 AM,  wrote:

> A simple upload button is proving difficult to implement bootstrap and css
> on My attempt is as follows:
>
>  class DocumentForm(forms.Form):
>docfile = forms.FileField(label='Choose')
>def __init__(self, *args, **kwargs): # don't particularly know or care 
> about this and the below component
>  super(DocumentForm, self).__init__(*args, **kwargs) #but they are 
> necessary to not get an error
>  ButtonHolder(
>Div('docfile', style="background: black;", css_class="col-md-12", 
> css_id="burton", template='home.html')
>), #the Div part is what I'm most interested in- in order to be 
> able to style the button.
>
> Furthermore, having set the "css_class" to "burton", I have tried
> referencing it in a normal css file:
>
>  .burton{
> 
>   }
>
> but that too is obviously misguided??
>
> Can someone tell me where I'm going wrong?
>

I answered your other email that had a very similar set of incorrect
syntax, and provided direction there.

https://groups.google.com/d/msgid/django-users/30dc988f-0def-4497-9ca7-9cc514adc5e5%40googlegroups.com?utm_medium=email&utm_source=footer

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


New to Django

2016-02-29 Thread Gary Dhillon
I've installed Django and I keep getting no module named django when 
importing. I have python 3.5.1 and used pip to install django 1.9.2. Its 
showing up on my python 2.7 though. Any help would be appreciated.

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


Re: New to Django

2016-02-29 Thread Lachlan Musicman
You will find there are two different pips on your computer - the default
is obv 2.7. the most likely command you will need is pip3 (on ubuntu), but
your best bet is to:

 - set up a virtualenv
 - set up your path to default to python 3.5.1

I would use the virtualenv solution personally.

There is also the quick and dirty "which python" then doing an ls -l | grep
pip on the directory that python is in (/usr/bin for me)

Cheers
L.


--
The most dangerous phrase in the language is, "We've always done it this
way."

- Grace Hopper

On 1 March 2016 at 11:59, Gary Dhillon  wrote:

> I've installed Django and I keep getting no module named django when
> importing. I have python 3.5.1 and used pip to install django 1.9.2. Its
> showing up on my python 2.7 though. Any help would be appreciated.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/3ea8f361-3642-4b16-97f0-77ce379a0a49%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/CAGBeqiNaKp2tW278LSaKTYEz_-rH_O5JTVKLRkJsB8UeZWOhTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: more than one field for aggregates? (ArrayAgg, StringAgg)

2016-02-29 Thread Simon Charette
Hi Tomasz,

I suppose you could implement `ROW` as a custom expression[1] and use it in
your `ArrayAgg` aggregate as follow:

from django.contrib.postgres.aggregates import ArrayAgg
from django.db.models import Expression

class Row(Expression):
template = 'ROW(%(expressions)s)'

# ...

MyModel.objects.aggregate(
ArrayAgg(Row(F('field1'), F('field2'))),
)


Cheers,
Simon

[1] 
https://docs.djangoproject.com/en/1.9/ref/models/expressions/#writing-your-own-query-expressions

Le lundi 29 février 2016 19:31:15 UTC-5, Tomasz Nowak a écrit :
>
> Hi!
>
> Module django.contrib.postgres.aggregates provides classes for ARRAY_AGG 
> and STRING_AGG PostgreSQL aggregates.
>
> Is it possible to provide more than one field to these aggregates? 
> Like in SQL, where you can provide more fields ("row" is optional):
>
> ARRAY_AGG(row(table.field1, table.field2))
>
> Best wishes,
> Tomasz
>

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


Re: New to Django

2016-02-29 Thread Gary Dhillon
Thanks, really appreciate it!

On Monday, 29 February 2016 19:19:21 UTC-7, Lachlan Musicman wrote:
>
> You will find there are two different pips on your computer - the default 
> is obv 2.7. the most likely command you will need is pip3 (on ubuntu), but 
> your best bet is to:
>
>  - set up a virtualenv
>  - set up your path to default to python 3.5.1
>
> I would use the virtualenv solution personally.
>
> There is also the quick and dirty "which python" then doing an ls -l | 
> grep pip on the directory that python is in (/usr/bin for me)
>
> Cheers
> L.
>
>
> --
> The most dangerous phrase in the language is, "We've always done it this 
> way."
>
> - Grace Hopper
>
> On 1 March 2016 at 11:59, Gary Dhillon > 
> wrote:
>
>> I've installed Django and I keep getting no module named django when 
>> importing. I have python 3.5.1 and used pip to install django 1.9.2. Its 
>> showing up on my python 2.7 though. Any help would be appreciated.
>>
>> -- 
>> You received this message because you are subscribed 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/3ea8f361-3642-4b16-97f0-77ce379a0a49%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/556c5a35-3b52-448d-8c4d-58d5da70a958%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.