Commit Graph

125 Commits

Author SHA1 Message Date
Guilherme Fabrizio
7d1e90bdf5 Migrate to unified Sentry SDK (#1820)
The raven library is deprecated. Replace it by the new sentry-sdk library:

https://docs.sentry.io/error-reporting/quickstart/?platform=python

fixes #1818
2019-03-20 10:04:44 +00:00
Bruno Alla
6e9f87fced Set AWS_DEFAULT_ACL to None as per django-storages documentation
fixes #1885
2019-03-19 19:57:31 +00:00
Bruno Alla
68f7268770
Run Black on Travis (#1957)
* Create a test matrix on Travis CI to help testing multiple options

* Change test_docker.sh to fail if any command in it fails

* Run black on the CI with --check option

* Fix formatting of project files using black

* Install black in the docker container

* Exclude migrations in black checks

* Fix Black formatting violations

* Run black on the whole generated project & fix issues
2019-03-18 17:49:43 +00:00
keithjeb
aea5c807f6 Change eager celery setting in local Docker (#1945)
[//]: # (Thank you for helping us out: your efforts mean great deal to the project and the community as a whole!)

[//]: # (Before you proceed:)

[//]: # (1. Make sure to add yourself to `CONTRIBUTORS.rst` through this PR provided you're contributing here for the first time)
[//]: # (2. Don't forget to update the `docs/` presuming others would benefit from a concise description of whatever that you're proposing)


## Description

[//]: # (What's it you're proposing?)

Added a note around CELERY_TASK_ALWAYS_EAGER = True in docker config for local development. This causes tasks to be executed on the 'main' thread rather than by the workers. I understand why that might be desirable, but thought it worth calling out incase (like me) it makes people think something is broken.


## Rationale

[//]: # (Why does the project need that?)

Ease of use/troubleshooting


## Use case(s) / visualization(s)

[//]: # ("Better to see something once than to hear about it a thousand times.")
2019-03-02 13:51:30 +00:00
Carl Johnson
1753812136 Settings: Use security settings in dev as well as prod 2018-11-12 15:04:03 -05:00
Chris Pappalardo
ea53635a0a fixed production bugs in caddyfile and middleware 2018-09-15 12:45:10 -07:00
Umair Ashraf
bf6c7e8e9c fixed s3 http url for static and media storage 2018-09-12 13:45:30 -04:00
Wan Liuyang
de5504f414
Rename custom S3Boto3Storage subclasses (#1784)
Closes #1788 

This PR preps for the upcoming `django-storages` 2.X:

1. ~~Explicitly set default ACL to None which was [incorrectly set](3f6ec74942/storages/backends/s3boto3.py (L195)) to `public-read` by `django-storages`~~

2. Renamed `StaticRootS3BotoStorage` to `StaticRootS3Boto3Storage` to avoid confusion. This is to prep for the upcoming `S3Boto` class deprecation.

See also:
https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html#settings
https://github.com/jschneier/django-storages/blob/master/CHANGELOG.rst
2018-09-09 19:59:04 +08:00
Irfan
27ae9c36e4 Fix #1771: Use full-fledge S3 Storage class in production settings
sorl-thumbnail serialized and deserializes the storage class and during this
process location parameter is lost if factory is used. Using a full-fledge
storage class fixes this issue.

See: https://stackoverflow.com/a/18046120/104731
2018-09-01 11:49:01 +05:00
Nikita P. Shupeyko
ac61117b59 Prevent AWS S3 bucket from being created automatically
Rationale: most of the time you want to create a bucket yourself in order to assign/tweak polices etc.
2018-06-28 16:35:35 +03:00
Nikita Shupeyko
07060eaecc
Extend & enhance Celery configuration (#1679)
* CELERY_TASK_TIME_LIMIT

* CELERY_TASK_SOFT_TIME_LIMIT

* CELERY_ALWAYS_EAGER -> CELERY_TASK_ALWAYS_EAGER

* CELERY_EAGER_PROPAGATES = CELERY_TASK_ALWAYS_EAGER

Addresses https://github.com/pydanny/cookiecutter-django/pull/1446/files#r167238808

* CELERY_RESULT_BACKEND = CELERY_BROKER_URL always

* CELERY_TIMEZONE = TIME_ZONE

* CELERY_TASK_EAGER_PROPAGATES = True

* Name task limit settings appropriately

CELERY_TASK_TIME_LIMIT -> CELERYD_TASK_TIME_LIMIT, CELERY_TASK_SOFT_TIME_LIMIT -> CELERYD_TASK_SOFT_TIME_LIMIT
2018-06-21 19:38:48 +00:00
Nikita P. Shupeyko
c812e01fc5 Rename UsersConfig to UsersAppConfig 2018-06-05 12:18:35 +03:00
Nikita P. Shupeyko
95d218e3e4 Rename CeleryConfig to CeleryAppConfig 2018-06-05 12:18:07 +03:00
Nikita Shupeyko
fe3f45ba7d
Rename DJANGO_SENTRY_DSN env to SENTRY_DSN (#1663)
Rationale: so that Heroku auto-provisioned Sentry addon, with its SENTRY_DSN config var is being connected to out-of-box
2018-05-27 22:36:13 +03:00
Nikita P. Shupeyko
b069f8e40e Fix E303 in production.py 2018-05-21 21:57:52 +03:00
Nikita P. Shupeyko
600be33b85 Fix E402 in production.py 2018-05-21 21:57:31 +03:00
Nikita P. Shupeyko
5b6c8a89d3 Fix flake8 errors in wsgi.py 2018-05-21 21:36:03 +03:00
Nikita P. Shupeyko
c3baadd8c7 Set DEBUG=True unconditionally in local config 2018-05-14 10:21:33 +03:00
saschalalala
6d4be405d8 Migrate to Django2 path urls (#1637)
* Change users urls to Django 2 paths

* Change config urls to Django 2 paths

* Change admin url setting to Django 2 path syntax

* Replace more admin urls

* Add myself to contributors.rst
2018-05-14 10:09:24 +03:00
Nikita P. Shupeyko
fd15b20a08 Use string interpolation in production STATIC_URL 2018-05-13 17:03:04 +03:00
Nikita P. Shupeyko
661fc3e449 Fix E402 2018-05-09 13:42:20 +03:00
Nikita P. Shupeyko
a07327459c Fix logging module imported unconditionally in production.py 2018-05-09 13:24:08 +03:00
Nikita P. Shupeyko
df1ce737d5 Replace os.environ.get with env call in local.py 2018-05-09 13:15:41 +03:00
Nikita P. Shupeyko
00ff5c8506
Fix a typo in production.py 2018-05-07 20:33:34 +03:00
Osaetin Daniel
a4f059196e Removed unnecessary sentry configuration (#1598) 2018-04-10 10:39:44 +08:00
Daniel Roy Greenfeld
3f753e0411
First pass at running black across the project (#1602) 2018-04-08 17:03:29 -05:00
Nikita P. Shupeyko
26ccf9307f Fix REDIS_URL missing
Fixes #1570.
2018-04-04 13:42:01 +03:00
Nikita P. Shupeyko
418b53bf77 Rename use_sentry_for_error_reporting to use_sentry
Rationale: consistency
2018-04-03 12:12:26 +03:00
Wan Liuyang
d1198f63b1
Drop Opbeat (#1578) 2018-03-21 19:54:27 +08:00
jose Gabriel Guzman Lopez
0601a1b858
Local
add  "127.0.0.1"
2018-03-16 11:35:39 -05:00
Daniel Roy Greenfeld
b32fd78012
Update base.py 2018-03-13 22:21:01 -05:00
Daniel Roy Greenfeld
19501ef26b
Adding DRF 2018-03-13 22:17:46 -05:00
Malik S
6c8538abfe Add all internal IPs for multiple docker networks (#1520)
* Add all internal IPs for multiple docker networks

When developing with modified docker-compose.yml that contains multiple
network definitions, all networks gateways of the created container
should be added to INTERNAL_IPS, otherwise Django-Debug-Toolbar will not
work.

* Add @flyudvik to contributors
2018-03-08 15:54:24 +03:00
Wan Liuyang
9cb7e50b8e Convert old-styled string formatting to f-string (#1528)
* Convert old-styled string formatting to f-string

* Update flake8 explicit version to 3.5.0

* Make tox.ini in sync with requirements.txt

* Fix annoying flake8 F405
2018-03-06 19:56:27 +03:00
Nikita Shupeyko
d2791b019a
Prettify and re-order settings entries (#1550)
* Prettify and re-order settings entries

* Use old-style .format() for the time being

* Remove redundant linebreaks at the settings files' beginning

* Fix E303 too many blank lines

* Remove a redundant linebreak from requirements.txt

* Some linebreake juggling in config.settings.base
2018-03-06 14:28:25 +03:00
Bruno Alla
82dcd2d30c Simplify Mailgun settings
When creating a Mailgun add-on on Heroku, the app gets some environment
variables by default:

    MAILGUN_API_KEY
    MAILGUN_DOMAIN

However, the cookiecutter names do not match and requires a manual step
from the user deploying. It's used elsewhere but shouldn't harm the
other deployment methods to rename these variables.

While updating the docs I noticed a variable that appear unused
DJANGO_MAILGUN_SERVER_NAME so this removes it from the documentation.
2018-03-05 17:56:45 +00:00
Nikita P. Shupeyko
64f2541743 Set ALLOWED_HOSTS in config.settings.local 2018-03-04 17:51:37 +03:00
Nikita P. Shupeyko
f4e217ed21 Simplify production databases section generation 2018-03-04 17:33:54 +03:00
Nikita P. Shupeyko
6c26d39f65 Unconditionally connect to database from DATABASE_URL env when opting for Docker
Closes #1541.
2018-03-04 17:24:06 +03:00
adammsteele
ed2204ecba Celery config - json serialization by default (#1535)
* Use json serialization in celery by default

* Added myself to CONTRIBUTORS.rst
2018-03-01 14:25:33 +03:00
Wan Liuyang
30dfbbd0ab Remove AWS S3 header bytes workaround 2018-02-20 16:04:16 +08:00
Bruno Alla
3853094221
Merge pull request #1374 from svleeuwen/patch-1
Remove boto related settings that aren't used
2018-02-16 21:19:35 +00:00
Hashim Muqtadir
e8ca2dd8ea Add atomic requests setting to production.py (#1513)
Since config/production.py sets a new value for `DATABASES['default']`, the `DATABASES['default']['ATOMIC_REQUESTS'] = True` setting from base gets overridden. So it's probably a good idea to add it back.
2018-02-16 18:15:50 +03:00
Sander van Leeuwen
bef1bb856e
Add cache control via AWS_S3_OBJECT_PARAMETERS setting
Previously covered by AWS_HEADERS
2018-02-13 16:04:43 +01:00
Nikita Shupeyko
86e33e8714
Refactor *_gen_project hooks (#1490)
* Fix ./hooks/pre_gen_project.py asking user to select an option once only

+ prettify output

* Fix pre_gen hook not really exiting when it should

* Refactor & prettify ./hooks/post_gen_project.py

* Ensure same POSTGRES_USER is set across environments

+ get rid of env.example in favor of pre-generated .env.
2018-02-07 22:52:52 +03:00
David
b24d0d0bd8 Fixes wsgi.py app_path to avoid deleting all /config occurrences. (#1467) 2018-02-03 00:01:28 +03:00
Daniel Roy Greenfeld
793a46ba45 Removed expiramental elastic beanstalk support and bumped official Django version to 1.11.9 2018-01-15 12:33:51 -08:00
Pierre Chiquet
d2dd265a99 Fix MediaRootS3BotoStorage: do not override existing files (#1367)
* Fix MediaRootS3BotoStorage: do not override existing files

see https://github.com/jschneier/django-storages/issues/50

* Update "other contributors"

* alphabetical order
2017-12-13 16:06:48 +03:00
Bruno Alla
4f8cd89bb7 Set CONN_MAX_AGE to 60 seconds -- fixes #710 (#1382)
* Set CONN_MAX_AGE to 60 seconds -- fixes #710

Setting the value in the production config.

* Get CONN_MAX_AGE from the environment, default to 60 in .env

* Add test for CONN_MAX_AGE setting

* Remove duplication in default value & test cleanup

* Remove test for CONN_MAX_AGE value in settings
2017-11-13 23:08:47 +03:00
Sander van Leeuwen
9661ecaf8f Remove boto related settings that aren't used
Since upgrade to boto3 in commit 12db5176d6 we don't need AWS_HEADERS anymore
2017-10-25 14:11:36 +02:00