You are welcome :-)
On Tue, May 25, 2021 at 3:41 AM Michał T. Lorenc <m.t.lorenc@gmail.com> wrote:
Hi,Thank you it works.--On Tue, May 25, 2021 at 12:31 AM RANGA BHARATH JINKA <bharathjinka09@gmail.com> wrote:hi,Run migrations. python manage.py makemigrations and python manage.py migrateOn Mon, May 24, 2021 at 7:20 PM Mic <m.t.lorenc@gmail.com> wrote:Hello,--I found a Django project and failed to get it running in Docker container in the following way:1. `git clone git clone https://github.com/NAL-i5K/django-blast.git`2. `$ cat requirements.txt` in this files the below dependencies had to be updated:- psycopg2==2.8.6I have the following Dockerfile:```FROM python:2ENV PYTHONUNBUFFERED=1RUN apt-get update && apt-get install -y postgresql-clientWORKDIR /codeCOPY requirements.txt /code/RUN pip install -r requirements.txtCOPY . /code/RUN mkdir -p /var/log/djangoRUN mkdir -p /var/log/i5k```For `docker-compose.yml` I use:```version: "3"services:db:image: postgresvolumes:- ./data/db:/var/lib/postgresql/data- ./scripts/install-extensions.sql:/docker-entrypoint-initdb.d/install-extensions.sqlenvironment:- POSTGRES_DB=postgres- POSTGRES_USER=postgres- POSTGRES_PASSWORD=postgresweb:build: .command: python manage.py runserver 0.0.0.0:8000volumes:- .:/codeports:- "8000:8000"depends_on:- dblinks:- db``````$ cat scripts/install-extensions.sqlCREATE EXTENSION hstore;```I had to change:```$ vim i5k/settings.pyDATABASES = {'default': {'ENGINE': 'django.db.backends.postgresql_psycopg2','NAME': 'postgres','USER': 'postgres','PASSWORD': 'postgres','HOST': 'db','PORT': '5432',}}```Next, I ran `docker-compose up --build` and opened in Browser `http://localhost:8000/admin/` which caused:```Environment:Request Method: GETRequest URL: http://localhost:8000/admin/Django Version: 1.8.12Python Version: 2.7.18Installed Applications:('django.contrib.auth','django.contrib.contenttypes','django.contrib.sessions','django.contrib.sites','django.contrib.messages','django.contrib.staticfiles','django.contrib.postgres','axes','rest_framework','rest_framework_swagger','pipeline','app','blast','migrate_account','suit','filebrowser','django.contrib.admin','django.contrib.admindocs','social.apps.django_app.default','captcha','dashboard','proxy','hmmer','clustal','webapollo_sso','drupal_sso')Installed Middleware:('django.middleware.common.CommonMiddleware','django.contrib.sessions.middleware.SessionMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','axes.middleware.FailedLoginMiddleware','app.middleware.SocialAuthExceptionMiddleware')Traceback:File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response132. response = wrapped_callback(request, *callback_args, **callback_kwargs)File "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in wrapper254. return self.admin_view(view, cacheable)(*args, **kwargs)File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view110. response = view_func(request, *args, **kwargs)File "/usr/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func57. response = view_func(request, *args, **kwargs)File "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner222. if not self.has_permission(request):File "/usr/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in has_permission162. return request.user.is_active and request.user.is_staffFile "/usr/local/lib/python2.7/site-packages/django/utils/functional.py" in inner225. self._setup()File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py" in _setup376. self._wrapped = self._setupfunc()File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" in <lambda>22. request.user = SimpleLazyObject(lambda: get_user(request))File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/middleware.py" in get_user10. request._cached_user = auth.get_user(request)File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in get_user167. user_id = _get_user_session_key(request)File "/usr/local/lib/python2.7/site-packages/django/contrib/auth/__init__.py" in _get_user_session_key59. return get_user_model()._meta.pk.to_python(request.session[SESSION_KEY])File "/usr/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in __getitem__48. return self._session[key]File "/usr/local/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py" in _get_session181. self._session_cache = self.load()File "/usr/local/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py" in load21. expire_date__gt=timezone.now()File "/usr/local/lib/python2.7/site-packages/django/db/models/manager.py" in manager_method127. return getattr(self.get_queryset(), name)(*args, **kwargs)File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in get328. num = len(clone)File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in __len__144. self._fetch_all()File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in _fetch_all965. self._result_cache = list(self.iterator())File "/usr/local/lib/python2.7/site-packages/django/db/models/query.py" in iterator238. results = compiler.execute_sql()File "/usr/local/lib/python2.7/site-packages/django/db/models/sql/compiler.py" in execute_sql840. cursor.execute(sql, params)File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute79. return super(CursorDebugWrapper, self).execute(sql, params)File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute64. return self.cursor.execute(sql, params)File "/usr/local/lib/python2.7/site-packages/django/db/utils.py" in __exit__98. six.reraise(dj_exc_type, dj_exc_value, traceback)File "/usr/local/lib/python2.7/site-packages/django/db/backends/utils.py" in execute64. return self.cursor.execute(sql, params)Exception Type: ProgrammingError at /admin/Exception Value: relation "django_session" does not existLINE 1: ...ession_data", "django_session"."expire_date" FROM "django_se...```What did I miss?Thank you in advance
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/d671a6dc-cdc9-42ab-9c32-0ec46263e242n%40googlegroups.com.
----Thanks and RegardsJ. Ranga Bharathcell: 9110334114
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/8nn2lMxFxn0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m317w45hABoFr_-79iXOunkQT7gnOCbcMEoGHMiY_PXm2kA%40mail.gmail.com.
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABMg7%3DmVphppQuBOvy-UAWCOd%2Bp2z1xBjjGpN6qr0iC8SX0X3Q%40mail.gmail.com.
Thanks and Regards
J. Ranga Bharath
cell: 9110334114
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAK5m314yremOnPBG5zW6QWMw6SqOw0WxsRTnzvPFnqMzt92ZGA%40mail.gmail.com.
No comments:
Post a Comment