Commit Graph

112 Commits

Author SHA1 Message Date
Bruno Alla
17fa459dc3
Fix inconsistent line length and move configs to pyproject.toml (#4276)
* Fix inconsistent line length and move config to pyproject.toml

Fix #2720

* Fix running tox with AUTOFIXABLE_STYLES

* Adjust some styles

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adjust more styles

* Split isort and flake8 tests

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-15 15:43:04 +01:00
Andrew Chen Wang
1783257ed3
Add username_type option (#3958)
* Add username_type option

* Update docs

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>

* Fix errors and lint

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>

* Try linting again

* Try linting again

* Handle signup

* Fix url reverse in template

* Fix migration file

* Remove extra line in factories

* E2E tests for email username

* Fix style in users api views and serializers

* Fix style in users api views and serializers

* Add conditions for fields in UserAdminCreationForm

* Consistent Jinja tag conditions

* Fix more empty lines issues

* Tweak options order

* Test username email

* Fix code style

* Fix kwargs to reverse user details view

* Remove comment in template

* Fix error messages dict in user form

* Fix line wrapping

* Move custom manager into a separate module and add tests

---------

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2023-04-15 11:53:15 +01:00
Jelmer
42c30dafcb
Upgrade Python to version 3.11 (Faster CPython) (#4256)
* Upgrade Python to version 3.11 (Faster CPython)

* Update pyupgrade config for Python 3.11

* Update tox env to Python 3.11

* Update to latest Python 3.11.3

* Add a note about lack of support in PythonAnywhere

* Rephrase note

* Fix casing

---------

Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2023-04-15 11:42:33 +01:00
Jelmer
f93a9f78d9
Replace runserver_plus with runserver (#4255)
* Replace runserver_plus with runserver since it is not compatible with django >= 4.1

* Replace runserver_plus with runserver in post_gen_hooks

---------

Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
2023-04-04 21:42:53 +01:00
Hoai-Thu Vuong
dcea8f1e7b
Trim leading and trailing space in domain_name and email (#4163)
* remove trailing space in domain_name and email

* Add test for leading and trailing spaces removals

* Move magic string and add a comment explaining its role

---------

Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
2023-03-16 17:17:02 +00:00
Arkadiusz Michał Ryś
06369bfd4c
Add option to serve media files locally using nginx (#2457)
* Add option to serve media files locally using nginx

* Fix nginx media location and storage issue

* Fix traefik django-media typo

* Add certresolver property to web-media-router

* Add trailing slash in nginx configuration to avoid path traversal exploits

* Remove autoindexing from nginx configuration so nginx uses its default off setting

* Use nginx to serve media files if cloud provider is None

* Add back warning about lack of media files without Docker or Cloud providers

* Update documentation

* Fix typos and rephrase

Co-authored-by: Arkadiusz Ryś <arkadiusz.michal.rys@gmail.com>

---------

Co-authored-by: Bruno Alla <alla.brunoo@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2023-03-04 18:36:11 +00:00
Bruno Alla
cbb0e19de7
Add Webpack support (#3623)
* Add support for Webpack as frontend pipeline

* Rename CI jobs

* Fix a couple of issues with Webpack + Docker

* Don't include Boostrap CSS from CDN with Webpack

* Rename variable

* Set publicPath in prod webpack config

* Fix removal of SASS files in post-gen hooks

* Add Webpack to readme usage section

* Run Django + Webpack dev server concurrently without Docker

* Fix async runserver command with Gulp/Webpack

* Upgrade django-webpack-loader to 1.5.0

* Pass variables required by Webpack at build time

* Upgrade django-webpack-loader to 1.7.0

* Add missing condition

* Add support for Azure Storage + Webpack

* Whitespaces

* Rename ROOT_DIR -> BASE_DIR

* Rename jobs

* Bump django-webpack-loader to latest

* Document limitation of Docker + Webpack + no Whitenoise

* Update section on custom Bootstrap compilation in generated readme
2023-01-29 12:12:12 +00:00
Bruno Alla
c0e83b104c
Refactor merge_production_dotenvs_in_dotenv.py (#4105) 2023-01-28 15:10:45 +00:00
rguptar
49b3bb8ffe
Add Azure Storage as an option to serve static and media files (#3967)
Fix https://github.com/cookiecutter/cookiecutter-django/issues/2301
2022-11-30 18:26:58 +00:00
Jelmer
4ea0e98f3f
Upgrade Python version from 3.9 to 3.10 (#3913) 2022-10-24 21:41:00 +01:00
Bruno Alla
ab4a32d558
Unify compressor, gulp and custom bootstrap options (#3535) 2022-03-20 15:00:40 +00:00
ghazi-git
c22f2c7e9e
Fix Swagger schema API endpoint & add a test for it (#3592)
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2022-02-16 12:25:32 +00:00
Vikas Yadav
721b86723c
Add swagger API documentation when DRF is enabled (#3536)
* Adds swagger api documentation when drf is enabled

Changes
* Integrate drf-spectacular module
* Added routes and tests for swagger-ui

* Removes swagger ui tests when drf is not enabled

* Changes url names and documentation title

* Apply suggestions from code review

Co-authored-by: Fábio C. Barrionuevo da Luz <bnafta@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>

* Fixes typos and linting issues

* Update domain in swagger description

Co-authored-by: Fábio C. Barrionuevo da Luz <bnafta@gmail.com>

Co-authored-by: Fábio C. Barrionuevo da Luz <bnafta@gmail.com>
Co-authored-by: Bruno Alla <browniebroke@users.noreply.github.com>
2022-01-19 18:14:36 +00:00
Bruno Alla
df0b2cac3f
Add a PyCharm run configuration for docker-compose (#3462)
Co-authored-by: Pavel Karateev <lancelote.du.lac@gmail.com>
2021-12-20 09:39:23 +00:00
Bruno Alla
ce1c76e34e
Fix carriage return in .gitignore on Windows (#3456) 2021-12-16 11:07:47 +00:00
Bruno Alla
035eede670
Configure Dependabot for npm packages at the template level (#3436) 2021-12-07 19:05:59 +00:00
Bruno Alla
407a7d8bbc
Setup pre-commit for the template files (#3433) 2021-11-26 15:41:50 +00:00
areski
a1d551d067 Update from Python3.8 to Python3.9 2021-01-26 16:13:27 +01:00
Arnav Choudhury
b064e09f12
Adding GitHub-Action CI Option (#2837) 2020-09-21 11:20:24 +01:00
Bruno Alla
68116dcdea Fix issue with Heroku + Django Compressor 2020-07-04 15:20:51 +01:00
Bruno Alla
672be773a3
Fix formatting 2020-04-28 23:18:52 +01:00
Pilhwan Kim
f13f3dc2bf add use drf tests 2020-04-28 12:41:51 +09:00
Bruno Alla
c4e4bea31b Merge branch 'master' into async 2020-04-16 09:43:38 +01:00
Andrew Chen Wang
2ecbf7ac34
Merge branch 'master' into async 2020-04-06 23:02:36 -04:00
Ernesto Cedeno
0cdf60ceac Change Python version to 3.8 2020-03-29 19:55:27 +02:00
Andrew-Chen-Wang
aee2de347b Add uvicorn and web sockets for Django 3
* Add use_async option to cookiecutter.json
* Add websocket configuration
2020-03-24 15:40:14 -04:00
Bruno Alla
c4b1666707 Move storages classes into their own module 2020-03-23 21:46:14 +00:00
Andrew-Chen-Wang
484fa4ae77 Added unsupported mail_service combinations
* Added default yaml Loader for pre_gen_projects.py
2020-03-22 13:31:52 -04:00
Bruno Alla
949d8b684c Merge branch 'master' into drf-option-with-tests
# Conflicts:
#	hooks/post_gen_project.py
2020-01-23 14:41:42 +00:00
Ivan Khomutov
113ce88d9c Add option to choose CI tool 2019-12-06 10:55:00 +03:00
Jelmert
eb8ea447e4 fix: black 2019-10-21 11:12:53 +02:00
Jelmert
58f41fc97f fix: remove the aws Dockerfile and remove the awscli definition from production.yml when not selected 2019-10-21 10:07:17 +02:00
Bruno Alla
6a9feea2fe
Support python 3.7 (#2240)
Support python 3.7
2019-10-06 11:06:03 +01:00
Caio Ariede
d0c208d10f Fix #2249 -- Broken static files with whitenoise=n & cloud_provider=none 2019-10-02 12:03:33 -03:00
Nicolas Stefani
ea52a0be25 Updated python version in warning message 2019-09-29 21:46:34 -03:00
Jerome Caisip
548417612f Additonal option to setup DRF. 2019-09-17 23:24:09 +08:00
Bruno Alla
2103cf2f9d Add a pre-generation hook to avoid non-lowercase slugs - fixes #2042 2019-06-05 19:00:43 +01:00
Tano Abeleyra
de7be3652a Make cloud_provider optional
Some projects may not need AWS or GCS
2019-05-19 12:45:28 -03: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
Bruno Alla
becd2dce13 Reword & clarify Python 2 warning in pre gen hook
Fixes #1942
2019-03-27 21:27:52 +00:00
Bruno Alla
b91c70d755
Add a node image to run Gulp when selecting it with Docker (#1687)
## Description

Following up on @webyneter attempt in #1205, which is now getting outdated, I've tried to make Gulp task runner work with Docker. There is no documentation yet, but this seems to work locally with the custom bootstrap compilation...

- [x] Add a node image for local developement
- [x] Proxy the django image rather than localhost in Browser sync, pass header to keep hostname
- [x] Don't call the runserver command from Gulp, let docker-compose handle
- [x] Update package.json & gulpfile.js templates to reduce the number of unwanted empty lines
- [x] Use [multi-stage build](https://docs.docker.com/develop/develop-images/multistage-build/) in production to make sure the static assets are produced
- [x] Update documentation
- [x] Verify that the previous issue with static assets missing from production isn't there 

## Rationale

Currently, the static build isn't working nicely with Docker, extra manual setup is required.

Fixes #1762
2019-03-25 12:10:55 +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
Cole Mackenzie
5a4a3217f1 prevent removal if using travisci 2018-10-16 13:22:04 -06:00
Cole Mackenzie
9e8e09119d
Remove requirements.txt file from delete list.
fixes #1829
2018-10-10 21:35:17 -06:00
Bruno Alla
11bb4cdb84 Avoid '$' in random string generation
Until the [upstream bug](https://github.com/joke2k/django-environ/issues/60) is fixed in django-environ, this should prevent people using this template from hitting the bug.

Fix #454
2018-09-18 10:27:58 +01:00
Nikita P. Shupeyko
ed7609f715 Remove utility/ when use_docker=y 2018-06-28 16:43:34 +03:00
Nikita P. Shupeyko
c5c6bace99 Remove LICENSE for non open source projects 2018-06-28 16:39:51 +03:00
Nikita Shupeyko
275c13292c
Integrate Flower with Docker Compose setup (#1655)
* Integrate Flower with Docker Compose setup locally

* Remove alien worker celeryd option

* Move Flower COPY section below the worker's

* Remove set -o pipefail command from Flower start script

* Flower client authentication

* Override flower service image name

* Move flower service to the end of local.yml

* Install flower==0.9.2 in all environments

* Introduce production flower service

* Fix local flower start script

* Document Flower integration

* Prettify *.django envs

Rationale: consistency.

* Reference local environment Flower docs from the production's

* 'two more services' -> 'three more services'
2018-06-27 19:33:21 +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
be1024cd06 Drop Grunt support
Closes #1636.
2018-05-13 13:51:01 +03:00