Django Install failed: SyntaxError: invalid syntax

Just upgraded to Virtualmin pro and trying to run the Django install script on a newly created sub-domain. I had some troubles with the database, it didn’t want to initialize so I installed PSQL via SSH command line, ran through the debugging and then forced a cert update for the default snakeoil SSL cert that was failing. That fixed PSQL, but now I’m facing this error. I tried searching but there’s not much info about this out there.

Found https://www.djangoproject.com:443/download/4.0.4/tarball/ in cache ..
Found https://www.saddi.com:443/software/flup/dist/flup-1.0.2.tar.gz in cache ..

Now installing Django version 4.0.4 ..

    DB initialization install failed :

    Traceback (most recent call last):
      File "manage.py", line 22, in <module>
        main()
      File "manage.py", line 18, in main
        execute_from_command_line(sys.argv)
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/lib/python/Django-4.0.4-py3.8.egg/django/core/management/__init__.py", line 446, in execute_from_command_line
        utility.execute()
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/lib/python/Django-4.0.4-py3.8.egg/django/core/management/__init__.py", line 386, in execute
        settings.INSTALLED_APPS
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/lib/python/Django-4.0.4-py3.8.egg/django/conf/__init__.py", line 87, in __getattr__
        self._setup(name)
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/lib/python/Django-4.0.4-py3.8.egg/django/conf/__init__.py", line 74, in _setup
        self._wrapped = Settings(settings_module)
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/lib/python/Django-4.0.4-py3.8.egg/django/conf/__init__.py", line 183, in __init__
        mod = importlib.import_module(self.SETTINGS_MODULE)
      File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
      File "<frozen importlib._bootstrap>", line 991, in _find_and_load
      File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 844, in exec_module
      File "<frozen importlib._bootstrap_external>", line 981, in get_code
      File "<frozen importlib._bootstrap_external>", line 911, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/innovated/domains/wcadmin.innovated.tech/public_html/myproject/myproject/settings.py", line 80
        'PASSWORD': ''BbMLrqkrquxHZWp3'',
                      ^
    SyntaxError: invalid syntax

    More information on using this script can be found at http://www.djangoproject.com/.

.. installation was only partially complete.
SYSTEM INFORMATION
OS type and version Ubuntu Linux 20.04.4
Virtualmin version 6.17-3 Pro

As a note, I’m database ambiguous in this situation so it worked with MySQL, just not PostgreSQL

Hi,

I have given it a quick test and installation worked for me just fine. What is PostgreSQL database password for that virtual server set to?

maybe password needs to be inside single quote, not 2 single quotes (?)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.