Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Creating a django project via Stash
-
I am getting the following error after installing django with Stash and pip:
[~/Documents]$ django-admin.py startproject mysite stash: <class 'AttributeError'>: module 'django' has no attribute 'get_version'
The guide here assumes a pre-existing project imported from github. https://www.wideswathresearch.com/django-development-on-an-ipad-pro/
Anyone know if I should be able to create a fresh django project on Pythonista?
-
@codecowboy, unfortunately I cannot remember anyone using Django with Pythonista. This is probably because you rarely want to have a long-running web server on an iDevice, and for the more transient needs – like a quick connection from a PC, a callback server in the OAuth process, or mocking a remote API – Django is too complex, and you are better served by something like Bottle or Flask.
-
@mikael thanks. There are at least two posts online claiming that it is possible (one linked above) so I’d still like to get it working.
It looks like the SITE_PACKAGES path is incorrect as they aren’t in my Documents folder. Does “python modules” have its own folder?
-
@codecowboy, sorry, should have clicked on the link.
-
Are you running stash with 2.7 or 3.x interpreter?
-
@codecowboy also, make sure you don't have a folder or script called django -- sometimes people create a quick django.py to test functionality, but then the script that importa django imports the wrong file!
You can also check this by editing the django_admin.py to print django.file after importing.
stashconf py_traceback 1
Is useful for getting full traceback, or if you are comfortable with pdb,
stashconf py_pdb 1
Then you can check which Django is being used, etc.
-
@JonB its the Python3 interpreter