Django Installer Issue

Hello,

When trying to use your django installer script on a newly installed version of virtualmin gpl, it seems to hang at the database initialization phase. This does not happen with the older 1.4.x version of django, but only with the 1.5.x versions since they prompt you to press enter for an email address.

It seems the piece of code in question is where the email address is requested by the django installation process. Do you all have a bug fix for this, a replacement django.pl file, or a place where I can insert code for a carrier return ("press enter to leave blank")? Your help would be greatly appreciated.

$domuser =~ s/[\.\@\-]/_/g;
        foreach my $w ([ "yes.no", "yes" ],
                       [ "Username", $domuser ],
                       [ "E-mail address", $d->{'emailto_addr'} ],   (<--- Line in question?)
                       [ "Password", $dompass ],
                       [ "Password", $dompass ]) {
                local $rv = &wait_for($fh, $w->[0]);
                if ($rv < 0) {
                        return (-1,
                           "Database initialization failed at $w->[0] : ".
Status: 
Closed (fixed)

Comments

Are you seeing this prompt for an email address when the manage.py syncdb step is run manually? I'd be interested to see what that prompts for on your system.

When I run it manually, I receive a permission denied. I then (just for testing) chmod 777 the manage.py file. After that, if I try to run ./manage.py syncdb I then receive the following error:

django.core.management import execute_from_command_line ImportError: No module named django.core.management

After receiving that error, I then run: -sh-4.1$ export PYTHONPATH=/home/username/public_html/lib/python

After that, I am able to run the manage.py file and receive no prompts for an email address:

-sh-4.1$ ./manage.py syncdb Creating tables ... Installing custom SQL ... Installing indexes ... Installed 0 object(s) from 0 fixture(s)

On the GUI side of things (virtualmin in the browser), when I run the script installer for Python 1.5.x, I get the following:

Found http://www.djangoproject.com:80/download/1.5.5/tarball/ in cache .. Found http://www.saddi.com:80/software/flup/dist/flup-1.0.tar.gz in cache ..

Now installing Django version 1.5.4 ..

It freezes after saying "Now installing Django version 1.5.4. When I kill the manage.py PID in shell, the GUI then says:

Database initialization failed at E-mail address : (leave blank to use 'username'): username Email address: More information on using this script can be found at http://www.djangoproject.com/. .. installation was only partially complete. Re-loading Webmin .. .. done

Thank you and I hope I have given you enough details. James

Ok, I found the cause of this - the Django install script manage.py changed the prompt for "E-mail address" to "Email address", which broke Virtualmin's automation of that script!

I have released a fix for the Django script installer - just go to System Settings -> Script Installers -> Install Updates and click Save to get it.

Thank you Jamie,

I have tried to do the above and I am unable to download the new script installer for django. I have done what you said above, and the new update to django 1.5.5 from 1.5.4 is retreived. However, this does not seem to resolve the issue on newly created virtual servers. I checked the source on django.pl and it seems to be the same file. Am I missing something?

The update should be downloaded to /etc/webmin/virtual-server/latest-scripts/django.pl . Do you see that on your system?

Great! I was able to apply the changes "E-Mail" to "Email" in the django.pl script as you mentioned, and that fixed the problem. Jamie, my sincere thanks for helping me with this matter. Thank you

James

Automatically closed -- issue fixed for 2 weeks with no activity.

Automatically closed -- issue fixed for 2 weeks with no activity.

Hello,

Django 1.6 has been released, and I see that the virtualmin system updated the install scripts accordingly. However, the same database initialization issue is now occurring with 1.6 in a slightly different way

When upgrading from 1.5.5 to 1.6, there are no errors. When performing a new Django 1.6 installation, the following error occurs:

Database initialization failed at yes.no : Traceback (most recent call last): File "manage.py", line 10, in execute_from_command_line(sys.argv) File "/home/debugging/public_html/lib/python/django/core/management/init.py", line 399, in execute_from_command_line utility.execute() File "/home/debugging/public_html/lib/python/django/core/management/init.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/debugging/public_html/lib/python/django/core/management/base.py", line 242, in run_from_argv self.execute(*args, options.dict) File "/home/debugging/public_html/lib/python/django/core/management/base.py", line 285, in execute output = self.handle(*args, **options) File "/home/debugging/public_html/lib/python/django/core/management/base.py", line 415, in handle return self.handle_noargs(options) File "/home/debugging/public_html/lib/python/django/core/management/commands/syncdb.py", line 57, in handle_noargs cursor = connection.cursor() File "/home/debugging/public_html/lib/python/django/db/backends/init.py", line 157, in cursor cursor = self.make_debug_cursor(self._cursor()) File "/home/debugging/public_html/lib/python/django/db/backends/init.py", line 129, in _cursor self.ensure_connection() File "/home/debugging/public_html/lib/python/django/db/backends/init.py", line 124, in ensure_connection self.connect() File "/home/debugging/public_html/lib/python/django/db/utils.py", line 99, in exit six.reraise(dj_exc_type, dj_exc_value, traceback) File "/home/debugging/public_html/lib/python/django/db/backends/init.py", line 124, in ensure_connection self.connect() File "/home/debugging/public_html/lib/python/django/db/backends/init.py", line 112, in connect self.connection = self.get_new_connection(conn_params) File "/home/debugging/public_html/lib/python/django/db/backends/mysql/base.py", line 435, in get_new_connection conn = Database.connect(**conn_params) File "/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect return Connection(*args, **kwargs) File "/usr/lib64/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__ super(Connection, self).__init__(*args, **kwargs2) django.db.utils.OperationalError: (1045, "Access denied for user 'debugging'@'localhost' (using password: YES)")

Your assistance is greatly appreciated, I'm not sure about what to modify in the django script installer in this case, it seems as if the MySQL information is not getting picked up. Thank you

James

This looks like a different issue, related to DB permissions.

Is debugging the actual username for your domain? Because that is the user it appears to be trying to connect as.

Hello,

Yes that's just a user I created to test with after I noticed it stopped working.

Ok, I managed to re-produce this issue .. and have released a fix. You can get it by going to System Settngs -> Script Installers -> Installer Updates, and clicking Save. Let us know if that helps.

Thank you Jamie, this has resolved the issue.