Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 19:59
    wgordon17 opened #1922
  • Jan 31 2019 15:53

    browniebroke on pyup-update-django-extensions-2.1.4-to-2.1.5

    (compare)

  • Jan 31 2019 15:53

    browniebroke on master

    Update django-extensions from 2… Merge pull request #1916 from p… (compare)

  • Jan 31 2019 15:53
    browniebroke closed #1916
  • Jan 31 2019 15:52

    browniebroke on pyup-update-flake8-3.6.0-to-3.7.3

    (compare)

  • Jan 31 2019 15:52

    browniebroke on master

    Update flake8 from 3.6.0 to 3.7… Update flake8 from 3.6.0 to 3.7… Merge pull request #1920 from p… (compare)

  • Jan 31 2019 15:52
    browniebroke closed #1920
  • Jan 31 2019 15:49

    browniebroke on pyup-update-pytest-4.1.1-to-4.2.0

    (compare)

  • Jan 31 2019 15:49

    browniebroke on master

    Update pytest from 4.1.1 to 4.2… Update pytest from 4.1.1 to 4.2… Merge pull request #1919 from p… (compare)

  • Jan 31 2019 15:49
    browniebroke closed #1919
  • Jan 31 2019 13:43
    wgordon17 opened #1921
  • Jan 31 2019 13:23

    pydanny on pyup-update-flake8-3.6.0-to-3.7.2

    (compare)

  • Jan 31 2019 13:23
    pyup-bot closed #1918
  • Jan 31 2019 13:23
    pyup-bot commented #1918
  • Jan 31 2019 13:23
    pyup-bot opened #1920
  • Jan 31 2019 13:23

    pydanny on pyup-update-flake8-3.6.0-to-3.7.3

    Update flake8 from 3.6.0 to 3.7… (compare)

  • Jan 31 2019 13:23

    pydanny on pyup-update-flake8-3.6.0-to-3.7.3

    (compare)

  • Jan 31 2019 13:23

    pydanny on pyup-update-flake8-3.6.0-to-3.7.3

    Update flake8 from 3.6.0 to 3.7… (compare)

  • Jan 31 2019 00:40
    pyup-bot opened #1919
  • Jan 31 2019 00:40

    pydanny on pyup-update-pytest-4.1.1-to-4.2.0

    Update pytest from 4.1.1 to 4.2… (compare)

ak4zh
@ak4zh
Thanks will try
ak4zh
@ak4zh

@browniebroke What is the correct way to make migrations while using a docker environment.

If I make changes locally -> push to repository -> Git pull on server -> docker-compose build -> docker-compose up -> docker-compose run --rm django python manage.py migrate

I get this error:

’’’
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
’’’

ak4zh
@ak4zh

docker-compose run --rm django python manage.py makemigrations

builds the required migrations, but migrate command again gives the same error.

Seems I need to makemigrations before pushing to git, but then I have to set .env file with all required variables Database, celery in addition of docker environment.

Jack
@iJackCrack_twitter
I have this strange issue. I am using a script that works perfect on Docker Local but in Production Docker it is not redirecting to the set url.
<script async src="https://telegram.org/js/telegram-widget.js?5" data-telegram-login="MySamplebot" data-size="large" data-auth-url="https://mywebsite.com/users/tgauth" data-request-access="write"></script>
ak4zh
@ak4zh

Does anyone know where is the domains public certificate stored (cert.pem file) in docker?

I need to cert.pem to use in a webhook

Jack
@iJackCrack_twitter

My website works all good with non www version but the www.example.com version gives me 404 error and also SSL does not work

I have A record set for www and @ to my server IP

Have ".mydomain.com" in allowed host

What can be the issue?

atitut
@atitut6_twitter
Hi Danny! I was looking some way to open all data on my postgres db through DBeaver, but everytime I input the HOST, USER, PASS, and DB it's just show "Connection attempt timed out.". So, according on that case what step I missed? I'm not install the postgresql on my laptop
Mauricio Téllez
@mtellezj
Hi, suddenly I'm getting this error when I tried to build my production app: Could not install packages due to an EnvironmentError: [Errno 22] Invalid argument: '/usr/local/lib/python3.6/site-packages/wheel-0.33.1.dist-info/, but in base.txt I got this: wheel==0.29.0. Then I build the image on my machine and upload to docker-hub, and download the image on production instead of build, but now I get the Postgres is not available , but If I connect to the django container and run the code of postgres_ready() (defined in django/entrypoint.sh) I can connect to postgres. Any clue?
Mauricio Téllez
@mtellezj
I wasn't update the image so the postgres error. Now I'm deploying to production with a modified docker-compose.yml to use the image instead of build one and everything is working fine. At production I still has a git clone version of the project, but since I'm using only images from docker-hub, should I delete the git's folder and only use a docker file with an .env? or the content of the .envare copied to the image on build and can be delete on production? thanks for the help.
ak4zh
@ak4zh

@atitut6_twitter Because your postgres is not set to allow connection from any ip other than localhost.

You need to allow remote connections by editing pg_hba.conf file of postgres

Piyush Gandhi
@PiyuGandhi
Hi everyone, I have an issue, I am trying to deploy using docker and I wanted to know how much time does it take after docker-compose -f production.yml up command . It isn't a big application, running on localhost takes about 2-3 seconds but in production Idk why it's taking too much time (7-8 minutes atm and still not done)
Running it for the first time on production
shireenrao
@shireenrao
Hello - I am trying to start a new project on windows using docker. Here are my settings
'
cookiecutter https://github.com/pydanny/cookiecutter-django
You've downloaded C:\Users\srao.cookiecutters\cookiecutter-django before. Is it okay to delete and re-download it? [yes]: yes
project_name [My Awesome Project]:
project_slug [my_awesome_project]:
description [Behold My Awesome Project!]:
author_name [Daniel Roy Greenfeld]:
domain_name [example.com]:
email [daniel-roy-greenfeld@example.com]:
version [0.1.0]:
Select open_source_license:
1 - MIT
2 - BSD
3 - GPLv3
4 - Apache Software License 2.0
5 - Not open source
Choose from 1, 2, 3, 4, 5 (1, 2, 3, 4, 5) [1]:
timezone [UTC]:
windows [n]: y
use_pycharm [n]:
use_docker [n]: y
Select postgresql_version:
1 - 10.5
2 - 10.4
3 - 10.3
4 - 10.2
5 - 10.1
6 - 9.6
7 - 9.5
8 - 9.4
Choose from 1, 2, 3, 4, 5, 6, 7, 8 (1, 2, 3, 4, 5, 6, 7, 8) [1]:
Select js_task_runner:
1 - None
2 - Gulp
Choose from 1, 2 (1, 2) [1]:
Select cloud_provider:
1 - AWS
2 - GCE
Choose from 1, 2 (1, 2) [1]:
custom_bootstrap_compilation [n]:
use_compressor [n]:
use_celery [n]:
use_mailhog [n]: y
use_sentry [n]:
use_whitenoise [n]:
use_heroku [n]:
use_travisci [n]:
keep_local_envs_in_vcs [y]:
debug [n]:
[SUCCESS]: Project initialized, keep up the good work!
'
The build succeeds with 'docker-compose -f local.yml build' and the django_1 container fails after I execute 'docker-compose -f local.yml up'
The error is
'
django_1 | Running on http://0.0.0.0:8000/ (Press CTRL+C to quit)
django_1 |
Restarting with stat
': No such file or directorycute 'python
my_awesome_project_django_1 exited with code 127
'
I am on Docker version 18.09.2, build 6247962 and docker-compose version 1.23.2, build 1110ad01
Any ideas on what I am doing wrong?
Jonathan Scott Enderle
@senderle

I have plans to write an app using cookiecutter-django that serves some large static files to authenticated users only. The files are too big to wrap in a Django file response, and must only be accessible to authenticated users.

I did this before with a project that I migrated to cookiecutter-django when you were using Caddy. The change at that point was simple. Caddy uses the same header as nginx, the X-Accel-Redirect header, to tell the proxy to serve an otherwise inaccessible file instead of forwarding the response. (Here's a good description of the config required with nginx; it's not very different with Caddy -- https://wellfire.co/learn/nginx-django-x-accel-redirects/)

I have no idea how to accomplish the same thing with Traefik, and it appears it may not be possible at all since Traefik isn't actually a web server. Does anyone have recommendations on how to make this work with cookiecutter-django? Does this mean I just can't use it for projects like these?

Yann-Sebastien Tremblay-Johnston
@underchemist
Is it intended that with a fresh template project from https://github.com/pydanny/cookiecutter-django.git using docker/docker-compose I would still need to manually export DATABASE_URL like /entrypoint does already if in production?
in order to do things like python3 manage.py createsuperuser ?
i.e. if I'm using local settings (which uses /start as entrypoint), not production.
Jonathan Scott Enderle
@senderle
I posted a version of my question above to stack overflow here.
Would love any feedback at all!
Harshitg
@Harshitg
Hi, I have recently begin using cookiecutter on django. I read the documentation mentioning support for Postgre, is it possible to instead use MSSQL?
El 李天宝
@elcolie
Hi
Suppose I am using AWS Lambda. And I have to dispatch a long running job to child process. What is the best practice on this problem?
Burhan Khalid
@burhan
What is your concern with the approach you have now?
El 李天宝
@elcolie
@burhan I have long running task. And normally I dispatch it to child process. Luckily cookiecutter-django has build-in Celery/Redis for me.
Bernard Parah
@b3h3rkz
I have been having this issue for a while now when using circleci to deploy my project on digitalocean

this is the traceback...everything runs well until it gets to the postgres image

Creating CA: /home/circleci/.docker/machine/certs/ca.pem
Creating client certificate: /home/circleci/.docker/machine/certs/cert.pem
Running pre-create checks...
Creating machine...
(***-api) Importing SSH key...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with ubuntu(systemd)...
Installing Docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env ***-api
redis uses an image, skipping
Building postgres
ERROR: SSL error: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661)
Exited with code 1

I haven't made any changes to the docker configs that come with cookiecutter

I will be glad if someone can help me figure out why this is happening... thanks
step21
@step21
Does anyone know of a way to programatically approve accounts after adding them or disable approving the mail address in development? I couldn't find any field in the db. At the moment I add some users for testing, but I always need to approve their mail address after logging in first
ak4zh
@ak4zh
ACCOUNT_EMAIL_VERIFICATION = "optional"
@step21 set ACCOUNT_EMAIL_VERIFICATION = "optional" django-allauth configs
ak4zh
@ak4zh
@pydanny I have a separate postgresql so I set DATABASE_URL variable in .postgres and also removed postgres dependency from docker compose... Now when I run docker-compose up it gives me error Waiting for PostgreSQL to become available... It will work if I keep the postgres stuffs intact in docker-compose but that isn't needed as my project dont meed postgres image running. So you know what else I need to fix to get rid of waiting for PostgreSQL error?
ak4zh
@ak4zh
I guess it's something in entrypoint file
step21
@step21
@Ak4zh thanks!
Bruno Alla
@browniebroke
@Ak4zh yes it’s in the entrypoint file, it looks for user, password, host & DB rather than the DATABASE_URL.
ak4zh
@ak4zh
@browniebroke Ok got it resolved. The issue was I was using localhost in POSTGRES_HOST as my postgres was in same server but I had to give actual IP else it refers to localhost inside docker. Another question is if I have DJANGO_READ_DOT_ENV_FILE=True does docker setup also take use of .env in root directory? Or it only uses the ones inside .envs . This is little confusing where shall I put all my env variables
h8pwn
@h8pwn
I have set up a project with the cookiecutter problem is I forgot to make it set up whitenoise for static files. Is there any way to enable it now without hassle?
Dani Hodovic
@danihodovic
Dani Hodovic
@danihodovic
Bruno Alla
@browniebroke
@Ak4zh This environment variable is only for a .env file, which is mainly used for non-Docker. Docker compose will pass the environment variables using the env_file section of production.yml and local.yml

Is it required to set EMAIL_HOST and EMAIL_PORT when using the locmem backend?

Don’t know, does it work without them? Have you tried removing them?

For gunicorn being installed, it doesn’t look required from looking at their doc. This line was added back in 2013, back then` it might have been required.
Dani Hodovic
@danihodovic

Don’t know, does it work without them? Have you tried removing them?

I run my pytest suite without them and with the locmem backend :)

leollon
@leollon
@browniebroke I'm trying to add pre-commit to this project, is it necessary to have this?
Bruno Alla
@browniebroke
Im
I'm not a big fan of pre-commit hooks personally
leollon
@leollon
OK, I am going to commit a pr, maybe it will be needed someday
leollon
@leollon

I mean using pre-commit in the generated django project. This project which developers can choose whether they use pre-commit or not.

OK, I am going to commit a pr, maybe it will be needed someday

Ben Lindsay
@benlindsay
Hi all, I'm trying to get the hang of cookiecutter-django, which is amazing, but I'm having some trouble getting it working in production on AWS with docker. What's the best way to get some help troubleshooting? I don't want to spam this conversation with logs and stuff.
And to be clear, I'm just trying to deploy the project right after initialization before adding any custom code
Ben Lindsay
@benlindsay
Nevermind, it turns out the solution was to start over and go through the process again with a fresh EC2 instance. Thanks for all the work you all do on this awesome package!