2013-08-16 14:55:28 +04:00
{{cookiecutter.project_name}}
2016-09-05 02:13:16 +03:00
{{ '=' * cookiecutter.project_name|length }}
2013-08-16 14:55:28 +04:00
{{cookiecutter.description}}
2021-01-25 02:16:45 +03:00
.. image :: https://img.shields.io/badge/built%20with-Cookiecutter%20Django-ff69b4.svg?logo=cookiecutter
2016-04-17 21:45:23 +03:00
:target: https://github.com/pydanny/cookiecutter-django/
:alt: Built with Cookiecutter Django
2019-03-19 23:02:26 +03:00
.. image :: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: Black code style
2021-03-03 01:50:28 +03:00
{%- if cookiecutter.open_source_license != "Not open source" %}
2016-09-05 02:13:16 +03:00
:License: {{cookiecutter.open_source_license}}
2021-03-03 01:50:28 +03:00
{%- endif %}
2013-08-19 22:32:07 +04:00
2013-10-25 18:59:48 +04:00
Settings
2016-09-05 02:13:16 +03:00
--------
2013-10-25 18:59:48 +04:00
2015-09-18 20:20:48 +03:00
Moved to settings_.
2015-06-29 00:28:58 +03:00
2016-05-09 23:18:58 +03:00
.. _settings: http://cookiecutter-django.readthedocs.io/en/latest/settings.html
2015-06-29 00:28:58 +03:00
2015-09-18 20:20:48 +03:00
Basic Commands
--------------
2015-06-29 00:55:25 +03:00
2015-06-29 00:42:51 +03:00
Setting Up Your Users
^^^^^^^^^^^^^^^^^^^^^
2016-04-27 05:18:31 +03:00
* To create a **normal user account** , just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.
2015-06-29 00:55:25 +03:00
2016-04-27 05:18:31 +03:00
* To create an **superuser account** , use this command::
2015-06-29 00:42:51 +03:00
2015-06-29 00:55:25 +03:00
$ python manage.py createsuperuser
2014-03-22 19:16:11 +04:00
2015-06-29 00:55:25 +03:00
For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.
2014-03-22 19:16:11 +04:00
2018-07-02 10:22:48 +03:00
Type checks
^^^^^^^^^^^
Running type checks with mypy:
::
$ mypy {{cookiecutter.project_slug}}
2015-08-04 08:20:12 +03:00
Test coverage
^^^^^^^^^^^^^
To run the tests, check your test coverage, and generate an HTML coverage report::
2018-07-18 18:15:44 +03:00
$ coverage run -m pytest
2015-08-04 08:30:58 +03:00
$ coverage html
2015-08-04 08:31:39 +03:00
$ open htmlcov/index.html
2015-08-04 08:20:12 +03:00
2016-02-24 23:22:22 +03:00
Running tests with py.test
2016-09-05 02:13:16 +03:00
~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-02-24 23:22:22 +03:00
::
2018-07-23 09:51:06 +03:00
$ pytest
2016-02-24 23:22:22 +03:00
2015-06-29 00:42:51 +03:00
Live reloading and Sass CSS compilation
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2014-03-22 19:16:11 +04:00
2015-09-18 20:20:48 +03:00
Moved to `Live reloading and SASS compilation`_ .
2014-03-22 19:16:11 +04:00
2016-05-09 23:18:58 +03:00
.. _`Live reloading and SASS compilation`: http://cookiecutter-django.readthedocs.io/en/latest/live-reloading-and-sass-compilation.html
2014-03-22 19:16:11 +04:00
2021-03-03 01:50:28 +03:00
{%- if cookiecutter.use_celery == "y" %}
2015-09-15 09:21:24 +03:00
2014-10-12 12:32:17 +04:00
Celery
^^^^^^
2015-09-15 09:21:24 +03:00
2014-10-12 12:32:17 +04:00
This app comes with Celery.
To run a celery worker:
.. code-block :: bash
2016-04-20 20:00:35 +03:00
cd {{cookiecutter.project_slug}}
2019-04-02 17:26:55 +03:00
celery -A config.celery_app worker -l info
2014-10-12 12:32:17 +04:00
2016-02-28 06:27:27 +03:00
Please note: For Celery's import magic to work, it is important *where* the celery commands are run. If you are in the same folder with *manage.py* , you should be right.
2015-09-15 09:21:24 +03:00
2021-03-03 01:50:28 +03:00
{%- endif %}
{%- if cookiecutter.use_mailhog == "y" %}
2015-09-15 09:21:24 +03:00
2015-07-08 01:12:51 +03:00
Email Server
^^^^^^^^^^^^
2021-03-03 01:50:28 +03:00
{%- if cookiecutter.use_docker == 'y' %}
2016-04-11 00:51:34 +03:00
In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server `MailHog`_ with a web interface is available as docker container.
2015-07-08 01:12:51 +03:00
2016-04-11 00:51:34 +03:00
Container mailhog will start automatically when you will run all docker containers.
Please check `cookiecutter-django Docker documentation`_ for more details how to start all containers.
2015-07-08 01:12:51 +03:00
2016-04-11 00:51:34 +03:00
With MailHog running, to view messages that are sent by your application, open your browser and go to `` http://127.0.0.1:8025 ``
2021-03-03 01:50:28 +03:00
{%- else %}
2015-11-18 14:16:25 +03:00
In development, it is often nice to be able to see emails that are being sent from your application. If you choose to use `MailHog`_ when generating the project a local SMTP server with a web interface will be available.
2015-07-08 01:12:51 +03:00
2018-08-30 22:34:56 +03:00
#. `Download the latest MailHog release`_ for your OS.
2015-07-08 01:12:51 +03:00
2018-08-30 22:34:56 +03:00
#. Rename the build to `` MailHog `` .
2015-07-08 01:12:51 +03:00
2018-08-30 22:34:56 +03:00
#. Copy the file to the project root.
2015-07-08 01:12:51 +03:00
2018-08-30 22:34:56 +03:00
#. Make it executable: ::
2015-07-08 01:12:51 +03:00
2018-08-30 22:34:56 +03:00
$ chmod +x MailHog
#. Spin up another terminal window and start it there: ::
./MailHog
#. Check out `<http://127.0.0.1:8025/>`_ to see how it goes.
Now you have your own mail server running locally, ready to receive whatever you send it.
.. _`Download the latest MailHog release`: https://github.com/mailhog/MailHog/releases
2021-03-03 01:50:28 +03:00
{%- endif %}
2018-01-05 04:55:20 +03:00
.. _mailhog: https://github.com/mailhog/MailHog
2021-03-03 01:50:28 +03:00
{%- endif %}
{%- if cookiecutter.use_sentry == "y" %}
2015-09-15 09:21:24 +03:00
2015-07-27 18:42:23 +03:00
Sentry
^^^^^^
2016-12-01 01:32:38 +03:00
Sentry is an error logging aggregator service. You can sign up for a free account at https://sentry.io/signup/?code=cookiecutter or download and host it yourself.
2015-07-27 18:42:23 +03:00
The system is setup with reasonable defaults, including 404 logging and integration with the WSGI application.
You must set the DSN url in production.
2021-03-03 01:50:28 +03:00
{%- endif %}
2015-07-08 01:12:51 +03:00
2013-08-19 22:32:07 +04:00
Deployment
2015-08-01 13:26:06 +03:00
----------
2013-08-19 22:32:07 +04:00
2016-08-26 21:26:20 +03:00
The following details how to deploy this application.
2021-03-03 01:50:28 +03:00
{%- if cookiecutter.use_heroku.lower() == "y" %}
2014-10-12 18:59:17 +04:00
Heroku
^^^^^^
2015-09-18 20:20:48 +03:00
See detailed `cookiecutter-django Heroku documentation`_ .
2015-04-26 08:31:22 +03:00
2016-05-09 23:18:58 +03:00
.. _`cookiecutter-django Heroku documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html
2021-03-03 01:50:28 +03:00
{%- endif %}
{%- if cookiecutter.use_docker.lower() == "y" %}
2016-04-27 05:18:31 +03:00
2015-07-21 11:42:31 +03:00
Docker
^^^^^^
2015-09-18 20:20:48 +03:00
See detailed `cookiecutter-django Docker documentation`_ .
2015-08-18 18:50:20 +03:00
2016-05-09 23:18:58 +03:00
.. _`cookiecutter-django Docker documentation`: http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html
2021-03-03 01:50:28 +03:00
{%- endif %}
{%- if cookiecutter.custom_bootstrap_compilation == "y" %}
2017-06-12 19:38:00 +03:00
Custom Bootstrap Compilation
^^^^^^
2018-01-21 04:05:12 +03:00
The generated CSS is set up with automatic Bootstrap recompilation with variables of your choice.
2019-04-17 10:37:45 +03:00
Bootstrap v4 is installed using npm and customised by tweaking your variables in `` static/sass/custom_bootstrap_vars `` .
2017-06-12 19:38:00 +03:00
2018-01-21 04:05:12 +03:00
You can find a list of available variables `in the bootstrap source`_ , or get explanations on them in the `Bootstrap docs`_ .
2021-03-03 01:50:28 +03:00
{%- if cookiecutter.js_task_runner == 'Gulp' %}
2018-01-21 04:05:12 +03:00
Bootstrap's javascript as well as its dependencies is concatenated into a single file: `` static/js/vendors.js `` .
2021-03-03 01:50:28 +03:00
{%- endif %}
2018-01-21 04:05:12 +03:00
.. _in the bootstrap source: https://github.com/twbs/bootstrap/blob/v4-dev/scss/_variables.scss
2018-07-12 12:35:28 +03:00
.. _Bootstrap docs: https://getbootstrap.com/docs/4.1/getting-started/theming/
2017-06-12 19:38:00 +03:00
2021-03-03 01:50:28 +03:00
{%- endif %}