Forums

Source code "This directory does not exist"

Hi all, I'm trying to follow the Django Girls tutorial to learn Django and set up a blog but I think I messed up my pythonanywhere account. I'm getting a whole lot of error messages, I think the most important one is when I go to my "Web app setup" page. In Code: What Your Site is Running, it says Source Code: /home/joannaraygoza/joannaraygoza.pythonanywhere.com This directory does not exist. Sure enough, when I go to home/joannaraygoza, there is no file or folder called "joannaraygoza.pythonanywhere.com". Maybe I deleted it somehow? Do I need to start all over with a whole new account, or is there a way to fix this?

I tried redoing the setup steps from the Django Girls tutorial as shown below, to reset my PythonAnywhere setup. But I got an error that I already have a web app:

(joannaraygoza.pythonanywhere.com) 21:29 ~ $ pa_autoconfigure_django.py --python=3.6 https://github.com/Joannaraygoza/quarantine-blog.git
< Running API sanity checks >
   \
    ~<:>>>>>>>>>
Traceback (most recent call last):
  File "/home/joannaraygoza/.local/bin/pa_autoconfigure_django.py", line 47, in <module>
    main(arguments['<git-repo-url>'], arguments['--domain'], arguments['--python'], nuke=arguments.get('--nuke'))
  File "/home/joannaraygoza/.local/bin/pa_autoconfigure_django.py", line 29, in main
    project.sanity_checks(nuke=nuke)
  File "/home/joannaraygoza/.local/lib/python3.6/site-packages/pythonanywhere/project.py", line 24, in 
sanity_checks
    self.webapp.sanity_checks(nuke=nuke)
  File "/home/joannaraygoza/.local/lib/python3.6/site-packages/pythonanywhere/api/webapp.py", line 42, in 
sanity_checks
    domain=self.domain
pythonanywhere.exceptions.SanityException: You already have a webapp for 
joannaraygoza.pythonanywhere.com.

Use the --nuke option if you want to replace it.

So I tried it with the --nuke option, and got another error. The most important part of that error seems to be: "Removing joannaraygoza.pythonanywhere.com... ERROR: You cannot remove the active environment ('joannaraygoza.pythonanywhere.com'). Either switch to another environment, or run 'deactivate'."

Should I run 'deactivate'? Or am I totally on the wrong path?

You're getting that message because the virtualenv that the script wants to delete is activated and it cannot delete an active virtualenv. So follow the advice in the message and deactivate the environment before running the script again.

It worked! Thanks @glenn. It looks like I am back up and running.

Excellent, glad we could help!

I'm facing the same issue...and I dont understand what deactivation message you are talking about

There are multiple issues mentioned in this thread. We need to know your specific problem to help you.

I keep getting error when I attempt autoconfiguration.

It keeps saying invalid token. From which module am I importing requests ?

That sounds like you need to configure your PythonAnywhere account and your github account so that you can access your github account from PythonAnywhere. There is documentation on github about how to do that.

I have done that, now this is the error message I'm getting

/home/Magnify/.virtualenvs/myawesomeproject/bin/python: No module named virtualenvwrapper virtualenvwrapper.sh: There was a problem running the initialization hooks. If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/home/Magnify/.virtualenvs/myawesomeproject/bin/python and that PATH is set properly.

That looks like you've broken your .bashrc. If you do not have the lines:

export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

in your .bashrc, then virtualenvwrapper will not be initialised any you'll get that error.

how can I put the lines in it please...I have tried every means I know

Have you tried it in a new console after adding the change?