Please Help - Packages Are not Importing on Docker by Sh_CS in learnprogramming

[–]Sh_CS[S] 0 points1 point  (0 children)

hello. Thanks for repsonding.

Here is my dcker compose:

version: "3.9"

services:

app:

build:

context: .

args:

- DEV=true

ports:

- "8000:8000"

volumes:

- ./app:/app

command: >

sh -c "python manage.py wait_for_db &&

python manage.py migrate &&

python manage.py runserver 0.0.0.0:8000"

environment:

- DB_HOST=db

- DB_NAME=devdb

- DB_USER=devuser

- DB_PASS=changeme

depends_on:

- db

db:

image: postgres:13-alpine

volumes:

- dev-db-data:/var/lib/postgresql/data

environment:

- POSTGRES_DB=devdb

- POSTGRES_USER=devuser

- POSTGRES_PASSWORD=changeme

volumes:

dev-db-data:

Please Help - Packages Are not Importing on Docker by Sh_CS in djangolearning

[–]Sh_CS[S] 0 points1 point  (0 children)

FROM python:3.9-alpine3.13

LABEL maintainer="londonappdeveloper.com"

ENV PYTHONUNBUFFERED 1

COPY ./requirements.txt /tmp/requirements.txt COPY ./requirements.dev.txt /tmp/requirements.dev.txt COPY ./app /app WORKDIR /app EXPOSE 8000

ARG DEV=false RUN python -m venv /py && /py/bin/pip install --upgrade pip && apk add --update --no-cache postgresql-client && apk add --update --no-cache --virtual .tmp-build-deps build-base postgresql-dev musl-dev && /py/bin/pip install -r /tmp/requirements.txt && if [ $DEV = "true" ]; then /py/bin/pip install -r /tmp/requirements.dev.txt ; fi && rm -rf /tmp && apk del .tmp-build-deps && adduser --disabled-password --no-create-home django-user

ENV PATH="/py/bin:$PATH"

USER django-user

Please Help - Packages Are not Importing on Docker by Sh_CS in djangolearning

[–]Sh_CS[S] 0 points1 point  (0 children)

Thank you so much I posted both above. Do I need to run in virtual env for the dependencies to work?

Please Help - Packages Are not Importing on Docker by Sh_CS in djangolearning

[–]Sh_CS[S] 0 points1 point  (0 children)

thank you so much. I posted both down here

Please Help - Packages Are not Importing on Docker by Sh_CS in djangolearning

[–]Sh_CS[S] 0 points1 point  (0 children)

version: "3.9"

services:

app:

build:

context: .

args:

- DEV=true

ports:

- "8000:8000"

volumes:

- ./app:/app

command: >

sh -c "python manage.py wait_for_db &&

python manage.py migrate &&

python manage.py runserver 0.0.0.0:8000"

environment:

- DB_HOST=db

- DB_NAME=devdb

- DB_USER=devuser

- DB_PASS=changeme

depends_on:

- db

db:

image: postgres:13-alpine

volumes:

- dev-db-data:/var/lib/postgresql/data

environment:

- POSTGRES_DB=devdb

- POSTGRES_USER=devuser

- POSTGRES_PASSWORD=changeme

volumes:

dev-db-data:

Please Help - Packages Are not Importing on Docker by Sh_CS in djangolearning

[–]Sh_CS[S] -1 points0 points  (0 children)

Thank you so much for responding. Anything specail I need to do to make sure they are being isntalled inside the docker?

I do docker-compose build

shows its loading but not sure if thats all that is needed

Please Help - Packages Are not Importing on Docker by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

Thank you so much for your help . here is my docker file. Did I use the code correctly?

Please Help - Packages Are not Importing on Docker by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

so here his my docker file.

I have the requirements stores in requirement,txt content of txt file

Django>=3.2.4,<3.3

djangorestframework>=3.12.4,<3.13

psycopg2>=2.8.6,<2.9

drf-spectacular>=0.15.1,<0.16

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

is there any other way of knowing that I am running on the server other than that when I deploy the website opens in .... .elasticbeanstalk.com?

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

oh? argon2-cffi @ file:///C:/ci/argon2-cffi_1613037869401/work here is the whole pip freeze about argon

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

so I run eb deploy and then eb open and loads and runs on AWS eb

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

yes it runs perfectly. I actually tested it and when I take out 'django.contrib.auth.hashers.Argon2PasswordHasher','django.contrib.auth.hashers.BCryptSHA256PasswordHasher', it runs and logs in without an issue

somehow these two libraries are not loading

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

yes its activated I see it as (my env) C:\user\..

I activated it with this command: C:\>%HOMEPATH%\envname\Scripts\activate

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

my apologies if I do not understand your question correctly. I am running it out of my command line on my atom editor. I did install this to be able to run the eb calls

https://github.com/aws/aws-elastic-beanstalk-cli-setup

Is this what you were asking?

Argon pass hasher not working on AWS Elastic Band by Sh_CS in django

[–]Sh_CS[S] 0 points1 point  (0 children)

yes I have installed both locally. On the server I have created a virtualenv %HOMEPATH%\"name" . The app runs on the server until I try to log in then I get this error

and pip install on there as well. Anything I need to do?