Re: Database migration issue

2020-04-12 Thread wanbao jin
Ok, I figure it out, When application configuration class is used in
INSTALLED_APPS, the name field of AppConfig subclass should be the path of
that application.

AppConfig.name¶
>
> Full
> Python path to the application, e.g. 'django.contrib.admin'.
> This attribute defines which application the configuration applies to. It
> must be set in all AppConfig
> 
>  subclasses.
> It must be unique across a Django project.


 😊

On Mon, Apr 13, 2020 at 10:52 AM wanbao jin  wrote:

> When I just change the api.blogs.apps.BlogsConfig to api.blogs , it
>> worked fine. I am curious why api.blogs.apps.BlogsConfig doesn't work
>>  
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM82qv2UPXhPj4kzHTrtGAHBncGXPmvV7ubrS7PWfxanU-ztgQ%40mail.gmail.com.


Re: Database migration issue

2020-04-12 Thread wanbao jin
>
> When I just change the api.blogs.apps.BlogsConfig to api.blogs , it
> worked fine. I am curious why api.blogs.apps.BlogsConfig doesn't work
>  
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAM82qv3S4%2BdbiROoM_YChqvgTLi5fh5NxqvAs7o6a1vXN_r4%3DQ%40mail.gmail.com.


Re: database migration

2010-12-30 Thread Torsten Bronger
Hallöchen!

Torsten Bronger writes:

> Hallöchen!
>
> Michael P. Soulier writes:
>
>> On 29/12/10 Torsten Bronger said:
>>
>>> I don't recommend that.  If the database exceeds a certain size
>>> (and "certain" is MBs, not GBs), this simply fails.
>>
>> Is there a bug report for this issue? I find that very
>> disappointing.
>
> [...]

Sorry, an addition for Adblock occupied my clipboard.  The real link
is http://code.djangoproject.com/ticket/5423

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

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



Re: database migration

2010-12-30 Thread Ferran
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

On 30/12/10 13:17, Torsten Bronger wrote:
>> Is there a bug report for this issue? I find that very
>> > disappointing.
> http://1.2.3.12/bmi/stc.celeb.gate.cc/banner/pi/0120.gif

What i found disappointing is sending a NSFW image to a django list
without a note.

Thank your for my first post-xmas first boss talk :D
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJNHIMpAAoJEAWOKfEESaOw7rEQAI8AUH7EeF51ZocVJJOzi5sa
gavH1N9MesBtEiraN1t+sQyXy7m/wzlO4qRbhDkb56V8LrS2UME6kse7OY6TmmLV
Qkmqfmg4s0RdVQnWaOPEQax0oqb19kwjetr2HSleVV/uWB6DV5xiDVqojtuP7s9x
Tj3PJs8V1kUBpK5twHkRFSJRFqv5Yy/KRNiOdLXrRpenqivbqVHb8jwLPtZFN4Cc
FSpOljQ/A08jI644vhfUCOQJuI40IRaRQjVINolRhqmR5i0nI7ZOEz/rIgksgiIq
m+T//vuXKfJJ7QxMw5zl8ERpqwl67uebkKEeeFgKzIW8Y1v39OWNcK0TkJlI3bgW
MHicwZ+TNkmzNwINPDbnuNiBmZdLE6Ypg+Cng5na4j7IKr/aiyRcRAQl2MWR67XK
hS+MPCmEZMyPFVyM0cnKz3DIMhVZWXVyCu6rf1iR4yyI/5FAdYLxAwsRKGeh9Llp
BLM4fozVrkx6aUnEaAgLpaOLTSD41M3lQiIlT/NtXM3zqWUWWFtYZT2/m5XwWins
yaeFSHiYobmAuYz6Z6uwLLsejpsv/TTLpuxi5vyOWAVZd1UBdTnLtYEtX5+twrur
/4qHgxs8S7y3XnDvc/Hei1sDq9QA9OLs+UXD8cOHqtFrDoS22g7rxzQnU2dSsal8
GdMSrAYBtIjeTnqJSiLS
=tOGZ
-END PGP SIGNATURE-

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



Re: database migration

2010-12-30 Thread Torsten Bronger
Hallöchen!

Michael P. Soulier writes:

> On 29/12/10 Torsten Bronger said:
>
>> I don't recommend that.  If the database exceeds a certain size
>> (and "certain" is MBs, not GBs), this simply fails.
>
> Is there a bug report for this issue? I find that very
> disappointing.

http://1.2.3.12/bmi/stc.celeb.gate.cc/banner/pi/0120.gif

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

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



Re: database migration

2010-12-29 Thread Michael P. Soulier
On 29/12/10 Emmanuel Mayssat said:

> I was looking at a possibility of using manage.py dumpscript and
> manage.py runscript
> from django-extensions. But it is not straight forward either.

dumpdata/loaddata is quite simple, I recently used it myself. Torsten
suggested that there's a problem using it with large data sets. I have not
seen this myself.

> Wasn't django supposed to be database agnostic?

Yeah, and ANSI C was supposed to be platform independent. And so was Java. And
Python. And...

> Now, I understand what they really meant.
> Pick you database carefully and stick with it.
> But django code is not database specific.
> ...
> For one second, I though django was the holy grail of all web frameworks
> ...

If anyone claims a holy grail, they are selling you something.

Mike


signature.asc
Description: Digital signature


Re: database migration

2010-12-29 Thread Michael P. Soulier
On 29/12/10 Torsten Bronger said:

> I don't recommend that.  If the database exceeds a certain size (and
> "certain" is MBs, not GBs), this simply fails.

Is there a bug report for this issue? I find that very disappointing.

Mike
-- 
Michael P. Soulier 
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein


signature.asc
Description: Digital signature


Re: database migration

2010-12-29 Thread Emmanuel Mayssat
Michael, that's encouraging ;-)
I was looking at a possibility of using manage.py dumpscript and
manage.py runscript
from django-extensions. But it is not straight forward either.

Wasn't django supposed to be database agnostic?
Now, I understand what they really meant.
Pick you database carefully and stick with it.
But django code is not database specific.
...
For one second, I though django was the holy grail of all web frameworks
...

--
E

On Tue, Dec 28, 2010 at 11:48 PM, Torsten Bronger
 wrote:
> Hallöchen!
>
> Michael P. Soulier writes:
>
>> On 28/12/10 Emmanuel Mayssat said:
>>
>>> I have a classic database dump question
>>>
>>> I would like to migrate from sqlite to mysql.
>>> How can I dump and import the data?
>>
>> See the manage.py dumpdata/loaddata commands.
>
> I don't recommend that.  If the database exceeds a certain size (and
> "certain" is MBs, not GBs), this simply fails.
>
> Tschö,
> Torsten.
>
> --
> Torsten Bronger, aquisgrana, europa vetus
>                   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
>                                  or http://bronger-jmp.appspot.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: database migration

2010-12-28 Thread Torsten Bronger
Hallöchen!

Michael P. Soulier writes:

> On 28/12/10 Emmanuel Mayssat said:
>
>> I have a classic database dump question
>> 
>> I would like to migrate from sqlite to mysql.
>> How can I dump and import the data?
>
> See the manage.py dumpdata/loaddata commands.

I don't recommend that.  If the database exceeds a certain size (and
"certain" is MBs, not GBs), this simply fails.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
   Jabber ID: torsten.bron...@jabber.rwth-aachen.de
  or http://bronger-jmp.appspot.com

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



Re: database migration

2010-12-28 Thread Emrah Unal

within the main project directory in linux

python manage.py dumpdata > data.json

command will dump your data to a json file

change settings.py to use mysql, after that

python manage.py syncdb

this will create tables followed by

python manage.py loaddata data.json

will load everything back

cheers



On 12/29/2010 01:37 AM, Emmanuel Mayssat wrote:

I have a classic database dump question

I would like to migrate from sqlite to mysql.
How can I dump and import the data?
Regards,
--
E



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



Re: database migration

2010-12-28 Thread nfbueno78
see if this url could help you: 
http://www.maxkpage.com/blog/free-sqlite-to-mysql-converter-super-easy/

On Dec 29, 7:37 am, Emmanuel Mayssat  wrote:
> I have a classic database dump question
>
> I would like to migrate from sqlite to mysql.
> How can I dump and import the data?
> Regards,
> --
> E

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



Re: database migration

2010-12-28 Thread Michael P. Soulier
On 28/12/10 Emmanuel Mayssat said:

> I have a classic database dump question
> 
> I would like to migrate from sqlite to mysql.
> How can I dump and import the data?

See the manage.py dumpdata/loaddata commands.

Mike


signature.asc
Description: Digital signature


Re: Database Migration Question

2008-05-06 Thread jack

Russ - We had a few back and forths about this several weeks ago, if
you recall.  I now am much better versed in Django and so maybe a bit
more capable of making intelligent comments.

It would seem to me that with the primitives that I am seeking (which
is basically a continuation of hiding the SQL specifics of each DMBS
using Python code) all kinds of migration capabilities can easily be
implemented.  In fact, I can see several options, all valid, that each
developer can choose for their project.  That way Django would not
have to decide in advance how to do migrations.   Some may prefer
whole frameworks and specific methodologies, others will prefer to
roll their own.  For all intents and purposes, many of these
primitives already exist, at least for the initial creation of tables
from model class definitions, why not extend it to the next level and
provide the same toosl for Django developers to create tables and
modify them?  Seems like a natural to me.  I would write it myself,
but I am too rusty with SQL and the different syntaxes across
databases to be able to really dive in at this point.  But I would
enjoy collaborating on design and proposed implementation with anyone
who was willing and capable of tackling this task.

Jack

On May 5, 9:34 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On Tue, May 6, 2008 at 11:57 AM, jack <[EMAIL PROTECTED]> wrote:
>
> >  Are there any Python/Django methods that represent generic database
> >  commands such as creating a new table, renaming or dropping a column,
> >  etc.?  My thinking is that if these generic methods existed, so that
> >  all I needed to do was specifiy the correct info abt my DBMS in the
> >  Settings file, I could create my own migrations as custom Views.  I
> >  could invoke these via the web as well after having copied my latest
> >  code to my production server.
>
> There isn't anything built into Python or Django, but there are a few
> projects running externally to Django that implement this sort of
> feature.
>
> Personally, I would recommend Django Evolution [1] - but then, I'm one
> of the developers of that project. If you search the django-users and
> django-developers archives for "schema evolution", you will find
> references to a few other projects.
>
> [1]http://code.google.com/p/django-evolution
>
> Yours,
> Russ Magee %-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Database Migration Question

2008-05-05 Thread Russell Keith-Magee

On Tue, May 6, 2008 at 11:57 AM, jack <[EMAIL PROTECTED]> wrote:
>
>  Are there any Python/Django methods that represent generic database
>  commands such as creating a new table, renaming or dropping a column,
>  etc.?  My thinking is that if these generic methods existed, so that
>  all I needed to do was specifiy the correct info abt my DBMS in the
>  Settings file, I could create my own migrations as custom Views.  I
>  could invoke these via the web as well after having copied my latest
>  code to my production server.

There isn't anything built into Python or Django, but there are a few
projects running externally to Django that implement this sort of
feature.

Personally, I would recommend Django Evolution [1] - but then, I'm one
of the developers of that project. If you search the django-users and
django-developers archives for "schema evolution", you will find
references to a few other projects.

[1] http://code.google.com/p/django-evolution

Yours,
Russ Magee %-)

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



Re: Database migration

2007-03-27 Thread [EMAIL PROTECTED]

Thanks... I think I can handle that. If not, I can always roll it
back.

On Mar 26, 6:36 pm, "Honza Král" <[EMAIL PROTECTED]> wrote:
> On 3/27/07, Jonas Maurus <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > On Mar 26, 11:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
> > > I apologize for the vague newbie question, but I'm gonna ask it
> > > anyway...
>
> > > I'd like to switch DBs from mysql to postgres... how does one do so? I
> > > assume one must export from mysql, import to postgres, then make the
> > > appropriate changes in settings.py, but are there any gotchas I should
> > > be aware of? Any advice on HOW to best do the export/import? Any
> > > advice at all for someone who's never done this?
>
> > This is not easily done because the SQL-dialects of MySQL and
> > PostgreSQL differ. One thing that helped me is, when dumping data with
> > mysqldump, setting the compatibility mode to MySQL 3.23 so that
> > mysqldump produces neither character-set information nor "complex
> > inserts" (there is another command-line switch for that now, as far as
> > I remember). Then open the dump, strip out all CREATE TABLE statements
> > and execute those by hand on Postgres, fixing the data types along the
> > way (for example, int(...) becomes integer or bigint). Make sure that
> > you select the correct encoding when executing 'createdb'.
>
> > Basically then you need to look at the errors that PostgreSQL will
> > undoubtedly spit in your general direction and fix them.
>
> or you could use django fixture system to dump & restore the DB:
> 1) dump MySQL data
> 2) change settings to PostgreSQL db
> 3) run syncdb
> 4) load dumps
> 5) enjoy
>
>
>
> > Good luck,
> > Jonas
>
> --
> Honza Kr?l
> E-Mail: [EMAIL PROTECTED]
> ICQ#:   107471613
> Phone:  +420 606 678585


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



Re: Database migration

2007-03-26 Thread Honza Král
On 3/27/07, Jonas Maurus <[EMAIL PROTECTED]> wrote:
>
> On Mar 26, 11:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
> > I apologize for the vague newbie question, but I'm gonna ask it
> > anyway...
> >
> > I'd like to switch DBs from mysql to postgres... how does one do so? I
> > assume one must export from mysql, import to postgres, then make the
> > appropriate changes in settings.py, but are there any gotchas I should
> > be aware of? Any advice on HOW to best do the export/import? Any
> > advice at all for someone who's never done this?
>
> This is not easily done because the SQL-dialects of MySQL and
> PostgreSQL differ. One thing that helped me is, when dumping data with
> mysqldump, setting the compatibility mode to MySQL 3.23 so that
> mysqldump produces neither character-set information nor "complex
> inserts" (there is another command-line switch for that now, as far as
> I remember). Then open the dump, strip out all CREATE TABLE statements
> and execute those by hand on Postgres, fixing the data types along the
> way (for example, int(...) becomes integer or bigint). Make sure that
> you select the correct encoding when executing 'createdb'.
>
> Basically then you need to look at the errors that PostgreSQL will
> undoubtedly spit in your general direction and fix them.

or you could use django fixture system to dump & restore the DB:
1) dump MySQL data
2) change settings to PostgreSQL db
3) run syncdb
4) load dumps
5) enjoy

>
> Good luck,
> Jonas
>
>
> >
>


-- 
Honza Kr�l
E-Mail: [EMAIL PROTECTED]
ICQ#:   107471613
Phone:  +420 606 678585

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



Re: Database migration

2007-03-26 Thread Jonas Maurus

On Mar 26, 11:10 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I apologize for the vague newbie question, but I'm gonna ask it
> anyway...
>
> I'd like to switch DBs from mysql to postgres... how does one do so? I
> assume one must export from mysql, import to postgres, then make the
> appropriate changes in settings.py, but are there any gotchas I should
> be aware of? Any advice on HOW to best do the export/import? Any
> advice at all for someone who's never done this?

This is not easily done because the SQL-dialects of MySQL and
PostgreSQL differ. One thing that helped me is, when dumping data with
mysqldump, setting the compatibility mode to MySQL 3.23 so that
mysqldump produces neither character-set information nor "complex
inserts" (there is another command-line switch for that now, as far as
I remember). Then open the dump, strip out all CREATE TABLE statements
and execute those by hand on Postgres, fixing the data types along the
way (for example, int(...) becomes integer or bigint). Make sure that
you select the correct encoding when executing 'createdb'.

Basically then you need to look at the errors that PostgreSQL will
undoubtedly spit in your general direction and fix them.

Good luck,
Jonas


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



Re: Database Migration

2006-08-24 Thread Rock

One of my django apps contains testing data about every item our
company has manufactured over the last year or so. The database has
over 50 million rows of data. Despite this I have successfully migrated
the database several times. Sometimes it is trivial. Back up the data
for safety and then just add a column or columns in a table while
making the same change in the models. Viola! (Renaming or retyping a
column can be similarly easy at times.)

I have even done a more massive migration. Here I backed up the data.
Cleared out all the tables. Made the model changes and recreated
database tables. Then I used sed to edit a copy of the backed up data
such that I could reload into the new tables.

Django does nothing to make it easier or harder to migrate a database
that any other database app (although I hear persistence rumors of some
eventual tool support for some of the more trivial migration
oeprations.)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Database Migration

2006-08-24 Thread Jay Parlar

On 8/25/06, Dave <[EMAIL PROTECTED]> wrote:
>
> I create my models in models.py, and everything looks great. I launch
> the application and millions upon millions of peope start using my app
> and creating their own little entries in my database, via the perfect
> models.py I wrote.
>
> But then, the EVIL CLIENT comes along and requests a change to existing
> functionality that requires a change to the model...
>
> What do I do about my millions upon millions of users, with vital, life
> affirming and threatening data stored in the database? I can't change a
> model and then have it change the database without destroying all their
> information? Or is there some aspect of manage.py I've completely
> missed?
>
> If this is simple and I'm missing the point entirely, feel free to hit
> me in the head with a brick. Softly.
>


Right now, the only option is to manually run whatever SQL commands
are required to convert the schema to match your new
model(adding/dropping columns, tables, etc). You can use manage.py to
show what the schema should look like for your new model, then figure
out the SQL commands on your own.

There is a Summer of Code project for Django schema migration, which
should do the above steps automatically. Not sure of the current
progress of it (though I'd guess it'll be done soon).

Jay P.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---