Re: Authenticate User with Django 1.5

2012-12-15 Thread Ian Foote

On 15/12/12 11:18, sebastien.mor...@gmail.com wrote:

Hi, i've an authenticate problem with Django 1.5
All informations are
herehttp://stackoverflow.com/questions/13883539/authenticate-with-django-1-5
but i'll resume the situation :

I've a custum user model which looks like :

class User(AbstractBaseUser):
 email = models.EmailField(unique=True)
 activation_key = models.CharField(max_length=255)
 is_active = models.BooleanField(default=False)
 is_admin = models.BooleanField(default=False)

 objects = UserManager()

 USERNAME_FIELD = 'username'






The probleme is that user = authenticate(username=email,
password=password) gives me None as return.
According to the doc, authenticate takes an usersname, not an email as
arg. But how can i use authenticate because my User model desn't support
Username.
Is there a solution with Django 1.5 ?



Have you tried changing USERNAME_FIELD to 'email'?

Ian

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Authenticate User with Django 1.5

2012-12-15 Thread Russell Keith-Magee
On Sat, Dec 15, 2012 at 7:18 PM,  wrote:

> Hi, i've an authenticate problem with Django 1.5
> All informations are here
> http://stackoverflow.com/questions/13883539/authenticate-with-django-1-5but 
> i'll resume the situation :
>
> I've a custum user model which looks like :
>
> class User(AbstractBaseUser):
> email = models.EmailField(unique=True)
> activation_key = models.CharField(max_length=255)
> is_active = models.BooleanField(default=False)
> is_admin = models.BooleanField(default=False)
>
> objects = UserManager()
>
> USERNAME_FIELD = 'username'
>
> With a form, i can register users, and all is correct.
> Now, i'd like to log the registred user with :
> class LoginForm(forms.Form):
> email = forms.EmailField()
> password = forms.CharField(
> label="Password",
> widget=forms.PasswordInput()
> )
>
> The corresponding view is :
>
> def login(request):
> form = LoginForm()
> if request.method == 'POST':
> form = LoginForm(request.POST)
> email =  request.POST['email']
> password = request.POST['password']
> user = authenticate(username=email, password=password)
> if user is not None:
> if user.is_active:
> login(user)
> else:
> message = 'disabled account, check validation email'
> return render(
> request,
> 'account-login-failed.html',
> {'message': message}
> )
>
> return render(request, 'account-login.html', {'form': form})
>
>
> The probleme is that user = authenticate(username=email,
> password=password) gives me None as return.
> According to the doc, authenticate takes an usersname, not an email as
> arg. But how can i use authenticate because my User model desn't support
> Username.
> Is there a solution with Django 1.5 ?


Well, no, there isn't a special Django 1.5 solution -- what you've
described here (calling authenticate() with the email address as the
username argument) should be all you need to do.

My initial guess would be that you're not calling the right authenticate
method; you haven't included your imports, but based on the fact that
you're calling "login()", in a view called "login()", I'm going to guess
there might be some import conflicts going on. I'd try starting in a shell
trying to manually authenticate a user - if:

>>> from django.contrib.auth import authenticate
>>> authenticate(username='t...@example.com', password='s3kr1t')

works, but your view doesn't, then the problem will be with imports. If it
doesn't work, then the probably will probably be with the list of
authentication backends -- I'm guessing the ModelBackend isn't being
installed correctly. However, without more details, it's hard to tell.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Authenticate User with Django 1.5

2012-12-15 Thread Russell Keith-Magee
Hi Tom,

You've missed an important detail here: he's talking about Django 1.5 and a
custom User model. A custom authentication backend isn't required; the
ModelBackend should adapt to any well-defined User model.

Yours,
Russ Magee %-)

On Sun, Dec 16, 2012 at 6:33 AM, Tom Christie wrote:

> I believe you'll need a custom authentication backend to tie in with your
> user model.
>
> Take a look at the docs here:
>
> https://docs.djangoproject.com/en/dev/ref/authbackends/
>
> Here's an example of an auth backend that takes email/password instead of
> username/password:
>
>
> https://github.com/dabapps/django-email-as-username/blob/master/emailusernames/backends.py
>
> Hope that helps.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/csl1KBONlr4J.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Authenticate User with Django 1.5

2012-12-15 Thread Tom Christie
I believe you'll need a custom authentication backend to tie in with your user 
model.

Take a look at the docs here:

https://docs.djangoproject.com/en/dev/ref/authbackends/

Here's an example of an auth backend that takes email/password instead of 
username/password:

https://github.com/dabapps/django-email-as-username/blob/master/emailusernames/backends.py

Hope that helps.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/csl1KBONlr4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Phil Brant
ah that worked. I have apache on port 80 so I didn't see my django site, so
I just tried a different port and all my django sites work on the new port
now. I always used port 8080 before I wonder why it doesn't work anymore.
Anyway working again, thanks a million devan!


On Sat, Dec 15, 2012 at 4:25 PM, Dev  wrote:

> Run from command line:
> "python manage.py runserver"
>
> Also i guess you are getting an import error because your 'path
> environment variable' doesn't contain the path of the directory of your
> project.
>
> Sent from my iPhone
>
> On 15-Dec-2012, at 9:34 PM, Phil Brant  wrote:
>
> OK, thanks for your help anyway.
>
>
> On Sat, Dec 15, 2012 at 3:57 PM, Ramiro Morales  wrote:
>
>>
>> On Dec 15, 2012 11:30 AM, "Phil"  wrote:
>> >
>> > Hi,
>> >
>> > I had django setup and working for over a year now working with it on
>> and off. I was away for a month, came back and now whenever I run
>> "django-admin.py runserver 8080" I get the following error...
>> >
>> > ImportError: Settings cannot be imported, because environment variable
>> DJANGO_SETTINGS_MODULE is undefined.
>> >
>> > I can import django from command line(version 1.4.3), I ran
>> "django-admin.py startproject test" to try a new project. It has
>> "os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared
>> in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so
>> how is my DJANGO_SETTINGS_MODULE undefined?
>>
>> Hace you by chance actually upgraded Django todo 1.4.x from aún older
>> versión? Are you using Mac OS X?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Kind Regards,
> Philip Brant.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Kind Regards,
Philip Brant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Bill Freeman
On Sat, Dec 15, 2012 at 9:30 AM, Phil  wrote:

> Hi,
>
> I had django setup and working for over a year now working with it on and
> off. I was away for a month, came back and now whenever I run
> "django-admin.py runserver 8080" I get the following error...
>

Maybe there's a way to do this, but the only thing that I use
django-admin.py for is startproject.  I haven't  found any suggestion to
use it for anything else in the documents.  All other operations, like
syncdb, runserver, I do by cd'ing into the project root (directory
containing manage.py) and running "python manage.py runserver 8080", for
example.  The cd part is important, because python adds the current
directory to sys.path (if it's not already there), and it needs to be there
to import settings, among other things.  (Running under WSGI, for example,
you will need to add this directory yourself.)

Bill

>
> ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined.
>
> I can import django from command line(version 1.4.3), I ran
> "django-admin.py startproject test" to try a new project. It has
> "os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared
> in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so
> how is my DJANGO_SETTINGS_MODULE undefined?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/DKnfFKq7KcQJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Dev
Run from command line:
"python manage.py runserver"

Also i guess you are getting an import error because your 'path environment 
variable' doesn't contain the path of the directory of your project.

Sent from my iPhone

On 15-Dec-2012, at 9:34 PM, Phil Brant  wrote:

> OK, thanks for your help anyway.
> 
> 
> On Sat, Dec 15, 2012 at 3:57 PM, Ramiro Morales  wrote:
> 
> On Dec 15, 2012 11:30 AM, "Phil"  wrote:
> >
> > Hi,
> >
> > I had django setup and working for over a year now working with it on and 
> > off. I was away for a month, came back and now whenever I run 
> > "django-admin.py runserver 8080" I get the following error...
> >
> > ImportError: Settings cannot be imported, because environment variable 
> > DJANGO_SETTINGS_MODULE is undefined.
> >
> > I can import django from command line(version 1.4.3), I ran 
> > "django-admin.py startproject test" to try a new project. It has 
> > "os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared 
> > in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so 
> > how is my DJANGO_SETTINGS_MODULE undefined?
> 
> Hace you by chance actually upgraded Django todo 1.4.x from aún older 
> versión? Are you using Mac OS X?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> -- 
> Kind Regards,
> Philip Brant.
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Authenticate User with Django 1.5

2012-12-15 Thread sebastien . morele
Hi, i've an authenticate problem with Django 1.5
All informations are here
http://stackoverflow.com/questions/13883539/authenticate-with-django-1-5but 
i'll resume the situation :

I've a custum user model which looks like :

class User(AbstractBaseUser):
email = models.EmailField(unique=True)
activation_key = models.CharField(max_length=255)
is_active = models.BooleanField(default=False)
is_admin = models.BooleanField(default=False)

objects = UserManager()

USERNAME_FIELD = 'username'

With a form, i can register users, and all is correct.
Now, i'd like to log the registred user with :
class LoginForm(forms.Form):
email = forms.EmailField()
password = forms.CharField(
label="Password",
widget=forms.PasswordInput()
)

The corresponding view is :

def login(request):
form = LoginForm()
if request.method == 'POST':
form = LoginForm(request.POST)
email =  request.POST['email']
password = request.POST['password'] 
user = authenticate(username=email, password=password)
if user is not None:
if user.is_active:
login(user)
else:
message = 'disabled account, check validation email'
return render(
request, 
'account-login-failed.html', 
{'message': message}
)

return render(request, 'account-login.html', {'form': form})


The probleme is that user = authenticate(username=email, password=password) 
gives me None as return.
According to the doc, authenticate takes an usersname, not an email as arg. 
But how can i use authenticate because my User model desn't support 
Username.
Is there a solution with Django 1.5 ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/IFegrWWN1zgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



【HELP】AttributeError: 'AdminSite' object has no attribute 'urls'

2012-12-15 Thread 向浩
Environment:

Request Method: GET
Request URL: http://127.0.0.1:8000/admin/
Django Version: 1.0.4
Python Version: 2.7.3
Installed Applications:
['django.contrib.auth',
 'django.contrib.admin',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'mysite.books']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" 
in get_response
  82. request.path_info)
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in resolve
  181. for pattern in self.urlconf_module.urlpatterns:
File "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py" 
in _get_urlconf_module
  205. self._urlconf_module = __import__(self.urlconf_name, {}, 
{}, [''])
File "/home/xhao/djcode/mysite/../mysite/urls.py" in 
  16. (r'^admin/', include(admin.site.urls)),

Exception Type: AttributeError at /admin/
Exception Value: 'AdminSite' object has no attribute 'urls'

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/SdlHuLExd9YJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Theming Django with Diazo/XSLT

2012-12-15 Thread 4 The good Life we work
Hallo,

I'm used to theme Plone with Diazo/ XSLT.

Is there any tutorial for Django?

Thanks,
Michael

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Phil Brant
OK, thanks for your help anyway.


On Sat, Dec 15, 2012 at 3:57 PM, Ramiro Morales  wrote:

>
> On Dec 15, 2012 11:30 AM, "Phil"  wrote:
> >
> > Hi,
> >
> > I had django setup and working for over a year now working with it on
> and off. I was away for a month, came back and now whenever I run
> "django-admin.py runserver 8080" I get the following error...
> >
> > ImportError: Settings cannot be imported, because environment variable
> DJANGO_SETTINGS_MODULE is undefined.
> >
> > I can import django from command line(version 1.4.3), I ran
> "django-admin.py startproject test" to try a new project. It has
> "os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared
> in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so
> how is my DJANGO_SETTINGS_MODULE undefined?
>
> Hace you by chance actually upgraded Django todo 1.4.x from aún older
> versión? Are you using Mac OS X?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Kind Regards,
Philip Brant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Ramiro Morales
On Dec 15, 2012 11:30 AM, "Phil"  wrote:
>
> Hi,
>
> I had django setup and working for over a year now working with it on and
off. I was away for a month, came back and now whenever I run
"django-admin.py runserver 8080" I get the following error...
>
> ImportError: Settings cannot be imported, because environment variable
DJANGO_SETTINGS_MODULE is undefined.
>
> I can import django from command line(version 1.4.3), I ran
"django-admin.py startproject test" to try a new project. It has
"os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared
in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so
how is my DJANGO_SETTINGS_MODULE undefined?

Hace you by chance actually upgraded Django todo 1.4.x from aún older
versión? Are you using Mac OS X?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Xavier Ordoquy
Le 15 déc. 2012 à 16:37, Phil Brant  a écrit :

> Running that in python interpreter just throws an error "Invalid Syntax"

Without stacktrace, there isn't much we can do.
There might be something wrong in your settings file.

Regards,
Xavier Ordoquy,
Linovia.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Phil Brant
Running that in python interpreter just throws an error "Invalid Syntax"


On Sat, Dec 15, 2012 at 3:29 PM, Xavier Ordoquy wrote:

>
> Sorry I should have been more explicit. You need to call the manage.py
> through the python interpreter: "python manage.py runserver" because your
> local directory isn't in your paths.
>
> Regards,
> Xavier Ordoquy,
> Linovia.
>
> Le 15 déc. 2012 à 16:14, Phil Brant  a écrit :
>
> I tried "manage.py runserver 8080" there just get "command not found".
> I've never done it that way in the past but doesn't work either.
>
>
> On Sat, Dec 15, 2012 at 3:09 PM, Xavier Ordoquy wrote:
>
>>
>> Have you tried to start them with the manage.py runserver instead of
>> django-admin ?
>>
>> Regards,
>> Xavier Ordoquy,
>> Linovia.
>>
>> Le 15 déc. 2012 à 15:38, Phil  a écrit :
>>
>> Hi Xavier, I tried a project called "boom" too and same message, plus my
>> other 3 django projects I had working previously all get the same error now.
>>
>> On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
>>>
>>> Hi Phil,
>>>
>>> test is a python module. Your project name conflicts with it.
>>> You should use another name for your project.
>>>
>>> Regards,
>>> Xavier Ordoquy,
>>> Linovia.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/kFwQlmOsSQgJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Kind Regards,
> Philip Brant.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Kind Regards,
Philip Brant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Xavier Ordoquy

Sorry I should have been more explicit. You need to call the manage.py through 
the python interpreter: "python manage.py runserver" because your local 
directory isn't in your paths.

Regards,
Xavier Ordoquy,
Linovia.

Le 15 déc. 2012 à 16:14, Phil Brant  a écrit :

> I tried "manage.py runserver 8080" there just get "command not found". I've 
> never done it that way in the past but doesn't work either.
> 
> 
> On Sat, Dec 15, 2012 at 3:09 PM, Xavier Ordoquy  wrote:
> 
> Have you tried to start them with the manage.py runserver instead of 
> django-admin ?
> 
> Regards,
> Xavier Ordoquy,
> Linovia.
> 
> Le 15 déc. 2012 à 15:38, Phil  a écrit :
> 
>> Hi Xavier, I tried a project called "boom" too and same message, plus my 
>> other 3 django projects I had working previously all get the same error now.
>> 
>> On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
>> Hi Phil, 
>> 
>> test is a python module. Your project name conflicts with it. 
>> You should use another name for your project. 
>> 
>> Regards, 
>> Xavier Ordoquy, 
>> Linovia. 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/kFwQlmOsSQgJ.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> -- 
> Kind Regards,
> Philip Brant.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Phil Brant
I tried "manage.py runserver 8080" there just get "command not found". I've
never done it that way in the past but doesn't work either.


On Sat, Dec 15, 2012 at 3:09 PM, Xavier Ordoquy wrote:

>
> Have you tried to start them with the manage.py runserver instead of
> django-admin ?
>
> Regards,
> Xavier Ordoquy,
> Linovia.
>
> Le 15 déc. 2012 à 15:38, Phil  a écrit :
>
> Hi Xavier, I tried a project called "boom" too and same message, plus my
> other 3 django projects I had working previously all get the same error now.
>
> On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
>>
>> Hi Phil,
>>
>> test is a python module. Your project name conflicts with it.
>> You should use another name for your project.
>>
>> Regards,
>> Xavier Ordoquy,
>> Linovia.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/kFwQlmOsSQgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Kind Regards,
Philip Brant.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Xavier Ordoquy

Have you tried to start them with the manage.py runserver instead of 
django-admin ?

Regards,
Xavier Ordoquy,
Linovia.

Le 15 déc. 2012 à 15:38, Phil  a écrit :

> Hi Xavier, I tried a project called "boom" too and same message, plus my 
> other 3 django projects I had working previously all get the same error now.
> 
> On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
> Hi Phil, 
> 
> test is a python module. Your project name conflicts with it. 
> You should use another name for your project. 
> 
> Regards, 
> Xavier Ordoquy, 
> Linovia. 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/django-users/-/kFwQlmOsSQgJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
Ok, got a friend to try this using python2.7 and did not get the naive
datetime warnings.

So I conclude it is something about either python2.6 or something else
in my local environment, and not a proper django-users concern.

P.S. Chris, thanks again for all the help.  You're really active
responding on django-users lately.

On Sat, Dec 15, 2012 at 4:13 AM, Bob Haugen  wrote:
> On Sat, Dec 15, 2012 at 1:16 AM, Chris Cogdon  wrote:
>> I never got the warnings you got, but I got three errors along the lines of:
>> IntegrityError: valueaccounting_economicagent.created_date may not be NULL
>
>> Want me to grab a different revision from git ?
>
> Fixed that one.  You could do a git pull if you really want.  And huge
> thanks for all the work.
>
> But I wonder why I never got that error (which was clearly an error,
> which I have been oblivious about), and you did not get the naive
> datetime warnings...?
>
> Some diff between python2.7 and python2.6?  I'll have a local friend
> try it later today.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Phil
Hi Xavier, I tried a project called "boom" too and same message, plus my 
other 3 django projects I had working previously all get the same error now.

On Saturday, December 15, 2012 2:34:48 PM UTC, Xavier Ordoquy wrote:
>
> Hi Phil, 
>
> test is a python module. Your project name conflicts with it. 
> You should use another name for your project. 
>
> Regards, 
> Xavier Ordoquy, 
> Linovia. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/kFwQlmOsSQgJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: error message on runserver locally

2012-12-15 Thread Xavier Ordoquy
Hi Phil,

test is a python module. Your project name conflicts with it.
You should use another name for your project.

Regards,
Xavier Ordoquy,
Linovia.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



error message on runserver locally

2012-12-15 Thread Phil
Hi,

I had django setup and working for over a year now working with it on and 
off. I was away for a month, came back and now whenever I run 
"django-admin.py runserver 8080" I get the following error...

ImportError: Settings cannot be imported, because environment variable 
DJANGO_SETTINGS_MODULE is undefined.

I can import django from command line(version 1.4.3), I ran 
"django-admin.py startproject test" to try a new project. It has 
"os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")" declared 
in "manage.py" in the root and in "test/test/wsgi.py" it's also declared so 
how is my DJANGO_SETTINGS_MODULE undefined?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/DKnfFKq7KcQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django Celery FIFO ORDER

2012-12-15 Thread psychok7
hey Nikolas, it looks like a solution that would work in fact, but there 
are some limitations in terms of performance (i need my app to be 
scalable). If for each request i sort my database it will eventually become 
slow for 10.000 requests, so i was actually looking for a more scalable 
solution.

For know i can work with your idea, but wouldn't want it to be long term. 
If you have any more ideas please share.

On Monday, December 10, 2012 4:20:52 PM UTC, psychok7 wrote:
>
> So I have this 2 applications connected with a REST API (json messages). 
> One written in Django and the other in Php. I have an exact database 
> replica on both sides (using mysql).
>
> When i press "submit" on one of them, i want that data to be saved on the 
> current app database, and start a cron job with celery/redis to update the 
> remote database for the other app using rest.
>
> *My question is, how do i attribute the same worker to my tasks in order 
> to keep a FIFO order?*
>
> I need my data to be consistent and FIFO is really important.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/dmZ0utouw48J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: getting "DateTimeField received a naive datetime" error but have no DateTimeFields

2012-12-15 Thread Bob Haugen
On Sat, Dec 15, 2012 at 1:16 AM, Chris Cogdon  wrote:
> I never got the warnings you got, but I got three errors along the lines of:
> IntegrityError: valueaccounting_economicagent.created_date may not be NULL

> Want me to grab a different revision from git ?

Fixed that one.  You could do a git pull if you really want.  And huge
thanks for all the work.

But I wonder why I never got that error (which was clearly an error,
which I have been oblivious about), and you did not get the naive
datetime warnings...?

Some diff between python2.7 and python2.6?  I'll have a local friend
try it later today.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-15 Thread Carsten Fuchs

Hi Chris,

Am 2012-12-13 19:39, schrieb Chris Cogdon:

This will depend on the problem, but let me site a simple example for how this 
is often
solved.
[...]

I hope that gives you sufficient options.


Yes, it does; I guess I'll just have to experiment with locking the "input" 
rows a bit.  :-)

Thank you very much for your help!

Best regards,
Carsten



--
   Cafu - the open-source Game and Graphics Engine
for multiplayer, cross-platform, real-time 3D Action
  Learn more at http://www.cafu.de

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.