Comments (14)
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.
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.
from ansible-django-stack.
@codegastudio What are the permissions of the manage.py
file? (in the git repo itself)
from ansible-django-stack.
@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.
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.
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.
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.
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.
@jcalazan yes it's from Django 1.8 👍
from ansible-django-stack.
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.
from ansible-django-stack.
Closed. Agreed that users should set the permissions in their repo and not have Ansible make the modifications.
from ansible-django-stack.
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)
- TravisCI check no longer showing up on PR's in GitHub. HOT 2
- SSL certificates not updating HOT 1
- Switch to log-level info as the default gunicorn log level
- Gunicorn script file is part of the `deploy` tag, but will never be re-read by Supervisor during a deployment
- Use of maintenance_off / maintenance_on files HOT 9
- Install deadsnakes team new Python Versions PPA fails HOT 1
- RabbitMQ vars and version control HOT 4
- VPS Setup: With or Without Vagrant? HOT 2
- Is the NGINX block for 500.html necessary? HOT 2
- Celery loglevel has to be in capital letters HOT 1
- Use new sample Django project HOT 3
- Remove memcached role HOT 1
- Remove security role? HOT 2
- Add a variable to define PostgreSQL version HOT 2
- Bintray has been deprecated HOT 1
- 'db_name' is undefined\ HOT 8
- Is the current "Upgrade pip" task actually doing anything? HOT 1
- What are previous users of this repo using to deploy Django? HOT 5
- 'db_name' is undefined error in Vagrant up /roles/db/tasks/main.yml task HOT 6
- Make sure branches are up to date before merging
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-django-stack.