mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-23 18:14:01 +03:00
Merge commit '8fa182c4f08482670cd0cbc6957c671ff09929ad'
This commit is contained in:
commit
d124a4ac0e
|
@ -25,6 +25,13 @@ matrix:
|
|||
script: sh tests/test_docker.sh
|
||||
- name: Docker with Celery
|
||||
script: sh tests/test_docker.sh use_celery=y
|
||||
- name: Bare metal
|
||||
script: sh tests/test_bare.sh use_celery=y use_compressor=y
|
||||
services:
|
||||
- postgresql
|
||||
- redis-server
|
||||
env:
|
||||
- CELERY_BROKER_URL=redis://localhost:6379/0
|
||||
|
||||
install:
|
||||
- pip install tox
|
||||
|
|
33
CHANGELOG.md
33
CHANGELOG.md
|
@ -2,6 +2,39 @@
|
|||
All enhancements and patches to Cookiecutter Django will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [2019-07-09]
|
||||
### Fixed
|
||||
- Always use test settings in pytest (@danihodovic)
|
||||
- Remove gunicorn from `INSTALLED_APPS` (@danihodovic)
|
||||
- Remove `EMAIL_HOST` and `EMAIL_PORT` with locmem backend (@danihodovic)
|
||||
|
||||
### Added
|
||||
- Add `EMAIL_TIMEOUT` (@danihodovic)
|
||||
|
||||
## [2019-06-22]
|
||||
### Fixed
|
||||
- Remove redundant template debug setting (@danihodovic)
|
||||
|
||||
## [2019-06-19]
|
||||
### Fixed
|
||||
- Fix removal carriage returns in docker scripts (@timclaessens)
|
||||
|
||||
## [2019-06-15]
|
||||
### Fixed
|
||||
- Issue with Pycharm setup for running things in Docker compose (@foarsitter)
|
||||
|
||||
## [2019-06-06]
|
||||
### Changed
|
||||
- Update generated Travis config (@browniebroke)
|
||||
|
||||
## [2019-06-03]
|
||||
### Added
|
||||
- Installed `django-celery-beat` to keep scheduled tasks in DB (@keyvanm)
|
||||
|
||||
## [2019-05-28]
|
||||
### Changed
|
||||
- Use GCP acronym rather than inconsistent GCE/GCS (@tanoabeleyra)
|
||||
|
||||
## [2019-05-27]
|
||||
### Changed
|
||||
- Made cloud provider optional (@tanoabeleyra)
|
||||
|
|
|
@ -42,6 +42,7 @@ Listed in alphabetical order.
|
|||
Name Github Twitter
|
||||
========================== ============================ ==============
|
||||
18 `@dezoito`_
|
||||
2O4 `@2O4`_
|
||||
a7p `@a7p`_
|
||||
Aaron Eikenberry `@aeikenberry`_
|
||||
Adam Bogdał `@bogdal`_
|
||||
|
@ -65,8 +66,8 @@ Listed in alphabetical order.
|
|||
Ashley Camba
|
||||
Barclay Gauld `@yunti`_
|
||||
Bartek `@btknu`_
|
||||
Ben Warren `@bwarren2`_
|
||||
Ben Lopatin
|
||||
Ben Warren `@bwarren2`_
|
||||
Benjamin Abel
|
||||
Bert de Miranda `@bertdemiranda`_
|
||||
Bo Lopker `@blopker`_
|
||||
|
@ -89,6 +90,7 @@ Listed in alphabetical order.
|
|||
Cullen Rhodes `@c-rhodes`_
|
||||
Curtis St Pierre `@curtisstpierre`_ @cstpierre1388
|
||||
Dan Shultz `@shultz`_
|
||||
Dani Hodovic `@danihodovic`_
|
||||
Daniel Hepper `@dhepper`_ @danielhepper
|
||||
Daniele Tricoli `@eriol`_
|
||||
David Díaz `@ddiazpinto`_ @DavidDiazPinto
|
||||
|
@ -98,8 +100,8 @@ Listed in alphabetical order.
|
|||
Demetris Stavrou `@demestav`_
|
||||
Denis Bobrov `@delneg`_
|
||||
Denis Orehovsky `@apirobot`_
|
||||
Dónal Adams `@epileptic-fish`_
|
||||
Diane Chen `@purplediane`_ @purplediane88
|
||||
Dónal Adams `@epileptic-fish`_
|
||||
Dong Huynh `@trungdong`_
|
||||
Emanuel Calso `@bloodpet`_ @bloodpet
|
||||
Eraldo Energy `@eraldo`_
|
||||
|
@ -130,10 +132,11 @@ Listed in alphabetical order.
|
|||
Keith Webber `@townie`_
|
||||
Kevin A. Stone
|
||||
Kevin Ndung'u `@kevgathuku`_
|
||||
Keyvan Mosharraf `@keyvanm`_
|
||||
Krzysztof Szumny `@noisy`_
|
||||
Krzysztof Żuraw `@krzysztofzuraw`_
|
||||
Leonardo Jimenez `@xpostudio4`_
|
||||
Leo Zhou `@glasslion`_
|
||||
Leonardo Jimenez `@xpostudio4`_
|
||||
Lin Xianyi `@iynaix`_
|
||||
Luis Nell `@originell`_
|
||||
Lukas Klein
|
||||
|
@ -152,6 +155,7 @@ Listed in alphabetical order.
|
|||
Meghan Heintz `@dot2dotseurat`_
|
||||
Mesut Yılmaz `@myilmaz`_
|
||||
Michael Gecht `@mimischi`_ @_mischi
|
||||
Min ho Kim `@minho42`_
|
||||
mozillazg `@mozillazg`_
|
||||
Oleg Russkin `@rolep`_
|
||||
Pablo `@oubiga`_
|
||||
|
@ -178,6 +182,7 @@ Listed in alphabetical order.
|
|||
Tano Abeleyra `@tanoabeleyra`_
|
||||
Taylor Baldwin
|
||||
Théo Segonds `@show0k`_
|
||||
Tim Claessens `@timclaessens`_
|
||||
Tim Freund `@timfreund`_
|
||||
Tom Atkins `@knitatoms`_
|
||||
Tom Offermann
|
||||
|
@ -190,29 +195,39 @@ Listed in alphabetical order.
|
|||
Vlad Doster `@vladdoster`_
|
||||
Will Farley `@goldhand`_ @g01dhand
|
||||
William Archinal `@archinal`_
|
||||
Xaver Y.R. Chen `@yrchen`_ @yrchen
|
||||
Yaroslav Halchenko
|
||||
========================== ============================ ==============
|
||||
|
||||
.. _@a7p: https://github.com/a7p
|
||||
.. _@2O4: https://github.com/2O4
|
||||
.. _@ad-m: https://github.com/ad-m
|
||||
.. _@adammsteele: https://github.com/adammsteele
|
||||
.. _@aeikenberry: https://github.com/aeikenberry
|
||||
.. _@afrowave: https://github.com/afrowave
|
||||
.. _@ahhda: https://github.com/ahhda
|
||||
.. _@alb3rto: https://github.com/alb3rto
|
||||
.. _@ameistad: https://github.com/ameistad
|
||||
.. _@amjith: https://github.com/amjith
|
||||
.. _@andor-pierdelacabeza: https://github.com/andor-pierdelacabeza
|
||||
.. _@andresgz: https://github.com/andresgz
|
||||
.. _@antoniablair: https://github.com/antoniablair
|
||||
.. _@apirobot: https://github.com/apirobot
|
||||
.. _@archinal: https://github.com/archinal
|
||||
.. _@areski: https://github.com/areski
|
||||
.. _@arruda: https://github.com/arruda
|
||||
.. _@bertdemiranda: https://github.com/bertdemiranda
|
||||
.. _@bittner: https://github.com/bittner
|
||||
.. _@bloodpet: https://github.com/bloodpet
|
||||
.. _@blopker: https://github.com/blopker
|
||||
.. _@bogdal: https://github.com/bogdal
|
||||
.. _@brentpayne: https://github.com/brentpayne
|
||||
.. _@btknu: https://github.com/btknu
|
||||
.. _@burhan: https://github.com/burhan
|
||||
.. _@bwarren2: https://github.com/bwarren2
|
||||
.. _@c-rhodes: https://github.com/c-rhodes
|
||||
.. _@caffodian: https://github.com/caffodian
|
||||
.. _@canonnervio: https://github.com/canonnervio
|
||||
.. _@carlmjohnson: https://github.com/carlmjohnson
|
||||
.. _@catherinedevlin: https://github.com/catherinedevlin
|
||||
.. _@ccurvey: https://github.com/ccurvey
|
||||
|
@ -222,109 +237,106 @@ Listed in alphabetical order.
|
|||
.. _@ChrisPappalardo: https://github.com/ChrisPappalardo
|
||||
.. _@chuckus: https://github.com/chuckus
|
||||
.. _@cmackenzie1: https://github.com/cmackenzie1
|
||||
.. _@cmargieson: https://github.com/cmargieson
|
||||
.. _@Collederas: https://github.com/Collederas
|
||||
.. _@curtisstpierre: https://github.com/curtisstpierre
|
||||
.. _@dadokkio: https://github.com/dadokkio
|
||||
.. _@danihodovic: https://github.com/danihodovic
|
||||
.. _@davitovmasyan: https://github.com/davitovmasyan
|
||||
.. _@ddiazpinto: https://github.com/ddiazpinto
|
||||
.. _@delneg: https://github.com/delneg
|
||||
.. _@demestav: https://github.com/demestav
|
||||
.. _@dezoito: https://github.com/dezoito
|
||||
.. _@dhepper: https://github.com/dhepper
|
||||
.. _@dot2dotseurat: https://github.com/dot2dotseurat
|
||||
.. _@dsclementsen: https://github.com/dsclementsen
|
||||
.. _@durkode: https://github.com/durkode
|
||||
.. _@Egregors: https://github.com/Egregors
|
||||
.. _@epileptic-fish: https://gihub.com/epileptic-fish
|
||||
.. _@eraldo: https://github.com/eraldo
|
||||
.. _@erfaan: https://github.com/erfaan
|
||||
.. _@ericgroom: https://github.com/ericgroom
|
||||
.. _@eriol: https://github.com/eriol
|
||||
.. _@eyadsibai: https://github.com/eyadsibai
|
||||
.. _@flyudvik: https://github.com/flyudvik
|
||||
.. _@foarsitter: https://github.com/foarsitter
|
||||
.. _@garry-cairns: https://github.com/garry-cairns
|
||||
.. _@garrypolley: https://github.com/garrypolley
|
||||
.. _@goldhand: https://github.com/goldhand
|
||||
.. _@glasslion: https://github.com/glasslion
|
||||
.. _@goldhand: https://github.com/goldhand
|
||||
.. _@hackebrot: https://github.com/hackebrot
|
||||
.. _@hairychris: https://github.com/hairychris
|
||||
.. _@hanaquadara: https://github.com/hanaquadara
|
||||
.. _@hendrikschneider: https://github.com/hendrikschneider
|
||||
.. _@hjwp: https://github.com/hjwp
|
||||
.. _@IanLee1521: https://github.com/IanLee1521
|
||||
.. _@ikkebr: https://github.com/ikkebr
|
||||
.. _@iynaix: https://github.com/iynaix
|
||||
.. _@jangeador: https://github.com/jangeador
|
||||
.. _@jazztpt: https://github.com/jazztpt
|
||||
.. _@jcass77: https://github.com/jcass77
|
||||
.. _@jleclanche: https://github.com/jleclanche
|
||||
.. _@juliocc: https://github.com/juliocc
|
||||
.. _@jvanbrug: https://github.com/jvanbrug
|
||||
.. _@ka7eh: https://github.com/ka7eh
|
||||
.. _@kaidokert: https://github.com/kaidokert
|
||||
.. _@kappataumu: https://github.com/kappataumu
|
||||
.. _@keithjeb: https://github.com/keithjeb
|
||||
.. _@kevgathuku: https://github.com/kevgathuku
|
||||
.. _@keyvanm: https://github.com/keyvanm
|
||||
.. _@knitatoms: https://github.com/knitatoms
|
||||
.. _@krzysztofzuraw: https://github.com/krzysztofzuraw
|
||||
.. _@msaizar: https://github.com/msaizar
|
||||
.. _@MathijsHoogland: https://github.com/MathijsHoogland
|
||||
.. _@mattayes: https://github.com/mattayes
|
||||
.. _@mknapper1: https://github.com/mknapper1
|
||||
.. _@menzenski: https://github.com/menzenski
|
||||
.. _@mostaszewski: https://github.com/mostaszewski
|
||||
.. _@mfwarren: https://github.com/mfwarren
|
||||
.. _@MightySCollins: https://github.com/MightySCollins
|
||||
.. _@mimischi: https://github.com/mimischi
|
||||
.. _@minho42: https://github.com/minho42
|
||||
.. _@mjsisley: https://github.com/mjsisley
|
||||
.. _@myilmaz: https://github.com/myilmaz
|
||||
.. _@mknapper1: https://github.com/mknapper1
|
||||
.. _@mostaszewski: https://github.com/mostaszewski
|
||||
.. _@mozillazg: https://github.com/mozillazg
|
||||
.. _@mrcoles: https://github.com/mrcoles
|
||||
.. _@msaizar: https://github.com/msaizar
|
||||
.. _@myilmaz: https://github.com/myilmaz
|
||||
.. _@noisy: https://github.com/noisy
|
||||
.. _@originell: https://github.com/originell
|
||||
.. _@oubiga: https://github.com/oubiga
|
||||
.. _@parbhat: https://github.com/parbhat
|
||||
.. _@pchiquet: https://github.com/pchiquet
|
||||
.. _@phiberjenz: https://github.com/phiberjenz
|
||||
.. _@purplediane: https://github.com/purplediane
|
||||
.. _@raonyguimaraes: https://github.com/raonyguimaraes
|
||||
.. _@reggieriser: https://github.com/reggieriser
|
||||
.. _@rm--: https://github.com/rm--
|
||||
.. _@rolep: https://github.com/rolep
|
||||
.. _@romanosipenko: https://github.com/romanosipenko
|
||||
.. _@saschalalala: https://github.com/saschalalala
|
||||
.. _@shireenrao: https://github.com/shireenrao
|
||||
.. _@show0k: https://github.com/show0k
|
||||
.. _@shultz: https://github.com/shultz
|
||||
.. _@siauPatrick: https://github.com/siauPatrick
|
||||
.. _@sladinji: https://github.com/sladinji
|
||||
.. _@slafs: https://github.com/slafs
|
||||
.. _@ssteinerX: https://github.com/ssteinerx
|
||||
.. _@stepmr: https://github.com/stepmr
|
||||
.. _@suledev: https://github.com/suledev
|
||||
.. _@takkaria: https://github.com/takkaria
|
||||
.. _@tanoabeleyra: https://github.com/tanoabeleyra
|
||||
.. _@timclaessens: https://github.com/timclaessens
|
||||
.. _@timfreund: https://github.com/timfreund
|
||||
.. _@townie: https://github.com/townie
|
||||
.. _@Travistock: https://github.com/Tavistock
|
||||
.. _@trungdong: https://github.com/trungdong
|
||||
.. _@Tubo: https://github.com/tubo
|
||||
.. _@umrashrf: https://github.com/umrashrf
|
||||
.. _@viviangb: https://github.com/viviangb
|
||||
.. _@vladdoster: https://github.com/vladdoster
|
||||
.. _@xpostudio4: https://github.com/xpostudio4
|
||||
.. _@yrchen: https://github.com/yrchen
|
||||
.. _@yunti: https://github.com/yunti
|
||||
.. _@zcho: https://github.com/zcho
|
||||
.. _@phiberjenz: https://github.com/phiberjenz
|
||||
.. _@sladinji: https://github.com/sladinji
|
||||
.. _@andresgz: https://github.com/andresgz
|
||||
.. _@jangeador: https://github.com/jangeador
|
||||
.. _@townie: https://github.com/townie
|
||||
.. _@MightySCollins: https://github.com/MightySCollins
|
||||
.. _@dadokkio: https://github.com/dadokkio
|
||||
.. _@bwarren2: https://github.com/bwarren2
|
||||
.. _@bertdemiranda: https://github.com/bertdemiranda
|
||||
.. _@brentpayne: https://github.com/brentpayne
|
||||
.. _@afrowave: https://github.com/afrowave
|
||||
.. _@pchiquet: https://github.com/pchiquet
|
||||
.. _@delneg: https://github.com/delneg
|
||||
.. _@purplediane: https://github.com/purplediane
|
||||
.. _@umrashrf: https://github.com/umrashrf
|
||||
.. _@ahhda: https://github.com/ahhda
|
||||
.. _@keithjeb: https://github.com/keithjeb
|
||||
.. _@btknu: https://github.com/btknu
|
||||
.. _@rolep: https://github.com/rolep
|
||||
.. _@canonnervio: https://github.com/canonnervio
|
||||
.. _@jcass77: https://github.com/jcass77
|
||||
.. _@Egregors: https://github.com/Egregors
|
||||
.. _@saschalalala: https://github.com/saschalalala
|
||||
.. _@mrcoles: https://github.com/mrcoles
|
||||
.. _@ericgroom: https://github.com/ericgroom
|
||||
.. _@hanaquadara: https://github.com/hanaquadara
|
||||
.. _@vladdoster: https://github.com/vladdoster
|
||||
.. _@cmargieson: https://github.com/cmargieson
|
||||
.. _@tanoabeleyra: https://github.com/tanoabeleyra
|
||||
|
||||
Special Thanks
|
||||
~~~~~~~~~~~~~~
|
||||
|
|
|
@ -30,7 +30,7 @@ Run these commands to deploy the project to Heroku:
|
|||
heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production
|
||||
heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)"
|
||||
|
||||
# Generating a 32 character-long random string without any of the visually similiar characters "IOl01":
|
||||
# Generating a 32 character-long random string without any of the visually similar characters "IOl01":
|
||||
heroku config:set DJANGO_ADMIN_URL="$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/"
|
||||
|
||||
# Set this to your Heroku app url, e.g. 'bionic-beaver-28392.herokuapp.com'
|
||||
|
|
|
@ -29,7 +29,7 @@ Once you've been through this one-off config, future deployments are much simple
|
|||
Getting your code and dependencies installed on PythonAnywhere
|
||||
--------------------------------------------------------------
|
||||
|
||||
Make sure your project is fully commited and pushed up to Bitbucket or Github or wherever it may be. Then, log into your PythonAnywhere account, open up a **Bash** console, clone your repo, and create a virtualenv:
|
||||
Make sure your project is fully committed and pushed up to Bitbucket or Github or wherever it may be. Then, log into your PythonAnywhere account, open up a **Bash** console, clone your repo, and create a virtualenv:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
|
@ -153,7 +153,7 @@ Back on the Web tab, hit **Reload**, and your app should be live!
|
|||
|
||||
|
||||
**NOTE:** *you may see security warnings until you set up your SSL certificates. If you
|
||||
want to supress them temporarily, set DJANGO_SECURE_SSL_REDIRECT to blank. Follow
|
||||
want to suppress them temporarily, set DJANGO_SECURE_SSL_REDIRECT to blank. Follow
|
||||
the instructions here to get SSL set up: https://help.pythonanywhere.com/pages/SSLOwnDomains/*
|
||||
|
||||
|
||||
|
|
|
@ -120,13 +120,13 @@ In production, we have Mailgun_ configured to have your back!
|
|||
|
||||
Celery
|
||||
------
|
||||
|
||||
If the project is configured to use Celery as a task scheduler then by default tasks are set to run on the main thread
|
||||
when developing locally. If you have the appropriate setup on your local machine then set
|
||||
when developing locally. If you have the appropriate setup on your local machine then set the following
|
||||
in ``config/settings/local.py``::
|
||||
|
||||
CELERY_TASK_ALWAYS_EAGER = False
|
||||
|
||||
in /config/settings/local.py
|
||||
|
||||
|
||||
Sass Compilation & Live Reloading
|
||||
---------------------------------
|
||||
|
|
|
@ -21,7 +21,7 @@ If you set up your project to `develop locally with docker`_, run the following
|
|||
|
||||
$ docker-compose -f local.yml run django pytest
|
||||
|
||||
Targetting particular apps for testing in ``docker`` follows a similar pattern as previously shown above.
|
||||
Targeting particular apps for testing in ``docker`` follows a similar pattern as previously shown above.
|
||||
|
||||
Coverage
|
||||
--------
|
||||
|
|
|
@ -22,6 +22,10 @@ if hasattr(project_slug, "isidentifier"):
|
|||
project_slug.isidentifier()
|
||||
), "'{}' project slug is not a valid Python identifier.".format(project_slug)
|
||||
|
||||
assert (
|
||||
project_slug == project_slug.lower()
|
||||
), "'{}' project slug should be all lowercase".format(project_slug)
|
||||
|
||||
assert (
|
||||
"\\" not in "{{ cookiecutter.author_name }}"
|
||||
), "Don't include backslashes in author name."
|
||||
|
|
|
@ -5,13 +5,13 @@ binaryornot==0.4.4
|
|||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
black==19.3b0
|
||||
flake8==3.7.7
|
||||
flake8==3.7.8
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
tox==3.12.1
|
||||
pytest==4.6.0
|
||||
pytest_cases==1.6.3
|
||||
pytest-cookies==0.3.0
|
||||
pytest-xdist==1.28.0
|
||||
pyyaml==5.1
|
||||
tox==3.13.2
|
||||
pytest==5.0.1
|
||||
pytest_cases==1.10.1
|
||||
pytest-cookies==0.4.0
|
||||
pytest-xdist==1.29.0
|
||||
pyyaml==5.1.1
|
||||
|
|
26
tests/test_bare.sh
Executable file
26
tests/test_bare.sh
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
# this is a very simple script that tests the docker configuration for cookiecutter-django
|
||||
# it is meant to be run from the root directory of the repository, eg:
|
||||
# sh tests/test_docker.sh
|
||||
|
||||
set -o errexit
|
||||
|
||||
# install test requirements
|
||||
pip install -r requirements.txt
|
||||
|
||||
# create a cache directory
|
||||
mkdir -p .cache/bare
|
||||
cd .cache/bare
|
||||
|
||||
# create the project using the default settings in cookiecutter.json
|
||||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=n $@
|
||||
cd my_awesome_project
|
||||
|
||||
# Install OS deps
|
||||
sudo utility/install_os_dependencies.sh install
|
||||
|
||||
# Install Python deps
|
||||
pip install -r requirements/local.txt
|
||||
|
||||
# run the project's tests
|
||||
pytest
|
|
@ -2,6 +2,7 @@ import os
|
|||
import re
|
||||
|
||||
import pytest
|
||||
from cookiecutter.exceptions import FailedHookException
|
||||
from pytest_cases import pytest_fixture_plus
|
||||
import sh
|
||||
import yaml
|
||||
|
@ -145,3 +146,14 @@ def test_travis_invokes_pytest(cookies, context):
|
|||
assert yaml.load(travis_yml)["script"] == ["pytest"]
|
||||
except yaml.YAMLError as e:
|
||||
pytest.fail(e)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("slug", ["project slug", "Project_Slug"])
|
||||
def test_invalid_slug(cookies, context, slug):
|
||||
"""Invalid slug should failed pre-generation hook."""
|
||||
context.update({"project_slug": slug})
|
||||
|
||||
result = cookies.bake(extra_context=context)
|
||||
|
||||
assert result.exit_code != 0
|
||||
assert isinstance(result.exception, FailedHookException)
|
||||
|
|
14
{{cookiecutter.project_slug}}/.idea/workspace.xml
Normal file
14
{{cookiecutter.project_slug}}/.idea/workspace.xml
Normal file
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
<component name="DjangoConsoleOptions"
|
||||
custom-start-script="import sys; print('Python %s on %s' % (sys.version, sys.platform)) import django; print('Django %s' % django.get_version()) import os os.environ.setdefault("DATABASE_URL","postgres://{}:{}@{}:{}/{}".format(os.environ['POSTGRES_USER'], os.environ['POSTGRES_PASSWORD'], os.environ['POSTGRES_HOST'], os.environ['POSTGRES_PORT'], os.environ['POSTGRES_DB'])) os.environ.setdefault("CELERY_BROKER_URL", os.environ['REDIS_URL']) sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) if 'setup' in dir(django): django.setup() import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)"
|
||||
module-name="{{ cookiecutter.project_slug }}" is-module-sdk="true">
|
||||
</component>
|
||||
{%- else %}
|
||||
<component name="DjangoConsoleOptions"
|
||||
custom-start-script="import sys; print('Python %s on %s' % (sys.version, sys.platform)) import django; print('Django %s' % django.get_version()) import os os.environ.setdefault("DATABASE_URL","postgres://{}:{}@{}:{}/{}".format(os.environ['POSTGRES_USER'], os.environ['POSTGRES_PASSWORD'], os.environ['POSTGRES_HOST'], os.environ['POSTGRES_PORT'], os.environ['POSTGRES_DB'])) sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) if 'setup' in dir(django): django.setup() import django_manage_shell; django_manage_shell.run(PROJECT_ROOT)"
|
||||
module-name="{{ cookiecutter.project_slug }}" is-module-sdk="true">
|
||||
</component>
|
||||
{%- endif %}
|
||||
</project>
|
|
@ -41,7 +41,7 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="TestRunnerService">
|
||||
<option name="projectConfiguration" value="py.test" />
|
||||
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
||||
<option name="projectConfiguration" value="pytest" />
|
||||
<option name="PROJECT_TEST_RUNNER" value="pytest" />
|
||||
</component>
|
||||
</module>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
sudo: true
|
||||
dist: xenial
|
||||
services:
|
||||
- postgresql
|
||||
before_install:
|
||||
- sudo apt-get update -qq
|
||||
- sudo apt-get install -qq build-essential gettext python-dev zlib1g-dev libpq-dev xvfb
|
||||
- sudo apt-get install -qq libtiff4-dev libjpeg8-dev libfreetype6-dev liblcms1-dev libwebp-dev
|
||||
- sudo apt-get install -qq libjpeg8-dev libfreetype6-dev libwebp-dev
|
||||
- sudo apt-get install -qq graphviz-dev python-setuptools python3-dev python-virtualenv python-pip
|
||||
- sudo apt-get install -qq firefox automake libtool libreadline6 libreadline6-dev libreadline-dev
|
||||
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
||||
|
|
|
@ -20,23 +20,23 @@ COPY ./requirements /requirements
|
|||
RUN pip install -r /requirements/local.txt
|
||||
|
||||
COPY ./compose/production/django/entrypoint /entrypoint
|
||||
RUN sed -i 's/\r//' /entrypoint
|
||||
RUN sed -i 's/\r$//g' /entrypoint
|
||||
RUN chmod +x /entrypoint
|
||||
|
||||
COPY ./compose/local/django/start /start
|
||||
RUN sed -i 's/\r//' /start
|
||||
RUN sed -i 's/\r$//g' /start
|
||||
RUN chmod +x /start
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
COPY ./compose/local/django/celery/worker/start /start-celeryworker
|
||||
RUN sed -i 's/\r//' /start-celeryworker
|
||||
RUN sed -i 's/\r$//g' /start-celeryworker
|
||||
RUN chmod +x /start-celeryworker
|
||||
|
||||
COPY ./compose/local/django/celery/beat/start /start-celerybeat
|
||||
RUN sed -i 's/\r//' /start-celerybeat
|
||||
RUN sed -i 's/\r$//g' /start-celerybeat
|
||||
RUN chmod +x /start-celerybeat
|
||||
|
||||
COPY ./compose/local/django/celery/flower/start /start-flower
|
||||
RUN sed -i 's/\r//' /start-flower
|
||||
RUN sed -i 's/\r$//g' /start-flower
|
||||
RUN chmod +x /start-flower
|
||||
{% endif %}
|
||||
WORKDIR /app
|
||||
|
|
|
@ -31,28 +31,28 @@ RUN pip install --no-cache-dir -r /requirements/production.txt \
|
|||
&& rm -rf /requirements
|
||||
|
||||
COPY ./compose/production/django/entrypoint /entrypoint
|
||||
RUN sed -i 's/\r//' /entrypoint
|
||||
RUN sed -i 's/\r$//g' /entrypoint
|
||||
RUN chmod +x /entrypoint
|
||||
RUN chown django /entrypoint
|
||||
|
||||
COPY ./compose/production/django/start /start
|
||||
RUN sed -i 's/\r//' /start
|
||||
RUN sed -i 's/\r$//g' /start
|
||||
RUN chmod +x /start
|
||||
RUN chown django /start
|
||||
|
||||
{%- if cookiecutter.use_celery == "y" %}
|
||||
COPY ./compose/production/django/celery/worker/start /start-celeryworker
|
||||
RUN sed -i 's/\r//' /start-celeryworker
|
||||
RUN sed -i 's/\r$//g' /start-celeryworker
|
||||
RUN chmod +x /start-celeryworker
|
||||
RUN chown django /start-celeryworker
|
||||
|
||||
COPY ./compose/production/django/celery/beat/start /start-celerybeat
|
||||
RUN sed -i 's/\r//' /start-celerybeat
|
||||
RUN sed -i 's/\r$//g' /start-celerybeat
|
||||
RUN chmod +x /start-celerybeat
|
||||
RUN chown django /start-celerybeat
|
||||
|
||||
COPY ./compose/production/django/celery/flower/start /start-flower
|
||||
RUN sed -i 's/\r//' /start-flower
|
||||
RUN sed -i 's/\r$//g' /start-flower
|
||||
RUN chmod +x /start-flower
|
||||
{%- endif %}
|
||||
|
||||
|
|
|
@ -75,7 +75,11 @@ THIRD_PARTY_APPS = [
|
|||
"allauth.account",
|
||||
"allauth.socialaccount",
|
||||
"rest_framework",
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
"django_celery_beat",
|
||||
{%- endif %}
|
||||
]
|
||||
|
||||
LOCAL_APPS = [
|
||||
"{{ cookiecutter.project_slug }}.users.apps.UsersConfig",
|
||||
# Your stuff: custom apps go here
|
||||
|
@ -167,8 +171,6 @@ TEMPLATES = [
|
|||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
|
||||
"DIRS": [str(APPS_DIR.path("templates"))],
|
||||
"OPTIONS": {
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-debug
|
||||
"debug": DEBUG,
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
|
||||
# https://docs.djangoproject.com/en/dev/ref/templates/api/#loader-types
|
||||
"loaders": [
|
||||
|
@ -214,6 +216,8 @@ X_FRAME_OPTIONS = "DENY"
|
|||
EMAIL_BACKEND = env(
|
||||
"DJANGO_EMAIL_BACKEND", default="django.core.mail.backends.smtp.EmailBackend"
|
||||
)
|
||||
# https://docs.djangoproject.com/en/2.2/ref/settings/#email-timeout
|
||||
EMAIL_TIMEOUT = 5
|
||||
|
||||
# ADMIN
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -270,6 +274,8 @@ CELERY_TASK_TIME_LIMIT = 5 * 60
|
|||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#task-soft-time-limit
|
||||
# TODO: set to whatever value is adequate in your circumstances
|
||||
CELERY_TASK_SOFT_TIME_LIMIT = 60
|
||||
# http://docs.celeryproject.org/en/latest/userguide/configuration.html#beat-scheduler
|
||||
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
||||
|
||||
{%- endif %}
|
||||
# django-allauth
|
||||
|
|
|
@ -23,11 +23,6 @@ CACHES = {
|
|||
}
|
||||
}
|
||||
|
||||
# TEMPLATES
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
||||
TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405
|
||||
|
||||
# EMAIL
|
||||
# ------------------------------------------------------------------------------
|
||||
{% if cookiecutter.use_mailhog == 'y' and cookiecutter.use_docker == 'y' -%}
|
||||
|
|
|
@ -179,10 +179,6 @@ ANYMAIL = {
|
|||
"MAILGUN_API_URL": env("MAILGUN_API_URL", default="https://api.mailgun.net/v3"),
|
||||
}
|
||||
|
||||
# Gunicorn
|
||||
# ------------------------------------------------------------------------------
|
||||
INSTALLED_APPS += ["gunicorn"] # noqa F405
|
||||
|
||||
{% if cookiecutter.use_whitenoise == 'y' -%}
|
||||
# WhiteNoise
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -34,8 +34,6 @@ PASSWORD_HASHERS = ["django.contrib.auth.hashers.MD5PasswordHasher"]
|
|||
|
||||
# TEMPLATES
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#templates
|
||||
TEMPLATES[0]["OPTIONS"]["debug"] = DEBUG # noqa F405
|
||||
TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405
|
||||
(
|
||||
"django.template.loaders.cached.Loader",
|
||||
|
@ -50,10 +48,6 @@ TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405
|
|||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
|
||||
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
|
||||
EMAIL_HOST = "localhost"
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
|
||||
EMAIL_PORT = 1025
|
||||
|
||||
# Your stuff...
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -14,7 +14,7 @@ This repository comes with already prepared "Run/Debug Configurations" for docke
|
|||
|
||||
.. image:: images/2.png
|
||||
|
||||
But as you can see, at the beggining there is something wrong with them. They have red X on django icon, and they cannot be used, without configuring remote python interpteter. To do that, you have to go to *Settings > Build, Execution, Deployment* first.
|
||||
But as you can see, at the beginning there is something wrong with them. They have red X on django icon, and they cannot be used, without configuring remote python interpteter. To do that, you have to go to *Settings > Build, Execution, Deployment* first.
|
||||
|
||||
|
||||
Next, you have to add new remote python interpreter, based on already tested deployment settings. Go to *Settings > Project > Project Interpreter*. Click on the cog icon, and click *Add Remote*.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[pytest]
|
||||
DJANGO_SETTINGS_MODULE=config.settings.test
|
||||
addopts = --ds=config.settings.test
|
||||
{%- if cookiecutter.js_task_runner != 'None' %}
|
||||
norecursedirs = node_modules
|
||||
{%- endif %}
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
pytz==2019.1 # https://github.com/stub42/pytz
|
||||
python-slugify==3.0.2 # https://github.com/un33k/python-slugify
|
||||
Pillow==6.0.0 # https://github.com/python-pillow/Pillow
|
||||
Pillow==6.1.0 # https://github.com/python-pillow/Pillow
|
||||
{%- if cookiecutter.use_compressor == "y" %}
|
||||
rcssmin==1.0.6{% if cookiecutter.windows == 'y' and cookiecutter.use_docker == 'n' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin
|
||||
{%- endif %}
|
||||
argon2-cffi==19.1.0 # https://github.com/hynek/argon2_cffi
|
||||
{%- if cookiecutter.use_whitenoise == 'y' %}
|
||||
whitenoise==4.1.2 # https://github.com/evansd/whitenoise
|
||||
whitenoise==4.1.3 # https://github.com/evansd/whitenoise
|
||||
{%- endif %}
|
||||
redis==3.2.1 # https://github.com/antirez/redis
|
||||
{%- if cookiecutter.use_celery == "y" %}
|
||||
celery==4.3.0 # pyup: < 5.0 # https://github.com/celery/celery
|
||||
django-celery-beat==1.5.0 # https://github.com/celery/django-celery-beat
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
flower==0.9.3 # https://github.com/mher/flower
|
||||
{%- endif %}
|
||||
|
@ -18,9 +19,9 @@ flower==0.9.3 # https://github.com/mher/flower
|
|||
|
||||
# Django
|
||||
# ------------------------------------------------------------------------------
|
||||
django==2.2.2 # pyup: < 3.0 # https://www.djangoproject.com/
|
||||
django==2.2.3 # pyup: < 3.0 # https://www.djangoproject.com/
|
||||
django-environ==0.4.5 # https://github.com/joke2k/django-environ
|
||||
django-model-utils==3.1.2 # https://github.com/jazzband/django-model-utils
|
||||
django-model-utils==3.2.0 # https://github.com/jazzband/django-model-utils
|
||||
django-allauth==0.39.1 # https://github.com/pennersr/django-allauth
|
||||
django-crispy-forms==1.7.2 # https://github.com/django-crispy-forms/django-crispy-forms
|
||||
{%- if cookiecutter.use_compressor == "y" %}
|
||||
|
@ -29,5 +30,5 @@ django-compressor==2.3 # https://github.com/django-compressor/django-compressor
|
|||
django-redis==4.10.0 # https://github.com/niwinz/django-redis
|
||||
|
||||
# Django REST Framework
|
||||
djangorestframework==3.9.4 # https://github.com/encode/django-rest-framework
|
||||
djangorestframework==3.10.0 # https://github.com/encode/django-rest-framework
|
||||
coreapi==2.3.3 # https://github.com/core-api/python-client
|
||||
|
|
|
@ -2,25 +2,25 @@
|
|||
|
||||
Werkzeug==0.14.1 # pyup: < 0.15 # https://github.com/pallets/werkzeug
|
||||
ipdb==0.12 # https://github.com/gotcha/ipdb
|
||||
Sphinx==2.1.0 # https://github.com/sphinx-doc/sphinx
|
||||
Sphinx==2.1.2 # https://github.com/sphinx-doc/sphinx
|
||||
{%- if cookiecutter.use_docker == 'y' %}
|
||||
psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2
|
||||
psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2
|
||||
{%- else %}
|
||||
psycopg2-binary==2.8.2 # https://github.com/psycopg/psycopg2
|
||||
psycopg2-binary==2.8.3 # https://github.com/psycopg/psycopg2
|
||||
{%- endif %}
|
||||
|
||||
# Testing
|
||||
# ------------------------------------------------------------------------------
|
||||
mypy==0.701 # https://github.com/python/mypy
|
||||
pytest==4.6.0 # https://github.com/pytest-dev/pytest
|
||||
mypy==0.720 # https://github.com/python/mypy
|
||||
pytest==5.0.1 # https://github.com/pytest-dev/pytest
|
||||
pytest-sugar==0.9.2 # https://github.com/Frozenball/pytest-sugar
|
||||
|
||||
# Code quality
|
||||
# ------------------------------------------------------------------------------
|
||||
flake8==3.7.7 # https://github.com/PyCQA/flake8
|
||||
flake8==3.7.8 # https://github.com/PyCQA/flake8
|
||||
coverage==4.5.3 # https://github.com/nedbat/coveragepy
|
||||
black==19.3b0 # https://github.com/ambv/black
|
||||
pylint-django==2.0.9 # https://github.com/PyCQA/pylint-django
|
||||
pylint-django==2.0.11 # https://github.com/PyCQA/pylint-django
|
||||
{%- if cookiecutter.use_celery == 'y' %}
|
||||
pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
|
||||
{%- endif %}
|
||||
|
@ -29,7 +29,7 @@ pylint-celery==0.3 # https://github.com/PyCQA/pylint-celery
|
|||
# ------------------------------------------------------------------------------
|
||||
factory-boy==2.12.0 # https://github.com/FactoryBoy/factory_boy
|
||||
|
||||
django-debug-toolbar==1.11 # https://github.com/jazzband/django-debug-toolbar
|
||||
django-extensions==2.1.7 # https://github.com/django-extensions/django-extensions
|
||||
django-debug-toolbar==2.0 # https://github.com/jazzband/django-debug-toolbar
|
||||
django-extensions==2.1.9 # https://github.com/django-extensions/django-extensions
|
||||
django-coverage-plugin==1.6.0 # https://github.com/nedbat/django_coverage_plugin
|
||||
pytest-django==3.4.8 # https://github.com/pytest-dev/pytest-django
|
||||
pytest-django==3.5.1 # https://github.com/pytest-dev/pytest-django
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
-r ./base.txt
|
||||
|
||||
gunicorn==19.9.0 # https://github.com/benoitc/gunicorn
|
||||
psycopg2==2.8.2 --no-binary psycopg2 # https://github.com/psycopg/psycopg2
|
||||
psycopg2==2.8.3 --no-binary psycopg2 # https://github.com/psycopg/psycopg2
|
||||
{%- if cookiecutter.use_whitenoise == 'n' %}
|
||||
Collectfast==0.6.2 # https://github.com/antonagestam/collectfast
|
||||
{%- endif %}
|
||||
{%- if cookiecutter.use_sentry == "y" %}
|
||||
sentry-sdk==0.9.0 # https://github.com/getsentry/sentry-python
|
||||
sentry-sdk==0.10.2 # https://github.com/getsentry/sentry-python
|
||||
{%- endif %}
|
||||
|
||||
# Django
|
||||
|
@ -18,4 +18,4 @@ django-storages[boto3]==1.7.1 # https://github.com/jschneier/django-storages
|
|||
{%- elif cookiecutter.cloud_provider == 'GCP' %}
|
||||
django-storages[google]==1.7.1 # https://github.com/jschneier/django-storages
|
||||
{%- endif %}
|
||||
django-anymail[mailgun]==6.0.1 # https://github.com/anymail/django-anymail
|
||||
django-anymail[mailgun]==6.1.0 # https://github.com/anymail/django-anymail
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<form method="POST" action=".">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" name="action" value="{% trans 'change password' %}"/>
|
||||
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'change password' %}"/>
|
||||
</form>
|
||||
{% else %}
|
||||
<p>{% trans 'Your password is now changed.' %}</p>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<form method="POST" action="{% url 'account_set_password' %}" class="password_set">
|
||||
{% csrf_token %}
|
||||
{{ form|crispy }}
|
||||
<input type="submit" name="action" value="{% trans 'Set Password' %}"/>
|
||||
<input class="btn btn-primary" type="submit" name="action" value="{% trans 'Set Password' %}"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% endraw %}
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">{{ message }}</div>
|
||||
<div class="alert {% if message.tags %}alert-{{ message.tags }}{% endif %}">{{ message }}<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
{% raw %}{% extends "base.html" %}
|
||||
{% load static i18n %}
|
||||
{% block title %}Members{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container">
|
||||
<h2>Users</h2>
|
||||
|
||||
<div class="list-group">
|
||||
{% for user in user_list %}
|
||||
<a href="{% url 'users:detail' user.username %}" class="list-group-item">
|
||||
<h4 class="list-group-item-heading">{{ user.username }}</h4>
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}{% endraw %}
|
Loading…
Reference in New Issue
Block a user