Forum Archive

Creating a django project via Stash

codecowboy

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?

mikael

@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.

codecowboy

@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.

I also found this

It looks like the SITE_PACKAGES path is incorrect as they aren’t in my Documents folder. Does “python modules” have its own folder?

mikael

@codecowboy, sorry, should have clicked on the link.

JonB

Are you running stash with 2.7 or 3.x interpreter?

JonB

@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.

codecowboy

@JonB its the Python3 interpreter