Giter Club home page Giter Club logo

Comments (14)

mprat avatar mprat commented on September 25, 2024 4

Hmm I think upon further thought I agree with you. I confirmed that after chmod +x manage.py and committing that manage.py to my Django project I was no longer seeing this error. I am going to delete my previous PR.

from ansible-django-stack.

mprat avatar mprat commented on September 25, 2024 1

It looks like a bug with the django_manage Ansible add-on. I solved it by making the manage.py file executable after I clone my repository.

- name: Make manage.py executable
  file:
    path: "{{ project_path }}/manage.py"
    mode: 0777

Not a long-term solution, I know, but it will solve the problem.

from ansible-django-stack.

YPCrumble avatar YPCrumble commented on September 25, 2024 1

from ansible-django-stack.

jcalazan avatar jcalazan commented on September 25, 2024

@codegastudio What are the permissions of the manage.pyfile? (in the git repo itself)

from ansible-django-stack.

codegastudio avatar codegastudio commented on September 25, 2024

@jcalazan permissions are not applied at the moment of migrate command is call so manage.py is :
-rwxr-xr-x 1 root root 250 Jul 19 18:42 manage.py

from ansible-django-stack.

jcalazan avatar jcalazan commented on September 25, 2024

Hmm...permissions looks right, I remember seeing a similar error before and the issue was the manage.py file wasn't excutable in the git repo.

Mind pasting the error from Ansible? You can add -vvvv flag to the ansible-playbook command to get more detailed info from Ansible.

from ansible-django-stack.

codegastudio avatar codegastudio commented on September 25, 2024

Hi,

I changed few steps in setup_django_app.
Django 1.9 no longer use syncdb method.
We need to call makemigrations command with project name (eg:project in my case) before call migrate command.

So i tested the followed ansible instructions and this work

- name: Run Django database makemigrations
  django_manage: >
    command="makemigrations project"
    app_path={{ project_path }}
    virtualenv={{ virtualenv_path }}
    settings={{ django_settings_file }}
  when: run_django_db_migrations is defined and run_django_db_migrations
  tags: django.migrate

- name: Run Django database migrate
  django_manage: >
    command=migrate 
    app_path={{ project_path }}
    virtualenv={{ virtualenv_path }}
    settings={{ django_settings_file }}
  when: run_django_db_migrations is defined and run_django_db_migrations
  tags: django.migrate

@jcalazan Thank you for your time

from ansible-django-stack.

codegastudio avatar codegastudio commented on September 25, 2024

Just add "migrations" repository in your django project and you will not be oblige to call makemigrations followed by your project name

- name: Run Django database makemigrations
  django_manage: >
    command=makemigrations
    app_path={{ project_path }}
    virtualenv={{ virtualenv_path }}
    settings={{ django_settings_file }}
  when: run_django_db_migrations is defined and run_django_db_migrations
  tags: django.migrate

from ansible-django-stack.

jcalazan avatar jcalazan commented on September 25, 2024

Glad you got it working @codegastudio, I believe the startapp command starting from Django 1.8 automatically creates the migrations directory/package.

from ansible-django-stack.

codegastudio avatar codegastudio commented on September 25, 2024

@jcalazan yes it's from Django 1.8 👍

from ansible-django-stack.

mprat avatar mprat commented on September 25, 2024

I was using Django 1.8 (legacy project... I guess I should update soon) but my first priority was automating deployment.

from ansible-django-stack.

YPCrumble avatar YPCrumble commented on September 25, 2024

from ansible-django-stack.

jcalazan avatar jcalazan commented on September 25, 2024

Closed. Agreed that users should set the permissions in their repo and not have Ansible make the modifications.

from ansible-django-stack.

crysyn avatar crysyn commented on September 25, 2024

I had a very weird situation that Ill document here because this was the best / only real source for what was going on here:

My Setup:
Vagrant|VirtualBox running Ubuntu (14.04) and the latest Ansible as of this writing.
Would constantly get Permission Denied errors when getting to the manage.py commands using this plugin despite the permissions being set up properly.
Installed vbguest to help mitigate sync'd folders in the environment which resolved the issue for everyone but me.
"permissions in their repo" was the clue from this post. This was all running on macOS however I use Parallels+Win10 and Git Extensions to manage my repositories. This ended up being the issue.

I do not know how/why but in the unlikely case someone else runs this unique setup and encounters this issue, doing a cli git pull of the repo or having a direct copy of the filesystem within virtualbox allowed the ansible playbooks to run successfully.

from ansible-django-stack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.