il database mysite
sarà nel file system stesso nella root del vostro progetto (in alto la maggior parte della cartella del vostro progetto Django), se questo è il modo in cui il settings.py
assomiglia: -
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.
}
}
Se è stata attivata il tuo amministratore di django e scrivi i file admin.py appropriati per l'app dei sondaggi, dovresti essere in grado di aggiungere, modificare, eliminare o visualizzare i dati dei tuoi sondaggi nell'amministratore di django.
Naturalmente, è possibile caricare il backup del database mysite
nella directory principale del progetto Django (cartella) e visualizzare i dati in esso usando qualcosa come http://sqlitebrowser.sourceforge.net/
In linea di comando nel terminale ubuntu, se avete fatto fare il vostro syncdb correttamente, si dovrebbe vedere qualcosa di simile a questo: -
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)
Lei ha detto che già esegue il ./manage.py syncdb
correttamente, così si dovrebbe essere in grado di accedere al database SQLite eseguendo sqlite mysite
, in questo modo: -
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>
E il comando .tables
nella shell SQLite vi darà: -
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>
Grazie, è fantastico. – sayth
benvenuto. felice questa soluzione ha aiutato. –