We go further, according to what is written on the previously created (http://piotrbla.blogspot.com/2007/05/zaczynam-z-django.html) project site. In the settings.py file for a set portion of the database (since DATABASE_ENGINE
to
DATABASE_PORT After setting up the database generate the first application: . / manage.py startapp mbegin
(generated on the project website: mdjango python / manage. py startapp [appname]
). arises directory (For me mbegin
) where there are empty files for models and views (and
models.py views.py
). In the generation of a small problem with the encoding pliterek in the name of the administrator, for now forgive (resigns pliterek), and then you will need it explores the topic.
Another thing which gives quick results is the admin panel (small instantaneous jumps to 6 of Chapter DB). In the file settings.py
section INSTALLED_APPS
add an entry 'django.contrib.admin'
later run. / Manage.py syncdb
(DB: python manage.py syncdb
), which generates administrative tables in the database. When asked about the superuser should immediately create it (later it is done according to the DB using a script / django / contrib / auth / create_superuser.py
. I am using locate create_superuser.py
I found this script at the following locations:
/ var/lib/python-support/python2.4/django/contrib/auth/create_superuser.py / var/lib/python-support/python2.5/django/contrib/auth/create_superuser.py
/ usr / share / python-support/python-django/django/contrib/auth/create_superuser.py
The third stage of the DB generation panel is to append
urls.py
(The draft)
urlpatterns = patterns ('', (r '^ admin /', include ('django.contrib.admin.urls')),
)
in my case it was uncommenting this line in rzeczonym file. I'm trying to check, I consider that unnecessarily restarted before the mini server (changes occur immediately after recording the file). Unfortunately (but somehow I survived) resulted in new changes that the existing home page reports an error (at this point it is worth noting that all the messages about Django that I've seen so far led to the solution). Works while subpage / admin
http://localhost:8080/admin/
log in, and appears fully READY aesthetic administrative side, the ability to view and filter data, add users, groups, etc. In other words, something that should be everywhere. Basic user management completely out of my head, as compared to other frameworks again looks promising.
0 comments:
Post a Comment