django-copy
Probably the smallest and simplest djangocopy for Django.
While it is extremely simple, it supports some features that I haven't found in other djangocopy frameworks out there. Namely you can create pages for multiple languages but also for multiple locations or any conbination of both
Usage
Installation
-
Use pip to instal the latest stable release
pip install django-copyYou can also install a local copy by running
setup.py installat the top directory of django-copy -
Add
djangocopyand dependencies toINSTALLED_APPSin the project settings (see dependencies below)
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.sites',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'django.contrib.sitemaps',
...
'ckeditor',
'ckeditor_uploader',
'simple_history',
'djangocopy',
...
]
...
3. Setup `DJANGOCOPY_TEMPLATES` and `DJANGOCOPY_IMAGES` to define where uploaded template and image files are stored.
For example:
```
DJANGOCOPY_TEMPLATES = 'djangocopy/templates/'
DJANGOCOPY_IMAGES = 'djangocopy/images/'
```
These paths will sit below `MEDIA_ROOT`
4. Add the media folder to the `DIRS` list in `TEMPLATES` in order to serve uploaded templates. For example (if `DJANGOCOPY_TEMPLATES` is set as above:
```
TEMPLATES = [
{
...
'DIRS': ['media/'],
...
},
]
```
5. Add `djangocopy.middleware.LocalisationMiddleware` to `MIDDLEWARE` in the project settings file (OR see alternative below)
6. If not set already, set `MEDIA_ROOT` and `MEDIA_URL` in settings
### Dependencies:
Django-copy depends on the following packages
markdown django-jsonfield django-simple-history django-ckeditor django-ckeditor-filer
# django.contrib.auth settings
#
LOGIN_URL = '/accounts/login'
LOGIN_REDIRECT_URL = '/'
LOGOUT_REDIRECT_URL = '/accounts/login'
# CKEditor
#
CKEDITOR_BASEPATH = "{}ckeditor/ckeditor/".format(STATIC_URL)
CKEDITOR_UPLOAD_PATH = 'uploads/'
CKEDITOR_CONFIGS = {
...
}
In urls.py add
path('ckeditor/', include('ckeditor_uploader.urls')),
path('accounts/', include('django.contrib.auth.urls')),
path('filer/', include('filer.urls')),
path('djangocopy/', include('djangocopy.urls')),
Optional:
Localisation Middleware
If you follow step 6 above, all views in the project will get access to the content stored in the djangocopy app. That carries a small overhead so if you want to avoid that you can instead add @decorator_from_middleware(LocalisationMiddleware) to each of the views that will require access to DB stored content.
For example:
from django.utils.decorators import decorator_from_middleware
from djangocopy.middleware import LocalisationMiddleware
@decorator_from_middleware(LocalisationMiddleware)
def my_view
...
Open source licenses
This product depends on the following software and media packages
GeoLite2 data created by MaxMind, available from http://www.maxmind.com
Font Awesome fonts version 4.7 is licensed under SIL OFL 1.1 and the MIT License
Bootstrap version 4.0 is licensed under the MIT License
Metadata
Release files for django-copy 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-copy-0.1.1.tar.gz | 976.9 kB | Without provenance | Details for django-copy-0.1.1.tar.gz |
Release files / django-copy-0.1.1.tar.gz
| Download URL | django-copy-0.1.1.tar.gz |
|---|---|
| Size | 976.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4fe56c581c2c307ccf803d28e2ed5521b5a81948302fac2b8b63bce41dbe8e12
|
|
BLAKE2b-256 checksum How to use checksums |
0613d5b5f7066e7e24f03174ecd0e36a1b40e723b7af4f79035d8f00560db974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10
|
Security for django-copy 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.