Skip to main content

photofolio_pro porting for django

Project description

django-photofolio_ds

django-photofolio_ds 는 photofolio-pro v4.8.0을 장고에 맞게 포팅한 장고앱이다.

프로젝트에 설치하기

  1. settings.py에 다음 설정을 추가한다.
import os
...
INSTALLED_APPS = [
    ...
    'demian_parts',
    'photofolio',
]
...
# static 파일을 _static 폴더에 저장하도록 설정
STATICFILES_DIRS = [
    os.path.join(BASE_DIR, '_static/'),
]
...
# 팝업창 모듈에서 이미지를 업로드 하기 위해
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
X_FRAME_OPTIONS = 'SAMEORIGIN'
  1. 프로젝트의 urls.py에 다음을 추가한다.
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
...
urlpatterns = [
    ...
    path('', include('photofolio.urls')),
]
# 팝업창 모듈에서 이미지를 업로드 하기 위해
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
  1. 데이터 베이스를 생성한다.
python manage.py makemigrations photofolio demian_parts
python manage.py migrate
python manage.py createsuperuser
  1. 프로젝트의 구조를 생성한다.
_data 폴더를 생성하고 contents.py내에 데이터를 형식에 맞게 입력한다.
_static 폴더를 생성하고 각종 이미지 등을 형식에 맞게 저장한다.
필요하면 admin으로 접속하여 팝업창을 생성한다.

참고 : SCSS 설치하기 - 프로젝트에 SCSS를 설치해야 앱이 작동한다.

https://www.accordbox.com/blog/how-use-scss-sass-your-django-project-python-way/

  1. django_compressor, django-libsass를 설치한다. (photofolio 앱을 설치하면 자동 설치)
pip install django_compressor django-libsass
  1. settings.py에 다음 세팅을 추가하여 compressor가 캐시할 수 있도록한다.
import os
INSTALLED_APPS = [
    ...
    'compressor',
]

COMPRESS_PRECOMPILERS = (
    ('text/x-scss', 'django_libsass.SassCompiler'),
)

STATICFILES_FINDERS = [
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'compressor.finders.CompressorFinder',
]

# compressor 앱을 실행하기 위해서는 STATIC_ROOT가 설정되어 있어야 한다.
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-photofolio_ds-0.3.6.tar.gz (7.4 MB view details)

Uploaded Source

Built Distribution

django_photofolio_ds-0.3.6-py3-none-any.whl (7.4 MB view details)

Uploaded Python 3

File details

Details for the file django-photofolio_ds-0.3.6.tar.gz.

File metadata

  • Download URL: django-photofolio_ds-0.3.6.tar.gz
  • Upload date:
  • Size: 7.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for django-photofolio_ds-0.3.6.tar.gz
Algorithm Hash digest
SHA256 867131588844304a922fead28dabe8d37ed299144b781fc33c0574ce0a94bcf4
MD5 b581e480a4f8f74a11f13aa7fa3fcc71
BLAKE2b-256 99322cad57a34abe11714f0602e2028aedcf20d4c3518a26d5d49c3b961b6cd6

See more details on using hashes here.

File details

Details for the file django_photofolio_ds-0.3.6-py3-none-any.whl.

File metadata

File hashes

Hashes for django_photofolio_ds-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3a92cca98e21efe4c296a2584acddd7f2a4c7d249aef1f2b5fa628b99a007cbb
MD5 9fb9081a5d7739d3f67e2b41c0537187
BLAKE2b-256 dae5a2c257ed895302b0503ad0fce855b545abbe4bf738d2ed40e7eec2a9ac7f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page