2

I am trying puplish my django project on Cpanel this is my site (http://qhse-erp.com/)

I had used pip install django==2.1 --use-feature=2020-resolver

for install all my package but I got following error:


move_auto_add... OK
  Applying admin.0003_logentry_add_action_flag_choices... OK
  Applying authtoken.0001_initial... OK
  Applying authtoken.0002_auto_20160226_1747...Traceback (most recent call last):
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.SyntaxError: syntax error at or near "WITH ORDINALITY"
LINE 6:                     FROM unnest(c.conkey) WITH ORDINALITY co...
                                                  ^
................
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/utils.py", line 89, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/aeraeg/virtualenv/python/3.7/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: syntax error at or near "WITH ORDINALITY"
LINE 6:                     FROM unnest(c.conkey) WITH ORDINALITY co...

this is some of my package

this is list of my package was installed

Django==2.1
django-appconf==1.0.3
django-autocomplete-light==3.4.1
django-bootstrap-datepicker-plus==3.0.5
django-bootstrap4==1.0.1
django-countries==5.5
django-crispy-forms==1.8.0
django-cruds-adminlte==0.0.16
django-image-cropping==1.2.0
django-modeltranslation==0.13.4
django-rosetta==0.9.3
django-settings-export==1.2.1
django-taggit==1.1.0
django-userforeignkey==0.3.0
djangoajax==3.1
djangorestframework==3.10.3
Pillow==6.2.1
pipenv==2018.11.26
polib==1.1.0
psycopg2-binary==2.8.4
pycodestyle==2.5.0

i got error message ERROR: easy-thumbnails 2.6 requires django<2,>=1.8, but you'll have django 2.2.6 which is incompatible. easy-thumbnails 2.6 requires pillow<4, but you'll have pillow 6.2.1 which is incompatible.

but i try uninstall django and Pillow by many verson but its not

Youssri Abo Elseod
  • 671
  • 1
  • 9
  • 23
  • 1
    I don't think that's a problem with `--use-feature=2020-resolver`. After running `pip install`, you can run `pip freeze` to see what it installed. – Alasdair Nov 24 '20 at 10:55
  • 2
    The traceback is showing that the error is occurring when you run `manage.py migrate`. Are you running a very old version or PostgreSQL that doesn't support `WITH ORDINALITY`? Django 2.1 [requires PostgreSQL 9.4+](https://docs.djangoproject.com/en/2.1/ref/databases/#postgresql-notes). However, note that Django 2.1.X is now end of life, so you should upgrade to the latest 2.2.X LTS or 3.1.X release if possible. – Alasdair Nov 24 '20 at 10:56
  • hi Alasdair , thanks for your reply – Youssri Abo Elseod Nov 24 '20 at 11:20
  • i work on CPanel so i use psycopg2-binary==2.8.4 i add some of my backage in my topic – Youssri Abo Elseod Nov 24 '20 at 11:26
  • 1
    `psycopg2-binary` is the Python package used to access the PostgreSQL database, not the actual PostgreSQL installation. I'm not familiar with cPanel, but [this thread](https://forums.cpanel.net/threads/checking-postgresql-version-from-cpanel.644553/) suggests using phpPgAdmin to check the PostgreSQL version. – Alasdair Nov 24 '20 at 11:33
  • Alasdair , i got it , the PostgreSQL verison is>> PostgreSQL 9.2.24 – Youssri Abo Elseod Nov 24 '20 at 11:47
  • 2
    That's a very old version of PostgreSQL - [Django 1.10 was the last version to support PostgreSQL 9.2](https://docs.djangoproject.com/en/1.10/ref/databases/#postgresql-notes) – Alasdair Nov 24 '20 at 12:35
  • thanks Alasdair , i have commanicated with the site admin for update this PostgeSql version , i will feed you back – Youssri Abo Elseod Nov 24 '20 at 13:07
  • PostgreSqle updated to verging 5 , i reinstall database and re migrate data again after deleting old migration files but there are error – Youssri Abo Elseod Nov 25 '20 at 12:59
  • That's a separate isssue, so it might be better to ask a new question. The `django>=1.8,<2` and `pillow<4` requirements [are for older versions of Python](https://github.com/SmileyChris/easy-thumbnails/blob/2.6.0/setup.py#L51), so I don't understand why you would get those errors if you are using `pip` for a recent version of Python. – Alasdair Nov 25 '20 at 13:29
  • Alasdair thanks for your interested , my site it can't be lunch , this is the case – Youssri Abo Elseod Nov 25 '20 at 13:55
  • i create some steps python manage.py makemigrations python manage.py migrate , the error disapeared , i command manage.py runserver and its ok ___________but the site isn't lunch yer (http://qhse-erp.com/) – Youssri Abo Elseod Nov 25 '20 at 14:02
  • This is getting far away from your original error message, so I can't help. You'll probably get more views if you ask a new question. If the new problem is getting the Django site to launch, then you should explain how you've configured cPanel. – Alasdair Nov 25 '20 at 14:09
  • 1
    Note that it isn't safe to run `manage.py runserver` in production. Usually you'd use something like Apache + mod_wsgi or Nginx + gunicorn. For more info see the [deployment docs](https://docs.djangoproject.com/en/3.1/howto/deployment/), or look for a step by step tutorial (you might be able to find one specifically for cPanel). – Alasdair Nov 25 '20 at 14:10

1 Answers1

3

thanks Alsdair for your comments , i will re quesiton in another place for next sloution stages

here i found useful notes ( by Argo) about

  • Delete all migration files(not the migration folder, keep the init.py file

    python manage.py makemigrations

    python manage.py migrate --fake

    python manage.py makemigrations

    python manage.py migrate

Youssri Abo Elseod
  • 671
  • 1
  • 9
  • 23