When I try to run "django-admin startproject mysite" an error appears:
django-admin startprojekt mysite
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 11, in <module>
sys.exit(execute_from_command_line())
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 330, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 182, in fetch_command
settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 48, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
% (desc, ENVIRONMENT_VARIABLE))
django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
It's a fresh installation of Ubuntu 15.04.
As default I have both python 2 and 3 installed:
python:
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
python3:
Python 3.4.3 (default, Mar 26 2015, 22:03:40)
I have installed django via pip (sudo pip install Django).
Django seems to be installed:
python -c "import django; print(django.get_version())"
1.8.2
python3 -c "import django; print(django.get_version())"
1.7.6
What can be wrong?
You have misspelled
startproject
asstartprojekt
. Try: