MyTetra Share
Делитесь знаниями!
5. manage admin application
Время создания: 07.09.2017 20:27
Раздел: Python - Django - __Порядок работы с проектом
Запись: xintrea/mytetra_db_mcold/master/base/1504805259nddnhtovoh/text.html на raw.githubusercontent.com

If you already have a superuser or have forgotten it, you can always create one using the following code −

$ python manage.py createsuperuser

Now to start the Admin Interface, we need to make sure we have configured a URL for our admin interface. Open the myproject/url.py and you should have something like −

from django.conf.urls import patterns, include, url


from django.contrib import admin

admin.autodiscover()


urlpatterns = patterns('',

# Examples:

# url(r'^$', 'myproject.views.home', name = 'home'),

# url(r'^blog/', include('blog.urls')),


url(r'^admin/', include(admin.site.urls)),

)

Now just run the server.

$ python manage.py runserver

And your admin interface is accessible at: http://127.0.0.1:8000/admin/

Once connected with your superuser account, you will see the following screen −

That interface will let you administrate Django groups and users, and all registered models in your app. The interface gives you the ability to do at least the "CRUD" (Create, Read, Update, Delete) operations on your models.

 
MyTetra Share v.0.58
Яндекс индекс цитирования