django-admin.py startproject mysite

1,945 views
Skip to first unread message

Santiago Caracol

unread,
Apr 4, 2011, 4:11:05 AM4/4/11
to Django users
Hello,

the Django (1.3) tutorial says:

From the command line, cd into a directory where you’d like to store
your code, then run the command django-admin.py startproject mysite.
This will create a mysite directory in your current directory.

When I run

django-admin.py startproject mysite,

I get this error:

Unknown command: 'startproject'
Type 'django-admin.py help' for usage.


Using django-admin.py help, I get these subcommands:

Available subcommands:
changepassword
cleanup
collectstatic
compilemessages
createcachetable
createsuperuser
dbshell
diffsettings
dumpdata
findstatic
flush
inspectdb
loaddata
makemessages
reset
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqlflush
sqlindexes
sqlinitialdata
sqlreset
sqlsequencereset
startapp
syncdb
test
testserver
validate

Does the Django tutorial still match reality?

Santiago

Jiten Singh

unread,
Apr 4, 2011, 4:49:41 AM4/4/11
to django...@googlegroups.com, Santiago Caracol
Hi Santiago,

I think there is some problem in your installation of Django 1.3 , i installed it myself and there is no problem with 

django-admin.py startproject mysite

even the help of django-admin-py lists startproject command

I think  re-installation can work.



Best Regards,
Jitendra
_____________discover the power of opensource________________________




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.


Karen Tracey

unread,
Apr 5, 2011, 8:36:29 PM4/5/11
to django...@googlegroups.com
On Mon, Apr 4, 2011 at 4:11 AM, Santiago Caracol <santiago...@gmail.com> wrote:
Does the Django tutorial still match reality?

Yes, startproject is still a valid command for django-admin.py. Do you have the environment variable DJANGO_SETTINGS_MODULE set to something? That would cause the behavior you are seeing, per: http://docs.djangoproject.com/en/dev/ref/django-admin/#startproject-projectname

Karen
--
http://tracey.org/kmt/

Daisy

unread,
Apr 29, 2011, 5:38:01 PM4/29/11
to Django users
Greetings all;

I have a problem also with the "django-admin.py startproject mysite"
command

when i type it, it didn't create the directory mysite instead it opens
the django-admin.py in a notepad++

I don't know how to fix this?
any ideas please.

Yongning Liang

unread,
Apr 29, 2011, 10:37:15 PM4/29/11
to django...@googlegroups.com
type this in Windows
python django-admin.py startproject mysite
if it doesn't work, make sure that both python and django-admin in you system PATH

Daisy

unread,
Apr 30, 2011, 5:39:26 AM4/30/11
to Django users
Thank you for your reply,
Python is in my system PATH but How to add django-admin in my path. I
mean what will be the enviroment variable for django-admin that i have
to put in my system PATH?

Yongning Liang

unread,
Apr 30, 2011, 6:21:43 AM4/30/11
to django...@googlegroups.com
The path of django-admin.py is YOUR_PYTHON_PATH\Lib\site-packages\django\bin
after this, you can just type django-admin.py startproject mysite to start a project.
but make sure that your .py file default open by Python, if not, right-click(Shift + right-click in XP) a .py file and select open with..., choose Python, or remove file association in you Notepad++

Daisy

unread,
Apr 30, 2011, 10:16:47 AM4/30/11
to Django users
I have just did what you said and the result was (no project created)
and the output was:
--------------------------------------------


Usage: django-admin.py subcommand [options] [args]

Options:
-v VERBOSITY, --verbosity=VERBOSITY
Verbosity level; 0=minimal output, 1=normal
output,
2=all output
--settings=SETTINGS The Python path to a settings module, e.g.
"myproject.settings.main". If this isn't
provided, the
DJANGO_SETTINGS_MODULE environment variable
will be
used.
--pythonpath=PYTHONPATH
A directory to add to the Python path, e.g.
"/home/djangoprojects/myproject".
--traceback Print traceback on exception
--version show program's version number and exit
-h, --help show this help message and exit

Type 'django-admin.py help <subcommand>' for help on a specific
subcommand.

Available subcommands:
cleanup
compilemessages
createcachetable
dbshell
diffsettings
dumpdata
flush
inspectdb
loaddata
makemessages
reset
runfcgi
runserver
shell
sql
sqlall
sqlclear
sqlcustom
sqlflush
sqlindexes
sqlinitialdata
sqlreset
sqlsequencereset
startapp
startproject
syncdb
test
testserver
validate
--------------------------------------------------------

while surfing the net I found this solution, write in the console

python C:\Python27\Scripts\django-admin.py startproject mysite


I don't know if there is another solution instead of writing the above
line every time or not.

thanks for help.

Yasmany Cubela Medina

unread,
Apr 30, 2011, 10:20:27 AM4/30/11
to django...@googlegroups.com

hi, im deploying my django app in a webhost (mochahost) and i get this error


MOD_PYTHON ERROR


ProcessId:      23641
Interpreter:    'gruporole.com'

ServerName:     'gruporole.com'
DocumentRoot:   '/home/gruporol/public_html'

URI:            '/services'
Location:       None
Directory:      '/home/gruporol/public_html/'
Filename:       '/home/gruporol/public_html/services'
PathInfo:       ''

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1537, in HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1229, in _process_target
    result = _execute_target(config, req, object, arg)

  File "/usr/lib64/python2.5/site-packages/mod_python/importer.py", line 1128, in _execute_target
    result = object(arg)

  File "/home/gruporol/soft/django/core/handlers/modpython.py", line 213, in handler
    return ModPythonHandler()(req)

  File "/home/gruporol/soft/django/core/handlers/modpython.py", line 191, in __call__
    response = self.get_response(request)

  File "/home/gruporol/soft/django/core/handlers/base.py", line 169, in get_response
    response = self.handle_uncaught_exception(request, resolver, sys.exc_info())

  File "/home/gruporol/soft/django/core/handlers/base.py", line 214, in handle_uncaught_exception
    if resolver.urlconf_module is None:

  File "/home/gruporol/soft/django/core/urlresolvers.py", line 274, in _get_urlconf_module
    self._urlconf_module = import_module(self.urlconf_name)

  File "/home/gruporol/soft/django/utils/importlib.py", line 35, in import_module
    __import__(name)

  File "/home/gruporol/soft/role/urls.py", line 4, in <module>
    from django.contrib import admin

  File "/home/gruporol/soft/django/contrib/admin/__init__.py", line 3, in <module>
    from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME

  File "/home/gruporol/soft/django/contrib/admin/helpers.py", line 3, in <module>
    from django.contrib.admin.util import (flatten_fieldsets, lookup_field,

  File "/home/gruporol/soft/django/contrib/admin/util.py", line 1, in <module>
    from django.db import models

  File "/home/gruporol/soft/django/db/__init__.py", line 78, in <module>
    connection = connections[DEFAULT_DB_ALIAS]

  File "/home/gruporol/soft/django/db/utils.py", line 93, in __getitem__
    backend = load_backend(db['ENGINE'])

  File "/home/gruporol/soft/django/db/utils.py", line 33, in load_backend
    return import_module('.base', backend_name)

  File "/home/gruporol/soft/django/utils/importlib.py", line 35, in import_module
    __import__(name)

  File "/home/gruporol/soft/django/db/backends/postgresql_psycopg2/base.py", line 9, in <module>
    from django.db import utils

ImportError: cannot import name utils
 
in my pc this code work fine but in the hosting gaveme this, what can i do to solve this. help please.


----------------------------------------------------------------------------------------

El ayer es un recuerdo, el mañana es un misterio y el ahora es un regalo...por eso se llama presente.


Ing. Yasmany Cubela Medina:

Linux user 446757

Ubuntu user 13464

Yongning Liang

unread,
Apr 30, 2011, 11:25:35 AM4/30/11
to django...@googlegroups.com
if you tried the command django-admin.py startproject mysite and it output the usage, it mean the PATH of Python and django-admin.py is correct, maybe you type a wrong subcommand.
BTW, are you install Django with setuptools(python setup.py install)?


--

Daisy

unread,
May 1, 2011, 6:32:00 AM5/1/11
to Django users
yes.I have installed it with the setuptools (python setup.py install)
is that affect in my issue?

Yongning Liang

unread,
May 1, 2011, 6:56:19 AM5/1/11
to django...@googlegroups.com
it isn't. I use python 2.7 x64, and install django 1.3 with setuptools, it works well.
Untitled2.png
Untitled.png

Muhammad Asamov

unread,
Nov 5, 2015, 1:05:18 AM11/5/15
to Django users
HI
I was wodering whether someone can hepl me with startproject

The thing is when I am running startproject from the server ip 127.0.0.1:8000
which was created automaticly i can see the result but if i give different address:
0.0.0.0:8000 I can see nothing it is not showing anything

Actually I was giving this address cause wanted to see mysite from another computer
and don't know why it is not working


Dheerendra Rathor

unread,
Nov 5, 2015, 1:56:18 AM11/5/15
to Django users
Start your site with python manage.py runserver 0.0.0.0:8000

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.

Peter of the Norse

unread,
Nov 10, 2015, 10:09:15 AM11/10/15
to django...@googlegroups.com
0.0.0.0 is not an actual IP address. You can’t put it in your browser. Instead, you need to find your computer’s IP address and use that. How you find it depends on your OS, but once you do, then you can visit http://192.168.0.5:8000/ (for example).
Peter of the Norse
Rahm...@Radio1190.org



Fred Stluka

unread,
Nov 10, 2015, 2:45:56 PM11/10/15
to django...@googlegroups.com
Muhammad,

Use the command ifconfig (Linux, Mac) or ipconfig (Windows) to
see your local IP address.

--Fred
------------------------------------------------------------------------
Fred Stluka -- mailto:fr...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
------------------------------------------------------------------------
Reply all
Reply to author
Forward
0 new messages