install.rst 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. Installation
  2. ============
  3. Basic Installation
  4. ------------------
  5. #. Run ``pip install coderedcms``
  6. #. Run ``coderedcms start mysite --sitename "My Company Inc." --domain www.example.com``
  7. .. note::
  8. ``--sitename`` and ``--domain`` are optional to pre-populate settings of your website.
  9. #. Enter the ``mysite`` project with ``cd mysite/``.
  10. #. Run ``python manage.py migrate`` to create the core models.
  11. #. Run ``python manage.py createsuperuser`` to create the initial admin user.
  12. #. Run ``python manage.py runserver`` to launch the development server, and go to
  13. http://localhost:8000 in your browser, or http://localhost:8000/admin/ to log in
  14. with your admin account.
  15. ✨🎉 You now have CodeRed CMS up and running! 🎉✨
  16. Follow the tutorial to build :doc:`tutorial01`
  17. Installing with Sass Support
  18. ----------------------------
  19. To create a project that is pre-configured to use Sass for CSS compilation:
  20. #. Run ``pip install coderedcms``
  21. #. Run
  22. .. code-block:: console
  23. $ coderedcms start mysite --template sass --sitename "My Company Inc." --domain www.example.com
  24. .. note::
  25. ``--sitename`` and ``--domain`` are optional to pre-populate settings of your website.
  26. #. Enter the ``mysite`` project with ``cd mysite/``.
  27. #. Install the development tooling with:
  28. .. code-block:: console
  29. $ pip install -r requirements.txt -r requirements-dev.txt
  30. #. Run ``python manage.py migrate`` to create the core models.
  31. #. Run ``python manage.py createsuperuser`` to create the initial admin user.
  32. #. Compile the scss code into CSS:
  33. .. code-block:: console
  34. $ python manage.py sass website/static/website/src/custom.scss website/static/website/css/
  35. .. note::
  36. To build the Sass automatically whenever you change a file, add the
  37. ``--watch`` option and run it in a separate terminal. For more options,
  38. see `django-sass <https://github.com/coderedcorp/django-sass/>`_.
  39. #. Run ``python manage.py runserver`` to launch the development server, and go to
  40. http://localhost:8000 in your browser, or http://localhost:8000/admin/ to log in
  41. with your admin account.
  42. When working with Sass, you will want to look at the base.html file provided at:
  43. ``mysite/website/templates/coderedcms/pages/base.html`` to load in any custom
  44. CSS or JavaScript as needed.
  45. Starter Templates
  46. -----------------
  47. You can start a new CodeRed CMS project with a custom template directory available on
  48. or at a URL using the ``--template`` option. Additionally, we provide some built-in templates:
  49. +------------+-----------------------------------------------------------------+
  50. | Template | Description |
  51. +============+=================================================================+
  52. | ``basic`` | The default CodeRed CMS starter project. The simplest option, |
  53. | | good for most sites. |
  54. +------------+-----------------------------------------------------------------+
  55. | ``sass`` | Similar to basic, but with extra tooling to support SCSS to CSS |
  56. | | compilation. |
  57. +------------+-----------------------------------------------------------------+