0

I am trying my first deployment. Following this instructions. The problem is that those instructions are for python 2.7, while I am on 3+. So I have mixed it with some another instructions. I have created a virtual environment for python 3. Run python manage.py runserver 0.0.0.0:8000 also successfully.

But stopped on the point of configurating Gunicorn.
When I write vim bin/gunicorn_start - I come to vim redactor, I write some configuration, but next when I try save and exit with :wq - I get E212 error, which in brief says that I can't save that file, but I don't know the reason of that.
Why does that happen? What am I doing wrong?

Here is a structure of folders beginning from my_project_folder mowing to the top level folder, got with ls, may be that will help somehow (first in the row is folder where we come from).:

   ^ Cosmo
   | polo polo_env
   | environments
   | chiefir
   | home  bin  boot  dev  etc  initrd.img  lib  lib64  lost+found  media  mnt  opt  proc  root  run  sbin  snap  srv  sys  tmp  usr  var  vmlinuzcd
Chiefir
  • 2,561
  • 1
  • 27
  • 46
  • What's the full error message that you're getting ? Did you checked this ? https://unix.stackexchange.com/questions/144741/vim-error-e212-cannot-open-file-for-writing-when-trying-to-create-new-files – Umair Mohammad May 11 '18 at 18:16
  • @Umair thank you for your answer, just a minute ago managed to fix that - the problem was that I run that command from folder cloned with git, but I should run it from `polo_env` folder. But may be u can tell me if my `polo` (which is my project folder) should be in `polo_env` folder? – Chiefir May 11 '18 at 18:26
  • Did you checked this https://stackoverflow.com/questions/1783146/where-in-a-virtualenv-does-the-custom-code-go ? – Umair Mohammad May 12 '18 at 08:14

1 Answers1

1

I know it's late but could save another soul here... Open vim as sudo. The virtual environment is protecting itself by ensuring that a user is absolutely sure of what they are doing before writing anything there. This is because it is in the bin folder. So get the privileges with sudo vim /bin/gunicorn_start to be able to save anything in that location. Afterwards, just as before, :wq. This time it will pass.

karuoro
  • 541
  • 4
  • 12