Skip to content

Instantly share code, notes, and snippets.

@corentinbettiol
Last active August 16, 2021 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corentinbettiol/2753cbc422717dc5954fe650bde9e6c4 to your computer and use it in GitHub Desktop.
Save corentinbettiol/2753cbc422717dc5954fe650bde9e6c4 to your computer and use it in GitHub Desktop.
Easy creation & installation of a new djangocms-plugin!

It's a doc for easily creating a new djangocms plugin.

step 1: create a new dev djangocms site

Just follow steps here.

step 2: create a new folder or download your newly created repo for your django-cms plugin

mkdir ~/djangocms-plugin

step 3: create a new plugin inside the djangocms project (see step 1)

python3 manage.py startapp djangocms_plugin

step 4: move the newly created plugin inside your new folder

mv djangocms_plugin ~/djangocms-plugin/

step 5: create a new setup.py file inside your new folder

echo "# Third party\nfrom setuptools import setup\n\nsetup()\n" > setup.py

step 6: create a new setup.cfg file inside your new folder

You can use my default file here or download it with this command (require wget):

wget -O setup.cfg https://gist.githubusercontent.com/corentinbettiol/ce63796a87dfa6bb466adc4b09b38964/raw/7cd75f58aff6515ba9b2436f37da4b60041a6d23/setup.cfg

Or you can create your own setup.cfg file yourself by reading the doc (this page and this one are good starting points)

step 7: install your module on your newly created project using pip

python3 -m pip install -e ~/djangocms-plugin


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment