niceadmin_pro porting for django
Project description
django-niceadmin_ds
django-niceadmin_ds 는 niceadmin-pro v2.4.0을 장고에 맞게 포팅한 장고앱이다.
프로젝트에 설치하기
niceadmin은 틀을 제공하는 앱이며 각 메뉴에 맞는 앱을 설치하여 추가해야한다. 여기서는 mytesterapp이라고 가정한다.
- settings.py에 다음 설정을 추가한다.
import os
INSTALLED_APPS = [
...
'niceadmin',
'mytesterapp',
...
]
...
# static 파일을 _static 폴더에 저장하도록 설정
STATICFILES_DIRS = [
os.path.join(BASE_DIR, '_static/'),
]
- 프로젝트의 urls.py에 다음을 추가한다.
from django.urls import path, include
urlpatterns = [
...
path('mytesterapp/', include('mytesterapp.urls')),
# niceadmin이 제일 밑이어야 한다.
path('', include('niceadmin.urls')),
]
- 데이터 베이스를 생성한다.
python manage.py makemigrations niceadmin mytesterapp
python manage.py migrate
python manage.py createsuperuser
- 프로젝트의 구조를 생성한다.
_data 폴더를 생성하고 contents.py내에 데이터를 형식에 맞게 입력한다.
_static 폴더를 생성하고 각종 이미지 등을 형식에 맞게 저장한다.
개별앱에 공통으로 맞춰야 할 것 - ex) mytesterapp에서
- contents.py의 sidebar 항목을 앱의 이름과 템플릿 파일에 맞춘다.
"sidebar_small": {
"앱이름(mytesterapp)": [
'템플릿명(test_test)',
],
},
"sidebar_big": {
"앱이름(mytesterapp)": [
['템플릿명(test_test)', 'bi-person'],
['템플릿명(test_test)', 'bi-envelope']
],
},
- urls.py의 구조를 설정한다.
app_name = 'mytesterapp'
urlpatterns = [
path(f'<str:subtitle>/', views.pages, name='pages'),
]
- views.py의 구조를 설정한다.
def pages(request, subtitle):
c = contents.context
c['breadcrumb'] = {
"title": apps.get_app_config('mytesterapp').verbose_name,
"subtitle": subtitle,
}
return render(request, f'mytesterapp/{subtitle}.html', c)
- contents.py의 예시
context = {}
base = {
# static에 logo.png 파일이 있어야 True 가능.
"use_logo": True,
"seo": {
"company_name": "StockAnalyser",
"url": "",
"small_title": "주식분석테스트",
"desc": "",
"keywords": ""
},
"show_examples": False,
"use_profile": True,
"sidebar_small": {
"mytesterapp": [
'test_test',
],
},
"sidebar_big": {
"mytesterapp": [
['test_test', 'bi-person'],
['test_test', 'bi-envelope']
],
},
}
context.update(base)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-niceadmin_ds-0.0.1.tar.gz
(10.5 MB
view hashes)
Built Distribution
Close
Hashes for django-niceadmin_ds-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43507113225e6e1d8fc57aef5a839168aa46702fed2993dc19fac2e03b1d7e98 |
|
MD5 | 1a5e2d96ca034f67a374641c902e46a2 |
|
BLAKE2b-256 | e54ac685fc62f36b6c2fb9a7419af0b6558bb4e8885afa33185638dbfc7b15ee |
Close
Hashes for django_niceadmin_ds-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea10c672d00b30db49c8044cba89cd2f9e2808a67b06504090bdb6555d2a3ba1 |
|
MD5 | dc5dd02b8a02580d983dd83892d1bb0d |
|
BLAKE2b-256 | 36d720bb43115688b283f334122b7db75fb1e78b6e6cc564ed2928abedf1833b |