liuyang1520 / django-command-extensions

Automatically exported from code.google.com/p/django-command-extensions
MIT License
0 stars 0 forks source link

Defect in command reset_db with postgresql_psycopg2 #100

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Configure de django projet for work with postgresql_psycopg2 and run syncdb
after run reset_db. The command return that django can't find database.

I'm resolve the problem with the modification posted her:

===================================================================
--- django_extensions/management/commands/reset_db.py   (revisão 195)
+++ django_extensions/management/commands/reset_db.py   (cópia de trabalho)
@@ -82,8 +82,10 @@
             if settings.DATABASE_NAME == '':
                 from django.core.exceptions import ImproperlyConfigured
                 raise ImproperlyConfigured, "You need to specify
DATABASE_NAME in your Django settings file."
+           else:
+               conn_string = "dbname=%s " % (settings.DATABASE_NAME)
             if settings.DATABASE_USER:
-                conn_string = "user=%s" % (settings.DATABASE_USER)
+                conn_string += "user=%s" % (settings.DATABASE_USER)
             if settings.DATABASE_PASSWORD:
                 conn_string += " password='%s'" % settings.DATABASE_PASSWORD
             if settings.DATABASE_HOST:

For more detail contact me for rodrigopmatias at gmail dot com.

I'm brazilian and not domain the english.

Original issue reported on code.google.com by rodrigopmatias on 23 Apr 2009 at 1:06

GoogleCodeExporter commented 8 years ago
The diff file.

Original comment by rodrigopmatias on 23 Apr 2009 at 1:09

Attachments:

GoogleCodeExporter commented 8 years ago
congratulations on creating the 100th issue for django_extentions !

Original comment by v.oostv...@gmail.com on 23 Apr 2009 at 9:09

GoogleCodeExporter commented 8 years ago
hehe, it is good!!!

I'm working on it.

Original comment by rodrigopmatias on 24 Apr 2009 at 7:31

GoogleCodeExporter commented 8 years ago
Now patch is ready!!!

Original comment by rodrigopmatias on 25 Apr 2009 at 1:01

Attachments:

GoogleCodeExporter commented 8 years ago
This project still alive?
zZzZzZ

Original comment by rodrigopmatias on 4 May 2009 at 2:46

GoogleCodeExporter commented 8 years ago
Look at the repository at github to see how 'alive' the project is.
Also you could join the mailinglist and make a post there.

Everybody helping out here has a life and a job, so unless your willing to 
donate to
the cause expect no miracles here.

If nobody else takes a look at your patch and commit it into the tree then I 
will do
so when I have the time for it.

Original comment by v.oostv...@gmail.com on 4 May 2009 at 2:35

GoogleCodeExporter commented 8 years ago
Seeing as nobody had to time to pick this up, I've committed a fix to the github
repository. Based on your patch.

Thanks for the patch and bugreport!

Url:
http://github.com/django-extensions/django-extensions/commit/5b68593daa5a08bd46d
1093545ece7534a5bd755

Original comment by v.oostv...@gmail.com on 11 May 2009 at 8:35