Почему хостинг на pythonanywhere не работает? Синтаксис мне кажется правильным? Все отлично работает на моем компьютере.
http://fixitcemes.pythonanywhere.com/
https://www.pythonanywhere.com/user/fixitcemes/files/var/log/fixitcemes.pythonanywhere.com.error.log
models.py
class Device(models.Model):
"""Model representing a device."""
type_name = models.ManyToManyField(DeviceType, help_text='Select a device type')
device_id = models.DecimalField(max_digits=4, decimal_places=0)
short_name_device_own = ForeignKey(DeviceType, related_name='device_type_device', on_delete=models.SET_NULL,
null=True)
prod_year = models.DateTimeField(auto_now=False, auto_now_add=False)
worked_science = models.DateField(auto_now=False)
def __str__(self):
"""String for representing the Model object."""
return f'{self.short_name_device_own} - {self.device_id}'
журнал ошибок:
2019-10-13 10:05:37,509: Error running WSGI application
2019-10-13 10:05:37,510: File "/home/fixitcemes/fixitcemes.pythonanywhere.com/mysite/dokumenty/models.py", line 38
2019-10-13 10:05:37,510:
2019-10-13 10:05:37,511: return f'{self.short_name_device_own} - {self.device_id}'
2019-10-13 10:05:37,511:
2019-10-13 10:05:37,511: ^
2019-10-13 10:05:37,511:
2019-10-13 10:05:37,511: SyntaxError: invalid syntax
2019-10-13 10:05:37,511: File "/var/www/fixitcemes_pythonanywhere_com_wsgi.py", line 15, in <module>
2019-10-13 10:05:37,512: application = get_wsgi_application()
2019-10-13 10:05:37,512:
2019-10-13 10:05:37,512: File "/home/fixitcemes/.virtualenvs/fixitcemes.pythonanywhere.com/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-10-13 10:05:37,512: django.setup(set_prefix=False)
2019-10-13 10:05:37,512:
2019-10-13 10:05:37,512: File "/home/fixitcemes/.virtualenvs/fixitcemes.pythonanywhere.com/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
2019-10-13 10:05:37,513: apps.populate(settings.INSTALLED_APPS)
2019-10-13 10:05:37,513:
2019-10-13 10:05:37,513: File "/home/fixitcemes/.virtualenvs/fixitcemes.pythonanywhere.com/lib/python3.5/site-packages/django/apps/registry.py", line 114, in populate
2019-10-13 10:05:37,513: app_config.import_models()
2019-10-13 10:05:37,514:
2019-10-13 10:05:37,514: File "/home/fixitcemes/.virtualenvs/fixitcemes.pythonanywhere.com/lib/python3.5/site-packages/django/apps/config.py", line 211, in import_models
2019-10-13 10:05:37,514: self.models_module = import_module(models_module_name)
2019-10-13 10:05:37,514: ***************************************************
2019-10-13 10:05:37,514: If you're seeing an import error and don't know why,
2019-10-13 10:05:37,515: we have a dedicated help page to help you debug:
2019-10-13 10:05:37,515: https://help.pythonanywhere.com/pages/DebuggingImportError/