Django Help! Linode Stack Install Script, NOW WHAT?!
I've installed a Ubuntu Server using this "Security, PostgreSQL/MySQL/MongoDB, Apache, Django" Linode Stack Script. …
However, I'm totally stuck and need help. my site
python manage.py startapp whiskey…
I get this…
benjamin@thallium:/srv/website/app/webapp$ python manage.py startapp whiskey
Traceback (most recent call last):
File "manage.py", line 2, in
ImportError: No module named django.core.management
ALSO this seems to be an error…
benjamin@thallium:/srv/website/app/webapp$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
from django import get_version
Traceback (most recent call last):
File "
If anyone can offer help and the next step i'm totally missing please help.
Thanks!
6 Replies
source bin/activate
it should set up your python path properly.
@obs:
Your PYTHONPATH is probably missing the path to django, it appears the stack script you used stores sites in virtualenvs inside /srv so if you cd /srv/[your project name] then run
source bin/activate
it should set up your python path properly.
Hi Obs,
I'm unsure what your code
source bin/activate
is actually suppose to be… I understand that I'm not linking something correctly.
I've been trying to adapt this guide to my system unsucessfully..
My structure of /srv is ..
/srv
-> website
-> -> app
-> -> -> webapp
init.py manage.py settings.py urls.py
And my /etc/apache2/sites-available/yozomo.com file looks like this…
<virtualhost *:80="">ServerAdmin zobrakster@yahoo.com
ServerName yozomo.com
Alias /site_media/ /srv/website/app/webapp/site_media/
Alias /media/ /srv/website/venv/lib/python2.6/site-packages/django/contrib/admin/media/
Alias /robots.txt /srv/website/app/webapp/site_media/robots.txt
Alias /favicon.ico /srv/website/app/webapp/site_media/favicon.ico
CustomLog "|/usr/sbin/rotatelogs /srv/website/logs/access.log.%Y%m%d-%H%M%S 5M" combined
ErrorLog "|/usr/sbin/rotatelogs /srv/website/logs/error.log.%Y%m%d-%H%M%S 5M"
LogLevel warn
WSGIDaemonProcess yozomo.com user=benjamin group=benjamin processes=1 threads=15 maximum-requests=10000 python-path=/srv/website/venv/lib/python2.6/site-packages python-eggs=/srv/website/run/eggs
WSGIProcessGroup yozomo.com
WSGIScriptAlias / /srv/website/app/conf/apache/django.wsgi
<directory srv="" website="" app="" webapp="" site_media="">Order deny,allow
Allow from all
Options -Indexes FollowSymLinks</directory>
<directory srv="" website="" app="" conf="" apache="">Order deny,allow
Allow from all</directory></virtualhost>
You should have a script called 'activate' in /srv/$DJANGOPROJECTNAME/venv/bin/, where $DJANGOPROJECTNAME is the one set during StackScript deployment (default: myproject). Once you do "source /srv/$DJANGOPROJECTNAME/venv/bin/activate", a little (env) will appear in your prompt and then you should be able to "python manage.py startapp whiskey" from /srv/$DJANGOPROJECT_NAME, picking up the Django tutorial at that step
@hoopycat:
Once you do "source /srv/$DJANGOPROJECTNAME/venv/bin/activate", a little (env) will appear in your prompt and then you should be able to "python manage.py startapp whiskey" from /srv/$DJANGOPROJECTNAME
Yes yes, Thank you very much that was it. I missed the "activate" command. All is well now.
Thanks again!
Benjamin