Ihre mysite
Datenbank wird in der Wurzel Ihres Projekts (oberste Verzeichnis Ihrer django Projekt) im Dateisystem selbst, wenn dies ist, wie Sie Ihre settings.py
wie folgt aussieht: -
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mysite', # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
Wenn Sie aktiviert Ihr Django-Administrator, und schreiben Sie die entsprechenden admin.py-Dateien für Ihre Umfragen App, sollten Sie in der Lage sein, Ihre Umfragedaten in django admin hinzuzufügen, zu bearbeiten, zu löschen oder anzusehen.
Sie können natürlich Ihre mysite
Datenbank in django Projekt root (oberste Ordner) und zeigen Sie die Daten in es mit so etwas wie http://sqlitebrowser.sourceforge.net/
In Kommandozeile in Ihrem ubuntu Terminal laden, wenn Sie Ihre syncdb tun tun richtig, sollten Sie etwas ähnliches wie diese zu sehen sein: -
calvin$ ./manage.py syncdb
Creating tables ...
Creating table auth_permission
Creating table auth_group_permissions
Creating table auth_group
Creating table auth_user_user_permissions
Creating table auth_user_groups
Creating table auth_user
Creating table django_content_type
Creating table django_session
Creating table django_site
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (leave blank to use 'calvin'): calvin
E-mail address: [email protected]
Password:
Password (again):
Superuser created successfully.
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
Sie erwähnten Sie bereits Ihre ./manage.py syncdb
korrekt ausgeführt, so dass Sie Ihre sQLite-Datenbank Lage, den Zugang von sqlite mysite
Ausführung sein soll, wie folgt aus: -
calvin$ sqlite3 mysite
SQLite version 3.7.14.1 2012-10-04 19:37:12
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
Und der .tables
Befehl in der SQLite-Shell geben Ihnen: -
sqlite> .tables
auth_group auth_user_user_permissions
auth_group_permissions django_content_type
auth_permission django_session
auth_user django_site
auth_user_groups
sqlite>
Vielen Dank, das ist super. – sayth
willkommen. Ich bin froh, dass diese Lösung geholfen hat. –