Re: Python & Django.

2015-07-05 Thread Aaron C. de Bruyn
I have a django project running under Python 3.4, so I don't think
it's a problem with Django.

If you can provide us with *any* information that might clue us in to
what is going on, it would be helpful.

At the moment, all we know is that something doesn't work.

Can you provide information on what version of Linux, Windows, or Mac
you are using?
Commands you are typing in and the responses you are getting?
Does 'python manage.py runserver' produce any output?

Thanks,

-A

On Sun, Jul 5, 2015 at 6:44 PM, Steve Burrus  wrote:
> "Are you getting an error message?" lNo particular error message. But I
> cannot even start to go thru the usual procedure to end up connecting to the
> Django server! It's irrational that for as long as the version 3.4.* of
> python has been out that  I hAvE to still use the old version 2.7.
>
> On Sun, Jul 5, 2015 at 4:52 PM, Aaron C. de Bruyn 
> wrote:
>>
>> Are you getting an error message?
>>
>> Can you describe what is happening (or not happening)?
>>
>> Thanks,
>>
>> -A
>>
>> On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus 
>> wrote:
>> > Listen I am having/experiencing some degree of diffilculty in being able
>> > to
>> > coordinaTE my Pytjhon version with Django. i can easily end up
>> > connecting to
>> > the [django] server but I have to use python version 2.7.* ins tead of
>> > the
>> > preferred version 3.4.* ZCan some please help me with this?
>> >
>> >
>> >
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "Django users" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to django-users+unsubscr...@googlegroups.com.
>> > To post to this group, send email to django-users@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/django-users.
>> > To view this discussion on the web visit
>> >
>> > https://groups.google.com/d/msgid/django-users/1d63c599-24ae-416f-8f01-d584c3fd8dfa%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/fAjA0D7wyXM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAEE%2BrGpyXcBm1AszLHXqsaJ2rg7y13u-1SjT9MizNbT6wdx8Cw%40mail.gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABcoaSDK9Yk%2BxadQMw2Kq3cXpEz4BzDzsbs_JDE8db%3DUFGUOEw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.

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


Re: Python & Django.

2015-07-05 Thread Andrew Farrell
Could you please paste a reply with:
- The operating system you are running on
- The output of the command "pip freeze"
- The commands you are entering to try to run django on python 3.4 and the
output of those commands
?

On Sun, Jul 5, 2015 at 8:44 PM, Steve Burrus 
wrote:

>
> *"Are you getting an error message?" lNo particular error message. But I
> cannot even start to go thru the usual procedure to end up connecting to
> the Django server! It's irrational that for as long as the version 3.4.* of
> python has been out that  I hAvE to still use the old version 2.7.  *
>
>
> *On Sun, Jul 5, 2015 at 4:52 PM, Aaron C. de Bruyn  > wrote:*
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Are you getting an error message? Can you describe what is happening (or
>> not happening)? Thanks, -A On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus
>> > wrote: > Listen I am
>> having/experiencing some degree of diffilculty in being able to >
>> coordinaTE my Pytjhon version with Django. i can easily end up connecting
>> to > the [django] server but I have to use python version 2.7.* ins tead of
>> the > preferred version 3.4.* ZCan some please help me with this? > > > > >
>> -- > You received this message because you are subscribed to the Google
>> Groups > "Django users" group. > To unsubscribe from this group and stop
>> receiving emails from it, send an > email to
>> django-users+unsubscr...@googlegroups.com
>> . > To post to this group,
>> send email to django-users@googlegroups.com
>> . > Visit this group at
>> http://groups.google.com/group/django-users
>> . > To view this discussion on
>> the web visit >
>> https://groups.google.com/d/msgid/django-users/1d63c599-24ae-416f-8f01-d584c3fd8dfa%40googlegroups.com
>> .
>> > For more options, visit https://groups.google.com/d/optout
>> . -- You received this message because
>> you are subscribed to a topic in the Google Groups "Django users" group. To
>> unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/fAjA0D7wyXM/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> django-users+unsubscr...@googlegroups.com
>> . To post to this group, send
>> email to django-users@googlegroups.com .
>> Visit this group at http://groups.google.com/group/django-users
>> . To view this discussion on
>> the web visit
>> https://groups.google.com/d/msgid/django-users/CAEE%2BrGpyXcBm1AszLHXqsaJ2rg7y13u-1SjT9MizNbT6wdx8Cw%40mail.gmail.com
>> .
>> *
>>
>> *For more options, visit https://groups.google.com/d/optout
>> . *
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABcoaSDK9Yk%2BxadQMw2Kq3cXpEz4BzDzsbs_JDE8db%3DUFGUOEw%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Python & Django.

2015-07-05 Thread Steve Burrus
*"Are you getting an error message?" lNo particular error message. But I
cannot even start to go thru the usual procedure to end up connecting to
the Django server! It's irrational that for as long as the version 3.4.* of
python has been out that  I hAvE to still use the old version 2.7.  *


*On Sun, Jul 5, 2015 at 4:52 PM, Aaron C. de Bruyn > wrote:*
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *Are you getting an error message? Can you describe what is happening (or
> not happening)? Thanks, -A On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus
> > wrote: > Listen I am
> having/experiencing some degree of diffilculty in being able to >
> coordinaTE my Pytjhon version with Django. i can easily end up connecting
> to > the [django] server but I have to use python version 2.7.* ins tead of
> the > preferred version 3.4.* ZCan some please help me with this? > > > > >
> -- > You received this message because you are subscribed to the Google
> Groups > "Django users" group. > To unsubscribe from this group and stop
> receiving emails from it, send an > email to
> django-users+unsubscr...@googlegroups.com
> . > To post to this group,
> send email to django-users@googlegroups.com
> . > Visit this group at
> http://groups.google.com/group/django-users
> . > To view this discussion on
> the web visit >
> https://groups.google.com/d/msgid/django-users/1d63c599-24ae-416f-8f01-d584c3fd8dfa%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout
> . -- You received this message because
> you are subscribed to a topic in the Google Groups "Django users" group. To
> unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/fAjA0D7wyXM/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> django-users+unsubscr...@googlegroups.com
> . To post to this group, send
> email to django-users@googlegroups.com .
> Visit this group at http://groups.google.com/group/django-users
> . To view this discussion on
> the web visit
> https://groups.google.com/d/msgid/django-users/CAEE%2BrGpyXcBm1AszLHXqsaJ2rg7y13u-1SjT9MizNbT6wdx8Cw%40mail.gmail.com
> .
> *
>
> *For more options, visit https://groups.google.com/d/optout
> . *
>

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


Re: Python & Django.

2015-07-05 Thread Aaron C. de Bruyn
Are you getting an error message?

Can you describe what is happening (or not happening)?

Thanks,

-A

On Sun, Jul 5, 2015 at 8:33 AM, Steve Burrus  wrote:
> Listen I am having/experiencing some degree of diffilculty in being able to
> coordinaTE my Pytjhon version with Django. i can easily end up connecting to
> the [django] server but I have to use python version 2.7.* ins tead of the
> preferred version 3.4.* ZCan some please help me with this?
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1d63c599-24ae-416f-8f01-d584c3fd8dfa%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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


Where does django-rest-framework-social-oauth2 create Django user accounts?

2015-07-05 Thread Daniel Grace
Where in the source code does django-rest-framework-social-oauth2 (which 
uses django-oauth-toolkit and python-social-auth) auto create Django user 
accounts?

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


How to update a Django field which uses pre_save, within a pre_save hook?

2015-07-05 Thread Zsolt Ero


I am using Django Markitup to store markdown rendered versions of 
TextFields in a database. I'd like to normalise all unicode data upon save 
using unicodedata.normalize.

I've written a pre_save signal hook, which does this on all TextFields and 
CharField and it works well.

@receiver(pre_save)def unicode_normalise(sender, **kwargs):
obj = kwargs['instance']
fields = obj._meta.fields
for f in fields:
# excluding django markitup rendered fields
if f.name.endswith('_rendered'):
continue

if isinstance(f, MarkupField):
_markupfield = getattr(obj, f.name)
_markupfield.raw = normalize('NFC', getattr(obj, _markupfield.raw))
# would need to re-render and save rendered version here

elif isinstance(f, (models.CharField, models.TextField)):
normalized = normalize('NFC', getattr(obj, f.name))
setattr(obj, f.name, normalized)

But Django Markitup make things complicated, as it has this two field (raw, 
rendered) concept, which uses pre_save to render and save into it's hidden 
rendered field: GitHub source 


My problem is that a field's pre_save has priority over the signal 
pre_save, so I cannot update the fields within the signal's pre_save function 
(comment inserted in code block above).

How can I re-run a field's pre_save function within my pre_save hook and 
make sure that the rendered markupfield is updated with the new version?

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


Python & Django.

2015-07-05 Thread Steve Burrus
*Listen I am having/experiencing some degree of diffilculty in being able 
to coordinaTE my Pytjhon version with Django. i can easily end up 
connecting to the [django] server but I have to use python version 2.7.* 
ins tead of the preferred version 3.4.* ZCan some please help me with this?*


 

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


Búsquedas en una aplicacion

2015-07-05 Thread Carlos Alonso Turner Benites
Buen día, me podrían dar una idea sobre como seria la forma mas adecuada 
para búsquedas en una aplicación.

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


Re: NoReverseMatch in Django (url ploblem)

2015-07-05 Thread Jeff Gaoey
James - Thank You Very Much

that true it doesn't need /. everything work fine as I want :D.

เมื่อ วันศุกร์ที่ 3 กรกฎาคม ค.ศ. 2015 7 นาฬิกา 38 นาที 54 วินาที UTC+7, 
James Schneider เขียนว่า:
>
>
> > > I'm a beginner of Django I want to set my url with database field_name
> > > instead of use primary key from Django tutorial. This is my code.
> > >
> > > *mysite*
> > > **dwru/urls.py**
> > > urlpatterns = [
> > > url(r'^$', include('product.urls', namespace="product")),
> > > ]
> >
> > This regex is incorrect, and will only match a URL of '/', which is
> > probably not what you want (since you are making other URL's like
> > '/TestCA01' down below). You need to remove the $ from the regex to
> > pass along the entire URL string to the include. You probably need a
> > slash in there also to remove it as a prefix when it is passed along
> > to the include:
> >
> > url(r'^/', include('product.urls', namespace="product")),
> >
>
> I was thinking about this and you may not need the /, if it doesn't work, 
> try without it. I'm not in front of a computer to verify.
>
> -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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e779ffbb-2480-4dc6-998f-dc7bfec97b2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Not getting static files with django & heroku deployment

2015-07-05 Thread Martín Torre Castro
I have just read now your mail when awakening. I also love the work from
Danny and Audrey and got his las two books "2 scoops...".

I will look about this links along today (kind of holidays here) and answer
soon.

Thanks
El 5/7/2015 3:44 a. m., "Malik Rumi"  escribió:

> Hi Martin,
>
> First let me say unapologetically that I love PyDanny and his work and
> contributions to the Django community, especially Two Scoops. However, you
> should know that the philosophy he espouses there is very different from
> the one Heroku espouses. I've been told he talks about that somewhere, but
> I've never seen it personally.
>
> I won't go into too much detail, but you can read about it here:
> https://devcenter.heroku.com/articles/architecting-apps
>
> What you need more than anything is the Heroku Django template :
> https://devcenter.heroku.com/articles/django-app-configuration
>
> Try that first. Follow the directions carefully, then let us know if you
> still need help.
>
>
> On Saturday, July 4, 2015 at 7:13:39 PM UTC-5, Martin Torre Castro wrote:
>>
>> Hello,
>>
>> I'm developing a webapp with Django 1.7 (project_name is "sonata") and
>> the project layout from the "Two scoops of Django 1.6", so I have a 3-tier
>> basic folder tree.
>>
>> .├── requirements└── sonata
>> ├── person
>> │   └── templatetags
>> ├── registration
>> ├── sonata
>> │   └── settings
>> ├── static
>> │   ├── css
>> │   │   └── images
>> │   ├── fonts
>> │   └── js
>> ├── templates
>> │   ├── personApp
>> │   └── registrationApp
>> └── utils
>> └── templatetags
>>
>>
>> I have a problem when deploying on Heroku. I have achieved the
>> deployment, but the static files are not being served to the browser.
>>
>> I know I should force some way of serving the static files through the
>> settings and have googled about. I've seen many ways and read about using
>> Amazon services, but I'm looking for the easiest one, which will make the
>> future production deployment easy as well with gUnicorn (I hope).
>>
>> I tried modifying the settings file (which is the heroku.py one, which
>> overrides the base.py) and changing values for STATIC_ROOT,
>> STATICFILES_DIRS and adding the line:
>>
>> *urlpatterns += static(settings.MEDIA_URL,
>> document_root=settings.STATIC_ROOT)*
>>
>> I've tried as well running:
>>
>> *heroku run sonata/manage.py collectstatic*
>>
>> before doing
>>
>> *git push heroku master*
>>
>> but nothing happens, even checking with
>>
>> *heroku run ls sonata/assets *
>>
>> that the files are being copied.
>>
>> Please, I would like some orientation for really understanding what I'm
>> doing wrong and mending it.
>>
>> When finding out about heroku and deployment I met also some sample
>> ProcFiles which used a project_name.wsgi file and I don't know anything
>> about it.
>>
>> I could use use some help, because the more webs I read, the more
>> confused I get. Please assume I know very little about deployments. A link
>> would be useful, but it has to show newbie's material :-(
>>
>> Thank you very much on advance.
>>
>>
>> ### *ProcFile*
>> ##
>> web: python sonata/manage.py runserver 0.0.0.0:$PORT --noreload
>>
>>
>>
>>
>> ### *heroku.py*
>> ##
>> # -*- coding: utf-8 -*-
>> """Heroku settings and globals."""
>>
>> from __future__ import absolute_import
>>
>> from .base import *
>>
>> from os import environ
>>
>> # TODO Warning! Heroku retrieve values as strings
>> # TODO we should check (only for Heroku) that 'True' and 'False' are
>> respectively True and False 0,
>> # or the equivalent ones, True and False
>> def get_env_setting(setting):
>> """ Gets the environment variable or an Exception.
>> This can be used, for example, for getting the SECRET_KEY and not
>> having it hardcoded in the source code
>> Also for setting the active settings file for local development,
>> heroku, production server, etc... """
>> try:
>> return environ[setting]
>> except KeyError:
>> error_msg = "Set the %s env variable" % setting
>> raise ImproperlyConfigured(error_msg)
>>
>> ## HOST CONFIGURATION
>> # See:
>> https://docs.djangoproject.com/en/1.5/releases/1.5/#allowed-hosts-required-in-production
>> ALLOWED_HOSTS = ['*']
>> ## END HOST CONFIGURATION
>>
>> ## EMAIL CONFIGURATION
>> # See:
>> https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
>> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
>>
>> # See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
>> EMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')
>>
>> # See:
>> https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
>> EMA