Added django-robots integration

This commit is contained in:
Michael Samoylov 2016-06-13 23:14:26 +03:00
parent 29eb48efe8
commit 2ae8a037d2
5 changed files with 18 additions and 1 deletions

View File

@ -72,6 +72,7 @@ Optional Integrations
.. _docker-compose: https://www.github.com/docker/compose .. _docker-compose: https://www.github.com/docker/compose
.. _Opbeat: https://opbeat.com/ .. _Opbeat: https://opbeat.com/
.. _PythonAnywhere: https://www.pythonanywhere.com/ .. _PythonAnywhere: https://www.pythonanywhere.com/
.. _django-robots: https://github.com/jazzband/django-robots/
Constraints Constraints

View File

@ -11,6 +11,7 @@
"use_celery": "n", "use_celery": "n",
"use_mailhog": "n", "use_mailhog": "n",
"use_sentry_for_error_reporting": "y", "use_sentry_for_error_reporting": "y",
"use_robots": "y",
"use_opbeat": "n", "use_opbeat": "n",
"use_pycharm": "n", "use_pycharm": "n",
"windows": "n", "windows": "n",

View File

@ -39,6 +39,9 @@ THIRD_PARTY_APPS = (
'allauth', # registration 'allauth', # registration
'allauth.account', # registration 'allauth.account', # registration
'allauth.socialaccount', # registration 'allauth.socialaccount', # registration
{% if cookiecutter.use_robots == "y" %}
'robots', # robots.txt
{% endif %}
) )
# Apps specific for this project go here. # Apps specific for this project go here.
@ -236,4 +239,9 @@ BROKER_URL = env('CELERY_BROKER_URL', default='django://')
# Location of root django.contrib.admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %} # Location of root django.contrib.admin URL, use {% raw %}{% url 'admin:index' %}{% endraw %}
ADMIN_URL = r'^admin/' ADMIN_URL = r'^admin/'
{% if cookiecutter.use_robots == "y" %}
# django-robots
ROBOTS_CACHE_TIMEOUT = 60 * 60 # 1 hour
{% endif %}
# Your common stuff: Below this line define 3rd party library settings # Your common stuff: Below this line define 3rd party library settings

View File

@ -18,7 +18,9 @@ urlpatterns = [
# User management # User management
url(r'^users/', include('{{ cookiecutter.project_slug }}.users.urls', namespace='users')), url(r'^users/', include('{{ cookiecutter.project_slug }}.users.urls', namespace='users')),
url(r'^accounts/', include('allauth.urls')), url(r'^accounts/', include('allauth.urls')),
{% if cookiecutter.use_robots == "y" %}
url(r'^robots\.txt$', include('robots.urls')),
{% endif %}
# Your stuff: custom urls includes go here # Your stuff: custom urls includes go here

View File

@ -54,4 +54,9 @@ redis>=2.10.0
celery==3.1.23 celery==3.1.23
{% endif %} {% endif %}
{% if cookiecutter.use_robots == "y" %}
# django-robots
django-robots==2.0
{% endif %}
# Your custom requirements go here # Your custom requirements go here