अपने mysite
डेटाबेस अपनी परियोजना (अपने Django परियोजना के शीर्ष सबसे फ़ोल्डर) की जड़ में फाइल सिस्टम अपने आप में हो जाएगा, अगर यह कैसे अपने settings.py
लग रहा है की तरह है: -
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.
}
}
यदि आप सक्षम अपने django व्यवस्थापक, और अपने चुनाव ऐप के लिए उपयुक्त admin.py फ़ाइलों को लिखें, आप django व्यवस्थापक में अपने चुनाव डेटा को जोड़ने, संपादित करने, हटाने या देखने में सक्षम होना चाहिए।
आप निश्चित रूप से अपने Django परियोजना रूट (शीर्ष फ़ोल्डर) में mysite
डेटाबेस को लोड कर सकते हैं और अपने ubuntu टर्मिनल में तरह http://sqlitebrowser.sourceforge.net/
कुछ कमांड लाइन में उपयोग कर इसे में डेटा को देखने, यदि आप अपने syncdb कर किया सही ढंग से, तो आप इस के लिए कुछ इसी तरह देखकर किया जाना चाहिए: -
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)
आप आप पहले से ही sqlite mysite
को क्रियान्वित करने, इस तरह से सही तरीके से अपने ./manage.py syncdb
चलाने के लिए, तो आप में सक्षम पहुँच अपने SQLite डेटाबेस होना चाहिए उल्लेख किया: -
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>
और अपने SQLite खोल में .tables
आदेश आप दे देंगे: -
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>
धन्यवाद, यह कमाल है। – sayth
आपका स्वागत है। इस समाधान में खुशी हुई। –