OfficineArduinoTorino / LabAdmin

Manage user rights to access the lab and the machines
Other
3 stars 3 forks source link

Upgrading to a newer version not working #34

Closed tommasoltrz closed 7 years ago

tommasoltrz commented 7 years ago

when I run sudo -H -u labadmin ../venv/bin/pip install https://github.com/OfficineArduinoTorino/LabAdmin/archive/v0.4.0.zip

I get Traceback (most recent call last): File "../venv/bin/pip", line 11, in <module> sys.exit(main()) File "/var/www/labadmin/venv/lib/python3.5/site-packages/pip/__init__.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.5/locale.py", line 594, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

xrmx commented 7 years ago

Could you please paste the output of ../venv/bin/pip --version?

tommasoltrz commented 7 years ago

pip 8.1.1 from /var/www/labadmin/venv/lib/python3.5/site-packages (python 3.5)

xrmx commented 7 years ago

Please do ../venv/bin/pip install --upgrade pip and retry to install the upgrade.

tommasoltrz commented 7 years ago

when I run ../venv/bin/pip install --upgrade pip and

I get Traceback (most recent call last): File "../venv/bin/pip", line 11, in <module> sys.exit(main()) File "/var/www/labadmin/venv/lib/python3.5/site-packages/pip/__init__.py", line 215, in main locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.5/locale.py", line 594, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting

xrmx commented 7 years ago

Which version of pip is now installed?

tommasoltrz commented 7 years ago

The same as before. May the problem be that I am in the wrong folder?

I'm running commands from here: /var/www/labadmin/labadmin

xrmx commented 7 years ago

You really have to fix the locales (as superuser) of the machine then as pip is not even able to upgrade itself. That error has been made non fatal in pip 8.1.2.

tommasoltrz commented 7 years ago

uhmm, any idea on how to do this? I've tried with sudo locale-gen "it_IT.UTF-8" and sudo dpkg-reconfigure locales

but nothing changed

tommasoltrz commented 7 years ago

I solved the issue with locale and completed the installation. but now when I click on a user profile i get this:

screen shot 2017-05-26 at 19 04 37

xrmx commented 7 years ago

Did sudo -H -u labadmin ../venv/bin/python manage.py migrate returned any error?

tommasoltrz commented 7 years ago

I got this error using the command sudo -H -u labadmin ../venv/bin/python manage.py collectstatic :

File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 367, in execute_from_command_line utility.execute() File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/core/management/__init__.py", line 359, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/core/management/base.py", line 294, in run_from_argv self.execute(*args, **cmd_options) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/core/management/base.py", line 345, in execute output = self.handle(*args, **options) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 193, in handle collected = self.collect() File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 124, in collect handler(path, prefixed_path, storage) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 349, in copy_file if not self.delete_file(path, prefixed_path, source_storage): File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 255, in delete_file if self.storage.exists(prefixed_path): File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/core/files/storage.py", line 394, in exists return os.path.exists(self.path(name)) File "/var/www/labadmin/venv/lib/python3.5/site-packages/django/contrib/staticfiles/storage.py", line 49, in path raise ImproperlyConfigured("You're using the staticfiles app " django.core.exceptions.ImproperlyConfigured: You're using the staticfiles app without having set the STATIC_ROOT setting to a filesystem path.

but now it seem to be working fine on the front end...

xrmx commented 7 years ago

It works because you previously forget to run migrations which updates the database to match the code.

The next error is because your installation differs from the tutorial as it's using the django builtin runserver instead of gunicorn so you don't need to run staticfiles. If user's image upload is not working you'll probably need something like these: https://github.com/OfficineArduinoTorino/LabAdmin/commit/889d9e06020470a12247047fca0f7605c2d0d838#diff-ecfc8407f6ffb94bfe056d82854abe80 https://github.com/OfficineArduinoTorino/LabAdmin/commit/889d9e06020470a12247047fca0f7605c2d0d838#diff-b5779d9d37148b123f51392efda6409a

Closing as there's nothing actionable to do on labadmin.