Re: How can I access field values generically?

2016-12-21 Thread C. Kirby
Mike, I've done a lot of work with Model meta, and I'm pretty sure I can 
give you at least the bones of a solution, but I can't really get my head 
around the problem. Could you post a set of related models and what you 
would expect the result to look like?  

On Wednesday, December 21, 2016 at 4:55:49 AM UTC+2, Mike Dewhirst wrote:
>
> Bumping this question again, I have done all the individual 
> concatenations with the following model method ... 
>
> def concat_fields(self, ingredients): 
>  """ ingredients is a queryset of substance:substance m2m records 
>  with the second FK to substance in a field called "ingredient" 
>  Objective is concatenate text from all text fields into the mixture 
>  """ 
>  if ingredients: 
>  objects = list() 
>  ellip = "..." 
>  for m2m in ingredients: 
>  obj = m2m.ingredient.get_health() 
>  if obj: 
>  objects.append(obj) 
>  if objects: 
>   # first of seven text fields in this model 
>  comment = self.ototoxic_comment or "" 
>  comment = comment.strip() 
>  if comment: 
>  comment = "{0}\n".format(comment.strip()) 
>  if not comment or ellip in comment: 
>  for obj in objects: 
>  if not obj.substance.name in comment: 
>  if obj.ototoxic_comment: 
>  comment = "{0}{1}: {2}\n".format(comment, 
> obj.substance.name, obj.ototoxic_comment) 
>  if comment: 
>  self.ototoxic_comment = 
> comment.replace(ellip, "") 
>   # next of seven text fields in this model and so on 
>   ... 
>
> There are 90 occurrences of this pattern in 18 concat_fields() methods 
> in 18 models which are all much the same. 
>
> This offends me but I don't know how to start on the necessary "meta" 
> programming to make it somewhat more elegant. 
>
> Here is the on-screen help text for the user ... 
>
> "For mixtures, expandable blank fields "\ 
> "below will be populated with ingredient data from the same fields. "\ 
> "Edit as required. To retrieve that data again add an ellipsis (...) "\ 
> "somewhere in the field and click [Save]" 
>
> Any advice would be appreciated. And appreciation might involve red wine. 
>
> Thanks 
>
> Mike 
>
>
> On 7/12/2016 9:38 AM, Mike Dewhirst wrote: 
> > Consider a chemical mixture with a bunch of ingredients. Both mixture 
> > and ingredients are instances of the same class so they have the same 
> > fields. They also have many related models, including 1:1, 1:n and n:m. 
> > 
> > Each related model will have none or many TextField's. 
> > 
> > The objective is to programmatically fill empty mixture text fields 
> > with concatenated content from the ingredients. The concatenated 
> > content would be separated by ingredient name titles for the user to 
> > deal with the content more easily. 
> > 
> > I don't necessarily need all mixture text fields filled this way but 
> > it certainly makes sense for some. With a couple of related models I'd 
> > concatenate all text fields, with most though I'd like to pick and 
> > choose by field name and I'd ignore some models completely. 
> > 
> > The following model method is working properly as described but it is 
> > mostly boiler-plate. It also only covers the first few of a large 
> > number of related models with text fields. If I keep using this 
> > technique it will add hundreds of LOC. Yuk. 
> > 
> > The question is how can I refactor this and make it generic? Perhaps 
> > using the _meta API? 
> > 
> > Any guidance appreciated 
> > 
> > 
> > (In the abstract ancestor class of the Solid, Liquid and Gas classes) 
> > 
> > def concat_fields(self, ingredients): 
> > """ ingredients is a queryset of substance-to-substance m2m records. 
> > A substance has one physical state object being gas, liquid or solid 
> > each of which inherits from core_fields and the fields *here* we 
> wish 
> > to concatenate text from (at the moment) all come from core_fields. 
> > """ 
> > assert ingredients 
> > # populate the list of ingredient physical state objects 
> > state_objs = list() 
> > for m2m in ingredients: 
> > state_objs.append(m2m.ingredient.get_physical_state_object()) 
> > 
> > # get the text concatenated 
> > if not self.stability_comment: 
> > comment = "" 
> > for obj in state_objs: 
> > if obj.stability_comment: 
> > name = obj.substance.name 
> > text = obj.stability_comment 
> > comment = "{0}\n{1}: {2}".format(comment, name, text) 
> > comment = comment.strip() 
> > if comment: 
> > self.stability_comment = comment 
> > 
> > if not self.reactivity: 
> > comment = "" 
> > for obj in state_objs: 
> > if obj.r

Re: validate_email returns None for any or format

2016-12-21 Thread Michal Petrucha
On Tue, Dec 20, 2016 at 05:28:48AM -0800, NoviceSortOf wrote:
> 
> Why does validate_email return None irregardless of what is typed in?
> 
> >>> from django.core.validators import validate_email
> >>> x = validators.validate_email('t...@example.com')
> >>> print x
> None
> >>>
> 
> Shouldn't it be returning True or False?

According to
https://docs.djangoproject.com/en/1.10/ref/forms/validation/#validators:

> A validator is merely a callable object or function that takes a
> value and simply returns nothing if the value is valid or raises a
> ValidationError if not.

Cheers,

Michal

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


signature.asc
Description: Digital signature


Unique app name error problem when building a Wagtail multisite solution

2016-12-21 Thread 'Matthias Brück' via Django users
Hi all,

I want to build a Wagtail multisite solution and I'm running into problems 
with unique application labels. I would like to have the following project 
structure:

project
  |
  |--app1
  ||--core
  ||--pages
  |...
  |--app2
  ||--core
  ||--pages
  |...


Even when i try to set the name in `apps.py` to unique ones i still get the 
unique name error. 

Is this project structure somehow possible?
I understand that you would commonly put app2 in a separate project. 
But how would you do it if you implement a Wagtail multisite solution and 
still want to keep things separated?

Thanks!
Matthias

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


django-report-tools replacement for Django 1.7 and higher

2016-12-21 Thread schaf . mh
Hi all,
I took over a very old Django project and I like to upgrade it to the 
actual version.
I will do a step wise upgrade and from Django 1.6 to 1.7 I have the 
problem, that the used django-report-tools is no longer 
supported/compatible because the django.utils.encoding.StrAndUnicode
has been removed.

Is there a replacement or what do you recommend for report generation in 
django 1.7 and higher.

Thanks
schaf

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


Re: GeoDjango: Filter by Area

2016-12-21 Thread Tim Graham
If you don't get an answer here, you can also ask on the geodjango 
list: https://groups.google.com/forum/#!forum/geodjango.

On Monday, December 19, 2016 at 6:59:43 AM UTC-5, Sanjay Bhangar wrote:
>
> Hey folks,
>
> I am trying to use the 'Area' function documented here: 
> https://docs.djangoproject.com/en/1.10/ref/contrib/gis/functions/#area to 
> annotate my geo queryset results with Area of the polygon geometries in my 
> database.
>
> This works great with something like:
>
>   annotated_qset = GeoModel.objects.annotate(area=Area('geom'))
>
> I then have a property called 'area` which I can use and it's all great.
>
> However, I then try and filter by Area by following the documentation for 
> filtering by Length on the documentation page, so I try something like:
>
>   filtered_qset = 
> GeoModel.objects.annotate(area=Area('geom')).filter(area__gt=1)
>
> This gives an error like "AttributeError: 'AreaField' object has no 
> attribute 'get_lookup".
>
> It makes sense that this works for the Length function since Length uses 
> the FloatField class, so supports lookups and filters, whereas the 
> AreaField does not: 
> https://github.com/django/django/blob/master/django/contrib/gis/db/models/sql/conversion.py#L24
>
> I could be totally naive here and this may just not be a trivial thing for 
> the back-end (PostGIS in my case) to support, but just wondering if anyone 
> has any work-arounds to filter by area size of feature, and / or if there 
> are plans to support this in future versions.
>
> Thank you all again for an amazing community and amazing piece of software 
> :-)
>
> -Sanjay
>

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


Model _meta API

2016-12-21 Thread Matthew Pava
Since the standardization of the Model _meta API and making it public, I was 
wondering if Django plans on removing the underscore in _meta in the future?  
Just curious.

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


Re: Model _meta API

2016-12-21 Thread James Bennett
I'd be against it.

At work I deal with one codebase that's Django and one that's
Flask/SQLAlchemy, so I've run into the issue of not being able to name a
column 'metadata' in a SQLAlchemy ORM model (that name is reserved for
SQLAlchemy's internal use, but not underscore-prefixed), and been
frustrated by it. I don't know offhand if anyone would ever want to use
'meta' as a field name in a Django model, but making it impossible when
Python provides a standard convention for indicating something is internal
API seems like a bad idea.

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


RE: Model _meta API

2016-12-21 Thread Matthew Pava
Thank you so much for that clarification!

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


Re: validate_email returns None for any or format

2016-12-21 Thread NoviceSortOf
Thanks, I can build logic on that.


On Tuesday, December 20, 2016 at 2:28:48 PM UTC+1, NoviceSortOf wrote:
>
>
> Why does validate_email return None irregardless of what is typed in?
>
> >>> from django.core.validators import validate_email
> >>> x = validators.validate_email('t...@example.com')
> >>> print x
> None
> >>>
>
> Shouldn't it be returning True or False?
>
>
>

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


Django user shows 2 users rows sql table auth_user has over 3000 rows

2016-12-21 Thread NoviceSortOf

>From the command line in Python

>>from books.models import user 
>>custs = list(rusers.objects.all())
>>print custs
>>[, ]

>From SQL
SELECT *  FROM auth_user WHERE username LIKE '%TEST%'
-- None found.

auth_user has been vacuumed, and reindexed during the tests.

- Where and in what schema are these mysterious 2 user rows being stored?

Any clues welcome.

Models.py excerpt follows.


>From books.models.py

from django.db import models
from django.contrib.auth.models import User
from django.core import validators
from django.utils.http import urlquote
from django.utils.translation import ugettext_lazy as _
from django.core.mail import send_mail
import re
# from userprofile.models import BaseProfile
from django.utils.translation import ugettext as _
from django.conf import settings
import datetime
from django.utils import timezone
from django.contrib.auth.models import BaseUserManager
from django.contrib.auth.models import UserManager
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin


class user(AbstractBaseUser, PermissionsMixin):
"""
Custom user structure
   
"""
username = models.CharField(_('username'), max_length=30, unique=True,
help_text=_('Required. 30 characters or fewer. Letters, numbers and 
'
'@/./+/-/_ characters'),
validators=[
validators.RegexValidator(re.compile('^[\w.@+-]+$'), _('Enter a 
valid username.'), 'invalid')
])
first_name = models.CharField(_('first name'), max_length=30, 
blank=True)
last_name = models.CharField(_('last name'), max_length=30, blank=True)
email = models.EmailField(_('email address'), blank=True)
is_staff = models.BooleanField(_('staff status'), default=False,
help_text=_('Designates whether the user can log into this admin '
'site.'))
is_active = models.BooleanField(_('active'), default=True,
help_text=_('Designates whether this user should be treated as '
'active. Unselect this instead of deleting accounts.'))
date_joined = models.DateTimeField(_('date joined'), 
default=timezone.now)
objects = UserManager()
USERNAME_FIELD = 'username'
REQUIRED_FIELDS = ['email']

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


Re: Django user shows 2 users rows sql table auth_user has over 3000 rows

2016-12-21 Thread NoviceSortOf
To answer my own question on doing a psql dump of the data base found the 2 
records 
in books_user  auth_user --now that the custom user has been entered on 
models. 
Should of known from the line -- import from books.models import user 


On Wednesday, December 21, 2016 at 9:46:20 PM UTC+1, NoviceSortOf wrote:
>
>
> From the command line in Python
>
> >>from books.models import user 
> >>custs = list(rusers.objects.all())
> >>print custs
> >>[, ]
>
> From SQL
> SELECT *  FROM auth_user WHERE username LIKE '%TEST%'
> -- None found.
>
> auth_user has been vacuumed, and reindexed during the tests.
>
> - Where and in what schema are these mysterious 2 user rows being stored?
>
> Any clues welcome.
>
> Models.py excerpt follows.
>
>
> 
> From books.models.py
>
> from django.db import models
> from django.contrib.auth.models import User
> from django.core import validators
> from django.utils.http import urlquote
> from django.utils.translation import ugettext_lazy as _
> from django.core.mail import send_mail
> import re
> # from userprofile.models import BaseProfile
> from django.utils.translation import ugettext as _
> from django.conf import settings
> import datetime
> from django.utils import timezone
> from django.contrib.auth.models import BaseUserManager
> from django.contrib.auth.models import UserManager
> from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
>
>
> class user(AbstractBaseUser, PermissionsMixin):
> """
> Custom user structure
>
> """
> username = models.CharField(_('username'), max_length=30, unique=True,
> help_text=_('Required. 30 characters or fewer. Letters, numbers 
> and '
> '@/./+/-/_ characters'),
> validators=[
> validators.RegexValidator(re.compile('^[\w.@+-]+$'), _('Enter 
> a valid username.'), 'invalid')
> ])
> first_name = models.CharField(_('first name'), max_length=30, 
> blank=True)
> last_name = models.CharField(_('last name'), max_length=30, blank=True)
> email = models.EmailField(_('email address'), blank=True)
> is_staff = models.BooleanField(_('staff status'), default=False,
> help_text=_('Designates whether the user can log into this admin '
> 'site.'))
> is_active = models.BooleanField(_('active'), default=True,
> help_text=_('Designates whether this user should be treated as '
> 'active. Unselect this instead of deleting accounts.'))
> date_joined = models.DateTimeField(_('date joined'), 
> default=timezone.now)
> objects = UserManager()
> USERNAME_FIELD = 'username'
> REQUIRED_FIELDS = ['email']
>
>

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


Re: Unique app name error problem when building a Wagtail multisite solution

2016-12-21 Thread 'Matthias Brück' via Django users
is this really just not possible? What I found is this: 

you can't have two apps with the same name, even if they have different 
> fully qualified module paths


https://groups.google.com/forum/#!msg/django-users/AMYLfQo6Ba4/Y-57B0i7qy4J

How would you guys handle this?

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


Re: How can I access field values generically?

2016-12-21 Thread Mike Dewhirst

On 21/12/2016 9:10 PM, C. Kirby wrote:
Mike, I've done a lot of work with Model meta, and I'm pretty sure I 
can give you at least the bones of a solution, but I can't really get 
my head around the problem. Could you post a set of related models and 
what you would expect the result to look like?


I have a main model (substance) with a bunch of child models 
(properties, toxicity, health, spill etc) containing TextFields with 
advice for that substance. There are obviously lots of substances and 
they carry varying  advice in their child models. Two of them are MMA 
and Styrene.


With a new substance (eg Base Resin CK90) which is a mixture of those 
two substances, the chemical manufacturer needs to assemble advice in 
those same TextFields in the CK90 mixture as the ones in the child 
models carrying the varying advice. In some cases that advice (eg spill 
advice) can come out of an expert's head and just be typed in. In some 
cases the expert may prefer to see the spill advice from all the 
ingredient substances first. Like so ... [1]




... editing out the ingredient names - in this case MMA and Styrene - 
and combining the advice for the mixture, getting rid of redundant or 
repetitive advice.


The concat_fields method which sources the advice only works for a 
mixture (ie substance has ingredients). It only works on a blank field 
or (when signalled) replaces advice from one or more ingredients. The 
user deletes one (or more) of the ingredient names and inserts an 
ellipsis in the CK90 field. The advice from that/those ingredient(s) 
will be appended. If another ingredient is added to the mixture and an 
ellipsis is inserted in the CK90 mixture TextField, the new ingredient 
advice is appended.


The models are pretty standard ... there are more than the 1:1 (Spill) 
and 1:n (Exposure) shown here.


Substance (main model)
ingredients = models.ManyToManyField('self', symmetrical=False, 
blank=True,

through='Substance_Ingredients',)

Substance_Ingredients (m2m 'through' table)
substance = models.ForeignKey('Substance')
ingredient = models.ForeignKey('Substance')
proportion = models.DecimalField()

Spill (1:1 model)
substance = models.OneToOneField('Substance')
small = models.TextField(verbose_name="Small spill",
help_text="Response recommended for spills around 25 litres.")

Exposure (1:n model)
substance = models.ForeignKey('Substance', related_name='route')
symptoms = models.TextField(help_text="Potential adverse health 
effects and symptoms from "
"the first at lowest exposure through to consequences of severe 
exposure.")


Thanks CK

Mike

[1] For those not seeing the embedded image, it is a TextField 
containing the following words:
Methyl methacrylate monomer: Soak up with inert absorbent material (e.g. 
silica gel, acid binder, universal binder, sawdust). Keep in suitable, 
closed containers for disposal.
Styrene: Soak up with inert absorbent material (e.g. sawdust). Keep in 
closed containers for disposal.




On Wednesday, December 21, 2016 at 4:55:49 AM UTC+2, Mike Dewhirst wrote:

Bumping this question again, I have done all the individual
concatenations with the following model method ...

def concat_fields(self, ingredients):
 """ ingredients is a queryset of substance:substance m2m records
 with the second FK to substance in a field called "ingredient"
 Objective is concatenate text from all text fields into the
mixture
 """
 if ingredients:
 objects = list()
 ellip = "..."
 for m2m in ingredients:
 obj = m2m.ingredient.get_health()
 if obj:
 objects.append(obj)
 if objects:
  # first of seven text fields in this model
 comment = self.ototoxic_comment or ""
 comment = comment.strip()
 if comment:
 comment = "{0}\n".format(comment.strip())
 if not comment or ellip in comment:
 for obj in objects:
 if not obj.substance.name
 in comment:
 if obj.ototoxic_comment:
 comment = "{0}{1}:
{2}\n".format(comment,
obj.substance.name , obj.ototoxic_comment)
 if comment:
 self.ototoxic_comment =
comment.replace(ellip, "")
  # next of seven text fields in this model and so on
  ...

There are 90 occurrences of this pattern in 18 concat_fields()
methods
in 18 models which are all much the same.

This offends me but I don't know how to start on the necessary "meta"
programming to make it somewhat more elegant.

Here is the on-screen help text for the user ...

"For mixtures, expandable blank fields "\
 

Re: Maybe a bug, about app and view function name collision

2016-12-21 Thread Xin Belter
It works, I didn't change anything(maybe somewhere I didn't realize)... 
interesting...

在 2016年12月19日星期一 UTC+8下午8:17:09,Xin Belter写道:
>
> Here is the strange thing I just met:
>
> My project's name is *showMetDDA*, and has only one app named *showTable*, 
>  in my app's vimes.py file, I have a view function named *show_table().*
>
> When I import my view function in 
> urls.py(~/djcode/showMetDDA/showMetDDA/urls.py) file, I cannot import it.
>
>
> 
>
> error like this:
>
>
> 
>
>
> When I comment the line where has show_table, It works:
>
>
> 
>
>
>
> 
>
>
> What happened? Is it normal???
>
>
>
>
>
>
>
>
>
>

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


Erroneous links in my URLs - all load the home page -- not a 404 or other error.page

2016-12-21 Thread NoviceSortOf

URLs not defined in my urls.py all show my home page and not a 404 missing 
page error.

For instance 

www.mysite.com  
Naturally shows my home page.

www.mysite.com/catalogs 
Shows the downloadable catalogs
 
then anything goes.

www.mysite.com/thisisanonsenselink
or
www.mysite.com/AnythingTypedHere


Shows my homepage

Why isn't my project issuing 404 or other errors when page not found?

Please advise 


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


Re: Erroneous links in my URLs - all load the home page -- not a 404 or other error.page

2016-12-21 Thread Vijay Khemlani
show your urls.py

On Wed, Dec 21, 2016 at 10:43 PM, NoviceSortOf 
wrote:

>
> URLs not defined in my urls.py all show my home page and not a 404 missing
> page error.
>
> For instance
>
> www.mysite.com
> Naturally shows my home page.
>
> www.mysite.com/catalogs
> Shows the downloadable catalogs
>
> then anything goes.
>
> www.mysite.com/thisisanonsenselink
> or
> www.mysite.com/AnythingTypedHere
>
>
> Shows my homepage
>
> Why isn't my project issuing 404 or other errors when page not found?
>
> Please advise
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/94dc7439-38f5-464c-b93e-001faf03491c%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/CALn3ei3EwqHZE%3DoON4GH8LwFz5%2B0ZD%2BvroUt0H6RH72_fkiURw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-report-tools replacement for Django 1.7 and higher

2016-12-21 Thread C. Kirby
It looks like github user daegun has the most up to date fork of it, but 
you will have to pip install from github instead of pypi

https://github.com/daegun/django-report-tools/commit/521cefa61103166c5aea40586549d95aadbc561d


On Wednesday, December 21, 2016 at 4:06:05 PM UTC+2, scha...@gmail.com 
wrote:
>
> Hi all,
> I took over a very old Django project and I like to upgrade it to the 
> actual version.
> I will do a step wise upgrade and from Django 1.6 to 1.7 I have the 
> problem, that the used django-report-tools is no longer 
> supported/compatible because the django.utils.encoding.StrAndUnicode
> has been removed.
>
> Is there a replacement or what do you recommend for report generation in 
> django 1.7 and higher.
>
> Thanks
> schaf
>

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


Re: django-report-tools replacement for Django 1.7 and higher

2016-12-21 Thread C. Kirby
Quick followup, it looks like 3 of the 4 forks from HEAD on master have 
fixed it, take a look at the network graph

https://github.com/evanbrumley/django-report-tools/network

On Thursday, December 22, 2016 at 9:49:44 AM UTC+2, C. Kirby wrote:
>
> It looks like github user daegun has the most up to date fork of it, but 
> you will have to pip install from github instead of pypi
>
>
> https://github.com/daegun/django-report-tools/commit/521cefa61103166c5aea40586549d95aadbc561d
>
>
> On Wednesday, December 21, 2016 at 4:06:05 PM UTC+2, scha...@gmail.com 
> wrote:
>>
>> Hi all,
>> I took over a very old Django project and I like to upgrade it to the 
>> actual version.
>> I will do a step wise upgrade and from Django 1.6 to 1.7 I have the 
>> problem, that the used django-report-tools is no longer 
>> supported/compatible because the django.utils.encoding.StrAndUnicode
>> has been removed.
>>
>> Is there a replacement or what do you recommend for report generation in 
>> django 1.7 and higher.
>>
>> Thanks
>> schaf
>>
>

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


Re: existing database connectivity

2016-12-21 Thread Rasika

I am followed the steps as I am getting in tutorials
when I run the command :
python manage.py migrate
this is giving me following error

from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 22, in 
execute_from_command_line(sys.argv)
On Monday, December 19, 2016 at 7:50:19 PM UTC+5:30, Derek wrote:
>
> Suggest you look at Django authentication:
>
> https://docs.djangoproject.com/en/1.10/topics/auth/customizing/
> "Authentication backends provide an extensible system for when a username 
> and password stored with the user model need to be authenticated against a 
> different service than Django’s default."
>
> It also seems as if your Django project was not set up properly (again 
> from the docs):
>
> "By default, the required configuration is already included in the 
> settings.py generated by django-admin startproject, these consist of two 
> items listed in your INSTALLED_APPS setting:
> 1. 'django.contrib.auth' contains the core of the authentication 
> framework, and its default models.
> 2.  'django.contrib.contenttypes' is the Django content type system, which 
> allows permissions to be associated with models you create"
>
>
> On Monday, 19 December 2016 13:34:39 UTC+2, Rasika wrote:
>>
>> Hello all,
>>  I am using Django framework for our website.I am stuck on the 
>> database connectivity.I want to change the default database sqlite with our 
>> for test purpose but in that also I am getting problems.
>>  My aim is I have to use our compnies database so that already registered 
>> users have not to create their account again
>> AsDjango already comes with its own builtin apps for login,logout 
>> authentication and registration .Also I am not able to find the 
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.sites',
>> 'django.contrib.admin',
>> etc and all default apps also.
>> Please help me.
>>
>> Thank you.
>>
>

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