Monday 21 September 2020

Python Anywhere issue with Disk Space Quota Limit.

The official help page for this on Python can be found at https://help.pythonanywhere.com/pages/DiskQuota/

Here's my notes on what I've tried so far. 

du -hs /tmp ~/.[!.]* ~/* /var/www/


4.0K /home/mysite/.bashrc4.0K /home/mysite/.gitconfig4.0K /home/mysite/.profile4.0K /home/mysite/.pythonstartup.py4.0K /home/mysite/.viminfo4.0K /home/mysite/README.txt4.0K /tmp8.0K /home/mysite/.local8.0K /home/mysite/.vimrc17M /home/mysite/.cache160M /home/mysite/aroundaboutslaundry321M /home/mysite/.virtualenvs


An easy fix is if the Cache is bloated. 

rm -rf ~/.cache

rm -rf ~/.cache/*

Or lets clean up Unused files. 

rm -rf /tmp/*
In my case this neither of these helped.    


CLEAN UP ANY UNUSED VIRTUALENVS

How see old virtual environments ( see what virtualenvs I have) 



lsvirtualenv

Running this command showed me that I only had the one Environment working . 




Uninstall python packages you don't need anymore

To see what packages you have take a look at your requirements.txt page or run 

pip list

I then ran through a handful that I believed I'm not using ; although I may need to install them again at a later date. 

To remove here is an example


pip uninstall django-cripsy-forms

And then Remove from requirements.txt.  



From here I could now install the package I wanted, which was 'wagtail' 

pip install wagtail







Thursday 17 September 2020

ImportError: No module named django.core.management

 I got this error when running

python manage.py migrate


Traceback (most recent call last):

  File "manage.py", line 8, in <module>

    from django.core.management import execute_from_command_line

ImportError: No module named django.core.management


And then realised I should have run 

python3 manage.py migrate

Doh!