mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-09 14:34:53 +03:00
Merge branch 'master' into 1639-split-issue-templates-by-categories
This commit is contained in:
commit
4a22100cf8
|
@ -141,6 +141,7 @@ Listed in alphabetical order.
|
|||
Roman Afanaskin `@siauPatrick`_
|
||||
Roman Osipenko `@romanosipenko`_
|
||||
Russell Davies
|
||||
Sascha `@saschalalala` @saschalalala
|
||||
Sam Collins `@MightySCollins`_
|
||||
Shupeyko Nikita `@webyneter`_
|
||||
Sławek Ehlert `@slafs`_
|
||||
|
|
|
@ -158,13 +158,13 @@ Answer the prompts with your own desired options_. For example::
|
|||
domain_name [example.com]: myreddit.com
|
||||
version [0.1.0]: 0.0.1
|
||||
timezone [UTC]: America/Los_Angeles
|
||||
use_whitenoise [y]: n
|
||||
use_whitenoise [n]: n
|
||||
use_celery [n]: y
|
||||
use_mailhog [n]: n
|
||||
use_sentry [y]: y
|
||||
use_sentry [n]: y
|
||||
use_pycharm [n]: y
|
||||
windows [n]: n
|
||||
use_docker [y]: n
|
||||
use_docker [n]: n
|
||||
use_heroku [n]: y
|
||||
use_compressor [n]: y
|
||||
Select postgresql_version:
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"project_slug": "{{ cookiecutter.project_name.lower()|replace(' ', '_')|replace('-', '_') }}",
|
||||
"description": "Behold My Awesome Project!",
|
||||
"author_name": "Daniel Roy Greenfeld",
|
||||
"email": "{{ cookiecutter.author_name.lower()|replace(' ', '-') }}@example.com",
|
||||
"domain_name": "example.com",
|
||||
"email": "{{ cookiecutter.author_name.lower()|replace(' ', '-') }}@example.com",
|
||||
"version": "0.1.0",
|
||||
"open_source_license": [
|
||||
"MIT",
|
||||
|
@ -28,15 +28,14 @@
|
|||
],
|
||||
"js_task_runner": [
|
||||
"None",
|
||||
"Gulp",
|
||||
"Grunt"
|
||||
"Gulp"
|
||||
],
|
||||
"custom_bootstrap_compilation": "n",
|
||||
"use_compressor": "n",
|
||||
"use_celery": "n",
|
||||
"use_mailhog": "n",
|
||||
"use_sentry": "y",
|
||||
"use_whitenoise": "y",
|
||||
"use_sentry": "n",
|
||||
"use_whitenoise": "n",
|
||||
"use_heroku": "n",
|
||||
"use_travisci": "n",
|
||||
"keep_local_envs_in_vcs": "y",
|
||||
|
|
|
@ -18,7 +18,7 @@ Run these commands to deploy the project to Heroku:
|
|||
|
||||
heroku config:set WEB_CONCURRENCY=4
|
||||
# Generating a 32 character-long random string without any of the visually similiar characters "IOl01":
|
||||
heroku config:set DJANGO_ADMIN_URL="^$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/"
|
||||
heroku config:set DJANGO_ADMIN_URL="$(openssl rand -base64 4096 | tr -dc 'A-HJ-NP-Za-km-z2-9' | head -c 32)/"
|
||||
heroku config:set DJANGO_SECRET_KEY="$(openssl rand -base64 64)"
|
||||
heroku config:set DJANGO_SETTINGS_MODULE=config.settings.production
|
||||
heroku config:set DJANGO_ALLOWED_HOSTS='.herokuapp.com'
|
||||
|
@ -33,6 +33,7 @@ Run these commands to deploy the project to Heroku:
|
|||
heroku config:set PYTHONHASHSEED=random
|
||||
|
||||
git push heroku master
|
||||
heroku run python manage.py migrate
|
||||
heroku run python manage.py check --deploy
|
||||
heroku run python manage.py createsuperuser
|
||||
heroku open
|
||||
|
|
|
@ -84,6 +84,10 @@ Once this is ready, you can run it with::
|
|||
|
||||
docker-compose -f production.yml up
|
||||
|
||||
To run the stack and detach the containers, run::
|
||||
|
||||
docker-compose -f production.yml up -d
|
||||
|
||||
To run a migration, open up a second terminal and run::
|
||||
|
||||
docker-compose -f production.yml run --rm django python manage.py migrate
|
||||
|
|
|
@ -1,31 +1,31 @@
|
|||
Project Generation Options
|
||||
==========================
|
||||
|
||||
project_name [My Awesome Project]:
|
||||
project_name:
|
||||
Your project's human-readable name, capitals and spaces allowed.
|
||||
|
||||
project_slug [my_awesome_project]:
|
||||
project_slug:
|
||||
Your project's slug without dashes or spaces. Used to name your repo
|
||||
and in other places where a Python-importable version of your project name
|
||||
is needed.
|
||||
|
||||
description [Behold My Awesome Project!]
|
||||
description:
|
||||
Describes your project and gets used in places like ``README.rst`` and such.
|
||||
|
||||
author_name [Daniel Roy Greenfeld]:
|
||||
author_name:
|
||||
This is you! The value goes into places like ``LICENSE`` and such.
|
||||
|
||||
email [daniel-roy-greenfeld@example.com]:
|
||||
email:
|
||||
The email address you want to identify yourself in the project.
|
||||
|
||||
domain_name [example.com]
|
||||
domain_name:
|
||||
The domain name you plan to use for your project once it goes live.
|
||||
Note that it can be safely changed later on whenever you need to.
|
||||
|
||||
version [0.1.0]
|
||||
version:
|
||||
The version of the project at its inception.
|
||||
|
||||
open_source_license [1]
|
||||
open_source_license:
|
||||
A software license for the project. The choices are:
|
||||
|
||||
1. MIT_
|
||||
|
@ -34,19 +34,19 @@ open_source_license [1]
|
|||
4. `Apache Software License 2.0`_
|
||||
5. Not open source
|
||||
|
||||
timezone [UTC]
|
||||
timezone:
|
||||
The value to be used for the ``TIME_ZONE`` setting of the project.
|
||||
|
||||
windows [n]
|
||||
windows:
|
||||
Indicates whether the project should be configured for development on Windows.
|
||||
|
||||
use_pycharm [n]
|
||||
use_pycharm:
|
||||
Indicates whether the project should be configured for development with PyCharm_.
|
||||
|
||||
use_docker [y]
|
||||
use_docker:
|
||||
Indicates whether the project should be configured to use Docker_ and `Docker Compose`_.
|
||||
|
||||
postgresql_version [1]
|
||||
postgresql_version:
|
||||
Select a PostgreSQL_ version to use. The choices are:
|
||||
|
||||
1. 10.3
|
||||
|
@ -57,46 +57,45 @@ postgresql_version [1]
|
|||
6. 9.4
|
||||
7. 9.3
|
||||
|
||||
js_task_runner [1]
|
||||
js_task_runner:
|
||||
Select a JavaScript task runner. The choices are:
|
||||
|
||||
1. Gulp_
|
||||
2. Grunt_
|
||||
3. None
|
||||
1. None
|
||||
2. Gulp_
|
||||
|
||||
custom_bootstrap_compilation [n]
|
||||
custom_bootstrap_compilation:
|
||||
Indicates whether the project should support Bootstrap recompilation
|
||||
via the selected JavaScript task runner's task. This can be useful
|
||||
for real-time Bootstrap variable alteration.
|
||||
|
||||
use_compressor [n]
|
||||
use_compressor:
|
||||
Indicates whether the project should be configured to use `Django Compressor`_.
|
||||
|
||||
use_celery [n]
|
||||
use_celery:
|
||||
Indicates whether the project should be configured to use Celery_.
|
||||
|
||||
use_mailhog [n]
|
||||
use_mailhog:
|
||||
Indicates whether the project should be configured to use MailHog_.
|
||||
|
||||
use_sentry [n]
|
||||
use_sentry:
|
||||
Indicates whether the project should be configured to use Sentry_.
|
||||
|
||||
use_whitenoise [y]
|
||||
use_whitenoise:
|
||||
Indicates whether the project should be configured to use WhiteNoise_.
|
||||
|
||||
use_heroku [n]
|
||||
use_heroku:
|
||||
Indicates whether the project should be configured so as to be deployable
|
||||
to Heroku_.
|
||||
|
||||
use_travisci [n]
|
||||
use_travisci:
|
||||
Indicates whether the project should be configured to use `Travis CI`_.
|
||||
|
||||
keep_local_envs_in_vcs [y]
|
||||
keep_local_envs_in_vcs:
|
||||
Indicates whether the project's ``.envs/.local/`` should be kept in VCS
|
||||
(comes in handy when working in teams where local environment reproducibility
|
||||
is strongly encouraged).
|
||||
|
||||
debug [n]
|
||||
debug:
|
||||
Indicates whether the project should be configured for debugging.
|
||||
This option is relevant for Cookiecutter Django developers only.
|
||||
|
||||
|
@ -114,7 +113,6 @@ debug [n]
|
|||
.. _PostgreSQL: https://www.postgresql.org/docs/
|
||||
|
||||
.. _Gulp: https://github.com/gulpjs/gulp
|
||||
.. _Grunt: https://github.com/gruntjs/grunt
|
||||
|
||||
.. _Django Compressor: https://github.com/django-compressor/django-compressor
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ DJANGO_READ_DOT_ENV_FILE READ_DOT_ENV_FILE False
|
|||
======================================= =========================== ============================================== ======================================================================
|
||||
Environment Variable Django Setting Development Default Production Default
|
||||
======================================= =========================== ============================================== ======================================================================
|
||||
DJANGO_ADMIN_URL n/a r'^admin/' raises error
|
||||
DJANGO_ADMIN_URL n/a 'admin/' raises error
|
||||
DJANGO_CACHES CACHES (default) locmem redis
|
||||
DJANGO_DATABASES DATABASES (default) See code See code
|
||||
DJANGO_DEBUG DEBUG True False
|
||||
|
|
|
@ -67,12 +67,6 @@ def remove_heroku_files():
|
|||
os.remove(file_name)
|
||||
|
||||
|
||||
def remove_grunt_files():
|
||||
file_names = ["Gruntfile.js"]
|
||||
for file_name in file_names:
|
||||
os.remove(file_name)
|
||||
|
||||
|
||||
def remove_gulp_files():
|
||||
file_names = ["gulpfile.js"]
|
||||
for file_name in file_names:
|
||||
|
@ -160,7 +154,7 @@ def set_django_admin_url(file_path):
|
|||
django_admin_url = set_flag(
|
||||
file_path,
|
||||
"!!!SET DJANGO_ADMIN_URL!!!",
|
||||
formatted="^{}/",
|
||||
formatted="{}/",
|
||||
length=32,
|
||||
using_digits=True,
|
||||
using_ascii_letters=True,
|
||||
|
@ -264,16 +258,11 @@ def main():
|
|||
if "{{ cookiecutter.keep_local_envs_in_vcs }}".lower() == "y":
|
||||
append_to_gitignore_file("!.envs/.local/")
|
||||
|
||||
if "{{ cookiecutter.js_task_runner}}".lower() == "gulp":
|
||||
remove_grunt_files()
|
||||
elif "{{ cookiecutter.js_task_runner}}".lower() == "grunt":
|
||||
if "{{ cookiecutter.js_task_runner}}".lower() == "none":
|
||||
remove_gulp_files()
|
||||
else:
|
||||
remove_gulp_files()
|
||||
remove_grunt_files()
|
||||
remove_packagejson_file()
|
||||
if (
|
||||
"{{ cookiecutter.js_task_runner }}".lower() in ["grunt", "gulp"]
|
||||
"{{ cookiecutter.js_task_runner }}".lower() != "none"
|
||||
and "{{ cookiecutter.use_docker }}".lower() == "y"
|
||||
):
|
||||
print(
|
||||
|
|
|
@ -11,7 +11,7 @@ mkdir -p .cache/docker
|
|||
cd .cache/docker
|
||||
|
||||
# create the project using the default settings in cookiecutter.json
|
||||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y js_task_runner=None
|
||||
cookiecutter ../../ --no-input --overwrite-if-exists use_docker=y
|
||||
cd my_awesome_project
|
||||
|
||||
# run the project's tests
|
||||
|
|
3
{{cookiecutter.project_slug}}/.gitignore
vendored
3
{{cookiecutter.project_slug}}/.gitignore
vendored
|
@ -105,9 +105,6 @@ coverage
|
|||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
|
|
6
{{cookiecutter.project_slug}}/.idea/misc.xml
Normal file
6
{{cookiecutter.project_slug}}/.idea/misc.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptSettings">
|
||||
<option name="languageLevel" value="ES6" />
|
||||
</component>
|
||||
</project>
|
8
{{cookiecutter.project_slug}}/.idea/modules.xml
Normal file
8
{{cookiecutter.project_slug}}/.idea/modules.xml
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/{{ cookiecutter.project_slug }}.iml" filepath="$PROJECT_DIR$/.idea/{{ cookiecutter.project_slug }}.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -1,33 +0,0 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: runserver" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.local" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list>
|
||||
<mapping local-root="$PROJECT_DIR$" remote-root="/app" />
|
||||
</list>
|
||||
</option>
|
||||
</PathMappingSettings>
|
||||
<option name="launchJavascriptDebuger" value="false" />
|
||||
<option name="port" value="8000" />
|
||||
<option name="host" value="0.0.0.0" />
|
||||
<option name="additionalOptions" value="" />
|
||||
<option name="browserUrl" value="" />
|
||||
<option name="runTestServer" value="false" />
|
||||
<option name="runNoReload" value="false" />
|
||||
<option name="useCustomRunCommand" value="false" />
|
||||
<option name="customRunCommand" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,5 +1,6 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="merge_production_dotenvs_in_dotenv" type="PythonConfigurationType" factoryName="Python" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
|
@ -10,7 +11,6 @@
|
|||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="merge_production_dotenvs_in_dotenv.py" />
|
||||
<option name="PARAMETERS" value="" />
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: migrate" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<configuration default="false" name="migrate" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.local" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list>
|
|
@ -0,0 +1,33 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="runserver" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.local" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list>
|
||||
<mapping local-root="$PROJECT_DIR$" remote-root="/app" />
|
||||
</list>
|
||||
</option>
|
||||
</PathMappingSettings>
|
||||
<option name="launchJavascriptDebuger" value="false" />
|
||||
<option name="port" value="8000" />
|
||||
<option name="host" value="0.0.0.0" />
|
||||
<option name="additionalOptions" value="" />
|
||||
<option name="browserUrl" value="" />
|
||||
<option name="runTestServer" value="false" />
|
||||
<option name="runNoReload" value="false" />
|
||||
<option name="useCustomRunCommand" value="false" />
|
||||
<option name="customRunCommand" value="" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: runserver_plus" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<configuration default="false" name="runserver_plus" type="Python.DjangoServer" factoryName="Django server" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.local" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="false" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
||||
<list>
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: tests - all" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<configuration default="false" name="tests - all" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.test" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: tests - class: TestUser" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<configuration default="false" name="tests - class: TestUser" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.test" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: tests - file: test_models" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<configuration default="false" name="tests - file: test_models" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.test" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: tests - module: users" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<configuration default="false" name="tests - module: users" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.test" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
|
@ -1,17 +1,17 @@
|
|||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Docker: tests - specific: test_get_absolute_url" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<configuration default="false" name="tests - specific: test_get_absolute_url" type="DjangoTestsConfigurationType" factoryName="Django tests" singleton="true">
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<option name="INTERPRETER_OPTIONS" value="" />
|
||||
<option name="PARENT_ENVS" value="true" />
|
||||
<envs>
|
||||
<env name="PYTHONUNBUFFERED" value="1" />
|
||||
<env name="DJANGO_SETTINGS_MODULE" value="config.settings.test" />
|
||||
</envs>
|
||||
<option name="SDK_HOME" value="docker-compose://[$PROJECT_DIR$/local.yml]:django/python" />
|
||||
<option name="SDK_HOME" value="" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
<option name="IS_MODULE_SDK" value="true" />
|
||||
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<module name="{{ cookiecutter.project_slug }}" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" enabled="false" sample_coverage="true" runner="coverage.py" />
|
||||
<PathMappingSettings>
|
||||
<option name="pathMappings">
|
|
@ -3,4 +3,4 @@
|
|||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
</project>
|
||||
|
|
|
@ -5,19 +5,32 @@
|
|||
<configuration>
|
||||
<option name="rootFolder" value="$MODULE_DIR$" />
|
||||
<option name="settingsModule" value="config/settings/local.py" />
|
||||
<option name="manageScript" value="manage.py" />
|
||||
<option name="manageScript" value="$MODULE_DIR$/manage.py" />
|
||||
<option name="environment" value="<map/>" />
|
||||
<option name="doNotUseTestRunner" value="false" />
|
||||
<option name="trackFilePattern" value="migrations" />
|
||||
</configuration>
|
||||
</facet>
|
||||
</component>
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
{% if cookiecutter.js_task_runner != 'None' %}
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
|
||||
</content>
|
||||
{% else %}
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
{% endif %}
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
<component name="PackageRequirementsSettings">
|
||||
<option name="requirementsPath" value="$MODULE_DIR$/requirements/local.txt" />
|
||||
</component>
|
||||
<component name="PyDocumentationSettings">
|
||||
<option name="renderExternalDocumentation" value="true" />
|
||||
</component>
|
||||
<component name="ReSTService">
|
||||
<option name="workdir" value="$MODULE_DIR$/docs" />
|
||||
<option name="DOC_DIR" value="$MODULE_DIR$/docs" />
|
||||
</component>
|
||||
<component name="TemplatesService">
|
||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
||||
|
@ -31,4 +44,4 @@
|
|||
<option name="projectConfiguration" value="py.test" />
|
||||
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
||||
</component>
|
||||
</module>
|
||||
</module>
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
module.exports = function (grunt) {
|
||||
|
||||
var appConfig = grunt.file.readJSON('package.json');
|
||||
|
||||
// Load grunt tasks automatically
|
||||
// see: https://github.com/sindresorhus/load-grunt-tasks
|
||||
require('load-grunt-tasks')(grunt);
|
||||
|
||||
// Time how long tasks take. Can help when optimizing build times
|
||||
// see: https://npmjs.org/package/time-grunt
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
var pathsConfig = function (appName) {
|
||||
this.app = appName || appConfig.name;
|
||||
|
||||
return {
|
||||
app: this.app,
|
||||
templates: this.app + '/templates',
|
||||
css: this.app + '/static/css',
|
||||
sass: this.app + '/static/sass',
|
||||
fonts: this.app + '/static/fonts',
|
||||
images: this.app + '/static/images',
|
||||
js: this.app + '/static/js',
|
||||
manageScript: 'manage.py',
|
||||
}
|
||||
};
|
||||
|
||||
grunt.initConfig({
|
||||
|
||||
paths: pathsConfig(),
|
||||
pkg: appConfig,
|
||||
|
||||
// see: https://github.com/gruntjs/grunt-contrib-watch
|
||||
watch: {
|
||||
gruntfile: {
|
||||
files: ['Gruntfile.js']
|
||||
},
|
||||
sass: {
|
||||
files: ['<%= paths.sass %>/**/*.{scss,sass}'],
|
||||
tasks: ['sass:dev'],
|
||||
options: {
|
||||
atBegin: true
|
||||
}
|
||||
},
|
||||
livereload: {
|
||||
files: [
|
||||
'<%= paths.js %>/**/*.js',
|
||||
'<%= paths.sass %>/**/*.{scss,sass}',
|
||||
'<%= paths.app %>/**/*.html'
|
||||
],
|
||||
options: {
|
||||
spawn: false,
|
||||
livereload: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// see: https://github.com/sindresorhus/grunt-sass
|
||||
sass: {
|
||||
dev: {
|
||||
options: {
|
||||
outputStyle: 'nested',
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
includePaths: ['node_modules/bootstrap/scss'],
|
||||
{% endif %}
|
||||
sourceMap: false,
|
||||
precision: 10
|
||||
},
|
||||
files: {
|
||||
'<%= paths.css %>/project.css': '<%= paths.sass %>/project.scss'
|
||||
},
|
||||
},
|
||||
dist: {
|
||||
options: {
|
||||
outputStyle: 'compressed',
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
includePaths: ['node_modules/bootstrap/scss'],
|
||||
{% endif %}
|
||||
sourceMap: false,
|
||||
precision: 10
|
||||
},
|
||||
files: {
|
||||
'<%= paths.css %>/project.css': '<%= paths.sass %>/project.scss'
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
//see https://github.com/nDmitry/grunt-postcss
|
||||
postcss: {
|
||||
options: {
|
||||
map: true, // inline sourcemaps
|
||||
|
||||
processors: [
|
||||
require('pixrem')(), // add fallbacks for rem units
|
||||
require('autoprefixer')({browsers: [
|
||||
'Android 2.3',
|
||||
'Android >= 4',
|
||||
'Chrome >= 20',
|
||||
'Firefox >= 24',
|
||||
'Explorer >= 8',
|
||||
'iOS >= 6',
|
||||
'Opera >= 12',
|
||||
'Safari >= 6'
|
||||
]}), // add vendor prefixes
|
||||
require('cssnano')() // minify the result
|
||||
]
|
||||
},
|
||||
dist: {
|
||||
src: '<%= paths.css %>/*.css'
|
||||
}
|
||||
},
|
||||
|
||||
// see: https://npmjs.org/package/grunt-bg-shell
|
||||
bgShell: {
|
||||
_defaults: {
|
||||
bg: true
|
||||
},
|
||||
runDjango: {
|
||||
cmd: 'python <%= paths.manageScript %> runserver'
|
||||
},
|
||||
{% if cookiecutter.use_mailhog == "y" and cookiecutter.use_docker == 'n' -%}runMailHog: {
|
||||
cmd: './mailhog'
|
||||
},{%- endif %}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('serve', [
|
||||
{% if cookiecutter.use_mailhog == "y" and cookiecutter.use_docker == 'n' -%}
|
||||
'bgShell:runMailHog',
|
||||
{%- endif %}
|
||||
'bgShell:runDjango',
|
||||
'watch'
|
||||
]);
|
||||
|
||||
grunt.registerTask('build', [
|
||||
'sass:dist',
|
||||
'postcss'
|
||||
]);
|
||||
|
||||
grunt.registerTask('default', [
|
||||
'build'
|
||||
]);
|
||||
|
||||
};
|
|
@ -1,4 +1,3 @@
|
|||
release: manage.py migrate
|
||||
web: gunicorn config.wsgi:application
|
||||
{% if cookiecutter.use_celery == "y" -%}
|
||||
worker: celery worker --app={{cookiecutter.project_slug}}.taskapp --loglevel=info
|
||||
|
|
|
@ -19,22 +19,22 @@ RUN apk update \
|
|||
COPY ./requirements /requirements
|
||||
RUN pip install -r /requirements/local.txt
|
||||
|
||||
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
|
||||
RUN sed -i 's/\r//' /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
COPY ./compose/production/django/entrypoint /entrypoint
|
||||
RUN sed -i 's/\r//' /entrypoint
|
||||
RUN chmod +x /entrypoint
|
||||
|
||||
COPY ./compose/local/django/start.sh /start.sh
|
||||
RUN sed -i 's/\r//' /start.sh
|
||||
RUN chmod +x /start.sh
|
||||
COPY ./compose/local/django/start /start
|
||||
RUN sed -i 's/\r//' /start
|
||||
RUN chmod +x /start
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
COPY ./compose/local/django/celery/worker/start.sh /start-celeryworker.sh
|
||||
RUN sed -i 's/\r//' /start-celeryworker.sh
|
||||
RUN chmod +x /start-celeryworker.sh
|
||||
COPY ./compose/local/django/celery/worker/start /start-celeryworker
|
||||
RUN sed -i 's/\r//' /start-celeryworker
|
||||
RUN chmod +x /start-celeryworker
|
||||
|
||||
COPY ./compose/local/django/celery/beat/start.sh /start-celerybeat.sh
|
||||
RUN sed -i 's/\r//' /start-celerybeat.sh
|
||||
RUN chmod +x /start-celerybeat.sh
|
||||
COPY ./compose/local/django/celery/beat/start /start-celerybeat
|
||||
RUN sed -i 's/\r//' /start-celerybeat
|
||||
RUN chmod +x /start-celerybeat
|
||||
{% endif %}
|
||||
WORKDIR /app
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/entrypoint"]
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
FROM abiosoft/caddy:0.10.6
|
||||
FROM abiosoft/caddy:0.11.0
|
||||
|
||||
COPY ./compose/production/caddy/Caddyfile /etc/Caddyfile
|
||||
|
|
|
@ -19,23 +19,23 @@ COPY ./requirements /requirements
|
|||
RUN pip install --no-cache-dir -r /requirements/production.txt \
|
||||
&& rm -rf /requirements
|
||||
|
||||
COPY ./compose/production/django/gunicorn.sh /gunicorn.sh
|
||||
RUN sed -i 's/\r//' /gunicorn.sh
|
||||
RUN chmod +x /gunicorn.sh
|
||||
RUN chown django /gunicorn.sh
|
||||
COPY ./compose/production/django/entrypoint /entrypoint
|
||||
RUN sed -i 's/\r//' /entrypoint
|
||||
RUN chmod +x /entrypoint
|
||||
RUN chown django /entrypoint
|
||||
|
||||
COPY ./compose/production/django/entrypoint.sh /entrypoint.sh
|
||||
RUN sed -i 's/\r//' /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
RUN chown django /entrypoint.sh
|
||||
COPY ./compose/production/django/start /start
|
||||
RUN sed -i 's/\r//' /start
|
||||
RUN chmod +x /start
|
||||
RUN chown django /start
|
||||
{% if cookiecutter.use_celery == "y" %}
|
||||
COPY ./compose/production/django/celery/worker/start.sh /start-celeryworker.sh
|
||||
RUN sed -i 's/\r//' /start-celeryworker.sh
|
||||
RUN chmod +x /start-celeryworker.sh
|
||||
COPY ./compose/production/django/celery/worker/start /start-celeryworker
|
||||
RUN sed -i 's/\r//' /start-celeryworker
|
||||
RUN chmod +x /start-celeryworker
|
||||
|
||||
COPY ./compose/production/django/celery/beat/start.sh /start-celerybeat.sh
|
||||
RUN sed -i 's/\r//' /start-celerybeat.sh
|
||||
RUN chmod +x /start-celerybeat.sh
|
||||
COPY ./compose/production/django/celery/beat/start /start-celerybeat
|
||||
RUN sed -i 's/\r//' /start-celerybeat
|
||||
RUN chmod +x /start-celerybeat
|
||||
{% endif %}
|
||||
COPY . /app
|
||||
|
||||
|
@ -45,4 +45,4 @@ USER django
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
ENTRYPOINT ["/entrypoint"]
|
||||
|
|
|
@ -5,8 +5,6 @@ set -o pipefail
|
|||
set -o nounset
|
||||
|
||||
|
||||
cmd="$@"
|
||||
|
||||
# N.B. If only .env files supported variable expansion...
|
||||
export CELERY_BROKER_URL="${REDIS_URL}"
|
||||
|
||||
|
@ -36,12 +34,10 @@ sys.exit(0)
|
|||
|
||||
END
|
||||
}
|
||||
|
||||
until postgres_ready; do
|
||||
>&2 echo 'PostgreSQL is unavailable (sleeping)...'
|
||||
>&2 echo 'Waiting for PostgreSQL to become available...'
|
||||
sleep 1
|
||||
done
|
||||
>&2 echo 'PostgreSQL is available'
|
||||
|
||||
>&2 echo 'PostgreSQL is up - continuing...'
|
||||
|
||||
exec $cmd
|
||||
exec "$@"
|
|
@ -6,4 +6,4 @@ set -o nounset
|
|||
|
||||
|
||||
python /app/manage.py collectstatic --noinput
|
||||
/usr/local/bin/gunicorn config.wsgi -b 0.0.0.0:5000 --chdir=/app
|
||||
/usr/local/bin/gunicorn config.wsgi --bind 0.0.0.0:5000 --chdir=/app
|
|
@ -216,8 +216,8 @@ EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.s
|
|||
|
||||
# ADMIN
|
||||
# ------------------------------------------------------------------------------
|
||||
# Django Admin URL regex.
|
||||
ADMIN_URL = r'^admin/'
|
||||
# Django Admin URL.
|
||||
ADMIN_URL = 'admin/'
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#admins
|
||||
ADMINS = [
|
||||
("""{{cookiecutter.author_name}}""", '{{cookiecutter.email}}'),
|
||||
|
|
|
@ -4,7 +4,7 @@ from .base import env
|
|||
# GENERAL
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#debug
|
||||
DEBUG = env.bool('DJANGO_DEBUG', default=True)
|
||||
DEBUG = True
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
||||
SECRET_KEY = env('DJANGO_SECRET_KEY', default='!!!SET DJANGO_SECRET_KEY!!!')
|
||||
# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
||||
|
|
|
@ -89,7 +89,7 @@ AWS_S3_OBJECT_PARAMETERS = {
|
|||
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
|
||||
{%- else %}
|
||||
STATICFILES_STORAGE = 'config.settings.production.StaticRootS3BotoStorage'
|
||||
STATIC_URL = 'https://s3.amazonaws.com/%s/static/' % AWS_STORAGE_BUCKET_NAME
|
||||
STATIC_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/static/'
|
||||
{%- endif %}
|
||||
|
||||
# MEDIA
|
||||
|
@ -99,7 +99,7 @@ DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
|||
MEDIA_URL = f'https://s3.amazonaws.com/{AWS_STORAGE_BUCKET_NAME}/'
|
||||
{%- else %}
|
||||
# region http://stackoverflow.com/questions/10390244/
|
||||
from storages.backends.s3boto3 import S3Boto3Storage
|
||||
from storages.backends.s3boto3 import S3Boto3Storage # noqa E402
|
||||
StaticRootS3BotoStorage = lambda: S3Boto3Storage(location='static') # noqa
|
||||
MediaRootS3BotoStorage = lambda: S3Boto3Storage(location='media', file_overwrite=False) # noqa
|
||||
# endregion
|
||||
|
@ -158,8 +158,8 @@ INSTALLED_APPS += ['gunicorn'] # noqa F405
|
|||
# http://whitenoise.evans.io/en/latest/django.html#enable-whitenoise
|
||||
MIDDLEWARE = ['whitenoise.middleware.WhiteNoiseMiddleware'] + MIDDLEWARE # noqa F405
|
||||
|
||||
{%- endif %}
|
||||
{% if cookiecutter.use_compressor == 'y' -%}
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_compressor == 'y' -%}
|
||||
# django-compressor
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_ENABLED
|
||||
|
@ -169,16 +169,16 @@ COMPRESS_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
|||
# https://django-compressor.readthedocs.io/en/latest/settings/#django.conf.settings.COMPRESS_URL
|
||||
COMPRESS_URL = STATIC_URL
|
||||
|
||||
{%- endif %}
|
||||
{% if cookiecutter.use_whitenoise == 'n' -%}
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_whitenoise == 'n' -%}
|
||||
# Collectfast
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://github.com/antonagestam/collectfast#installation
|
||||
INSTALLED_APPS = ['collectfast'] + INSTALLED_APPS # noqa F405
|
||||
AWS_PRELOAD_METADATA = True
|
||||
|
||||
{%- endif %}
|
||||
{% if cookiecutter.use_sentry == 'y' -%}
|
||||
{% endif %}
|
||||
{%- if cookiecutter.use_sentry == 'y' -%}
|
||||
# raven
|
||||
# ------------------------------------------------------------------------------
|
||||
# https://docs.sentry.io/clients/python/integrations/django/
|
||||
|
@ -241,6 +241,7 @@ SENTRY_CELERY_LOGLEVEL = env.int('DJANGO_SENTRY_LOG_LEVEL', logging.INFO)
|
|||
RAVEN_CONFIG = {
|
||||
'dsn': SENTRY_DSN
|
||||
}
|
||||
|
||||
{%- else %}
|
||||
# LOGGING
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -290,6 +291,6 @@ LOGGING = {
|
|||
}
|
||||
}
|
||||
|
||||
{%- endif %}
|
||||
{% endif %}
|
||||
# Your stuff...
|
||||
# ------------------------------------------------------------------------------
|
||||
|
|
|
@ -1,25 +1,25 @@
|
|||
from django.conf import settings
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path
|
||||
from django.conf.urls.static import static
|
||||
from django.contrib import admin
|
||||
from django.views.generic import TemplateView
|
||||
from django.views import defaults as default_views
|
||||
|
||||
urlpatterns = [
|
||||
url(r"^$", TemplateView.as_view(template_name="pages/home.html"), name="home"),
|
||||
url(
|
||||
r"^about/$",
|
||||
path("", TemplateView.as_view(template_name="pages/home.html"), name="home"),
|
||||
path(
|
||||
"about/",
|
||||
TemplateView.as_view(template_name="pages/about.html"),
|
||||
name="about",
|
||||
),
|
||||
# Django Admin, use {% raw %}{% url 'admin:index' %}{% endraw %}
|
||||
url(settings.ADMIN_URL, admin.site.urls),
|
||||
path(settings.ADMIN_URL, admin.site.urls),
|
||||
# User management
|
||||
url(
|
||||
r"^users/",
|
||||
path(
|
||||
"users/",
|
||||
include("{{ cookiecutter.project_slug }}.users.urls", namespace="users"),
|
||||
),
|
||||
url(r"^accounts/", include("allauth.urls")),
|
||||
path("accounts/", include("allauth.urls")),
|
||||
# Your stuff: custom urls includes go here
|
||||
] + static(
|
||||
settings.MEDIA_URL, document_root=settings.MEDIA_ROOT
|
||||
|
@ -29,24 +29,24 @@ if settings.DEBUG:
|
|||
# This allows the error pages to be debugged during development, just visit
|
||||
# these url in browser to see how these error pages look like.
|
||||
urlpatterns += [
|
||||
url(
|
||||
r"^400/$",
|
||||
path(
|
||||
"400/",
|
||||
default_views.bad_request,
|
||||
kwargs={"exception": Exception("Bad Request!")},
|
||||
),
|
||||
url(
|
||||
r"^403/$",
|
||||
path(
|
||||
"403/",
|
||||
default_views.permission_denied,
|
||||
kwargs={"exception": Exception("Permission Denied")},
|
||||
),
|
||||
url(
|
||||
r"^404/$",
|
||||
path(
|
||||
"404/",
|
||||
default_views.page_not_found,
|
||||
kwargs={"exception": Exception("Page not Found")},
|
||||
),
|
||||
url(r"^500/$", default_views.server_error),
|
||||
path("500/", default_views.server_error),
|
||||
]
|
||||
if "debug_toolbar" in settings.INSTALLED_APPS:
|
||||
import debug_toolbar
|
||||
|
||||
urlpatterns = [url(r"^__debug__/", include(debug_toolbar.urls))] + urlpatterns
|
||||
urlpatterns = [path("__debug__/", include(debug_toolbar.urls))] + urlpatterns
|
||||
|
|
|
@ -23,12 +23,10 @@ from django.core.wsgi import get_wsgi_application
|
|||
app_path = os.path.abspath(os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)), os.pardir))
|
||||
sys.path.append(os.path.join(app_path, '{{ cookiecutter.project_slug }}'))
|
||||
|
||||
{% if cookiecutter.use_sentry == 'y' -%}
|
||||
if os.environ.get('DJANGO_SETTINGS_MODULE') == 'config.settings.production':
|
||||
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
|
||||
{%- endif %}
|
||||
|
||||
# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
|
||||
# if running multiple sites in the same mod_wsgi process. To fix this, use
|
||||
# mod_wsgi daemon mode with each site in its own daemon process, or use
|
||||
|
|
|
@ -22,7 +22,7 @@ services:
|
|||
- ./.envs/.local/.postgres
|
||||
ports:
|
||||
- "8000:8000"
|
||||
command: /start.sh
|
||||
command: /start
|
||||
|
||||
postgres:
|
||||
build:
|
||||
|
@ -60,7 +60,7 @@ services:
|
|||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports: []
|
||||
command: /start-celeryworker.sh
|
||||
command: /start-celeryworker
|
||||
|
||||
celerybeat:
|
||||
<<: *django
|
||||
|
@ -75,6 +75,6 @@ services:
|
|||
- ./.envs/.local/.django
|
||||
- ./.envs/.local/.postgres
|
||||
ports: []
|
||||
command: /start-celerybeat.sh
|
||||
command: /start-celerybeat
|
||||
|
||||
{%- endif %}
|
||||
|
|
|
@ -3,28 +3,7 @@
|
|||
"version": "{{ cookiecutter.version }}",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
{% if cookiecutter.js_task_runner == 'Grunt' %}
|
||||
"autoprefixer": "~8.1.0",
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
"bootstrap": "^4.0.0",
|
||||
{% endif %}
|
||||
"connect-livereload": "~0.6.0",
|
||||
"cssnano": "~3.10.0",
|
||||
"grunt": "~1.0.2",
|
||||
"grunt-bg-shell": "~2.3.1",
|
||||
"grunt-contrib-watch": "~1.0.0",
|
||||
"grunt-postcss": "~0.9.0",
|
||||
"grunt-sass": "~2.1.0",
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
"jquery": "^3.2.1-slim",
|
||||
{% endif %}
|
||||
"load-grunt-tasks": "~3.2.0",
|
||||
"pixrem": "~4.0.1",
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
"popper.js": "^1.12.3",
|
||||
{% endif %}
|
||||
"time-grunt": "~1.2.1"
|
||||
{% elif cookiecutter.js_task_runner == 'Gulp' %}
|
||||
{% if cookiecutter.js_task_runner == 'Gulp' %}
|
||||
{% if cookiecutter.custom_bootstrap_compilation == 'y' %}
|
||||
"bootstrap": "^4.0.0",
|
||||
{% endif %}
|
||||
|
@ -54,11 +33,8 @@
|
|||
"node": ">=0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
{% if cookiecutter.js_task_runner == 'Grunt' %}
|
||||
"dev": "grunt serve"
|
||||
{% elif cookiecutter.js_task_runner == 'Gulp' %}
|
||||
{% if cookiecutter.js_task_runner == 'Gulp' %}
|
||||
"dev": "gulp"
|
||||
{% endif %}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ services:
|
|||
env_file:
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
command: /gunicorn.sh
|
||||
command: /start
|
||||
|
||||
postgres:
|
||||
build:
|
||||
|
@ -58,7 +58,7 @@ services:
|
|||
env_file:
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
command: /start-celeryworker.sh
|
||||
command: /start-celeryworker
|
||||
|
||||
celerybeat:
|
||||
<<: *django
|
||||
|
@ -69,6 +69,6 @@ services:
|
|||
env_file:
|
||||
- ./.envs/.production/.django
|
||||
- ./.envs/.production/.postgres
|
||||
command: /start-celerybeat.sh
|
||||
command: /start-celerybeat
|
||||
|
||||
{%- endif %}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
pytz==2018.4 # https://github.com/stub42/pytz
|
||||
awesome-slugify==1.6.5 # https://github.com/dimka665/awesome-slugify
|
||||
python-slugify==1.2.5 # https://github.com/un33k/python-slugify
|
||||
Pillow==5.1.0 # https://github.com/python-pillow/Pillow
|
||||
{%- if cookiecutter.use_compressor == "y" %}
|
||||
rcssmin==1.0.6{% if cookiecutter.windows == 'y' %} --install-option="--without-c-extensions"{% endif %} # https://github.com/ndparker/rcssmin
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
from django.conf.urls import url
|
||||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = "users"
|
||||
urlpatterns = [
|
||||
url(regex=r"^$", view=views.UserListView.as_view(), name="list"),
|
||||
url(regex=r"^~redirect/$", view=views.UserRedirectView.as_view(), name="redirect"),
|
||||
url(regex=r"^~update/$", view=views.UserUpdateView.as_view(), name="update"),
|
||||
url(
|
||||
regex=r"^(?P<username>[\w.@+-]+)/$",
|
||||
path("", view=views.UserListView.as_view(), name="list"),
|
||||
path("~redirect/", view=views.UserRedirectView.as_view(), name="redirect"),
|
||||
path("~update/", view=views.UserUpdateView.as_view(), name="update"),
|
||||
path(
|
||||
"<str:username>",
|
||||
view=views.UserDetailView.as_view(),
|
||||
name="detail",
|
||||
),
|
||||
|
|
Loading…
Reference in New Issue
Block a user