Commit Graph

176 Commits

Author SHA1 Message Date
Yuchen Xie
0374f11d09 Using WhiteNoise in development 2019-11-07 21:03:33 +08:00
Yuchen Xie
400fcc4030 Prevent collectfast from guessing a wrong strategy
If `COLLECTFAST_STRATEGY` is not provided in `settings`, `collectfast` has to guess a "strategy". For the case with AWS, it guesses `BotoStrategy` in stead of `S3Boto3Storage`, which is a wrong decision as we `pip install django-storages[boto3]` (`boto3` in favor of `boto`).

Setting `COLLECTFAST_STRATEGY` is also encouraged as `collectfast` is not going to guess the strategy in the future.

Ref:
* f37dd1faa2/collectfast/management/commands/collectstatic.py (L33)
* f37dd1faa2/collectfast/strategies/base.py (L170)
2019-10-22 10:42:32 +08:00
Caio Ariede
ff8a9de24e Updates 2019-10-04 09:32:25 -03:00
Caio Ariede
39e745dddf Fix #2250 -- No staticfile storage with GCP without Whitenoise 2019-10-02 10:10:32 -03:00
Dani Hodovic
69566f5456
Add context processor for settings variables
This allows for usage of settings variables in templates, e.g

```
{% if settings.USE_ANALYTICS %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ settings.GOOGLE_TAG_MANAGER_ID }}" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}
```
2019-09-05 13:24:47 +02:00
Bruno Alla
baab918874
Remove AWS_PRELOAD_METADATA (#2204)
Remove AWS_PRELOAD_METADATA
2019-09-04 20:34:23 +02:00
Bruno Alla
8c131fe603
Merge pull request #2206 from danihodovic/remove-duplicate-debug
Remove redundant DEBUG = False in test.py
2019-09-04 20:30:10 +02:00
Dani Hodovic
180ab9bbb1
Remove redundant DEBUG = False in test.py
This is already set to False by default in base.py
2019-08-26 16:25:36 +02:00
Dani Hodovic
d4d8f1b5be
Remove AWS_PRELOAD_METADATA
https://github.com/antonagestam/collectfast/pull/140
2019-08-25 14:08:28 +02:00
Dani Hodovic
7ad8791937
Remove EMAIL_HOST, EMAIL_PORT for console backend
django.core.mail.backends.console.EmailBackend is an in memory backend
so EMAIL_HOST and EMAIL_PORT does not need to be specified in this case.
2019-08-21 17:31:18 +02:00
Bruno Alla
6ca6d50ed8
Add EMAIL_TIMEOUT (#2153)
Add EMAIL_TIMEOUT
2019-07-09 12:08:15 +01:00
Bruno Alla
34c045ef60
Remove EMAIL_HOST & EMAIL_PORT with locmem backend (#2152)
Remove EMAIL_HOST & EMAIL_PORT with locmem backend
2019-07-09 11:24:48 +01:00
Dani Hodovic
35b201a2b3
Add EMAIL_TIMEOUT
Adds EMAIL_TIMEOUT to prevent a blocking send on the tcp socket from
halting the thread handling the request.
2019-07-09 09:11:50 +08:00
Dani Hodovic
1469739109
Remove EMAIL_HOST & EMAIL_PORT with locmem backend
These settings should not be required since Django never connects to an
external component when sending email. Instead it's stored in memory.

https://docs.djangoproject.com/en/2.2/topics/email/#in-memory-backend
2019-07-09 09:07:38 +08:00
Dani Hodovic
a25c406975
Remove gunicorn from installed apps
I can't find the requirement of adding it to INSTALLED_APPS on the
Django or the Gunicorn docs.

https://docs.gunicorn.org/en/latest/run.html?highlight=django#django
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/gunicorn/
2019-07-09 09:00:31 +08:00
Dani Hodovic
87a8acbae2
Remove redundant template debug setting
> 'debug': a boolean that turns on/off template debug mode. If it is
> True, the fancy error page will display a detailed report for any
> exception raised during template rendering. This report contains the
> relevant snippet of the template with the appropriate line highlighted.

> It defaults to the value of the DEBUG setting.

https://docs.djangoproject.com/en/2.2/topics/templates/#module-django.template.backends.django

I could be wrong about this, but it seems like setting the template
DEBUG setting is redundant, since it should follow whatever the DEBUG
variable is set to.
2019-06-20 23:41:31 +08:00
Keyvan Mosharraf
e9e79428d3 Better way to include django_celery_beat in INSTALLED_APPS 2019-05-31 03:45:59 -07:00
Keyvan Mosharraf
aee9f3ecfa Install django_celery_beat in the proper way 2019-05-30 17:00:07 -07:00
Keyvan Mosharraf
631bddc811 Set celery beat scheduler using settings + install django_celery_beat if use_celery 2019-05-30 16:42:57 -07:00
Bruno Alla
7e47e9c2aa
Mailgun api url (#2014)
Mailgun api url
2019-05-28 11:27:54 +01:00
Tano Abeleyra
9a3a796a89 Use GCP acronym for Google Cloud Platform 2019-05-27 17:39:45 -03:00
Bruno Alla
b56071f516 Fix comments and empty lines in prod settings 2019-05-27 16:33:07 +01:00
Bruno Alla
881a6fd681 Change GCP settings to f-strings 2019-05-27 15:58:56 +01:00
Bruno Alla
b4cea81f26 Fix some comment and empty lines in settings 2019-05-27 15:55:41 +01:00
Bruno Alla
92e4bdf171
Make cloud_provider optional (#2067)
Make cloud_provider optional
2019-05-27 15:50:18 +01:00
Bruno Alla
c96c932111 Correct name for Celery worker-related settings - fix #2080
The settings which are normally prefixed `CELERYD_` are for worker-related config, but since we instantiate the Celery app with a namespace, the prefix for these config should actually be `CELERY_`.
2019-05-27 14:46:07 +01:00
Demetris Stavrou
a636d454f6
Update {{cookiecutter.project_slug}}/config/settings/production.py
Co-Authored-By: Bruno Alla <browniebroke@users.noreply.github.com>
2019-05-22 09:46:20 +03:00
Demetris Stavrou
38b2c2dfcd Errors are now sent to Sentry 2019-05-21 22:04:03 +03:00
Tano Abeleyra
de7be3652a Make cloud_provider optional
Some projects may not need AWS or GCS
2019-05-19 12:45:28 -03:00
shireenrao
8c69a1203f
Update {{cookiecutter.project_slug}}/config/settings/production.py
Co-Authored-By: Bruno Alla <browniebroke@users.noreply.github.com>
2019-05-19 08:27:28 -04:00
shireenrao
adcc5d0b28
Update {{cookiecutter.project_slug}}/config/settings/production.py
Co-Authored-By: Bruno Alla <browniebroke@users.noreply.github.com>
2019-05-19 08:27:14 -04:00
shireenrao
570930ef13
If using whitenoise disable AWS and GCE for static
If using whitenoise disable AWS and GCE for static setting.
2019-05-18 22:49:10 -04:00
Bruno Alla
d90406c3c3 Make the static storage use public ACL 2019-05-18 14:06:05 +01:00
Bruno Alla
b039e24130
Refactor Celery integration according to current best practices (#2016)
Refactor Celery integration according to current best practices
2019-05-17 21:38:00 +01:00
Tano Abeleyra
63a184f072 Set LOCALE_PATHS 2019-05-17 12:34:32 -03:00
Tano Abeleyra
ecc5a73aff
Add LocaleMiddleware 2019-05-17 11:57:13 -03:00
Bruno Alla
4a1894d5d6
Logging improvements (#2040)
Logging improvements
2019-05-16 13:25:38 +01:00
Tano Abeleyra
d00517252c UsersAppConfig improvements
+ Rename to UsersConfig to follow Django naming convention
+ Translate verbose_name
2019-05-15 20:10:55 -03:00
Bruno Alla
0fef828375 Create a logging config in base settings & add a root logger to existing ones 2019-05-15 17:20:14 +01:00
Bruno Alla
dc2cfc9904 Merge branch 'master' into upgrade/django-2.1 2019-05-08 12:23:23 +01:00
Craig Margieson
5ab5285e5f Edit STATIC and MEDIA urls for GCE production. 2019-05-06 15:13:01 +09:30
Bruno Alla
39df72669e Merge branch 'master' into upgrade/django-2.1
# Conflicts:
#	README.rst
2019-04-17 08:33:54 +01:00
anuj
2b141e6464 Add support for GCE static 2019-04-07 00:54:46 +05:30
anuj
b5e030b784 Corrected quotes, added parameter in tests 2019-04-07 00:34:22 +05:30
anuj
cad0b77658 Added support for GCE Media storage 2019-04-05 12:42:39 +05:30
Bruno Alla
57dd157c4a Remove deprecated password hasher 2019-04-02 19:37:12 +01:00
Bruno Alla
81851ffb6d Merge branch 'master' into mailgun_api_url 2019-04-02 15:45:37 +01:00
Bruno Alla
895298c28f Refactor Celery integration according to current best practices
- Change celery app to not be a Django app, more like a WSGI app
- Define a Celery task in the Django users app
- Write a test to execute the task
- Update scripts to use the new app to start workers
- Update documentation

Fix #865
2019-04-02 15:40:32 +01:00
Jelmert
d1bf4f4815 Added AWS_S3_REGION_NAME to production settings 2019-04-02 15:43:48 +02:00
Jelmert
17e7d603cf Added the MAILGUN_API_URL variable to the ANYMAIL configuration so we can easily switch to the EU region for mailgun 2019-04-02 15:08:51 +02:00