Re: syncdb command can execute

2016-12-19 Thread Jani Tiainen

Hi,

Note that syncdb was deprecated in favor of migrations.

Also if you have followed the official Django tutorial, second part of 
it goes through creating models and reflecting your models to database.


https://docs.djangoproject.com/en/1.10/intro/tutorial02/

On 19.12.2016 12:56, Navneel Pandey wrote:
hi i am new to django as i want to create a table but unable to do so 
I am writing the command python manage.py syncdb

--
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 
<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to django-users@googlegroups.com 
<mailto: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/ba2b0951-ab21-425c-91ed-9706830eae92%40googlegroups.com 
<https://groups.google.com/d/msgid/django-users/ba2b0951-ab21-425c-91ed-9706830eae92%40googlegroups.com?utm_medium=email&utm_source=footer>.

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


--
Jani Tiainen

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+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/df3fd711-4072-b508-bbb8-ded964028e25%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb command can execute

2016-12-19 Thread Lekan Wahab
Would you provide a little more information?

What errors are you getting?

On Mon, Dec 19, 2016 at 11:56 AM, Navneel Pandey 
wrote:

> hi i am new to django as i want to create a table but unable to do so I am
> writing the command python manage.py syncdb
>
> --
> 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/ba2b0951-ab21-425c-91ed-9706830eae92%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ba2b0951-ab21-425c-91ed-9706830eae92%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAE6v7ofNJmwum6Et_6_VBcs%3DTRGnSPXR_-7w94b4hu2%2BOSApfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


syncdb command can execute

2016-12-19 Thread Navneel Pandey
hi i am new to django as i want to create a table but unable to do so I am 
writing the command python manage.py syncdb

-- 
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/ba2b0951-ab21-425c-91ed-9706830eae92%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb problem with mongodb engine

2015-10-19 Thread Lianghong Xu
Hi,

I was able to fix the problem by applying the patch here:

https://bitbucket.org/andrewgodwin/south/pull-requests/86/fixing-the-keyerror-default-when-managerpy/diff

Thanks,
Lianghong


On Monday, October 19, 2015 at 12:44:33 PM UTC-4, James Schneider wrote:
>
> The version of Django you are running has not been supported for quite a 
> while, you should update your Django installation to 1.7 or 1.8. There may 
> be a compatibility issue if you have a new version of the plugin but an old 
> Django installation.
>
> You should also look to see if there is a support ticket queue for the 
> MongoDB app you are using since Django doesn't support it out of the box. I 
> doubt you'll get much help here for an unsupported Django version, 
> especially since you are trying to integrate with a heavy third-party 
> package.
>
> -James
> On Oct 19, 2015 9:14 AM, "Lianghong Xu" > 
> wrote:
>
>> Hi,
>>
>> I'm new to django. I would like to use MongoDB as my backend engine and 
>> installed all required packages for a MongoDB setup. However, when I run 
>> "python manage.py syncdb", I get the following error message:
>>
>> (mywiki)lianghon@172-19-151-114:~/repo/mywiki/testwiki$ python manage.py 
>> syncdb
>>
>> Traceback (most recent call last):
>>
>>   File "manage.py", line 10, in 
>>
>> execute_from_command_line(sys.argv)
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 399, in execute_from_command_line
>>
>> utility.execute()
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 392, in execute
>>
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 272, in fetch_command
>>
>> klass = load_command_class(app_name, subcommand)
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
>>  
>> line 75, in load_command_class
>>
>> module = import_module('%s.management.commands.%s' % (app_name, name))
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/utils/importlib.py",
>>  
>> line 40, in import_module
>>
>> __import__(name)
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/__init__.py",
>>  
>> line 13, in 
>>
>> from south.management.commands.syncdb import Command as SyncCommand
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
>>  
>> line 19, in 
>>
>> from south.db import dbs
>>
>>   File 
>> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/db/__init__.py",
>>  
>> line 84, in 
>>
>> db = dbs[DEFAULT_DB_ALIAS]
>>
>> KeyError: 'default'
>>
>>
>>
>> I've searched a lot on the Internet on this problem and most answers are 
>> like this: 
>>
>> "You don't have correct DATABASES 
>> <https://docs.djangoproject.com/en/1.4/ref/settings/#databases> in your 
>> settings. There should be a database named 'default'"
>>
>>
>> My DATABASES settings is as follows: 
>>
>>
>> DATABASES = {
>>
>> 'default': {
>>
>> 'ENGINE': 'django_mongodb_engine',
>>
>> 'NAME': 'wikipedia',
>>
>> }
>>
>> }
>>
>>
>> I don't think there is a problem with my settings. The mongodb server on 
>> my localhost is working fine. The django version I'm using is 1.5.11. 
>>
>>
>> Any help would be very much appreciated!
>>
>>
>> Thanks!
>>
>> Lianghong
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/37905c1e-7a22-4f2f-84f6-ed3afa86eebd%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/37905c1e-7a22-4f2f-84f6-ed3afa86eebd%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> 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/555cd3b2-65ee-4ad8-9c3c-c8037a9f0e29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb problem with mongodb engine

2015-10-19 Thread James Schneider
The version of Django you are running has not been supported for quite a
while, you should update your Django installation to 1.7 or 1.8. There may
be a compatibility issue if you have a new version of the plugin but an old
Django installation.

You should also look to see if there is a support ticket queue for the
MongoDB app you are using since Django doesn't support it out of the box. I
doubt you'll get much help here for an unsupported Django version,
especially since you are trying to integrate with a heavy third-party
package.

-James
On Oct 19, 2015 9:14 AM, "Lianghong Xu"  wrote:

> Hi,
>
> I'm new to django. I would like to use MongoDB as my backend engine and
> installed all required packages for a MongoDB setup. However, when I run
> "python manage.py syncdb", I get the following error message:
>
> (mywiki)lianghon@172-19-151-114:~/repo/mywiki/testwiki$ python manage.py
> syncdb
>
> Traceback (most recent call last):
>
>   File "manage.py", line 10, in 
>
> execute_from_command_line(sys.argv)
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
>
> utility.execute()
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 392, in execute
>
> self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 272, in fetch_command
>
> klass = load_command_class(app_name, subcommand)
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
> line 75, in load_command_class
>
> module = import_module('%s.management.commands.%s' % (app_name, name))
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/utils/importlib.py",
> line 40, in import_module
>
> __import__(name)
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/__init__.py",
> line 13, in 
>
> from south.management.commands.syncdb import Command as SyncCommand
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
> line 19, in 
>
> from south.db import dbs
>
>   File
> "/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/db/__init__.py",
> line 84, in 
>
> db = dbs[DEFAULT_DB_ALIAS]
>
> KeyError: 'default'
>
>
>
> I've searched a lot on the Internet on this problem and most answers are
> like this:
>
> "You don't have correct DATABASES
> <https://docs.djangoproject.com/en/1.4/ref/settings/#databases> in your
> settings. There should be a database named 'default'"
>
>
> My DATABASES settings is as follows:
>
>
> DATABASES = {
>
> 'default': {
>
> 'ENGINE': 'django_mongodb_engine',
>
> 'NAME': 'wikipedia',
>
> }
>
> }
>
>
> I don't think there is a problem with my settings. The mongodb server on
> my localhost is working fine. The django version I'm using is 1.5.11.
>
>
> Any help would be very much appreciated!
>
>
> Thanks!
>
> Lianghong
>
> --
> 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/37905c1e-7a22-4f2f-84f6-ed3afa86eebd%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/37905c1e-7a22-4f2f-84f6-ed3afa86eebd%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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%2Be%2BciUvTyxs2t1OjGPkgmweejw1WXaSsQZGMPhQrw7_j%3DB69w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


syncdb problem with mongodb engine

2015-10-19 Thread Lianghong Xu
Hi,

I'm new to django. I'd like to use MongoDB as my backend engine and have 
installed all the required packages for a MongoDB django setup. However, 
when I run "python manage.py syncdb", I get this error:

Traceback (most recent call last):

  File "./manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 453, in execute_from_command_line

utility.execute()

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 392, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 272, in fetch_command

klass = load_command_class(app_name, subcommand)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 77, in load_command_class

module = import_module('%s.management.commands.%s' % (app_name, name))

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/utils/importlib.py",
 
line 35, in import_module

__import__(name)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/__init__.py",
 
line 13, in 

from south.management.commands.syncdb import Command as SyncCommand

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
 
line 19, in 

from south.db import dbs

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/db/__init__.py",
 
line 84, in 

db = dbs[DEFAULT_DB_ALIAS]

KeyError: 'default'


I searched a lot on the Internet on this problem and most answers are like 
this one: 

"You don't have correct DATABASES 
<https://docs.djangoproject.com/en/1.4/ref/settings/#databases> in your 
settings. There should be a database named 'default'".


However, I don't think there is a problem with my settings file which 
already sets the default database:


DATABASES = {

'default': {

'ENGINE': 'django_mongodb_engine',

'NAME': 'wikipedia',

}

}


The Django version I'm using is 1.5.11. Any help would be very much 
appreciated! 


Thanks!

Lianghong

-- 
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/431013a9-5831-4bbf-8b24-477960e641f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


syncdb problem with mongodb engine

2015-10-19 Thread Lianghong Xu
Hi,

I'm new to django. I would like to use MongoDB as my backend engine and 
installed all required packages for a MongoDB setup. However, when I run 
"python manage.py syncdb", I get the following error message:

(mywiki)lianghon@172-19-151-114:~/repo/mywiki/testwiki$ python manage.py 
syncdb

Traceback (most recent call last):

  File "manage.py", line 10, in 

execute_from_command_line(sys.argv)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 399, in execute_from_command_line

utility.execute()

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 392, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 272, in fetch_command

klass = load_command_class(app_name, subcommand)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/core/management/__init__.py",
 
line 75, in load_command_class

module = import_module('%s.management.commands.%s' % (app_name, name))

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/django/utils/importlib.py",
 
line 40, in import_module

__import__(name)

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/__init__.py",
 
line 13, in 

from south.management.commands.syncdb import Command as SyncCommand

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/management/commands/syncdb.py",
 
line 19, in 

from south.db import dbs

  File 
"/h/lianghon/repo/mywiki/mywiki/local/lib/python2.7/site-packages/south/db/__init__.py",
 
line 84, in 

db = dbs[DEFAULT_DB_ALIAS]

KeyError: 'default'



I've searched a lot on the Internet on this problem and most answers are 
like this: 

"You don't have correct DATABASES 
<https://docs.djangoproject.com/en/1.4/ref/settings/#databases> in your 
settings. There should be a database named 'default'"


My DATABASES settings is as follows: 


DATABASES = {

'default': {

'ENGINE': 'django_mongodb_engine',

'NAME': 'wikipedia',

}

}


I don't think there is a problem with my settings. The mongodb server on my 
localhost is working fine. The django version I'm using is 1.5.11. 


Any help would be very much appreciated!


Thanks!

Lianghong

-- 
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/37905c1e-7a22-4f2f-84f6-ed3afa86eebd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Don't run python manage.py syncdb

2015-10-09 Thread Rafael E. Ferrero
i think that u need to set 'myApp' in INSTALLED_APPS

something like:

> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'myApp'


--
Rafael E. Ferrero

2015-10-09 16:39 GMT-03:00 Faffafa Trtrtrtrt :

> I create question in
> http://stackoverflow.com/questions/32999054/dont-run-python-manage-py-syncdb.
> Any one can answer it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+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/d1334ecc-3070-4968-b81f-ab1942841c8c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/d1334ecc-3070-4968-b81f-ab1942841c8c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAJJc_8UAL%2B%2BYSCNUwXJ4C_nJhwsmVrd5XYFfmJ8Wrk8p5AH_QA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Don't run python manage.py syncdb

2015-10-09 Thread Faffafa Trtrtrtrt
I create question 
in 
http://stackoverflow.com/questions/32999054/dont-run-python-manage-py-syncdb. 
Any one can answer it?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+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/d1334ecc-3070-4968-b81f-ab1942841c8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 upgrade custom user model syncdb

2015-04-09 Thread Jochen Wersdoerfer


On Wednesday, April 8, 2015 at 5:46:42 PM UTC+2, Markus Holtermann wrote:
>
>
> glad it works now. In that case you want to look at 
> https://docs.djangoproject.com/en/1.8/ref/settings/#migration-modules 
> and place the migrations somewhere in your project. Otherwise the 
> migrations end up in your virtualenv and are not available when you 
> deploy the application. 
>

Yep, thx - didn't know I could place the migrations anywhere :).

best regards,
Jochen 

-- 
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/61c002b2-dd7f-4fcf-a8f1-f6349c366aee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Markus Holtermann

Hey Jochen,

glad it works now. In that case you want to look at
https://docs.djangoproject.com/en/1.8/ref/settings/#migration-modules
and place the migrations somewhere in your project. Otherwise the
migrations end up in your virtualenv and are not available when you
deploy the application.

Best,

/Markus

On Wed, Apr 08, 2015 at 08:32:35AM -0700, Jochen Wersdoerfer wrote:

On Wednesday, April 8, 2015 at 4:56:43 PM UTC+2, Jochen Wersdoerfer wrote:



There’s an initial migration for my custom user model in accounts.models,
so the accounts_pixolususer table should have been created. The syncdb
command breaks while adding a constraint to an app without migrations
(meters), which has a model with a foreign key pointing to my custom user
model.



Ok, got it. Can't have a dependency from an unmigrated app to an
app with migrations. Most of my own and some third party apps were
unmigrated. Had circular dependencies, too. Difficult upgrade. You
can add an initial migration for an umigrated third party app installed
via pip by:

./manage.py makemigrations third_party_app

But now it works \o/ :).

best regards,
Jochen

--
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/3ad4dc51-94c0-41da-addf-cd1676243df7%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/20150408154558.GA3356%40pyler.local.
For more options, visit https://groups.google.com/d/optout.


pgp9EWuvA9hZm.pgp
Description: PGP signature


Re: django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Jochen Wersdoerfer
On Wednesday, April 8, 2015 at 4:56:43 PM UTC+2, Jochen Wersdoerfer wrote:
>
>
> There’s an initial migration for my custom user model in accounts.models,
> so the accounts_pixolususer table should have been created. The syncdb
> command breaks while adding a constraint to an app without migrations
> (meters), which has a model with a foreign key pointing to my custom user
> model.
>

Ok, got it. Can't have a dependency from an unmigrated app to an
app with migrations. Most of my own and some third party apps were
unmigrated. Had circular dependencies, too. Difficult upgrade. You
can add an initial migration for an umigrated third party app installed
via pip by:

./manage.py makemigrations third_party_app

But now it works \o/ :).

best regards,
Jochen 

-- 
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/3ad4dc51-94c0-41da-addf-cd1676243df7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django 1.8 upgrade custom user model syncdb

2015-04-08 Thread Jochen Wersdoerfer
Hi *,

I’m trying to upgrade to django 1.8, but running into some app-dependency
issues:

http://pastebin.com/uvKtBtNa

There’s an initial migration for my custom user model in accounts.models,
so the accounts_pixolususer table should have been created. The syncdb
command breaks while adding a constraint to an app without migrations
(meters), which has a model with a foreign key pointing to my custom user
model.

For syncdb there’s an easy workaround - I just run ./manage.py migrate 
accounts
first. But since syncdb is also called by the testrunner, so I can’t run 
tests
anymore :/.

best regards,
Jochen

-- 
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/99a9f0a4-cb6a-46dc-9eef-d85e87649b43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-23 Thread Dan Dong
Thanks Russell, that's clear now.

Cheers,
Dan


在 2015年3月20日星期五 UTC-5下午6:27:12,Russell Keith-Magee写道:
>
>
> On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong 
> > wrote:
>
>> Hi,
>>   Does anybody know how to supply the input parameters to "python 
>> manage.py syncdb" from a script? E.g, to set the the followings parameters:
>>
>> Would you like to create one now? (yes/no): yes
>> Username (leave blank to use 'root'): 
>> Email address: x
>> Password: xx
>> Password (again): xx
>>
>> You don't - and that's by design.
>
> If you're putting a password into a script, then that script is in plain 
> text, and so is your password - so you've just lost your security.
>
> So - you don't pass input parameters to the script. You run the script 
> with the --noinput flag, which will prevent the script from prompting for 
> user input.
>
> If you want to have an initial user in your database after syncdb, put 
> that user's data in a fixture, and load the fixture as part of the script. 
> The fixture will contain the password in a hashed format, so the password 
> will be protected.
>
> Yours,
> Russ Magee %-)
>

-- 
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/e12b2f3a-05c5-4c33-bcfd-5c6a8c6c9d1c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Russell Keith-Magee
On Sat, Mar 21, 2015 at 5:25 AM, Dan Dong  wrote:

> Hi,
>   Does anybody know how to supply the input parameters to "python
> manage.py syncdb" from a script? E.g, to set the the followings parameters:
>
> Would you like to create one now? (yes/no): yes
> Username (leave blank to use 'root'):
> Email address: x
> Password: xx
> Password (again): xx
>
> You don't - and that's by design.

If you're putting a password into a script, then that script is in plain
text, and so is your password - so you've just lost your security.

So - you don't pass input parameters to the script. You run the script with
the --noinput flag, which will prevent the script from prompting for user
input.

If you want to have an initial user in your database after syncdb, put that
user's data in a fixture, and load the fixture as part of the script. The
fixture will contain the password in a hashed format, so the password will
be protected.

Yours,
Russ Magee %-)

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


Supply parameters to "manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi, All,
  Does anybody know how to supply input parameters to "python manage.py 
syncdb" from a script? E.g. in a bash/python script, to set the following 
parameters:

Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): 
Email address: x...@xxx.xxx
Password: x
Password (again): x


Cheers,
Dan

-- 
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/92eba9eb-1494-4b14-bbb5-482f002e5748%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to supply parameters to "python manage.py syncdb" from a script?

2015-03-20 Thread Dan Dong
Hi,
  Does anybody know how to supply the input parameters to "python manage.py 
syncdb" from a script? E.g, to set the the followings parameters:

Would you like to create one now? (yes/no): yes
Username (leave blank to use 'root'): 
Email address: x
Password: xx
Password (again): xx


Cheers,
Dan

-- 
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/8f07775c-341f-40af-b25d-6364dfaaf966%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


oracle syncdb crashes while setting column to NULL when it already is NULL

2015-02-05 Thread Joris Benschop
hi

I'm not sure if this is a dev question or it should be posted here. 
Probably I did something dumb, so I hope you can help me doscover what that 
is:

I'm trying to syncdb to an empty Oracle DB. Many tables, triggers and 
sequences are made but then this:
--
...
Synchronizing apps without migrations:
  Creating tables...
Running deferred SQL...
  Installing custom SQL...
Running migrations:
  Rendering model states... DONE
  Applying contenttypes.0002_remove_content_type_name...DEBUG ALTER TABLE 
"DJANGO_CONTENT_TYPE" MODIFY "NAME" NULL; (params [])
DEBUG (0.055) QUERY = u'ALTER TABLE "DJANGO_CONTENT_TYPE" MODIFY "NAME" 
NULL' - PARAMS = (); args=[]
Traceback (most recent call last):
...
...
django.db.utils.DatabaseError: ORA-01451: column to be modified to NULL 
cannot be modified to NULL
--

Indeed if I run this in oracle directly:
ALTER TABLE "DJANGO_CONTENT_TYPE" MODIFY "NAME" NULL;
I get the same error: you cannot change a NULL column into NULL

I don't understand why django wants to alter a column name of a table it 
just made a few seconds before, but still. 
What seems to happen is that it changes a column to NULL, but because it 
already is NULL, the statement fails.
Workaround is to manually set: 
ALTER TABLE "DJANGO_CONTENT_TYPE" MODIFY ("NAME" NOT NULL);
Then run syncdb again and the error is gone.

I can see this is sillyness of oracle, but theres not much I can do about 
that. Is this a bug that I should report with the devs?

thanks
Joris

-- 
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/0ebae0c4-f6d1-4552-b71d-1afeb5c52e8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb error with Mysql database on Windows 7

2015-01-25 Thread Carlos Andre
install PyMySQL, after create a user e a databases in mysql terminal;
e.g:1º)create user 'root'@'localhost' identified by 'fish1777';
2º) create database Mydb;
3º) grant all privileges on Mydb.* to 'root'@'localhost' identified by
'fish1777';

use syncdb.

2015-01-25 6:04 GMT-02:00 olek.russ :

>   I also followed note for create schema  ( have watched
> https://www.youtube.com/watch?v=EL39BGSUkzw video in addition )  and got
> success.
>
> --
> 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/6adc4236-3c88-4a9c-9762-ba29a491bedb%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/6adc4236-3c88-4a9c-9762-ba29a491bedb%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CAA8yBMzn1s7aR9aVajin35U-p2asqDzW1r39BjTNZLsdWOq-Ag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb error with Mysql database on Windows 7

2015-01-25 Thread olek.russ
  I also followed note for create schema  ( have watched 
https://www.youtube.com/watch?v=EL39BGSUkzw video in addition )  and got 
success.

-- 
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/6adc4236-3c88-4a9c-9762-ba29a491bedb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't syncdb via django_pyodbc of Django.

2014-12-12 Thread Sugita Shinsuke
Hello Fred Stluka

Thank you for detailed document.

I resolved syncdb in Windows OS.
My SQL Server setting was something wrong.

I will try Linux edition also.


2014年12月12日金曜日 3時03分35秒 UTC+9 Fred Stluka:
>
>  Sugita,
>
> Django does work with MS SQL Server, but not as well as with 
> other DBs.  I have to use it because I'm interacting with on old
> legacy DB, but I'm gradually migrating everything to MySQL.
>
> To connect to MS SQL Server, from Mac, Linux and Windows,
> I use the following settings:
>
> ###
> DATABASES = {
> 'cf': {
> 'ENGINE': 'django.db.backends.sql_server.pyodbc',
> 'NAME'  : 'my_db_name',
> 'USER'  : 'my_username',
> 'PASSWORD'  : 'my_password',
> # ODBC DSN defined in /etc/freetds.conf or in 
> /usr/local/etc/freetds.conf
> 'HOST'  : 'my_dns_name',
> # Ignored for Windows; Required for Linux
> 'OPTIONS'   : {
> # ODBC driver name in /etc/odbcinst.ini or in /usr/local/etc
> 'driver': 'SQL Server',
> # NOTE: dsn option is added dynamically later, for Windows,
> },
> },
> }
> # The ODBC DSN name specified above as DATABASES.cf.HOST is ignored on
> # Windows, where it must be specified as DATABASES.cf.OPTIONS.dsn instead.
> # However, we haven't found a way to make DATABASES.cf.OPTIONS.dsn work in
> # Linux (and probably the same for Mac).  It causes the error:
> #Data source name not found, and no default driver specified 
> # Therefore we add it here, but only for Windows.
> #
> # On 64-bit Windows, with our current 32-bit version of pyodbc, the DSN
> # must be created via:
> #C:\Windows\SysWOW64\odbcad32.exe
> # instead of the regular "ODBC Data Sources" app in Control Panel, which 
> # invokes:
> #C:\Windows\system32\odbcad32.exe
> #
> if os.name == 'nt':  # Windows
> DATABASES['cf']['OPTIONS']['dsn'] = 'my_dns_name'
> ###
>
>
> To make this work, I had to install and configure the unixodbc 
> and freetds libraries, as well as pyodbc, and django-pyodbc.
> Here are excerpt from my notes, about the long and torturous
> path we took:
>
>
> ###
>
> ## Install non-Python ODBC libraries and tools
>
> ### Install unixODBC
>
> Mac:
>
> $ brew install unixodbc
>
> The `odbcinst.ini` file ends up in `/usr/local/etc/`.
>
> Linux:
>
> $ sudo apt-get install unixodbc-dev  # Ubuntu and Debian
> $ sudo yum -y install unixODBC-devel # CentOS, RedHat, and Fedora
>
> The `odbcinst.ini` file ends up in `/etc/`.
>
> ### Install FreeTDS
>
> Mac:
>
> $ brew install freetds --with-unixodbc
>
> Note that the `freetds.conf` file ends up in `/usr/local/etc/freetds.conf`.
> Installing this Homebrew package also provides the `tsql` command, which
> can be useful for testing.
>
> Linux:
>
> This package is typically available via the Linux package manager.
>
> For Ubuntu and Debian:
>
> $ sudo apt-get install freetds-dev tdsodbc
>
> The `freetds.conf` file ends up in `/etc/freetds/`. If you need the
> `tsql` program (useful for testing), you also need the `freetds-bin` 
> package:
>
> $ sudo apt-get install freetds-bin
>
> On CentOS (and, presumably, Fedora and RedHat):
>
> $ sudo yum -y install freetds-devel
>
> The `freetds.conf` file ends up in `/etc/`.
>
> ### Configure unixODBC and FreeTDS
>
> This blog post provides a good overview of the process:
> <http://lbolla.info/blog/2013/08/28/python-and-odbc> 
> <http://lbolla.info/blog/2013/08/28/python-and-odbc>
>
> (NOTE: Those instructions talk about setting up a `$HOME/.odbcinst.ini`.
> That file does not appear to be necessary.)
>
> Find your `odbcinst.ini` file (see the section, above, on installing
> `unixODBC`), and make its contents look like this.
>
> [SQL Server]
> Description = FreeTDS MSSQL
> # If you're on Linux, uncomment the following settings.
> #Driver  = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
> #Driver64= /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so
> #Setup   = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
> #Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so
> # Mac settings
> Driver  =

Re: I can't syncdb via django_pyodbc of Django.

2014-12-11 Thread Fred Stluka
 for the location on your operation system):

:::ini
[my_dns_name]
host = my_db_server_name
port = my_db_server_port_number
tds version = 7.0

### Confirm the FreeTDS configuration

tsql -S my_dns_name -D my_db_name -U my_username
Password:
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
Default database being set to my_db_name
1>

## Install pyodbc for Mac

2014-07-16 - Fred and Jim found new information for Max OS X

from: 
http://stackoverflow.com/questions/20074620/installing-pyodbc-fails-on-osx-10-9-mavericks


OSX Mavericks dropped sql headers that are required for pyodbc compilation.

Following these steps allowed me to install pyodbc:

1. Install the iODBC library  (http://www.iodbc.org/)
1. Download tar file from website, libiodbc-3.52.9.tar
2. Extract iODBC sources from the tar file.  We extracted into 
directory

   /Users/jim/Downloads/libiodbc-3.52.9
2. Run pip install --allow-external pyodbc --allow-unverified pyodbc 
--no-install pyodbc

3. cd [VIRTUAL_ENV]/build/pyodbc
4. Run  python setup.py build_ext 
--include-dirs=/Users/jim/Downloads/libiodbc-3.52.9/include/

5. Run pip install --no-download pyodbc

 Mac OS X note

The `pyodbc` package that _pip_ installs uses iODBC by default. We want it
to use `unixODBC`, instead, for a couple reasons.

* First, there are numerous sites on the Internet that make claims such as
  "iODBC is a slightly less desirable ODBC manager than unixODBC"
(http://www.cerebralmastication.com/2013/01/installing-debugging-odbc-on-mac-os-x/).
  More people _seem_ to have better luck with `unixODBC`.
* Second, we're using `unixODBC` on Linux, and the configuration is already
  complicated enough. So, why not just use the same approach on both 
platforms?


To get `pyodbc` to use `unixODBC` on the mac, you have to build it from 
source,

and you have to hack the `setup.py`. Here's how to do it.

$ . ~/pythons/hhl/bin/activate
$ cd /tmp
$ git clone https://code.google.com/p/pyodbc
$ cd pyodbc
$ patch >> import pyodbc
>>> conn = pyodbc.connect('DRIVER=SQL Server;'
  'SERVER=my_db_server_name'
  'PORT=my_db_server_port_number;'
  'DATABASE=my_db_name;'
  'UID=my_username;'
  'PWD=my_password')
>>> conn



###

Hope this helps!

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 12/10/14 11:58 AM, pythonista wrote:

I can actually help you here.

I had the same problem and tried 4 different modules.
The only module that works with sql server is

https://github.com/michiya/django-pyodbc-azure


I am running it both on windows and linux, simultaneously.


The settings components are displayed on the web site.

Works like a charm

One dependency is pyodbc to be installed.



On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:

Hi there.

Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
tried django_pyodbc. Any suggestion is appreciated.

my PC of Environment is below.

Database:
SQL Server 2014 Express

OS:
Windows 7 Home Premium SP1

I used the django module, django_pyodbc.
And, I tried to run syncdb but I couldn't.

My settings.py is below.

DATABASES = {
'default': {
'ENGINE': "django_pyodbc",
'HOST': "localhost",
'USER': "djangouser",
'PASSWORD': "x",
'NAME': "db_test",
'OPTIONS': {
 'host_is_server': True,
 'autocommit': True,
 'unicode_results': True,
 'extra_params': 'tds_version=8.0'
 },
}
}

Things I tried and did not work:
1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
2,removed 'OPTIONS'.


However, I tried the module pyodbc of pure python like below. It was fine.

---
conn = pyodbc.connect('driver={SQL 
Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
---

But, DB connection is not established without "Trusted_Connection

Re: I can't syncdb via django_pyodbc of Django.

2014-12-11 Thread Sugita Shinsuke
I use SQL Server Japanese edition.
So, I also wrote Japanese error message here.

django.db.utils.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL 
Server Driver][SQL Server]このログインで要求されたデータベース "db_test" 
を開けません。ログインに失敗しました。 (4060) (SQLDriverConnect);
[01S00] [Microsoft][ODBC SQL Server Driver]接続文字列の属性が正しくありません。 (0);
[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]
このログインで要求されたデータベース "db_test" を開けません。ログインに失敗しました。 (4060); [01S00] 
[Microsoft][ODBC SQL Server Driver]接続文字列の属性が正しくありません。 (0)')



2014年12月11日木曜日 1時58分58秒 UTC+9 pythonista:
>
> I can actually help you here.
>
> I had the same problem and tried 4 different modules.
> The only module that works with sql server is 
>
> https://github.com/michiya/django-pyodbc-azure
>
>
> I am running it both on windows and linux, simultaneously.
>
>
> The settings components are displayed on the web site.
>
> Works like a charm
>
> One dependency is pyodbc to be installed.
>
>
>
> On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>>
>> Hi there.
>>
>> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
>> tried django_pyodbc. Any suggestion is appreciated.
>>
>> my PC of Environment is below.
>>
>> Database:
>> SQL Server 2014 Express
>>
>> OS:
>> Windows 7 Home Premium SP1
>>
>> I used the django module, django_pyodbc.
>> And, I tried to run syncdb but I couldn't.
>>
>> My settings.py is below.
>>
>> DATABASES = {
>>'default': {
>>'ENGINE': "django_pyodbc",
>>'HOST': "localhost",
>>'USER': "djangouser",
>>'PASSWORD': "x",
>>'NAME': "db_test",
>>'OPTIONS': {
>> 'host_is_server': True,
>> 'autocommit': True,
>> 'unicode_results': True,
>> 'extra_params': 'tds_version=8.0'
>> },
>>}
>> }
>>
>> Things I tried and did not work:
>> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
>> 2,removed 'OPTIONS'.
>>
>>
>> However, I tried the module pyodbc of pure python like below. It was fine.
>>
>> ---
>> conn = pyodbc.connect('driver={SQL 
>> Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
>> ---
>>
>> But, DB connection is not established without "Trusted_Connection=yes".
>> At least I do not know any other way. Anyone who know this matter, please 
>> help.
>>
>>
>>
>> The error message is here.
>>
>> 
>>
>> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
>> Driver][
>> SQL 
>> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
>> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x8
>> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
>> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
>> [Micro
>> soft][ODBC SQL Server 
>> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
>> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
>> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
>> Server]\x82\xb1\
>> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
>> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
>> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
>> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
>> Driver]\x90\xda\x
>> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
>> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
>> 
>>
>>
>>

-- 
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/70cd8bcf-4022-415e-acd8-3420f41c73bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke
I use SQL Server Japanese edition.
So, I also wrote Japanese error message here.

django.db.utils.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL 
Server Driver][SQL Server]このログインで要求されたデータベース "db_test" 
を開けません。ログインに失敗しました。 (4060) (SQLDriverConnect);
[01S00] [Microsoft][ODBC SQL Server Driver]接続文字列の属性が正しくありません。 (0);
[42000] [Microsoft][ODBC SQL Server Driver][SQL Server]
このログインで要求されたデータベース "shannon_test" を開けません。ログインに失敗しました。 (4060); [01S00] 
[Microsoft][ODBC SQL Server Driver]接続文字列の属性が正しくありません。 (0)')

更新 <http://redmine.shannon-lab.net/issues/389/edit> 時間を記録 
<http://redmine.shannon-lab.net/issues/389/time_entries/new> ウォッチをやめる 
<http://redmine.shannon-lab.net/watchers/watch?object_id=389&object_type=issue>
 コピー <http://redmine.shannon-lab.net/projects/infra/issues/389/copy>

2014年12月11日木曜日 1時58分58秒 UTC+9 pythonista:
>
> I can actually help you here.
>
> I had the same problem and tried 4 different modules.
> The only module that works with sql server is 
>
> https://github.com/michiya/django-pyodbc-azure
>
>
> I am running it both on windows and linux, simultaneously.
>
>
> The settings components are displayed on the web site.
>
> Works like a charm
>
> One dependency is pyodbc to be installed.
>
>
>
> On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>>
>> Hi there.
>>
>> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
>> tried django_pyodbc. Any suggestion is appreciated.
>>
>> my PC of Environment is below.
>>
>> Database:
>> SQL Server 2014 Express
>>
>> OS:
>> Windows 7 Home Premium SP1
>>
>> I used the django module, django_pyodbc.
>> And, I tried to run syncdb but I couldn't.
>>
>> My settings.py is below.
>>
>> DATABASES = {
>>'default': {
>>'ENGINE': "django_pyodbc",
>>'HOST': "localhost",
>>'USER': "djangouser",
>>'PASSWORD': "x",
>>'NAME': "db_test",
>>'OPTIONS': {
>> 'host_is_server': True,
>> 'autocommit': True,
>> 'unicode_results': True,
>> 'extra_params': 'tds_version=8.0'
>> },
>>}
>> }
>>
>> Things I tried and did not work:
>> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
>> 2,removed 'OPTIONS'.
>>
>>
>> However, I tried the module pyodbc of pure python like below. It was fine.
>>
>> ---
>> conn = pyodbc.connect('driver={SQL 
>> Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
>> ---
>>
>> But, DB connection is not established without "Trusted_Connection=yes".
>> At least I do not know any other way. Anyone who know this matter, please 
>> help.
>>
>>
>>
>> The error message is here.
>>
>> 
>>
>> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
>> Driver][
>> SQL 
>> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
>> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x8
>> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
>> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
>> [Micro
>> soft][ODBC SQL Server 
>> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
>> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
>> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
>> Server]\x82\xb1\
>> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
>> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
>> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
>> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
>> Driver]\x90\xda\x
>> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
>> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
>> 
>>
>>
>>

-- 
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/e7ec8df4-307b-451f-bcf4-b01dfa57f6bc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke


Hello pythonista,

Thank you for replying.
I tried django-pyodbc-azure But syncdb didn't run yet.

As the website says, since I use Django 1.6.4,
I installed django-pyodbc-azure as "pip install "django-pyodbc-azure<1.2""

I checked the odbc driver by Control Panel > Administrative Tools > Data 
Sources (ODBC) > "Driver" tab
My settings.py is as below.

DATABASES = {
   'default': {
   'ENGINE': 'sql_server.pyodbc',
   'HOST': 'localhost', # I also tried 127.0.0.1
   'PORT': '1433', # I also tried empty
   'USER': 'djangouser',
   'PASSWORD': 'x',
   'NAME': 'db_test',
   'OPTIONS': { # I also removed the OPTION
   'driver': 'SQL Server Native Client 11.0', # I also change 'SQL 
Server Native Client 10.0'
   },
   }
}

I tried to run syncdb command again, and then I got some errors again.
here are error messages.

django.db.utils.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server
 Driver][SQL Server]

 [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]

[01S00] [Microsoft][ODBC SQL Server Driver]




2014年12月11日木曜日 1時58分58秒 UTC+9 pythonista:
>
> I can actually help you here.
>
> I had the same problem and tried 4 different modules.
> The only module that works with sql server is 
>
> https://github.com/michiya/django-pyodbc-azure
>
>
> I am running it both on windows and linux, simultaneously.
>
>
> The settings components are displayed on the web site.
>
> Works like a charm
>
> One dependency is pyodbc to be installed.
>
>
>
> On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>>
>> Hi there.
>>
>> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
>> tried django_pyodbc. Any suggestion is appreciated.
>>
>> my PC of Environment is below.
>>
>> Database:
>> SQL Server 2014 Express
>>
>> OS:
>> Windows 7 Home Premium SP1
>>
>> I used the django module, django_pyodbc.
>> And, I tried to run syncdb but I couldn't.
>>
>> My settings.py is below.
>>
>> DATABASES = {
>>'default': {
>>'ENGINE': "django_pyodbc",
>>'HOST': "localhost",
>>'USER': "djangouser",
>>'PASSWORD': "x",
>>'NAME': "db_test",
>>'OPTIONS': {
>> 'host_is_server': True,
>> 'autocommit': True,
>> 'unicode_results': True,
>> 'extra_params': 'tds_version=8.0'
>> },
>>}
>> }
>>
>> Things I tried and did not work:
>> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
>> 2,removed 'OPTIONS'.
>>
>>
>> However, I tried the module pyodbc of pure python like below. It was fine.
>>
>> ---
>> conn = pyodbc.connect('driver={SQL 
>> Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
>> ---
>>
>> But, DB connection is not established without "Trusted_Connection=yes".
>> At least I do not know any other way. Anyone who know this matter, please 
>> help.
>>
>>
>>
>> The error message is here.
>>
>> 
>>
>> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
>> Driver][
>> SQL 
>> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
>> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x8
>> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
>> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
>> [Micro
>> soft][ODBC SQL Server 
>> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
>> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
>> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
>> Server]\x82\xb1\
>> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
>> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
>> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
>> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
>> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
>> Driver]\x90\xda\x
>> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
>> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
>> 
>>
>>
>>

-- 
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/bc0eaa7a-3943-4091-a318-00c885352b0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread pythonista
I can actually help you here.

I had the same problem and tried 4 different modules.
The only module that works with sql server is 

https://github.com/michiya/django-pyodbc-azure


I am running it both on windows and linux, simultaneously.


The settings components are displayed on the web site.

Works like a charm

One dependency is pyodbc to be installed.



On Wednesday, December 10, 2014 4:22:44 AM UTC-5, Sugita Shinsuke wrote:
>
> Hi there.
>
> Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
> tried django_pyodbc. Any suggestion is appreciated.
>
> my PC of Environment is below.
>
> Database:
> SQL Server 2014 Express
>
> OS:
> Windows 7 Home Premium SP1
>
> I used the django module, django_pyodbc.
> And, I tried to run syncdb but I couldn't.
>
> My settings.py is below.
>
> DATABASES = {
>'default': {
>'ENGINE': "django_pyodbc",
>'HOST': "localhost",
>'USER': "djangouser",
>'PASSWORD': "x",
>'NAME': "db_test",
>'OPTIONS': {
> 'host_is_server': True,
> 'autocommit': True,
> 'unicode_results': True,
> 'extra_params': 'tds_version=8.0'
> },
>}
> }
>
> Things I tried and did not work:
> 1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
> 2,removed 'OPTIONS'.
>
>
> However, I tried the module pyodbc of pure python like below. It was fine.
>
> ---
> conn = pyodbc.connect('driver={SQL 
> Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
> ---
>
> But, DB connection is not established without "Trusted_Connection=yes".
> At least I do not know any other way. Anyone who know this matter, please 
> help.
>
>
>
> The error message is here.
>
> 
>
> pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server 
> Driver][
> SQL 
> Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
> b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x8
> 2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
> s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] 
> [Micro
> soft][ODBC SQL Server 
> Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
> 1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
> 2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL 
> Server]\x82\xb1\
> x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
> 83f\x81[\x83^\x83x\x81[\x83X "shannon_test" 
> \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
> 9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
> 2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server 
> Driver]\x90\xda\x
> 91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
> 82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')
> 
>
>
>

-- 
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/75829654-59e0-4ba5-a824-8a61123387c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I can't syncdb via django_pyodbc of Django.

2014-12-10 Thread Sugita Shinsuke


Hi there.

Could you tell me a good way to use Django with Micro Soft DB SQL server. I 
tried django_pyodbc. Any suggestion is appreciated.

my PC of Environment is below.

Database:
SQL Server 2014 Express

OS:
Windows 7 Home Premium SP1

I used the django module, django_pyodbc.
And, I tried to run syncdb but I couldn't.

My settings.py is below.

DATABASES = {
   'default': {
   'ENGINE': "django_pyodbc",
   'HOST': "localhost",
   'USER': "djangouser",
   'PASSWORD': "x",
   'NAME': "db_test",
   'OPTIONS': {
'host_is_server': True,
'autocommit': True,
'unicode_results': True,
'extra_params': 'tds_version=8.0'
},
   }
}

Things I tried and did not work:
1,change "localhost" to "127.0.0.1,1433" in the HOST property of the code.
2,removed 'OPTIONS'.


However, I tried the module pyodbc of pure python like below. It was fine.

---
conn = pyodbc.connect('driver={SQL 
Server};server=localhost;UID=djangouser;PWD=x;DATABASE=shannon_test;Trusted_Connection=yes')
---

But, DB connection is not established without "Trusted_Connection=yes".
At least I do not know any other way. Anyone who know this matter, please help.



The error message is here.



pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC SQL Server Driver][
SQL Server]\x82\xb1\x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\x
b3\x82\xea\x82\xbd\x83f\x81[\x83^\x83x\x81[\x83X "shannon_test" \x82\xf0\x8aJ\x8
2\xaf\x82\xdc\x82\xb9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94
s\x82\xb5\x82\xdc\x82\xb5\x82\xbd\x81B (4060) (SQLDriverConnect); [01S00] [Micro
soft][ODBC SQL Server Driver]\x90\xda\x91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x9
1\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x8
2\xf1\x81B (0); [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]\x82\xb1\
x82\xcc\x83\x8d\x83O\x83C\x83\x93\x82\xc5\x97v\x8b\x81\x82\xb3\x82\xea\x82\xbd\x
83f\x81[\x83^\x83x\x81[\x83X "shannon_test" \x82\xf0\x8aJ\x82\xaf\x82\xdc\x82\xb
9\x82\xf1\x81B\x83\x8d\x83O\x83C\x83\x93\x82\xc9\x8e\xb8\x94s\x82\xb5\x82\xdc\x8
2\xb5\x82\xbd\x81B (4060); [01S00] [Microsoft][ODBC SQL Server Driver]\x90\xda\x
91\xb1\x95\xb6\x8e\x9a\x97\xf1\x82\xcc\x91\xae\x90\xab\x82\xaa\x90\xb3\x82\xb5\x
82\xad\x82\xa0\x82\xe8\x82\xdc\x82\xb9\x82\xf1\x81B (0)')



-- 
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/5f3e2749-8da5-45eb-8c6f-1476e42c3164%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: syncdb error with Mysql database on Windows 7

2014-09-27 Thread Daniel Grace
For the record I solved this, I was mistaken there was no "mydb" schema in 
MySQL.  I created this schema and ran the "syncdb" command without any 
problems.

-- 
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/88715e60-0ed6-443b-b23e-5a2767cf92d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


syncdb error with Mysql database on Windows 7

2014-09-24 Thread Daniel Grace
I have a virtualenv with Python 3.4, Django 1.7 and MySQL installed on 
Windows 7.
I also have  the MySQL / Python adapter installed and the database settings 
in settings.py:

DATABASES = {
'default': {
'NAME': 'mydb',
'ENGINE': 'mysql.connector.django',
'USER': 'root',
'PASSWORD': 'fishy1777',
}
}

When I do a syncdb I get the following errors:

(landy) C:\landy\cresta>python manage.py syncdb
Traceback (most recent call last):
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 
133, in
 ensure_connection
self.connect()
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 
122, in
 connect
self.connection = self.get_new_connection(conn_params)
  File "C:\landy\lib\site-packages\mysql\connector\django\base.py", line 
590, in
 get_new_connection
cnx = mysql.connector.connect(**conn_params)
  File "C:\landy\lib\site-packages\mysql\connector\__init__.py", line 157, 
in co
nnect
return MySQLConnection(*args, **kwargs)
  File "C:\landy\lib\site-packages\mysql\connector\connection.py", line 
122, in
__init__
self.connect(**kwargs)
  File "C:\landy\lib\site-packages\mysql\connector\connection.py", line 
431, in
connect
self._open_connection()
  File "C:\landy\lib\site-packages\mysql\connector\connection.py", line 
398, in
_open_connection
self._ssl)
  File "C:\landy\lib\site-packages\mysql\connector\connection.py", line 
187, in
_do_auth
self._auth_switch_request(username, password)
  File "C:\landy\lib\site-packages\mysql\connector\connection.py", line 
224, in
_auth_switch_request
raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1049 (42000): Unknown database 
'mydb'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File "C:\landy\lib\site-packages\django\core\management\__init__.py", 
line 385
, in execute_from_command_line
utility.execute()
  File "C:\landy\lib\site-packages\django\core\management\__init__.py", 
line 354
, in execute
django.setup()
  File "C:\landy\lib\site-packages\django\__init__.py", line 21, in setup
apps.populate(settings.INSTALLED_APPS)
  File "C:\landy\lib\site-packages\django\apps\registry.py", line 108, in 
popula
te
app_config.import_models(all_models)
  File "C:\landy\lib\site-packages\django\apps\config.py", line 197, in 
import_m
odels
self.models_module = import_module(models_module_name)
  File "C:\Python34\lib\importlib\__init__.py", line 104, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 2231, in _gcd_import
  File "", line 2214, in _find_and_load
  File "", line 2203, in 
_find_and_load_unlocked
  File "", line 1200, in _load_unlocked
  File "", line 1129, in _exec
  File "", line 1448, in exec_module
  File "", line 321, in 
_call_with_frames_removed
  File "C:\landy\lib\site-packages\django\contrib\auth\models.py", line 40, 
in <
module>
class Permission(models.Model):
  File "C:\landy\lib\site-packages\django\db\models\base.py", line 125, in 
__new
__
new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "C:\landy\lib\site-packages\django\db\models\base.py", line 300, in 
add_t
o_class
value.contribute_to_class(cls, name)
  File "C:\landy\lib\site-packages\django\db\models\options.py", line 166, 
in co
ntribute_to_class
self.db_table = truncate_name(self.db_table, 
connection.ops.max_name_length(
))
  File "C:\landy\lib\site-packages\django\db\__init__.py", line 40, in 
__getattr
__
return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "C:\landy\lib\site-packages\django\db\utils.py", line 243, in 
__getitem__

conn = backend.DatabaseWrapper(db, alias)
  File "C:\landy\lib\site-packages\mysql\connector\django\base.py", line 
534, in
 __init__
self.ensure_connection()
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 
133, in
 ensure_connection
self.connect()
  File "C:\landy\lib\site-packages\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "C:\landy\lib\site-packages\django\utils\six.py", line 549, in 
reraise
raise value.with_traceback(tb)
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 
133, in
 ensure_connection
self.connect()
  File "C:\landy\lib\site-packages\django\db\backends\__init__.py", line 
122, in
 conn

python manage.py syncdb

2014-08-08 Thread ngangsia akumbo
when i try to suncdb db i get this error below

You just installed Django's auth system, which means you don't have any 
superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 443, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 196, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 371, in handle
return self.handle_noargs(**options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
 
line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", 
line 189, in emit_post_sync_signal
interactive=interactive, db=db)
  File 
"/usr/local/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", 
line 172, in send
response = receiver(signal=self, sender=sender, **named)
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py",
 
line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 150, in call_command
return klass.execute(*args, **defaults)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 232, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/commands/createsuperuser.py",
 
line 70, in handle
default_username = get_default_username()
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py",
 
line 105, in get_default_username
default_username = get_system_username()
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/management/__init__.py",
 
line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
  File "/usr/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
  File "/usr/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: en_NG

-- 
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/39d60904-5ee0-4589-85c4-92e1a2ba6fd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Recurring question. Automate manage.py syncdb

2014-06-20 Thread Ariel Calzada
I hope this helps you

http://pastebin.com/umGv3br9

Greetings from Colombia
ARIEL


2014-06-20 11:31 GMT-05:00 Rubén Ortiz :

> Hi
>
> I have to automate a kind of django setup in linux ubuntu box. The project
> runs under virtualenv. Then my main problem is when I have to execute the
> famous:
>
> $ python $VIRTUAL_ENV/opt/graphite/webapp/graphite/manage.py syncdb 
> --pythonpath=$VIRTUAL_ENV/opt/graphite/webapp -v 2
>
>
> I am very noob with python but I don't want to maintain dumps or
> workarounds with expect. I have found some info in stackoverflow but I
> don't know how to apply it.
>
> http://stackoverflow.com/questions/10326277/django-automate-syncdb
>
> Does anybody knows what I have to do? Goal is run manage.py syncb and in
> some way automate the send of user,password and email to python script.
>
> Thanks
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/ac7cdcba-52cc-4e1d-842a-cd440bc0167a%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/ac7cdcba-52cc-4e1d-842a-cd440bc0167a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Ariel Calzada
Homepage: http://www.000paradox000.co
Blog: http://blog.000paradox000.co

No sabré desatarme los zapatos y dejar que la ciudad me muerda los pies
no me emborracharé bajo los puentes, no cometeré faltas de estilo.
Acepto este destino de camisas planchadas,
llego a tiempo a los cines, cedo mi asiento a las señoras.
El largo desarreglo de los sentidos me va mal. Opto
por el dentífrico y las toallas. Me vacuno.
Mira qué pobre amante, incapaz de meterse en una fuente
para traerte un pescadito rojo
bajo la rabia de gendarmes y niñeras.

-- EL NIÑO BUENO / Julio Cortazar --

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


Recurring question. Automate manage.py syncdb

2014-06-20 Thread Rubén Ortiz
Hi

I have to automate a kind of django setup in linux ubuntu box. The project 
runs under virtualenv. Then my main problem is when I have to execute the 
famous:

$ python $VIRTUAL_ENV/opt/graphite/webapp/graphite/manage.py syncdb 
--pythonpath=$VIRTUAL_ENV/opt/graphite/webapp -v 2


I am very noob with python but I don't want to maintain dumps or 
workarounds with expect. I have found some info in stackoverflow but I 
don't know how to apply it.

http://stackoverflow.com/questions/10326277/django-automate-syncdb

Does anybody knows what I have to do? Goal is run manage.py syncb and in 
some way automate the send of user,password and email to python script. 

Thanks

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


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-04-06 Thread Venkatraman S
On Fri, Mar 21, 2014 at 5:43 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

>
> On Thu, Mar 20, 2014 at 6:50 PM, Venkatraman S  wrote:
>
>>
>> On Sat, Mar 15, 2014 at 7:11 AM, Russell Keith-Magee <
>> russ...@keith-magee.com> wrote:
>>
>>>
>>> On Sat, Mar 15, 2014 at 7:19 AM, Jonathan Baker <
>>> jonathandavidba...@gmail.com> wrote:
>>>
 Does that mean that the default="" functionality is implemented by the
 ORM, instead of in the database layer?

 This is correct - Django's "default" argument is an API level default,
>>> not a database level default.
>>>
>>>
>> @Russ, any specific reasons for this choice?
>>
>
> Honestly - not a clue. It was like that when I got here, so the reasons
> are probably lost in the depths of time. :-)
>
> Trying to reverse engineer the decision, the most likely reason is that
> Django has allowed callable defaults; if you define a callable in your
> Django model as a default, there's no way to pass this down to the database
> (or, at least, not an easy way).
>
>
This helped me in one of the cases just now and it was an Aha moment!
 Never realized that this feature would be so darn useful. Thanks devs.

-V
@venkasub 

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


ManytoManyField refuses to show up when I syncdb

2014-03-29 Thread willy Hakizimana
when I syncdb and use south schemamigration, I still can't get the 
ManyToManyField to show up.
what am I doing wrong. Any parameters I can pass to make it work?

Thank you guys


class Products(models.Model):

#product_id = models.AutoField(primary_key=True)
hs_number = models.CharField(primary_key=True, max_length=6)
product_description = models.ManyToManyField(Countries, 
through='Imports')

-- 
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/e38457f8-0910-4de6-9039-ccf7915656a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-20 Thread Mike Dewhirst

On 21/03/2014 11:13am, Russell Keith-Magee wrote:


On Thu, Mar 20, 2014 at 6:50 PM, Venkatraman S mailto:venka...@gmail.com>> wrote:


On Sat, Mar 15, 2014 at 7:11 AM, Russell Keith-Magee
mailto:russ...@keith-magee.com>> wrote:


On Sat, Mar 15, 2014 at 7:19 AM, Jonathan Baker
mailto:jonathandavidba...@gmail.com>> wrote:

Does that mean that the default="" functionality is
implemented by the ORM, instead of in the database layer?

This is correct - Django's "default" argument is an API level
default, not a database level default.


@Russ, any specific reasons for this choice?


Honestly - not a clue. It was like that when I got here, so the reasons
are probably lost in the depths of time. :-)


If some things are done in the database and some in the ORM, developer 
madness ensues.


I think keeping everything in the ORM is entirely manageable for 
programmers. Tweaking the database is last straw optimisation.


Mike



Trying to reverse engineer the decision, the most likely reason is that
Django has allowed callable defaults; if you define a callable in your
Django model as a default, there's no way to pass this down to the
database (or, at least, not an easy way).

Yours,
Russ Magee %-)

--
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/CAJxq848nGKNY%2B4tpfPK80sOT1gwPocvR%2BPbrs6jeQiUcOv1mew%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/532B8936.4090502%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-20 Thread Russell Keith-Magee
On Thu, Mar 20, 2014 at 6:50 PM, Venkatraman S  wrote:

>
> On Sat, Mar 15, 2014 at 7:11 AM, Russell Keith-Magee <
> russ...@keith-magee.com> wrote:
>
>>
>> On Sat, Mar 15, 2014 at 7:19 AM, Jonathan Baker <
>> jonathandavidba...@gmail.com> wrote:
>>
>>> Does that mean that the default="" functionality is implemented by the
>>> ORM, instead of in the database layer?
>>>
>>> This is correct - Django's "default" argument is an API level default,
>> not a database level default.
>>
>>
> @Russ, any specific reasons for this choice?
>

Honestly - not a clue. It was like that when I got here, so the reasons are
probably lost in the depths of time. :-)

Trying to reverse engineer the decision, the most likely reason is that
Django has allowed callable defaults; if you define a callable in your
Django model as a default, there's no way to pass this down to the database
(or, at least, not an easy way).

Yours,
Russ Magee %-)

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


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-20 Thread Venkatraman S
On Sat, Mar 15, 2014 at 7:11 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

>
> On Sat, Mar 15, 2014 at 7:19 AM, Jonathan Baker <
> jonathandavidba...@gmail.com> wrote:
>
>> Does that mean that the default="" functionality is implemented by the
>> ORM, instead of in the database layer?
>>
>> This is correct - Django's "default" argument is an API level default,
> not a database level default.
>
>
@Russ, any specific reasons for this choice?

Regards,
Venkat

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


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Russell Keith-Magee
On Sat, Mar 15, 2014 at 7:19 AM, Jonathan Baker <
jonathandavidba...@gmail.com> wrote:

> Does that mean that the default="" functionality is implemented by the
> ORM, instead of in the database layer?
>
> This is correct - Django's "default" argument is an API level default, not
a database level default.

Yours,
Russ Magee %-)

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


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Craig Schmidt
On Mar 14, 2014, at 7:24 PM, Shawn Milochik  wrote:

> On Fri, Mar 14, 2014 at 7:19 PM, Jonathan Baker 
>  wrote:
> Does that mean that the default="" functionality is implemented by the ORM, 
> instead of in the database layer?
> 
> 
> Perhaps I'm wrong -- I'm looking at my South migrations and they do pass the 
> defaults. I believe that, either way, if you only touch the database through 
> the ORM it'll be set properly. It probably depends on what database you're 
> using.
> 
> However, there's a bigger issue -- if you run syncdb a second time, it will 
> do nothing, so it doesn't matter either way. If you want to modify an 
> existing table you need to use South (or do it manually). Syncdb will not 
> touch existing tables -- it only adds new ones. Or you can wipe out your 
> whole database and then run syncdb, that would fix it if you don't care about 
> your data.

In my case, it is for a system that isn't in production yet, so I was planning 
to wipe the database before running syncdb.  I just didn't know if that is 
necessary.

-Craig


> 
> Shawn 
> 
> -- 
> 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/CAOzwKwHmO%3D3T9BvRU6c1OL6G7HbR-At0pbn5-V47Nb-fLrs-kQ%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/B823C8A7-120E-4ADC-A99B-811C64E9D8D6%40craigschmidt.com.
For more options, visit https://groups.google.com/d/optout.


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Shawn Milochik
On Fri, Mar 14, 2014 at 7:19 PM, Jonathan Baker <
jonathandavidba...@gmail.com> wrote:

> Does that mean that the default="" functionality is implemented by the
> ORM, instead of in the database layer?
>
>
Perhaps I'm wrong -- I'm looking at my South migrations and they do pass
the defaults. I believe that, either way, if you only touch the database
through the ORM it'll be set properly. It probably depends on what database
you're using.

However, there's a bigger issue -- if you run syncdb a second time, it will
do nothing, so it doesn't matter either way. If you want to modify an
existing table you need to use South (or do it manually). Syncdb will not
touch existing tables -- it only adds new ones. Or you can wipe out your
whole database and then run syncdb, that would fix it if you don't care
about your data.

Shawn

-- 
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/CAOzwKwHmO%3D3T9BvRU6c1OL6G7HbR-At0pbn5-V47Nb-fLrs-kQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Jonathan Baker
Does that mean that the default="" functionality is implemented by the ORM,
instead of in the database layer?


On Fri, Mar 14, 2014 at 5:16 PM, Shawn Milochik wrote:

> No, no syncdb required. The default applies to newly-created instances,
> not existing ones.
>
> --
> 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/CAOzwKwH-5UNR7ajWb%2B-w%3DepQRSUooEk%3DA-gwAjAhE8vtUT%3DA_Q%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CAOzwKwH-5UNR7ajWb%2B-w%3DepQRSUooEk%3DA-gwAjAhE8vtUT%3DA_Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jonathan D. Baker
Developer
http://jonathandbaker.com

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


Re: do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Shawn Milochik
No, no syncdb required. The default applies to newly-created instances, not
existing ones.

-- 
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/CAOzwKwH-5UNR7ajWb%2B-w%3DepQRSUooEk%3DA-gwAjAhE8vtUT%3DA_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


do I need to run syncdb when I change the default value in a field of a model?

2014-03-14 Thread Craig Schmidt
This is probably an easy question, but I didn't manage to find the answer.

If I just change the default value of a field in a model, do I need to run 
syncdb?

Specifically I changed:

foo = models.IntegerField(default=1)

to

foo = models.IntegerField(default=5)

Thanks,
Craig

-- 
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/1E74D9D7-51D1-4EF3-9772-3E54CC652B97%40craigschmidt.com.
For more options, visit https://groups.google.com/d/optout.


Re: Newbie: ImportError during syncdb

2014-03-07 Thread David
Dear Robin and Jay,

thanks, I was able to solve my problem: setting.py just wants the name
of the app.

Cheers,

David


On 06/03/14 08:42, Jay Parikh wrote:
> Let say for example i am going to create new app say bookmarks then i
> will do something like *"python manage.py startapp bookmarks" *likewise
> whatever name you have passed in place of *bookmarks.* Just place it
> inside INSTALLED_APPS.
> 
> 
> 
> On Thu, Mar 6, 2014 at 1:06 PM, Robin Lery  <mailto:robinl...@gmail.com>> wrote:
> 
> What the name of the app folder? I think its just django_bookmarks.
> 
> 
> On Thu, Mar 6, 2014 at 6:43 AM, David  <mailto:ld...@gmx.net>> wrote:
> 
> Dear django users,
> 
> I am new to django and have an ImportError: No module named
>     bookmarks
> problem.
> 
> It seems that as I tried to syncdb django does not recognize the
> bookmarks module I have created before. In the past I was able to
> syncdb, hence my confusion.
> 
> I am trying to teach myself by following "Learning Website
> Development
> with Django" by Ayman Hourieh.
> 
> I am not working in a virtualenv.
> 
> Thanks for your guidance and hints!
> 
> David
> 
> 
> settings.py:
> 
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django_bookmarks.bookmarks',
> )
> 
> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$
> python
> manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
> utility.execute()
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 280, in execute
> translation.activate('en-us')
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
> line 130, in activate
> return _trans.activate(language)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 188, in activate
> _active.value = translation(language)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
> 
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 159, in _fetch
> app = import_module(appname)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py",
> line
> 40, in import_module
> __import__(name)
> ImportError: No module named bookmarks
> 
> --
> 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
> <mailto:django-users%2bunsubscr...@googlegroups.com>.
> To post to this group, send email to
> django-users@googlegroups.com
> <mailto: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/5317CBCC.4060908%40gmx.net.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
>

Re: Newbie: ImportError during syncdb

2014-03-06 Thread Jay Parikh
Hi David,

Instead of specifying ''django_bookmarks.bookmarks'' in 'INSTALLED_APPS' i
would suggest you to use your app name which you have created e.g someting
like as below:
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bookmarks',
)
I am assuming over here as you have kept your app name as *'bookmarks'*.

-Jay


On Thu, Mar 6, 2014 at 6:43 AM, David  wrote:

> Dear django users,
>
> I am new to django and have an ImportError: No module named bookmarks
> problem.
>
> It seems that as I tried to syncdb django does not recognize the
> bookmarks module I have created before. In the past I was able to
> syncdb, hence my confusion.
>
> I am trying to teach myself by following "Learning Website Development
> with Django" by Ayman Hourieh.
>
> I am not working in a virtualenv.
>
> Thanks for your guidance and hints!
>
> David
>
>
> settings.py:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django_bookmarks.bookmarks',
> )
>
> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
> manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
> utility.execute()
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 280, in execute
> translation.activate('en-us')
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
> line 130, in activate
> return _trans.activate(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 188, in activate
> _active.value = translation(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 159, in _fetch
> app = import_module(appname)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
> 40, in import_module
> __import__(name)
> ImportError: No module named bookmarks
>
> --
> 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/5317CBCC.4060908%40gmx.net.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAD-syJVV9TM4_VrpxwdieauLK4E%2B2guHPPL%3D1Li9JCTgqLKN2g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Newbie: ImportError during syncdb

2014-03-06 Thread Jay Parikh
Let say for example i am going to create new app say bookmarks then i will
do something like *"python manage.py startapp bookmarks" *likewise whatever
name you have passed in place of *bookmarks.* Just place it inside
INSTALLED_APPS.



On Thu, Mar 6, 2014 at 1:06 PM, Robin Lery  wrote:

> What the name of the app folder? I think its just django_bookmarks.
>
>
> On Thu, Mar 6, 2014 at 6:43 AM, David  wrote:
>
>> Dear django users,
>>
>> I am new to django and have an ImportError: No module named bookmarks
>> problem.
>>
>> It seems that as I tried to syncdb django does not recognize the
>> bookmarks module I have created before. In the past I was able to
>> syncdb, hence my confusion.
>>
>> I am trying to teach myself by following "Learning Website Development
>> with Django" by Ayman Hourieh.
>>
>> I am not working in a virtualenv.
>>
>> Thanks for your guidance and hints!
>>
>> David
>>
>>
>> settings.py:
>>
>> INSTALLED_APPS = (
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'django_bookmarks.bookmarks',
>> )
>>
>> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
>> manage.py syncdb
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.argv)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 399, in execute_from_command_line
>> utility.execute()
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
>> line 392, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 242, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
>> line 280, in execute
>> translation.activate('en-us')
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
>> line 130, in activate
>> return _trans.activate(language)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 188, in activate
>> _active.value = translation(language)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 177, in translation
>> default_translation = _fetch(settings.LANGUAGE_CODE)
>>   File
>>
>> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
>> line 159, in _fetch
>> app = import_module(appname)
>>   File
>> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
>> 40, in import_module
>> __import__(name)
>> ImportError: No module named bookmarks
>>
>> --
>> 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/5317CBCC.4060908%40gmx.net
>> .
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> 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%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com<https://groups.google.com/d/msgid/django-users/CA%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAD-syJVuTabkTE2wO7%2BEt3tSN68RDSVU49j6%2BA8JLvxWamLXxw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Newbie: ImportError during syncdb

2014-03-05 Thread Robin Lery
What the name of the app folder? I think its just django_bookmarks.


On Thu, Mar 6, 2014 at 6:43 AM, David  wrote:

> Dear django users,
>
> I am new to django and have an ImportError: No module named bookmarks
> problem.
>
> It seems that as I tried to syncdb django does not recognize the
> bookmarks module I have created before. In the past I was able to
> syncdb, hence my confusion.
>
> I am trying to teach myself by following "Learning Website Development
> with Django" by Ayman Hourieh.
>
> I am not working in a virtualenv.
>
> Thanks for your guidance and hints!
>
> David
>
>
> settings.py:
>
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django_bookmarks.bookmarks',
> )
>
> david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
> manage.py syncdb
> Traceback (most recent call last):
>   File "manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 399, in execute_from_command_line
> utility.execute()
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
> line 280, in execute
> translation.activate('en-us')
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
> line 130, in activate
> return _trans.activate(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 188, in activate
> _active.value = translation(language)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 177, in translation
> default_translation = _fetch(settings.LANGUAGE_CODE)
>   File
>
> "/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
> line 159, in _fetch
> app = import_module(appname)
>   File
> "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
> 40, in import_module
> __import__(name)
> ImportError: No module named bookmarks
>
> --
> 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/5317CBCC.4060908%40gmx.net.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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%2B4-nGorOGF10TOCuYAWohS%2B3nHjrL-DRpkj%2BDGTtmHDq4u00A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Newbie: ImportError during syncdb

2014-03-05 Thread David
Dear django users,

I am new to django and have an ImportError: No module named bookmarks
problem.

It seems that as I tried to syncdb django does not recognize the
bookmarks module I have created before. In the past I was able to
syncdb, hence my confusion.

I am trying to teach myself by following "Learning Website Development
with Django" by Ayman Hourieh.

I am not working in a virtualenv.

Thanks for your guidance and hints!

David


settings.py:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_bookmarks.bookmarks',
)

david@ubuntu:~/Tools/Python/Code/myCode/Django/django_bookmarks$ python
manage.py syncdb
Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 399, in execute_from_command_line
utility.execute()
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py",
line 280, in execute
translation.activate('en-us')
  File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/__init__.py",
line 130, in activate
return _trans.activate(language)
  File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 188, in activate
_active.value = translation(language)
  File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 177, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
  File
"/usr/local/lib/python2.7/dist-packages/django/utils/translation/trans_real.py",
line 159, in _fetch
app = import_module(appname)
  File
"/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", line
40, in import_module
__import__(name)
ImportError: No module named bookmarks

-- 
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/5317CBCC.4060908%40gmx.net.
For more options, visit https://groups.google.com/groups/opt_out.


Re: referencing models before syncdb

2013-12-28 Thread thinkingpotato
Check if that is not something you're looking for:
https://docs.djangoproject.com/en/1.5/ref/signals/#post-syncdb


On Wednesday, December 25, 2013 7:18:45 PM UTC, vinaya...@iiitd.ac.in wrote:
>
> I have an actions.py file which defines custom actions for the admin page 
> for one of my models. It uses an intermediary page (like the default delete 
> action) and hence has a corresponding form which is also declared in the 
> same file.
>
> For some reason, I had drop by database (development) and now when I try 
> to run syncdb, it gives me the following error:
>
>
> Traceback (most recent call last):
>   File "/home/vinayak/pyCharm/helpers/pycharm/django_manage.py", line 23, 
> in 
> run_module(manage_file, None, '__main__', True)
>   File "/usr/lib/python2.7/runpy.py", line 176, in run_module
> fname, loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
> mod_name, mod_fname, mod_loader, pkg_name)
>   File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
> exec code in run_globals
>   File "/home/vinayak/zenatix/customuser/manage.py", line 10, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 399, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 242, in run_from_argv
> self.execute(*args, **options.__dict__)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 284, in execute
> self.validate()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
> line 310, in validate
> num_errors = get_validation_errors(s, app)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py",
>  
> line 34, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
> 196, in get_app_errors
> self._populate()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
> 75, in _populate
> self.load_app(app_name, True)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
> 99, in load_app
> models = import_module('%s.models' % app_name)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 40, in import_module
> __import__(name)
>   File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
> line 63, in 
> patch_root_urlconf()
>   File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
> line 51, in patch_root_urlconf
> reverse('djdt:render_panel')
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 480, in reverse
> app_list = resolver.app_dict[ns]
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 310, in app_dict
> self._populate()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 262, in _populate
> for pattern in reversed(self.url_patterns):
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 346, in url_patterns
> patterns = getattr(self.urlconf_module, "urlpatterns", 
> self.urlconf_module)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 341, in urlconf_module
> self._urlconf_module = import_module(self.urlconf_name)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 40, in import_module
> __import__(name)
>   File "/home/vinayak/zenatix/customuser/customuser/urls.py", line 6, in 
> 
> admin.autodiscover()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", 
> line 29, in autodiscover
> import_module('%s.admin' % app)
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 40, in import_module
> __import__(name)
>   File "/home/vinayak/zenatix/customuser/iiitd/admin.py", line 3, in 
> 
&g

referencing models before syncdb

2013-12-25 Thread vinayak11118
I have an actions.py file which defines custom actions for the admin page 
for one of my models. It uses an intermediary page (like the default delete 
action) and hence has a corresponding form which is also declared in the 
same file.

For some reason, I had drop by database (development) and now when I try to 
run syncdb, it gives me the following error:


Traceback (most recent call last):
  File "/home/vinayak/pyCharm/helpers/pycharm/django_manage.py", line 23, 
in 
run_module(manage_file, None, '__main__', True)
  File "/usr/lib/python2.7/runpy.py", line 176, in run_module
fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 82, in _run_module_code
mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
  File "/home/vinayak/zenatix/customuser/manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 399, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 242, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 284, in execute
self.validate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 310, in validate
num_errors = get_validation_errors(s, app)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/validation.py", 
line 34, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
196, in get_app_errors
self._populate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
75, in _populate
self.load_app(app_name, True)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/models/loading.py", line 
99, in load_app
models = import_module('%s.models' % app_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
line 63, in 
patch_root_urlconf()
  File "/usr/local/lib/python2.7/dist-packages/debug_toolbar/models.py", 
line 51, in patch_root_urlconf
reverse('djdt:render_panel')
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
480, in reverse
app_list = resolver.app_dict[ns]
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
310, in app_dict
self._populate()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
262, in _populate
for pattern in reversed(self.url_patterns):
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
346, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", 
self.urlconf_module)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
341, in urlconf_module
self._urlconf_module = import_module(self.urlconf_name)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/home/vinayak/zenatix/customuser/customuser/urls.py", line 6, in 

admin.autodiscover()
  File 
"/usr/local/lib/python2.7/dist-packages/django/contrib/admin/__init__.py", 
line 29, in autodiscover
import_module('%s.admin' % app)
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 40, in import_module
__import__(name)
  File "/home/vinayak/zenatix/customuser/iiitd/admin.py", line 3, in 

from actions import grant_read_permission
  File "/home/vinayak/zenatix/customuser/iiitd/actions.py", line 13, in 

class SelectUserForm(forms.Form):
  File "/home/vinayak/zenatix/customuser/iiitd/actions.py", line 16, in 
SelectUserForm
clientObj = ClientInfo.objects.all()[:1].get()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 301, in get
num = len(clone)
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 77, in __len__
self._fetch_all()
  File "/usr/local/lib/python2.7/dist-packages/django/db/models/query.py", 
line 854, in _fetch_all
self._result_cache = list(self

Re: Error Doing python manage.py syncdb in django pyBB

2013-12-15 Thread Frank Bieniek

django.utils.simplejson is deprecated; use json instead.

Hi Alok,
it seems pyBB is not django 1.6 compatible - simplejson got deprecated 
in 1.6


just my 2 cents
Frank


Am 14.12.13 15:15, schrieb Alok Nag:

Hello Experts,

I am newbie to Django/Python. I am trying to setup a forum app using 
pyBB and after following steps mentioned at their website, I am 
getting following error when I am running python manage.py syncdb


[aloknag-mbp15:~/Desktop/forum] aloknag% ./manage.py syncdb

/Library/Python/2.7/site-packages/django_common-0.1.51-py2.7.egg/common/fields.py:6: 
DeprecationWarning: django.utils.simplejson is deprecated; use json 
instead.


  from django.utils import simplejson


*CommandError: One or more models did not validate:*

*pyBB.forum: 'category' has a relation with model 'pybb.models.Category'>, which has either not been installed or is 
abstract.*


*pyBB.forum: Accessor for field 'category' clashes with related field 
'Category.forums'. Add a related_name argument to the definition for 
'category'.*


*pyBB.forum: Reverse query name for field 'category' clashes with 
related field 'Category.forums'. Add a related_name argument to the 
definition for 'category'.*


*pyBB.topic: 'forum' has a relation with model 'pybb.models.Forum'>, which has either not been installed or is abstract.*


*pyBB.topic: Accessor for field 'forum' clashes with related field 
'Forum.topics'. Add a related_name argument to the definition for 
'forum'.*


*pyBB.topic: Reverse query name for field 'forum' clashes with related 
field 'Forum.topics'. Add a related_name argument to the definition 
for 'forum'.*


*pyBB.post: 'topic' has a relation with model 'pybb.models.Topic'>, which has either not been installed or is abstract.*


*pyBB.post: Accessor for field 'topic' clashes with related field 
'Topic.posts'. Add a related_name argument to the definition for 'topic'.*


*pyBB.post: Reverse query name for field 'topic' clashes with related 
field 'Topic.posts'. Add a related_name argument to the definition for 
'topic'.*



Appreciate any insight to fix it.

Thanks,
Alok

--
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/c38a3c9f-27bf-4685-9c3e-8f79f5bb5bbc%40googlegroups.com.

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


--
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/52AE3759.3090307%40produktlaunch.de.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Error Doing python manage.py syncdb in django pyBB

2013-12-14 Thread Avraham Serour
maybe you forgot to add pybb to INSTALED_APPS ?


On Sat, Dec 14, 2013 at 4:15 PM, Alok Nag  wrote:

> Hello Experts,
>
> I am newbie to Django/Python. I am trying to setup a forum app using pyBB
> and after following steps mentioned at their website, I am getting
> following error when I am running python manage.py syncdb
>
> [aloknag-mbp15:~/Desktop/forum] aloknag% ./manage.py syncdb
>
> /Library/Python/2.7/site-packages/django_common-0.1.51-py2.7.egg/common/fields.py:6:
> DeprecationWarning: django.utils.simplejson is deprecated; use json instead.
>
>   from django.utils import simplejson
>
>
> *CommandError: One or more models did not validate:*
>
> *pyBB.forum: 'category' has a relation with model  'pybb.models.Category'>, which has either not been installed or is
> abstract.*
>
> *pyBB.forum: Accessor for field 'category' clashes with related field
> 'Category.forums'. Add a related_name argument to the definition for
> 'category'.*
>
> *pyBB.forum: Reverse query name for field 'category' clashes with related
> field 'Category.forums'. Add a related_name argument to the definition for
> 'category'.*
>
> *pyBB.topic: 'forum' has a relation with model  'pybb.models.Forum'>, which has either not been installed or is abstract.*
>
> *pyBB.topic: Accessor for field 'forum' clashes with related field
> 'Forum.topics'. Add a related_name argument to the definition for 'forum'.*
>
> *pyBB.topic: Reverse query name for field 'forum' clashes with related
> field 'Forum.topics'. Add a related_name argument to the definition for
> 'forum'.*
>
> *pyBB.post: 'topic' has a relation with model ,
> which has either not been installed or is abstract.*
>
> *pyBB.post: Accessor for field 'topic' clashes with related field
> 'Topic.posts'. Add a related_name argument to the definition for 'topic'.*
>
> *pyBB.post: Reverse query name for field 'topic' clashes with related
> field 'Topic.posts'. Add a related_name argument to the definition for
> 'topic'.*
>
>
> Appreciate any insight to fix it.
>
> Thanks,
> Alok
>
> --
> 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/c38a3c9f-27bf-4685-9c3e-8f79f5bb5bbc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
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/CAFWa6tKMZBhVOtB7bdpOc%3DB1i74s6B12GTMx3ZmxkyvkBgcXVw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Error Doing python manage.py syncdb in django pyBB

2013-12-14 Thread Alok Nag
Hello Experts,

I am newbie to Django/Python. I am trying to setup a forum app using pyBB 
and after following steps mentioned at their website, I am getting 
following error when I am running python manage.py syncdb

[aloknag-mbp15:~/Desktop/forum] aloknag% ./manage.py syncdb

/Library/Python/2.7/site-packages/django_common-0.1.51-py2.7.egg/common/fields.py:6:
 
DeprecationWarning: django.utils.simplejson is deprecated; use json instead.

  from django.utils import simplejson


*CommandError: One or more models did not validate:*

*pyBB.forum: 'category' has a relation with model , which has either not been installed or is 
abstract.*

*pyBB.forum: Accessor for field 'category' clashes with related field 
'Category.forums'. Add a related_name argument to the definition for 
'category'.*

*pyBB.forum: Reverse query name for field 'category' clashes with related 
field 'Category.forums'. Add a related_name argument to the definition for 
'category'.*

*pyBB.topic: 'forum' has a relation with model , 
which has either not been installed or is abstract.*

*pyBB.topic: Accessor for field 'forum' clashes with related field 
'Forum.topics'. Add a related_name argument to the definition for 'forum'.*

*pyBB.topic: Reverse query name for field 'forum' clashes with related 
field 'Forum.topics'. Add a related_name argument to the definition for 
'forum'.*

*pyBB.post: 'topic' has a relation with model , 
which has either not been installed or is abstract.*

*pyBB.post: Accessor for field 'topic' clashes with related field 
'Topic.posts'. Add a related_name argument to the definition for 'topic'.*

*pyBB.post: Reverse query name for field 'topic' clashes with related field 
'Topic.posts'. Add a related_name argument to the definition for 'topic'.*


Appreciate any insight to fix it.

Thanks,
Alok

-- 
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/c38a3c9f-27bf-4685-9c3e-8f79f5bb5bbc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Get command error when trying to syncdb in django pyBB

2013-12-14 Thread Alok Nag
Hello Experts!

I am trying to setup a forum app using pyBB. I followed steps mentioned in 
their website and finally getting below error when I try to run:
python manage.py syncdb

[aloknag-mbp15:~/Desktop/forum] aloknag% ./manage.py syncdb

/Library/Python/2.7/site-packages/django_common-0.1.51-py2.7.egg/common/fields.py:6:
 
DeprecationWarning: django.utils.simplejson is deprecated; use json instead.

  from django.utils import simplejson


*CommandError: One or more models did not validate:*

*pyBB.forum: 'category' has a relation with model , which has either not been installed or is 
abstract.*

*pyBB.forum: Accessor for field 'category' clashes with related field 
'Category.forums'. Add a related_name argument to the definition for 
'category'.*

*pyBB.forum: Reverse query name for field 'category' clashes with related 
field 'Category.forums'. Add a related_name argument to the definition for 
'category'.*

*pyBB.topic: 'forum' has a relation with model , 
which has either not been installed or is abstract.*

*pyBB.topic: Accessor for field 'forum' clashes with related field 
'Forum.topics'. Add a related_name argument to the definition for 'forum'.*

*pyBB.topic: Reverse query name for field 'forum' clashes with related 
field 'Forum.topics'. Add a related_name argument to the definition for 
'forum'.*

*pyBB.post: 'topic' has a relation with model , 
which has either not been installed or is abstract.*

*pyBB.post: Accessor for field 'topic' clashes with related field 
'Topic.posts'. Add a related_name argument to the definition for 'topic'.*

*pyBB.post: Reverse query name for field 'topic' clashes with related field 
'Topic.posts'. Add a related_name argument to the definition for 'topic'.*

Appreciate any insight to fix this.

Thanks,
Alok

-- 
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/2a365bdc-74b1-4a97-9bbc-472369e77ee4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Problem with syncdb and multiple databases

2013-11-11 Thread Sells, Fred
I'm using Django 1.5 and Mysql 5.1 and am in the early stages of a multiple app 
development and the schema is changing frequently as "hidden" requirements 
emerge.  I cannot get syncdb to sync anything other than my default db, and 
when I change my default, it still seems to see the old one.   Here is 
settings.py, with some junk removed for brevity.  Routers.py is attached and is 
in the same directory as settings.  I cannot figure out what's going wrong with 
syncdb, but the normal application seems to work correctly.I had commented 
out the "allow_syncdb" in the routers because I could not get it to work, it 
seems to have some impact but not sure what.

settings.py=
DATABASES = {
'default': {'ENGINE': 'django.db.backends.mysql', 'NAME': 'accstaff'...
},
'wnr': {   'ENGINE': 'django.db.backends.mysql', NAME': 'wnr'...},
'accstaff': {'ENGINE': 'django.db.backends.mysql', 'NAME': 
'accstaff'...},
'inserv': {  'ENGINE': 'django.db.backends.mysql', 'NAME': 'inserv'...}
}

DATABASE_ROUTERS = ['AccWeeklyNursingReport.routers.WnrRouter',
'AccWeeklyNursingReport.routers.AccStaffRouter',
'AccWeeklyNursingReport.routers.AccInservRouter']

=end settings.py===

The following is the output example

C:\all\django\AccWeeklyNursingReport>mysqladmin -f drop  accstaff
Database "accstaff" dropped

C:\all\django\AccWeeklyNursingReport>mysqladmin -f create  accstaff

C:\all\django\AccWeeklyNursingReport>python manage.py  syncdb 
--database=accstaff
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff sessions
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff sessions
allow syncdb for WnrRouter accstaff wnrapp
allow syncdb for WnrRouter accstaff wnrapp
Creating tables ...
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
allow syncdb for WnrRouter accstaff contenttypes
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

C:\all\django\AccWeeklyNursingReport>echo DONE
DONE

-- 
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/DCD75728F460F14586086EA606E83082E71E861F%40ACEVXCHMBX1001.ADVENTISTCORP.NET.
For more options, visit https://groups.google.com/groups/opt_out.


routers.py
Description: routers.py


Re: multiple databases and syncdb problem

2013-10-30 Thread Tom Evans
On Tue, Oct 29, 2013 at 9:35 PM, Simon Charette  wrote:
> syncdb defaults to syncing the 'default' database when no --database is
> specified.
>
> Try specifying which database to synchronize, with the --database=inserv
> flag in your case.
>

syncdb will only synch one DB at a time, and as Simon says, it will
default to 'default' if you do not specify a database. If you have
multiple databases, you need to call syncdb once for each of them.

A warning, if you have South installed, syncdb gains a '--all'
argument; this does not synch to all databases, it synchs all apps,
even migrated ones, which is probably not what you want.

Cheers

Tom

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


Re: multiple databases and syncdb problem

2013-10-29 Thread Simon Charette
syncdb defaults to syncing the 'default' database when no --database is 
specified<https://docs.djangoproject.com/en/1.5/ref/django-admin/#django-admin-option---database>
.

Try specifying which database to synchronize, with the --database=inserv 
flag in your case.

Le mardi 29 octobre 2013 16:52:15 UTC-4, fred a écrit :
>
>  I can syncdb OK if I don’t add allow_syncdb to my router, but if I add 
> the allow_syncdb to the router, only my default db is synced.  Any idea 
> what I’m doing wrong, code is:
>
>  
>
> def *allow_syncdb*(*self*, db, model):
>
> print *'allow syncdb for* Inserv Router'*, db, 
> model._meta.app_label
>
> return db==*'inserv'* and model._meta.app_label == *'inserv'*
>
>  
>  

-- 
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/48432761-428b-4e17-80d6-05f6c01de318%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


multiple databases and syncdb problem

2013-10-29 Thread Sells, Fred
I can syncdb OK if I don't add allow_syncdb to my router, but if I add the 
allow_syncdb to the router, only my default db is synced.  Any idea what I'm 
doing wrong, code is:

def allow_syncdb(self, db, model):
print 'allow syncdb for* Inserv Router', db, 
model._meta.app_label
return db=='inserv' and model._meta.app_label == 'inserv'

-- 
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/DCD75728F460F14586086EA606E83082E71DE597%40ACEVXCHMBX1001.ADVENTISTCORP.NET.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Table in models.py not being created during syncdb

2013-10-10 Thread Sergiy Khohlov
Have you added schedule to installed application list  ?
Many thanks,

Serge


+380 636150445
skype: skhohlov


On Wed, Oct 9, 2013 at 4:11 PM, Edward Lazarenko  wrote:
> Can you tell what did you exactly do, to make it work?
>
> On Wednesday, March 31, 2010 10:16:11 PM UTC+5, wchildsuk wrote:
>>
>> Hi,
>>
>> I'm using the django app, django-schedule (http://github.com/thauber/
>> django-schedule) and am adding an additional table to map users to
>> calendars (see line 253 on dpaste).  When I run syncdb it completely
>> ignores my table and doesn't through any errors. Can anyone shed any
>> light on way it might be being igored?
>>
>> My models file is available here:
>>
>> http://dpaste.com/178158/
>>
>> Thanks in advance
>>
>> Wes
>
> --
> 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/0573be21-ab52-44ec-a005-e8efb3ea09bd%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
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/CADTRxJPhp9r39dk%3D%2Bnc6Ai515c5x5eK7DjRWT1QbboZqVUp%3D4w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Table in models.py not being created during syncdb

2013-10-09 Thread Edward Lazarenko
Can you tell what did you exactly do, to make it work?

On Wednesday, March 31, 2010 10:16:11 PM UTC+5, wchildsuk wrote:
>
> Hi,
>
> I'm using the django app, django-schedule (http://github.com/thauber/
> django-schedule) and am adding an additional table to map users to
> calendars (see line 253 on dpaste).  When I run syncdb it completely
> ignores my table and doesn't through any errors. Can anyone shed any
> light on way it might be being igored?
>
> My models file is available here:
>
> http://dpaste.com/178158/
>
> Thanks in advance
>
> Wes
>
>

-- 
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/0573be21-ab52-44ec-a005-e8efb3ea09bd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Not able to create an simple application using DB (syncdb error)

2013-09-30 Thread Bill Freeman
Have you said which version of Django you are using?  (If so, it slipped
past me.)

Is this all code that you wrote yourself, or did you copy some or all it
from somewhere?
If copied, under what version of Django was it being used?

Have you gone through and understood the tutorial for the version of Django
you are using?

Please, in a terminal window, try:

   cd c:\Users\gsherieff\blog1
   python
   import blog1.settings

What is printed?


On Sat, Sep 28, 2013 at 8:28 AM, s. gulab  wrote:

> Hi,
>
>Thanks for your reply.I have tried with your answer which has given to
> last question but,still i am getting the same error.PFA of
> Screenshots.Please give me some simple steps or program to create an
> application with DB.
>
> Thanks in Advance!
>
> Thanks & Regards,
> Gulab S
>
>
> On Friday, 27 September 2013 23:40:02 UTC+5:30, ke1g wrote:
>
>> Not all that useful unless you un-hide the file extensions.
>>
>> I'm guessing that there are manage.py scripts in both the upper and lower
>> blog1 directories.  For recent Djangos, manage.py should only be in the
>> upper directory. The lower directory contains settings.py, urls.py, wsgo/[u
>> amd __init__.py.
>>
>> I see that you are in the lower directory when you try to run it, which
>> is also wrong.  cd up a level and try again.
>>
>> Are you working from a book written for an older version of Django, or
>> are you trying to port an project written for an older version to a modern
>> Django?  I can't see how you arrive at the directory contents that you have.
>>
>>
>>
>>
>> On Fri, Sep 27, 2013 at 1:24 PM, s. gulab  wrote:
>>
>>> Hi,
>>>
>>>Please find the attachment.In that i have pasted the screen shot of
>>> my paths,output and everything.
>>>
>>> Thanks & Regards,
>>> Gulab S
>>>
>>>
>>> On Thursday, 26 September 2013 00:01:21 UTC+5:30, ke1g wrote:
>>>
>>>> And where is your settings.py file?  If it is in the same directory as
>>>> manage.py, and it is a reasonably current Django (1.4, 1.5), then it's in
>>>> the wrong place.  It belongs in a sub-directory named 'blog1', along with
>>>> your urls.py, wsgi.py and an empty __init__.py .
>>>>
>>>>
>>>>
>>>> On Wed, Sep 25, 2013 at 1:40 PM, s. gulab  wrote:
>>>>
>>>>> When i give " ./manage.py syncdb " i am getting following error.
>>>>>
>>>>> " *Traceback (most recent call last):*
>>>>> *  File "manage.py", line 10, in *
>>>>> *execute_from_command_line(sys.argv)*
>>>>> *  File 
>>>>> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>>>> line*
>>>>> *453, in execute_from_command_line*
>>>>> *utility.execute()*
>>>>> *  File 
>>>>> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>>>> line*
>>>>> *392, in execute*
>>>>> *self.fetch_command(subcommand).run_from_argv(self.argv)*
>>>>> *  File 
>>>>> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>>>> line*
>>>>> *263, in fetch_command*
>>>>> *app_name = get_commands()[subcommand]*
>>>>> *  File 
>>>>> "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>>>> line*
>>>>> *109, in get_commands*
>>>>> *apps = settings.INSTALLED_APPS*
>>>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>>>> 53, in __ge*
>>>>> *tattr__*
>>>>> *self._setup(name)*
>>>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>>>> 48, in _set*
>>>>> *up*
>>>>> *self._wrapped = Settings(settings_module)*
>>>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>>>> 134, in __i*
>>>>> *nit__*
>>>>> *raise ImportError("Could not import settings '%s' (Is it on
>>>>> sys.path?): %s"*
>>>>> *% (self.SETTINGS_MODULE, e))*
>>>>> *ImportError: Could not import settings 'blog1.settings' (Is it on
>>>>> sys.path?): No*
>>>>> * module named blog1.settings* "
>>>>&

Re: Not able to create an simple application using DB (syncdb error)

2013-09-27 Thread Bill Freeman
Not all that useful unless you un-hide the file extensions.

I'm guessing that there are manage.py scripts in both the upper and lower
blog1 directories.  For recent Djangos, manage.py should only be in the
upper directory. The lower directory contains settings.py, urls.py, wsgo/[u
amd __init__.py.

I see that you are in the lower directory when you try to run it, which is
also wrong.  cd up a level and try again.

Are you working from a book written for an older version of Django, or are
you trying to port an project written for an older version to a modern
Django?  I can't see how you arrive at the directory contents that you have.




On Fri, Sep 27, 2013 at 1:24 PM, s. gulab  wrote:

> Hi,
>
>Please find the attachment.In that i have pasted the screen shot of my
> paths,output and everything.
>
> Thanks & Regards,
> Gulab S
>
>
> On Thursday, 26 September 2013 00:01:21 UTC+5:30, ke1g wrote:
>
>> And where is your settings.py file?  If it is in the same directory as
>> manage.py, and it is a reasonably current Django (1.4, 1.5), then it's in
>> the wrong place.  It belongs in a sub-directory named 'blog1', along with
>> your urls.py, wsgi.py and an empty __init__.py .
>>
>>
>>
>> On Wed, Sep 25, 2013 at 1:40 PM, s. gulab  wrote:
>>
>>> When i give " ./manage.py syncdb " i am getting following error.
>>>
>>> " *Traceback (most recent call last):*
>>> *  File "manage.py", line 10, in *
>>> *execute_from_command_line(sys.argv)*
>>> *  File "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>> line*
>>> *453, in execute_from_command_line*
>>> *utility.execute()*
>>> *  File "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>> line*
>>> *392, in execute*
>>> *self.fetch_command(subcommand).run_from_argv(self.argv)*
>>> *  File "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>> line*
>>> *263, in fetch_command*
>>> *app_name = get_commands()[subcommand]*
>>> *  File "c:\Python27\lib\site-packages\django\core\management\__init__.py",
>>> line*
>>> *109, in get_commands*
>>> *apps = settings.INSTALLED_APPS*
>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>> 53, in __ge*
>>> *tattr__*
>>> *self._setup(name)*
>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>> 48, in _set*
>>> *up*
>>> *self._wrapped = Settings(settings_module)*
>>> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
>>> 134, in __i*
>>> *nit__*
>>> *raise ImportError("Could not import settings '%s' (Is it on
>>> sys.path?): %s"*
>>> *% (self.SETTINGS_MODULE, e))*
>>> *ImportError: Could not import settings 'blog1.settings' (Is it on
>>> sys.path?): No*
>>> * module named blog1.settings* "
>>>
>>> manage.py:
>>> 
>>> #!/usr/bin/env python
>>> import os
>>> import sys
>>>
>>> if __name__ == "__main__":
>>> os.environ.setdefault("DJANGO_**SETTINGS_MODULE", "blog1.settings")
>>>
>>> from django.core.management import execute_from_command_line
>>>
>>> execute_from_command_line(sys.**argv)
>>>
>>> settings.py:
>>> 
>>>
>>> # Django settings for blog1 project.
>>>
>>> import os
>>>
>>> DEBUG = True
>>> TEMPLATE_DEBUG = DEBUG
>>>
>>> ADMINS = (
>>> # ('Your Name', 'your_...@example.com'),
>>> )
>>>
>>> MANAGERS = ADMINS
>>>
>>> *DATABASES = {*
>>> *'default': {*
>>> *'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
>>> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.*
>>> *'NAME': 'blog1',  # Or path to database
>>> file if using sqlite3.*
>>> *# The following settings are not used with sqlite3:*
>>> *'USER': 'blog',*
>>> *'PASSWORD': 'blog',*
>>> *'HOST': '',  # Empty for localhost through
>>> domain so

Re: Not able to create an simple application using DB (syncdb error)

2013-09-25 Thread Bill Freeman
And where is your settings.py file?  If it is in the same directory as
manage.py, and it is a reasonably current Django (1.4, 1.5), then it's in
the wrong place.  It belongs in a sub-directory named 'blog1', along with
your urls.py, wsgi.py and an empty __init__.py .



On Wed, Sep 25, 2013 at 1:40 PM, s. gulab  wrote:

> When i give " ./manage.py syncdb " i am getting following error.
>
> " *Traceback (most recent call last):*
> *  File "manage.py", line 10, in *
> *execute_from_command_line(sys.argv)*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *453, in execute_from_command_line*
> *utility.execute()*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *392, in execute*
> *self.fetch_command(subcommand).run_from_argv(self.argv)*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *263, in fetch_command*
> *app_name = get_commands()[subcommand]*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *109, in get_commands*
> *apps = settings.INSTALLED_APPS*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 53,
> in __ge*
> *tattr__*
> *self._setup(name)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 48,
> in _set*
> *up*
> *self._wrapped = Settings(settings_module)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
> 134, in __i*
> *nit__*
> *raise ImportError("Could not import settings '%s' (Is it on
> sys.path?): %s"*
> *% (self.SETTINGS_MODULE, e))*
> *ImportError: Could not import settings 'blog1.settings' (Is it on
> sys.path?): No*
> * module named blog1.settings* "
>
> manage.py:
> 
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog1.settings")
>
> from django.core.management import execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
> settings.py:
> 
>
> # Django settings for blog1 project.
>
> import os
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> *DATABASES = {*
> *'default': {*
> *'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.*
> *'NAME': 'blog1',  # Or path to database file
> if using sqlite3.*
> *# The following settings are not used with sqlite3:*
> *'USER': 'blog',*
> *'PASSWORD': 'blog',*
> *'HOST': '',  # Empty for localhost through
> domain sockets or '127.0.0.1' for localhost through TCP.*
> *'PORT': '',  # Set to empty string for
> default.*
> *}*
> *}*
>
> # Hosts/domain names that are valid for this site; required if DEBUG is
> False
> # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> ALLOWED_HOSTS = []
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> *TIME_ZONE = 'India/Tamilnadu'*
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded
> files.
> # Example: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/";, &q

Re: Not able to create an simple application using DB (syncdb error)

2013-09-25 Thread Roopa singh
Can you please check this thread
http://stackoverflow.com/questions/12987648/importerror-could-not-import-settings
.


On Wed, Sep 25, 2013 at 11:10 PM, s. gulab  wrote:

> When i give " ./manage.py syncdb " i am getting following error.
>
> " *Traceback (most recent call last):*
> *  File "manage.py", line 10, in *
> *execute_from_command_line(sys.argv)*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *453, in execute_from_command_line*
> *utility.execute()*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *392, in execute*
> *self.fetch_command(subcommand).run_from_argv(self.argv)*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *263, in fetch_command*
> *app_name = get_commands()[subcommand]*
> *  File
> "c:\Python27\lib\site-packages\django\core\management\__init__.py", line*
> *109, in get_commands*
> *apps = settings.INSTALLED_APPS*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 53,
> in __ge*
> *tattr__*
> *self._setup(name)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 48,
> in _set*
> *up*
> *self._wrapped = Settings(settings_module)*
> *  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line
> 134, in __i*
> *nit__*
> *raise ImportError("Could not import settings '%s' (Is it on
> sys.path?): %s"*
> *% (self.SETTINGS_MODULE, e))*
> *ImportError: Could not import settings 'blog1.settings' (Is it on
> sys.path?): No*
> * module named blog1.settings* "
>
> manage.py:
> 
> #!/usr/bin/env python
> import os
> import sys
>
> if __name__ == "__main__":
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog1.settings")
>
> from django.core.management import execute_from_command_line
>
> execute_from_command_line(sys.argv)
>
> settings.py:
> 
>
> # Django settings for blog1 project.
>
> import os
>
> DEBUG = True
> TEMPLATE_DEBUG = DEBUG
>
> ADMINS = (
> # ('Your Name', 'your_em...@example.com'),
> )
>
> MANAGERS = ADMINS
>
> *DATABASES = {*
> *'default': {*
> *'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add
> 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.*
> *'NAME': 'blog1',  # Or path to database file
> if using sqlite3.*
> *# The following settings are not used with sqlite3:*
> *'USER': 'blog',*
> *'PASSWORD': 'blog',*
> *'HOST': '',  # Empty for localhost through
> domain sockets or '127.0.0.1' for localhost through TCP.*
> *'PORT': '',  # Set to empty string for
> default.*
> *}*
> *}*
>
> # Hosts/domain names that are valid for this site; required if DEBUG is
> False
> # See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
> ALLOWED_HOSTS = []
>
> # Local time zone for this installation. Choices can be found here:
> # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
> # although not all choices may be available on all operating systems.
> # In a Windows environment this must be set to your system time zone.
> *TIME_ZONE = 'India/Tamilnadu'*
>
> # Language code for this installation. All choices can be found here:
> # http://www.i18nguy.com/unicode/language-identifiers.html
> LANGUAGE_CODE = 'en-us'
>
> SITE_ID = 1
>
> # If you set this to False, Django will make some optimizations so as not
> # to load the internationalization machinery.
> USE_I18N = True
>
> # If you set this to False, Django will not format dates, numbers and
> # calendars according to the current locale.
> USE_L10N = True
>
> # If you set this to False, Django will not use timezone-aware datetimes.
> USE_TZ = True
>
> # Absolute filesystem path to the directory that will hold user-uploaded
> files.
> # Example: "/var/www/example.com/media/"
> MEDIA_ROOT = ''
>
> # URL that handles the media served from MEDIA_ROOT. Make sure to use a
> # trailing slash.
> # Examples: "http://example.com/media/";, "http://media.example.com/";
> MEDIA_URL = ''
>
> # Absolute path to the directory static files 

Not able to create an simple application using DB (syncdb error)

2013-09-25 Thread s. gulab
When i give " ./manage.py syncdb " i am getting following error.

" *Traceback (most recent call last):*
*  File "manage.py", line 10, in *
*execute_from_command_line(sys.argv)*
*  File "c:\Python27\lib\site-packages\django\core\management\__init__.py", 
line*
*453, in execute_from_command_line*
*utility.execute()*
*  File "c:\Python27\lib\site-packages\django\core\management\__init__.py", 
line*
*392, in execute*
*self.fetch_command(subcommand).run_from_argv(self.argv)*
*  File "c:\Python27\lib\site-packages\django\core\management\__init__.py", 
line*
*263, in fetch_command*
*app_name = get_commands()[subcommand]*
*  File "c:\Python27\lib\site-packages\django\core\management\__init__.py", 
line*
*109, in get_commands*
*apps = settings.INSTALLED_APPS*
*  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 53, 
in __ge*
*tattr__*
*self._setup(name)*
*  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 48, 
in _set*
*up*
*self._wrapped = Settings(settings_module)*
*  File "c:\Python27\lib\site-packages\django\conf\__init__.py", line 134, 
in __i*
*nit__*
*raise ImportError("Could not import settings '%s' (Is it on 
sys.path?): %s"*
*% (self.SETTINGS_MODULE, e))*
*ImportError: Could not import settings 'blog1.settings' (Is it on 
sys.path?): No*
* module named blog1.settings* "

manage.py:

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "blog1.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)

settings.py:


# Django settings for blog1 project.

import os

DEBUG = True
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

*DATABASES = {*
*'default': {*
*'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 
'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.*
*'NAME': 'blog1',  # Or path to database file 
if using sqlite3.*
*# The following settings are not used with sqlite3:*
*'USER': 'blog',*
*'PASSWORD': 'blog',*
*'HOST': '',  # Empty for localhost through 
domain sockets or '127.0.0.1' for localhost through TCP.*
*'PORT': '',  # Set to empty string for default.
*
*}*
*}*

# Hosts/domain names that are valid for this site; required if DEBUG is 
False
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
ALLOWED_HOSTS = []

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# In a Windows environment this must be set to your system time zone.
*TIME_ZONE = 'India/Tamilnadu'*

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale.
USE_L10N = True

# If you set this to False, Django will not use timezone-aware datetimes.
USE_TZ = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/var/www/example.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://example.com/media/";, "http://media.example.com/";
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/var/www/example.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://example.com/static/";, "http://static.example.com/";
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATI

Re: error python manage.py syncdb

2013-09-12 Thread Germán Larraín
Never import Django stuff in your settings (except core.exceptions) unless you 
REALLY know what you are doing

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: error python manage.py syncdb

2013-09-11 Thread Marco Fucci
A few things might be causing the problem:

   - is settings.SECRET_KEY empty? If so, it's easy enough to fix
   - in your settings, you might be importing a custom module *before* defining 
   the SECRET_KEY causing dependency problems
   - you're doing something wrong in your settings (e.g. importing models) 
   and that causes the problem

There might be other cases but I suggest you should double-check your 
settings first.

 

On Wednesday, 11 September 2013 09:46:35 UTC+1, Gabriele Angeli wrote:
>
> Hi guys i have the following errors when edit python manage.py syncdb :
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 469, in execute_manager
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 272, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 77, in load_command_class
> module = import_module('%s.management.commands.%s' % (app_name, name))
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 35, in import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
>  
> line 8, in 
> from django.core.management.sql import custom_sql_for_model, 
> emit_post_sync_signal
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", 
> line 9, in 
> from django.db import models
>   File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", 
> line 11, in 
> if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 53, in __getattr__
> self._setup(name)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 48, in _setup
> self._wrapped = Settings(settings_module)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 152, in __init__
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must 
> not be empty.
>
>
> Someone can 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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: error python manage.py syncdb

2013-09-11 Thread Kishor Pawar
In python.py you just need to change the following line

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "projectname.settings")

no other changes required.

this error should be from settings.py

for details on python.py 

read same doc as your django version.
https://docs.djangoproject.com/en/dev/ref/django-admin/


On Wednesday, 11 September 2013 14:16:35 UTC+5:30, Gabriele Angeli wrote:
>
> Hi guys i have the following errors when edit python manage.py syncdb :
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> execute_manager(settings)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 469, in execute_manager
> utility.execute()
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 392, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 272, in fetch_command
> klass = load_command_class(app_name, subcommand)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
> line 77, in load_command_class
> module = import_module('%s.management.commands.%s' % (app_name, name))
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
> line 35, in import_module
> __import__(name)
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
>  
> line 8, in 
> from django.core.management.sql import custom_sql_for_model, 
> emit_post_sync_signal
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", 
> line 9, in 
> from django.db import models
>   File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", 
> line 11, in 
> if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 53, in __getattr__
> self._setup(name)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 48, in _setup
> self._wrapped = Settings(settings_module)
>   File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
> line 152, in __init__
> raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
> django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must 
> not be empty.
>
>
> Someone can 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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


error python manage.py syncdb

2013-09-11 Thread Gabriele Angeli
Hi guys i have the following errors when edit python manage.py syncdb :

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 469, in execute_manager
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 77, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/usr/local/lib/python2.7/dist-packages/django/utils/importlib.py", 
line 35, in import_module
__import__(name)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/syncdb.py",
 
line 8, in 
from django.core.management.sql import custom_sql_for_model, 
emit_post_sync_signal
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/sql.py", 
line 9, in 
from django.db import models
  File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 
11, in 
if settings.DATABASES and DEFAULT_DB_ALIAS not in settings.DATABASES:
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
line 53, in __getattr__
self._setup(name)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
line 48, in _setup
self._wrapped = Settings(settings_module)
  File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", 
line 152, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must 
not be empty.


Someone can 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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Andre Terra
On Mon, Aug 26, 2013 at 1:19 PM, Natko Perko  wrote:

> @laurent i guess it worked, but now i get the error no module named
> wikicamp.wiki.. this is all the code i have so far..


make sure the folder containing wikicamp is inside your PATH so you don't
get import errors. make sure there's an __init__.py inside it.

perhaps you could debug the import error like this:

$ ./manage.py shell
>>> import sys
>>> print '\n'.join(sys.path)
>>> import wikicamp
>>> from wikicamp import wiki


In the future, please post an entire traceback along with your question.

Cheers,
AT

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Natko Perko
@laurent i guess it worked, but now i get the error no module named 
wikicamp.wiki.. this is all the code i have so far..

from django.db import models

# Create your models here.

class Page(models.Model):
name = models.CharField(maxlength="20", primary_key=True)
content = models.TextField(blank=True)

   
:wq

@mantaszilinskis   thx for the links, gonna check them out

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Mantas Zilinskis
for your environment:
you should definitely look into this
http://www.jeffknupp.com/blog/2012/02/09/starting-a-django-project-the-right-way/

 if you're using mac also this
http://hackercodex.com/guide/python-virtualenv-on-mac-osx-mountain-lion-10.8/

setup your settings.py
http://www.rdegges.com/the-perfect-django-settings-file/

then work your way through tutorials

one more thing you should start with is writing your tests
http://www.youtube.com/watch?v=WfyoC0h9QKA


On Mon, Aug 26, 2013 at 8:53 AM, Laurent Meunier wrote:

> On 26/08/2013 14:34, Natko Perko wrote:
>
>> Hi out there,
>>
>> I just dove into Django (literally) and had so many issues installing it
>> and knowing where to start from that I don't even know how I made it
>> this far, so i finally started working on a project by mimicing this
>> tutorial 
>> http://showmedo.com/**videotutorials/video?name=**110.
>> Well id
>> didnt last for long since I already got stuck at 3:40 when the gentleman
>> is syncing his db. this is what I get If any1 knows a good video
>> tutorial for dummies please share with me cuz im desperate. Thx for
>> reading..
>>
>
> Hi,
>
> What is the value of DATABASES['default']['ENGINE'] in your settings.py?
>
> I think you have entered only 'sqlite3', but django wants you to enter the
> full path to the module (ie: 'django.db.backends.sqlite3').
>
>
> Best regards,
> --
> Laurent Meunier 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> django-users+unsubscribe@**googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/django-users
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: syncdb issue (begginer stuff)

2013-08-26 Thread Laurent Meunier

On 26/08/2013 14:34, Natko Perko wrote:

Hi out there,

I just dove into Django (literally) and had so many issues installing it
and knowing where to start from that I don't even know how I made it
this far, so i finally started working on a project by mimicing this
tutorial http://showmedo.com/videotutorials/video?name=110. Well id
didnt last for long since I already got stuck at 3:40 when the gentleman
is syncing his db. this is what I get If any1 knows a good video
tutorial for dummies please share with me cuz im desperate. Thx for
reading..


Hi,

What is the value of DATABASES['default']['ENGINE'] in your settings.py?

I think you have entered only 'sqlite3', but django wants you to enter 
the full path to the module (ie: 'django.db.backends.sqlite3').



Best regards,
--
Laurent Meunier 

--
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: SQLite3 refuses to work when running syncdb

2013-07-16 Thread Rafael E. Ferrero
hahaha... its ok... you will find that its really cool coding webs with
Django... See ya!


2013/7/16 Alex Hall 

> Well, disregard my email. I was selecting the dictionary to copy into my
> reply when I noticed I'd transposed two letters in the path, meaning that
> Django was trying to access a path that does not exist. That will certainly
> throw errors! :) Thanks anyway, and I'm sure I'll have more questions as I
> start developing my real site and not a tutorial. Sorry for the stupid
> mistake.
>
> On Jul 16, 2013, at 5:18 PM, Rafael E. Ferrero 
> wrote:
>
> maybe pastebin your code helps... you have permission on folders where
> sqlite file will be created?
> I have this in settings.py (django 1.3.1):
> ...
> 'default': {
> #  Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or
> 'oracle'.
> 'ENGINE': 'django.db.backends.sqlite3',
> #  Or path to database file if using sqlite3.
> 'NAME': '/path/to/my/file.sqlite',
> ...
>
> Have some info message of error ??
>
> Cheers!
>
>
> 2013/7/16 Alex Hall 
>
>> Hello list,
>> I am well versed in Python, and I hate web development, but I have to
>> make a website for my business. So, I thought I'd use Python to make the
>> task more tolerable.
>>
>> I'm working through the official Django tutorial, and am at the part
>> where I am to run "python manage.py syncdb". However, I keep getting:
>> operational error: unable to open database file."
>>
>> I set the "NAME" key to the absolute path (this is on OS10.8), the folder
>> should be writeable since it is just a folder in my user account, there are
>> no special characters or spaces in the path, and I've tried both ending it
>> with a slash and no filename and providing a filename. Nothing works, and I
>> have no idea why. I am running the latest production version, 1.5.1, if
>> that matters. Any suggestions would be greatly appreciated. Thank you.
>>
>>
>> Have a great day,
>> Alex (msg sent from Mac Mini)
>> mehg...@gmail.com
>>
>>
>>
>> --
>> 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.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
>
>
> Have a great day,
> Alex (msg sent from Mac Mini)
> mehg...@gmail.com
>
>
>
>  --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SQLite3 refuses to work when running syncdb

2013-07-16 Thread Alex Hall
Well, disregard my email. I was selecting the dictionary to copy into my reply 
when I noticed I'd transposed two letters in the path, meaning that Django was 
trying to access a path that does not exist. That will certainly throw errors! 
:) Thanks anyway, and I'm sure I'll have more questions as I start developing 
my real site and not a tutorial. Sorry for the stupid mistake.
On Jul 16, 2013, at 5:18 PM, Rafael E. Ferrero  wrote:

> maybe pastebin your code helps... you have permission on folders where sqlite 
> file will be created?
> I have this in settings.py (django 1.3.1): 
> ...
> 'default': {
> #  Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 
> 'oracle'.
> 'ENGINE': 'django.db.backends.sqlite3',
> #  Or path to database file if using sqlite3.
> 'NAME': '/path/to/my/file.sqlite',
> ...
> 
> Have some info message of error ??
> 
> Cheers!
> 
> 
> 2013/7/16 Alex Hall 
> Hello list,
> I am well versed in Python, and I hate web development, but I have to make a 
> website for my business. So, I thought I'd use Python to make the task more 
> tolerable.
> 
> I'm working through the official Django tutorial, and am at the part where I 
> am to run "python manage.py syncdb". However, I keep getting:
> operational error: unable to open database file."
> 
> I set the "NAME" key to the absolute path (this is on OS10.8), the folder 
> should be writeable since it is just a folder in my user account, there are 
> no special characters or spaces in the path, and I've tried both ending it 
> with a slash and no filename and providing a filename. Nothing works, and I 
> have no idea why. I am running the latest production version, 1.5.1, if that 
> matters. Any suggestions would be greatly appreciated. Thank you.
> 
> 
> Have a great day,
> Alex (msg sent from Mac Mini)
> mehg...@gmail.com
> 
> 
> 
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> 
> -- 
> Rafael E. Ferrero
> Claro: (03562) 15514856
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  



Have a great day,
Alex (msg sent from Mac Mini)
mehg...@gmail.com



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SQLite3 refuses to work when running syncdb

2013-07-16 Thread Rafael E. Ferrero
maybe pastebin your code helps... you have permission on folders where
sqlite file will be created?
I have this in settings.py (django 1.3.1):
...
'default': {
#  Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or
'oracle'.
'ENGINE': 'django.db.backends.sqlite3',
#  Or path to database file if using sqlite3.
'NAME': '/path/to/my/file.sqlite',
...

Have some info message of error ??

Cheers!


2013/7/16 Alex Hall 

> Hello list,
> I am well versed in Python, and I hate web development, but I have to make
> a website for my business. So, I thought I'd use Python to make the task
> more tolerable.
>
> I'm working through the official Django tutorial, and am at the part where
> I am to run "python manage.py syncdb". However, I keep getting:
> operational error: unable to open database file."
>
> I set the "NAME" key to the absolute path (this is on OS10.8), the folder
> should be writeable since it is just a folder in my user account, there are
> no special characters or spaces in the path, and I've tried both ending it
> with a slash and no filename and providing a filename. Nothing works, and I
> have no idea why. I am running the latest production version, 1.5.1, if
> that matters. Any suggestions would be greatly appreciated. Thank you.
>
>
> Have a great day,
> Alex (msg sent from Mac Mini)
> mehg...@gmail.com
>
>
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


-- 
Rafael E. Ferrero
Claro: (03562) 15514856

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




SQLite3 refuses to work when running syncdb

2013-07-16 Thread Alex Hall
Hello list,
I am well versed in Python, and I hate web development, but I have to make a 
website for my business. So, I thought I'd use Python to make the task more 
tolerable.

I'm working through the official Django tutorial, and am at the part where I am 
to run "python manage.py syncdb". However, I keep getting:
operational error: unable to open database file."

I set the "NAME" key to the absolute path (this is on OS10.8), the folder 
should be writeable since it is just a folder in my user account, there are no 
special characters or spaces in the path, and I've tried both ending it with a 
slash and no filename and providing a filename. Nothing works, and I have no 
idea why. I am running the latest production version, 1.5.1, if that matters. 
Any suggestions would be greatly appreciated. Thank you.


Have a great day,
Alex (msg sent from Mac Mini)
mehg...@gmail.com



-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: python manage.py syncdb (using mysql database)

2013-06-03 Thread lordkyoshi2
I solved the problem, i still don't know how this could make the project 
bug but 

after i tryed every section alone i went back into settings.py
i randomly found out
when i set the port even if its to the right value it don't succes to find 
and creat table into the db
but if i let django set the value of the port to default value, it works

here if you get an error same as mine, try to let PORT : '', 

Le dimanche 2 juin 2013 20:34:49 UTC+2, lordk...@gmail.com a écrit :
>
> Hello
>
> I try to create a polls from Django first tutorial
> https://docs.djangoproject.com/en/1.5/intro/tutorial01/
> but im blocked on syncdb
>
> if i choose on my settings the mysql, nothing happen, but if i take 
> sqlite3 it create the base
> The prompt just stay on, as if i need to enter some inputs.
>
> I checked yesterday and this morning, found nothing concluant about my 
> problem.
>
> I use an Ubuntu, i installed mysql srv and client, i got mysql dev for 
> mysql_config
>   python version 2.7.3
>   django version 1.5.1
>   mysql  version 5.5.31
>   i instaled the mysql-pyhton 1.2.4 if i test import the MySQLdb into 
> python interpreter it succes i can also connect to the db, i also can 
> import django
>  
> python manage.py runserver works fine, i can acces to the page
> but python manage.py syncdb just do nothing and i don't understand or 
> succes to figure why.
> i got the debug on, i try to set the verbosity but nothing append..
>
> I would appreciate some help.
>
> Does someone already have a lead for my problem
>
> or does some other have same problem as me with the tutorial?
>
> thx for reading

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




python manage.py syncdb (using mysql database)

2013-06-02 Thread lordkyoshi2
Hello

I try to create a polls from Django first tutorial
https://docs.djangoproject.com/en/1.5/intro/tutorial01/
but im blocked on syncdb

if i choose on my settings the mysql, nothing happen, but if i take sqlite3 
it create the base
The prompt just stay on, as if i need to enter some inputs.

I checked yesterday and this morning, found nothing concluant about my 
problem.

I use an Ubuntu, i installed mysql srv and client, i got mysql dev for 
mysql_config
  python version 2.7.3
  django version 1.5.1
  mysql  version 5.5.31
  i instaled the mysql-pyhton 1.2.4 if i test import the MySQLdb into 
python interpreter it succes i can also connect to the db, i also can 
import django
 
python manage.py runserver works fine, i can acces to the page
but python manage.py syncdb just do nothing and i don't understand or 
succes to figure why.
i got the debug on, i try to set the verbosity but nothing append..

I would appreciate some help.

Does someone already have a lead for my problem

or does some other have same problem as me with the tutorial?

thx for reading

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SyncDb doesn't create tables in database

2013-05-30 Thread Anas
You are right ! 
It looks that the table has been created the first time and i didn't saw 
the message.

Concerning the nodeid, i thought that it would be generated automatically 
and incremented for each new created instance   , isn't it ? 

And i noticed also that the graph was created while the graphdb wasn't ! 
even if i could create Airport nodes from the ./manage.py shell 

How can i solve this ? 
 
Thanks for the reply 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SyncDb doesn't create tables in database

2013-05-30 Thread Anas
You are right ! 
It looks that the table has been created the first time and i didn't saw 
the message.

Concerning the nodeid, i thought that it would be generated automatically 
and incremented for each new created instance   , isn't it ? 

Thanks for the reply 

On Thursday, May 30, 2013 3:35:36 PM UTC+2, Tom Evans wrote:
>
> On Thu, May 30, 2013 at 1:46 PM, Anas > 
> wrote: 
> > I am having Neo4Django in my django based application and trying to use 
> two 
> > databases at the sametime : Neo4j and PostGIS. So i configured 
> settings.py 
> > as suggested in the docs (http://neo4django.readthedocs.org) and 
> models.py 
> > as well. 
> > 
> > When i try to run syncdb , i am getting this message 
> > 
> > You just installed Django's auth system, which means you don't have 
> any 
> > superusers defined. 
> > Would you like to create one now? (yes/no): yes 
> > Username (leave blank to use 'postgres'): 
> > E-mail address: post...@gmail.com  
> > Password: 
> > Password (again): 
> > Superuser created successfully. 
> > Installing custom SQL ... 
> > Installing indexes ... 
> > Installed 0 object(s) from 0 fixture(s) 
> > 
> > but when i check if the table and the graph were created, i find nothing 
> ! 
> > 
> > i am using django 1.4 and neo4j 1.9.M05 
> > 
> > 
> > here is how i declared my databases in settings.py: 
> > 
> > DATABASES = { 
> > 'default': { 
> >  'ENGINE': 'django.contrib.gis.db.backends.postgis', 
> >  'NAME': 'geodjango', 
> >  'USER': 'postgres', 
> > 
> > 
> >  } 
> > } 
> > NEO4J_DATABASES = { 
> > 'default' : { 
> > 'HOST':'127.0.0.1', 
> > 'PORT':7474, 
> > 'ENDPOINT':'/db/data/' 
> > } 
> > } 
> > 
> > DATABASE_ROUTERS = ['neo4django.utils.Neo4djangoIntegrationRouter'] 
> > 
> > 
> > and i declared my models.py like this : 
> > 
> > from neo4django.db import models 
> > from django.contrib.gis.db import models as gis 
> > 
> > class Airport(models.NodeModel): 
> > name = models.StringProperty() 
> > iata = models.StringProperty() 
> > icao= models.StringProperty() 
> > 
> > city = models.Relationship('self',rel_type='isAT') 
> > 
> > #geographical database for storing entities coordinates 
> > class pointsOfInterest(gis.Model): 
> > nodeid = gis.IntegerField() 
> > longitude = gis.FloatField() 
> > latitude = gis.FloatField() 
> > 
> > # GeoDjango-specific: a geometry field (MultiPolygonField), and 
> > # overriding the default manager with a GeoManager instance. 
> > objects = gis.GeoManager() 
> > 
> > 
> > when i run `python manage.py sqlall testapp` (where testapp is my app 
> and 
> > after deleting the neo4j models , otherwise it won't work ), i am 
> getting 
> > that sql that permit to create the table : 
> > 
> > BEGIN; 
> > CREATE TABLE "testapp_pointsofinterest" ( 
> > "id" serial NOT NULL PRIMARY KEY, 
> > "nodeid" integer NOT NULL, 
> > "longitude" double precision NOT NULL, 
> > "latitude" double precision NOT NULL 
> > ) 
> > ; 
> > COMMIT; 
> > 
> > Then i try to create an instance of this table in the `python manage.py 
> > shell` i am getting this : 
> > 
> > 
> > postgres@anas-desktop:/home/anas/Desktop/testNeo4Django$ ./manage.py 
> > shell 
> > Python 2.6.5 (r265:79063, Oct  1 2012, 22:07:21) 
> > [GCC 4.4.3] on linux2 
> > Type "help", "copyright", "credits" or "license" for more 
> information. 
> > (InteractiveConsole) 
> > >>> from testNeo4Django.testapp.models import pointsOfInterest 
> > >>> 
> > >>> poi= pointsOfInterest.objects.create() 
> > Traceback (most recent call last): 
> >   File "", line 1, in  
> >   File 
> > "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", 
> line 
> > 137, in

Re: SyncDb doesn't create tables in database

2013-05-30 Thread Tom Evans
On Thu, May 30, 2013 at 1:46 PM, Anas  wrote:
> I am having Neo4Django in my django based application and trying to use two
> databases at the sametime : Neo4j and PostGIS. So i configured settings.py
> as suggested in the docs (http://neo4django.readthedocs.org) and models.py
> as well.
>
> When i try to run syncdb , i am getting this message
>
> You just installed Django's auth system, which means you don't have any
> superusers defined.
> Would you like to create one now? (yes/no): yes
> Username (leave blank to use 'postgres'):
> E-mail address: postg...@gmail.com
> Password:
> Password (again):
> Superuser created successfully.
> Installing custom SQL ...
> Installing indexes ...
> Installed 0 object(s) from 0 fixture(s)
>
> but when i check if the table and the graph were created, i find nothing !
>
> i am using django 1.4 and neo4j 1.9.M05
>
>
> here is how i declared my databases in settings.py:
>
> DATABASES = {
> 'default': {
>  'ENGINE': 'django.contrib.gis.db.backends.postgis',
>  'NAME': 'geodjango',
>  'USER': 'postgres',
>
>
>  }
> }
> NEO4J_DATABASES = {
> 'default' : {
> 'HOST':'127.0.0.1',
> 'PORT':7474,
> 'ENDPOINT':'/db/data/'
> }
> }
>
> DATABASE_ROUTERS = ['neo4django.utils.Neo4djangoIntegrationRouter']
>
>
> and i declared my models.py like this :
>
> from neo4django.db import models
> from django.contrib.gis.db import models as gis
>
> class Airport(models.NodeModel):
> name = models.StringProperty()
> iata = models.StringProperty()
> icao= models.StringProperty()
>
> city = models.Relationship('self',rel_type='isAT')
>
> #geographical database for storing entities coordinates
> class pointsOfInterest(gis.Model):
> nodeid = gis.IntegerField()
> longitude = gis.FloatField()
> latitude = gis.FloatField()
>
> # GeoDjango-specific: a geometry field (MultiPolygonField), and
> # overriding the default manager with a GeoManager instance.
> objects = gis.GeoManager()
>
>
> when i run `python manage.py sqlall testapp` (where testapp is my app and
> after deleting the neo4j models , otherwise it won't work ), i am getting
> that sql that permit to create the table :
>
> BEGIN;
> CREATE TABLE "testapp_pointsofinterest" (
> "id" serial NOT NULL PRIMARY KEY,
> "nodeid" integer NOT NULL,
> "longitude" double precision NOT NULL,
> "latitude" double precision NOT NULL
> )
> ;
> COMMIT;
>
> Then i try to create an instance of this table in the `python manage.py
> shell` i am getting this :
>
>
> postgres@anas-desktop:/home/anas/Desktop/testNeo4Django$ ./manage.py
> shell
> Python 2.6.5 (r265:79063, Oct  1 2012, 22:07:21)
> [GCC 4.4.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from testNeo4Django.testapp.models import pointsOfInterest
> >>>
> >>> poi= pointsOfInterest.objects.create()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line
> 137, in create
> return self.get_query_set().create(**kwargs)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line
> 377, in create
> obj.save(force_insert=True, using=self.db)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 463,
> in save
> self.save_base(using=using, force_insert=force_insert,
> force_update=force_update)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 551,
> in save_base
> result = manager._insert([self], fields=fields, return_id=update_pk,
> using=using, raw=raw)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line
> 203, in _insert
> return insert_query(self.model, objs, fields, **kwargs)
>   File
> "/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line
> 1593, in inse

SyncDb doesn't create tables in database

2013-05-30 Thread Anas
I am having Neo4Django in my django based application and trying to use two 
databases at the sametime : Neo4j and PostGIS. So i configured settings.py 
as suggested in the docs (http://neo4django.readthedocs.org) and models.py 
as well.

When i try to run syncdb , i am getting this message 

You just installed Django's auth system, which means you don't have any 
superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'postgres'): 
E-mail address: postg...@gmail.com
Password: 
Password (again): 
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

but when i check if the table and the graph were created, i find nothing ! 

i am using django 1.4 and neo4j 1.9.M05 


here is how i declared my databases in settings.py: 

DATABASES = {
'default': {
 'ENGINE': 'django.contrib.gis.db.backends.postgis',
 'NAME': 'geodjango',
 'USER': 'postgres',


 }
}
NEO4J_DATABASES = {
'default' : {
'HOST':'127.0.0.1',
'PORT':7474,
'ENDPOINT':'/db/data/'
}
}

DATABASE_ROUTERS = ['neo4django.utils.Neo4djangoIntegrationRouter']


and i declared my models.py like this : 

from neo4django.db import models
from django.contrib.gis.db import models as gis 

   
class Airport(models.NodeModel):
name = models.StringProperty()
iata = models.StringProperty()
icao= models.StringProperty()

city = models.Relationship('self',rel_type='isAT')

#geographical database for storing entities coordinates
class pointsOfInterest(gis.Model):
nodeid = gis.IntegerField()
longitude = gis.FloatField()
latitude = gis.FloatField()

# GeoDjango-specific: a geometry field (MultiPolygonField), and
# overriding the default manager with a GeoManager instance.
objects = gis.GeoManager()


when i run `python manage.py sqlall testapp` (where testapp is my app and 
after deleting the neo4j models , otherwise it won't work ), i am getting 
that sql that permit to create the table : 

BEGIN;
CREATE TABLE "testapp_pointsofinterest" (
"id" serial NOT NULL PRIMARY KEY,
"nodeid" integer NOT NULL,
"longitude" double precision NOT NULL,
"latitude" double precision NOT NULL
)
;
COMMIT;

Then i try to create an instance of this table in the `python manage.py 
shell` i am getting this : 


postgres@anas-desktop:/home/anas/Desktop/testNeo4Django$ ./manage.py 
shell
Python 2.6.5 (r265:79063, Oct  1 2012, 22:07:21) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from testNeo4Django.testapp.models import pointsOfInterest
>>> 
>>> poi= pointsOfInterest.objects.create()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 
137, in create
return self.get_query_set().create(**kwargs)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 
377, in create
obj.save(force_insert=True, using=self.db)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 
463, in save
self.save_base(using=using, force_insert=force_insert, 
force_update=force_update)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/base.py", line 
551, in save_base
result = manager._insert([self], fields=fields, 
return_id=update_pk, using=using, raw=raw)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/manager.py", line 
203, in _insert
return insert_query(self.model, objs, fields, **kwargs)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/query.py", line 
1593, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/models/sql/compiler.py", 
line 912, in execute_sql
cursor.execute(sql, params)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/backends/util.py", line 
40, in execute
return self.cursor.execute(sql, params)
  File 
"/usr/local/lib/python2.6/dist-packages/django/db/backends/postgresql_psycopg2/base.py",
 
line 52, in execute
return self.curs

SyncDb doesn't create tables

2013-05-30 Thread Anas
Hello all,

I am trying to create a table in my DB using models.py and the ./manage.py 
 syncdb command.

But what i notice is that anything is being inserted even though i can run 
this commad : ./manage.py sqlall testapp (where testapp is my app) and get 
the sql that permit to create the table.

here is my models.py file : 

#geographical database for storing entities coordinates
class pointsOfInterest(gis.Model):
nodeid = gis.IntegerField() #add an index over ths column to speed up 
search for coordinates
longitude = gis.FloatField()
latitude = gis.FloatField()

# GeoDjango-specific: a geometry field (MultiPolygonField), and
# overriding the default manager with a GeoManager instance.
objects = gis.GeoManager()

i added the application and database declaration in the settings.py file : 
DATABASES = {
'default': {
 'ENGINE': 'django.contrib.gis.db.backends.postgis',
 'NAME': 'geodjango',
 'USER': 'postgres',
 }
}

and in the installed apps.:
'testNeo4Django.testapp',
'django.contrib.gis', 


and when i run the command : python manage.py sqlall testapp , i get the 
sql responsible for creating the pointsOfInterest table : 

BEGIN;
CREATE TABLE "testapp_pointsofinterest" (
"id" serial NOT NULL PRIMARY KEY,
"nodeid" integer NOT NULL,
"longitude" double precision NOT NULL,
    "latitude" double precision NOT NULL); 

COMMIT;

but when i eventually need to create the table using python manage.py 
syncdb, nothing is being created !!! and i am getting back this message : 
 
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)

Any ideas about this ?? 

Thanks for your help 

Anas 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Syncdb hangs/stalls

2013-05-26 Thread Aaron C. de Bruyn
Do you have any processes open that are holding locks on the DB?

Maybe a 'manage.py shell'?

-A


On Sat, May 25, 2013 at 6:11 PM, Joshua Kehn  wrote:

> Everything was working up until a few hours ago. Then I tried setting up
> South because I have a less than simple migration to do. Now I've tried
> this with and without South in installed apps, but either way this is what
> I get:
>
> (venv)Joshs-MacBook-Air:webapp josh$ python manage.py syncdb --verbosity 3
> Creating tables ...
> Processing project.NewCampaign_influencers model
> Creating table project_newcampaign_influencers
> ^C # This doesn't kill it
>
> Reading the last thread I found with this question I switched my backend
> to SQLite3, same results. Any ideas about what to try for fixing 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Syncdb hangs/stalls

2013-05-25 Thread Joshua Kehn
Everything was working up until a few hours ago. Then I tried setting up 
South because I have a less than simple migration to do. Now I've tried 
this with and without South in installed apps, but either way this is what 
I get:

(venv)Joshs-MacBook-Air:webapp josh$ python manage.py syncdb --verbosity 3
Creating tables ...
Processing project.NewCampaign_influencers model
Creating table project_newcampaign_influencers
^C # This doesn't kill it

Reading the last thread I found with this question I switched my backend to 
SQLite3, same results. Any ideas about what to try for fixing 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
To try and find more information, I erased the Django-created tables and 
re-ran syncdb again. This time, I turned verbosity on to 3 and piped all of 
my stdout to a text file. I actually did this first. However, here's the 
contents of the first one which includes everything up to the point of 
failure.

Creating tables ...
Processing auth.Permission model
Creating table auth_permission
Processing auth.Group_permissions model
Creating table auth_group_permissions
Processing auth.Group model
Creating table auth_group
Processing contenttypes.ContentType model
Creating table django_content_type
Processing sessions.Session model
Creating table django_session
Processing sites.Site model
Creating table django_site
Processing admin.LogEntry model
Creating table django_admin_log

Note that I do have a custom UserModel, UserManager, and related Admin 
stuff based off of the docs. Could this be related to the problem? I 
removed a "db_index=True" option I had set on the User's email address.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
I should mention that I *did* convert all of my existing tables to InnoDB 
which hasn't helped at all. I don't have any weird configuration in my 
settings.py dealing with the database. As far as I can tell, all new tables 
created by syncdb are also InnoDB.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
When running syncdb, I am getting an unusual error. I'm using Django 1.5.1 
and a relatively recent version of MariaDB on Arch. I am using some 
pre-existing tables which I've built Models around. The error is:

*DatabaseError: (1005, "Can't create table '.#sql-1e51_2be' (errno: 150)")*

Running syncdb a second time seems to finish out the process without error.

Searching around hasn't really helped tremendously. At least, I'm not 
looking in the right place.

At first glance, I thought that maybe this was some weird table name. After 
some further thinking, does this hash symbol represent something in MySQL 
land? Perhaps an index? Perhaps literally implemented as a hash table? haha

I tried to debug it. I figured if I could get ahold of the SQL produced by 
syncdb and run it manually then the RDBMS might give me some more verbose 
output.

Unfortunately, I have my project broken up into quite a few modules (apps) 
and have no idea how the syncdb command goes about chaining the various 
"sqlall " dumps I can produce. I know with indexes in particular, 
order is important.

So, any clue as to what might be going on or how to dig in deeper? Thanks.

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




Re: [newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread crosa
I found the error. The application wasn't in the INSTALLED_APP in the 
settings file! 


On Thursday, May 9, 2013 2:13:19 PM UTC+2, Mike Dewhirst wrote:
>
> On 9/05/2013 10:04pm, crosa wrote: 
> > Hi guys, 
> > 
> > I'm testing django in order to build a little application. This 
> > application will have several models, so I've decided to split up them, 
> > in order to do this more readable (Any other form to do this?) 
> > When I run python manage.py syncdb, the models tables have not been 
> > created, and I don't know why! 
>
> Check this ... 
>
> https://docs.djangoproject.com/en/dev/ref/models/options/#app-label 
>
> > 
> > I have tried to use south for the migration too, and when I run this: 
> > python manage.py schemamigration testapp --initial 
> > This error appears. 
> > ImproperlyConfigured: App with label testapp could not be found 
> > 
> > I think it's something related with the models split up, but I don't 
> > know what 
> > 
> > Here we are the testproject tree (attached). 
> > 
> > ├── [-rwxr-xr-x  250 May  9 13:14]  manage.py 
> > ├── [drwxr-xr-x 4.0K May  9 13:51]  templates 
> > │   ├── [-rw-r--r--  111 May  9 13:50]  view1.html 
> > │   ├── [-rw-r--r--  111 May  9 13:50]  view2.html 
> > │   └── [-rw-r--r--  111 May  9 13:51]  view3.html 
> > └── [drwxr-xr-x 4.0K May  9 13:54]  testapp 
> >  ├── [-rw-r--r--  406 May  9 13:23]  admin.py 
> >  ├── [-rw-r--r--   27 May  9 13:23]  forms.py 
> >  ├── [-rw-r--r--0 May  9 13:10]  __init__.py 
> >  ├── [drwxr-xr-x 4.0K May  9 13:32]  models 
> >  │   ├── [-rw-r--r--  133 May  9 13:32]  __init__.py 
> >  │   ├── [-rw-r--r--  588 May  9 13:30]  model1.py 
> >  │   ├── [-rw-r--r--  921 May  9 13:31]  model2.py 
> >  │   └── [-rw-r--r--  588 May  9 13:32]  model3.py 
> >  ├── [-rw-r--r-- 5.4K May  9 13:24]  settings.py 
> >  ├── [-rw-r--r--  39K May  9 13:48]  sqlite.db 
> >  ├── [-rw-r--r--  774 May  9 13:52]  urls.py 
> >  ├── [-rw-r--r--  746 May  9 13:48]  views.py 
> >  └── [-rw-r--r-- 1.4K May  9 13:17]  wsgi.py 
> > 
> > Thanks in advance! 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to django-users...@googlegroups.com . 
> > To post to this group, send email to 
> > django...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/django-users?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread Mike Dewhirst

On 9/05/2013 10:04pm, crosa wrote:

Hi guys,

I'm testing django in order to build a little application. This
application will have several models, so I've decided to split up them,
in order to do this more readable (Any other form to do this?)
When I run python manage.py syncdb, the models tables have not been
created, and I don't know why!


Check this ...

https://docs.djangoproject.com/en/dev/ref/models/options/#app-label



I have tried to use south for the migration too, and when I run this:
python manage.py schemamigration testapp --initial
This error appears.
ImproperlyConfigured: App with label testapp could not be found

I think it's something related with the models split up, but I don't
know what

Here we are the testproject tree (attached).

├── [-rwxr-xr-x  250 May  9 13:14]  manage.py
├── [drwxr-xr-x 4.0K May  9 13:51]  templates
│   ├── [-rw-r--r--  111 May  9 13:50]  view1.html
│   ├── [-rw-r--r--  111 May  9 13:50]  view2.html
│   └── [-rw-r--r--  111 May  9 13:51]  view3.html
└── [drwxr-xr-x 4.0K May  9 13:54]  testapp
 ├── [-rw-r--r--  406 May  9 13:23]  admin.py
 ├── [-rw-r--r--   27 May  9 13:23]  forms.py
 ├── [-rw-r--r--0 May  9 13:10]  __init__.py
 ├── [drwxr-xr-x 4.0K May  9 13:32]  models
 │   ├── [-rw-r--r--  133 May  9 13:32]  __init__.py
 │   ├── [-rw-r--r--  588 May  9 13:30]  model1.py
 │   ├── [-rw-r--r--  921 May  9 13:31]  model2.py
 │   └── [-rw-r--r--  588 May  9 13:32]  model3.py
 ├── [-rw-r--r-- 5.4K May  9 13:24]  settings.py
 ├── [-rw-r--r--  39K May  9 13:48]  sqlite.db
 ├── [-rw-r--r--  774 May  9 13:52]  urls.py
 ├── [-rw-r--r--  746 May  9 13:48]  views.py
 └── [-rw-r--r-- 1.4K May  9 13:17]  wsgi.py

Thanks in advance!

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[newbie question] python manage syncdb doesn't create all the tables. Models has been splitted up.

2013-05-09 Thread crosa
Hi guys,

I'm testing django in order to build a little application. This application 
will have several models, so I've decided to split up them, in order to do 
this more readable (Any other form to do this?)
When I run python manage.py syncdb, the models tables have not been 
created, and I don't know why!

I have tried to use south for the migration too, and when I run this:
python manage.py schemamigration testapp --initial
This error appears.
ImproperlyConfigured: App with label testapp could not be found

I think it's something related with the models split up, but I don't know 
what

Here we are the testproject tree (attached).

├── [-rwxr-xr-x  250 May  9 13:14]  manage.py
├── [drwxr-xr-x 4.0K May  9 13:51]  templates
│   ├── [-rw-r--r--  111 May  9 13:50]  view1.html
│   ├── [-rw-r--r--  111 May  9 13:50]  view2.html
│   └── [-rw-r--r--  111 May  9 13:51]  view3.html
└── [drwxr-xr-x 4.0K May  9 13:54]  testapp
├── [-rw-r--r--  406 May  9 13:23]  admin.py
├── [-rw-r--r--   27 May  9 13:23]  forms.py
├── [-rw-r--r--0 May  9 13:10]  __init__.py
├── [drwxr-xr-x 4.0K May  9 13:32]  models
│   ├── [-rw-r--r--  133 May  9 13:32]  __init__.py
│   ├── [-rw-r--r--  588 May  9 13:30]  model1.py
│   ├── [-rw-r--r--  921 May  9 13:31]  model2.py
│   └── [-rw-r--r--  588 May  9 13:32]  model3.py
├── [-rw-r--r-- 5.4K May  9 13:24]  settings.py
├── [-rw-r--r--  39K May  9 13:48]  sqlite.db
├── [-rw-r--r--  774 May  9 13:52]  urls.py
├── [-rw-r--r--  746 May  9 13:48]  views.py
└── [-rw-r--r-- 1.4K May  9 13:17]  wsgi.py

Thanks in advance!

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




testapprj.tar.gz
Description: Binary data


Re: Creating Tables w/o SyncDB (Django ORM)

2013-05-03 Thread Tom Evans
On Fri, May 3, 2013 at 2:01 PM, Christian Schmitt
 wrote:
> Hi there,
> is there a possible way of creating tables with Django's ORM w/o SyncDB. It
> would be really helpfull, to make new tables while doing some UI
> interactions.
>

Do you want to do everything exactly that syncdb would do?

from django.core import management
management.call_command('syncdb', noinput=True)

Do you want a meta language for creating tables?

http://south.readthedocs.org/en/0.7.6/

Cheers

Tom

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




Creating Tables w/o SyncDB (Django ORM)

2013-05-03 Thread Christian Schmitt
Hi there,
is there a possible way of creating tables with Django's ORM w/o SyncDB. It 
would be really helpfull, to make new tables while doing some UI 
interactions.

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
i  already try it, no success, i think app its fine, its something with 
postgresql... 2 days ago i was able to sync, create.. db since yesterday 
its jus give that msg.
i already uninstall python and django, reinstall and get same erro. Still 
works fine with sqlite3, when i change the db... fails
its something with heroku i guess. i just copy and past the db configs from 
heroku.

Quinta-feira, 25 de Abril de 2013 16:47:06 UTC+1, Daniele Procida escreveu:
>
> On Thu, Apr 25, 2013, Pedro Silva > 
> wrote: 
>
> >installed apps: 
> >'django.contrib.auth', 
> >'django.contrib.contenttypes', 
> >'django.contrib.sessions', 
> >'django.contrib.messages', 
> >'django.contrib.staticfiles', 
> >'django.contrib.admin', 
> >'django.contrib.admindocs', 
> >'psycopg2.extensions', 
> >#my app 
> >'meetpop.meet', 
> >#more info at https://code.google.com/p/gsettings/wiki/API 
> >'meetpop.gsettings', 
> >#django logging view helper 
> >'django-log-file-viewer', 
> >#custom template tags 
> >'meetpop.meet.templatetags', 
> > 
> >its fresh, i can create a fresh sqllite db with no probs. 
>
> I would suggest trying it with only the django.contrib apps, and nothing 
> else. 
>
> If that doesn't work, then I don't know what to suggest. 
>
> Daniele 
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cant syncdb with postgresql

2013-04-25 Thread Tom Evans
On Thu, Apr 25, 2013 at 3:59 PM, Pedro Silva  wrote:
> installed apps:
> 'django.contrib.auth',
> 'django.contrib.contenttypes',
> 'django.contrib.sessions',
> 'django.contrib.messages',
> 'django.contrib.staticfiles',
> 'django.contrib.admin',
> 'django.contrib.admindocs',
> 'psycopg2.extensions',
> #my app
> 'meetpop.meet',
> #more info at https://code.google.com/p/gsettings/wiki/API
> 'meetpop.gsettings',
> #django logging view helper
> 'django-log-file-viewer',
> #custom template tags
> 'meetpop.meet.templatetags',
>
> its fresh, i can create a fresh sqllite db with no probs.
>

Comment out all apps except for those starting "django.".
Run syncdb
Re-enable one app
Re-run syncdb
Repeat

Which one does it crash on?

Cheers

Tom

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




Re: cant syncdb with postgresql

2013-04-25 Thread Daniele Procida
On Thu, Apr 25, 2013, Pedro Silva  wrote:

>installed apps:
>'django.contrib.auth',
>'django.contrib.contenttypes',
>'django.contrib.sessions',
>'django.contrib.messages',
>'django.contrib.staticfiles',
>'django.contrib.admin',
>'django.contrib.admindocs',
>'psycopg2.extensions',
>#my app
>'meetpop.meet',
>#more info at https://code.google.com/p/gsettings/wiki/API
>'meetpop.gsettings',
>#django logging view helper
>'django-log-file-viewer',
>#custom template tags 
>'meetpop.meet.templatetags',
>
>its fresh, i can create a fresh sqllite db with no probs.

I would suggest trying it with only the django.contrib apps, and nothing else.

If that doesn't work, then I don't know what to suggest.

Daniele 

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
no luck with that

Quinta-feira, 25 de Abril de 2013 14:27:31 UTC+1, Timothy Makobu escreveu:
>
> You need to catch exceptions during a commit and rollback the incomplete 
> transaction.
>
> from django.db import connection
> connection._rollback()
>
> to rollback the current one.
>
>
> On Thu, Apr 25, 2013 at 4:08 PM, Pedro Silva 
> 
> > wrote:
>
>> I cant sync db with heroku postgresql, with sqllite works great.
>> Can anybody help me?
>> requeriments:
>> Django==1.4.5
>> PIL==1.1.7
>> distribute==0.6.36
>> dj-database-url==0.2.1
>> django-db-log==2.2.1
>> django-log-file-viewer==0.4
>> psycopg2==2.5
>> virtualenv==1.9.1
>>
>>
>> erro:
>> c:\WorkspacePY>python manage.py reset meet
>> Traceback (most recent call last):
>>   File "manage.py", line 10, in 
>> execute_from_command_line(sys.**argv)
>>   File 
>> "C:\Python27\lib\site-**packages\django\core\**management\__init__.py", 
>> line
>> 443, in execute_from_command_line
>> utility.execute()
>>   File 
>> "C:\Python27\lib\site-**packages\django\core\**management\__init__.py", 
>> line
>> 382, in execute
>> self.fetch_command(subcommand)**.run_from_argv(self.argv)
>>   File "C:\Python27\lib\site-**packages\django\core\**management\base.py", 
>> line 196,
>>  in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File "C:\Python27\lib\site-**packages\django\core\**management\base.py", 
>> line 232,
>>  in execute
>> output = self.handle(*args, **options)
>>   File "C:\Python27\lib\site-**packages\django\core\**management\base.py", 
>> line 304,
>>  in handle
>> app_output = self.handle_app(app, **options)
>>   File "C:\Python27\lib\site-**packages\django\core\**
>> management\commands\reset.py",
>>  line 34, in handle_app
>> sql_list = sql_reset(app, self.style, connection)
>>   File "C:\Python27\lib\site-**packages\django\core\**management\sql.py", 
>> line 107,
>> in sql_reset
>> return sql_delete(app, style, connection) + sql_all(app, style, 
>> connection)
>>   File "C:\Python27\lib\site-**packages\django\core\**management\sql.py", 
>> line 66, i
>> n sql_delete
>> table_names = connection.introspection.get_**table_list(cursor)
>>   File "C:\Python27\lib\site-**packages\django\db\backends\**
>> postgresql_psycopg2\int
>> rospection.py", line 33, in get_table_list
>> AND pg_catalog.pg_table_is_**visible(c.oid)""")
>>   File "C:\Python27\lib\site-**packages\django\db\backends\**util.py", 
>> line 40, in e
>> xecute
>> return self.cursor.execute(sql, params)
>>   File "C:\Python27\lib\site-**packages\django\db\backends\**
>> postgresql_psycopg2\bas
>> e.py", line 52, in execute
>> return self.cursor.execute(query, args)
>> django.db.utils.DatabaseError: current transaction is aborted, commands 
>> ignored
>> until end of transaction block
>>
>> sql:
>> 2013-04-25 11:42:54,790 [DEBUG] (0.238) 
>> SELECT c.relname
>> FROM pg_catalog.pg_class c
>> LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
>> WHERE c.relkind IN ('r', 'v', '')
>> AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
>> AND pg_catalog.pg_table_is_**visible(c.oid); args=()
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com
>> .
>> Visit this group at http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cant syncdb with postgresql

2013-04-25 Thread Pedro Silva
installed apps:
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.admin',
'django.contrib.admindocs',
'psycopg2.extensions',
#my app
'meetpop.meet',
#more info at https://code.google.com/p/gsettings/wiki/API
'meetpop.gsettings',
#django logging view helper
'django-log-file-viewer',
#custom template tags 
'meetpop.meet.templatetags',

its fresh, i can create a fresh sqllite db with no probs.


Quinta-feira, 25 de Abril de 2013 15:10:21 UTC+1, Daniele Procida escreveu:
>
> On Thu, Apr 25, 2013, Pedro Silva > 
> wrote: 
>
> >I cant sync db with heroku postgresql, with sqllite works great. 
> >Can anybody help me? 
> >requeriments: 
> >Django==1.4.5 
> >PIL==1.1.7 
> >distribute==0.6.36 
> >dj-database-url==0.2.1 
> >django-db-log==2.2.1 
> >django-log-file-viewer==0.4 
> >psycopg2==2.5 
> >virtualenv==1.9.1 
>
> Can you list what you have in INSTALLED_APPS? 
>
> And, are you doing your syncdb on an empty database, or one with data 
> already in it? 
>
> Daniele 
>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: cant syncdb with postgresql

2013-04-25 Thread Daniele Procida
On Thu, Apr 25, 2013, Pedro Silva  wrote:

>I cant sync db with heroku postgresql, with sqllite works great.
>Can anybody help me?
>requeriments:
>Django==1.4.5
>PIL==1.1.7
>distribute==0.6.36
>dj-database-url==0.2.1
>django-db-log==2.2.1
>django-log-file-viewer==0.4
>psycopg2==2.5
>virtualenv==1.9.1

Can you list what you have in INSTALLED_APPS?

And, are you doing your syncdb on an empty database, or one with data already 
in it?

Daniele

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   4   5   6   7   8   9   >