mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-05 04:30:16 +03:00
Fixing conflicts:
{{cookiecutter.repo_name}}/README.rst And updating the install.rst to have the info about the `runserver_plus` cmd
This commit is contained in:
commit
d499f71b9d
|
@ -5,3 +5,8 @@ before_install:
|
|||
|
||||
script:
|
||||
- pep8 --ignore E201,E202 --max-line-length=120 --exclude='migrations' .
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: never
|
||||
on_failure: never
|
||||
|
|
|
@ -13,7 +13,7 @@ Tom Offermann
|
|||
Lyla Fischer
|
||||
Taylor Baldwin
|
||||
Chris Curvey (@ccurvey)
|
||||
Fábio C. Barrionuevo da Luz (@luzfcb)
|
||||
Fábio C. Barrionuevo da Luz (@luzfcb)*
|
||||
Saurabh Kumar (gh: theskumar / @_theskumar)*
|
||||
Ashley Camba
|
||||
Yaroslav Halchenko
|
||||
|
@ -31,6 +31,12 @@ Alberto Sanchez / @alb3rto
|
|||
Eyad Al Sibai / @eyadsibai
|
||||
Chris Franklin
|
||||
Benjamin Abel
|
||||
Felipe Arruda / @arruda
|
||||
Matt Warren / @mfwarren
|
||||
Martin Blech
|
||||
Andy Rose
|
||||
Andrew Mikhnevich / @zcho
|
||||
Kevin Ndung'u / @kevgathuku
|
||||
|
||||
* Possesses commit rights
|
||||
|
||||
|
|
19
README.rst
19
README.rst
|
@ -6,13 +6,18 @@ cookiecutter-django
|
|||
:alt: Requirements Status
|
||||
|
||||
.. image:: https://travis-ci.org/pydanny/cookiecutter-django.svg?branch=master
|
||||
:target: https://travis-ci.org/pydanny/cookiecutter-django.svg?branch=master
|
||||
:target: https://travis-ci.org/pydanny/cookiecutter-django?branch=master
|
||||
:alt: Build Status
|
||||
|
||||
A cookiecutter_ template for Django.
|
||||
|
||||
.. _cookiecutter: https://github.com/audreyr/cookiecutter
|
||||
|
||||
Please update your version of cookiecutter!
|
||||
--------------------------------------------
|
||||
|
||||
This cookiecutter template uses features that exists only in cookiecutter 0.9.0 or higher.
|
||||
|
||||
Features
|
||||
---------
|
||||
|
||||
|
@ -72,13 +77,15 @@ It prompts you for questions. Answer them::
|
|||
remote: Total 550 (delta 283), reused 479 (delta 222)
|
||||
Receiving objects: 100% (550/550), 127.66 KiB | 58 KiB/s, done.
|
||||
Resolving deltas: 100% (283/283), done.
|
||||
project_name (default is "project_name")? Reddit Clone
|
||||
repo_name (default is "repo_name")? redditclone
|
||||
project_name (default is "project_name is the title of the project.")? Reddit Clone
|
||||
repo_name (default is "reddit_clone")? reddit
|
||||
author_name (default is "Your Name")? Daniel Greenfeld
|
||||
email (default is "Your email")? pydanny@gmail.com
|
||||
description (default is "A short description of the project.")? A reddit clone.
|
||||
year (default is "Current year")? 2014
|
||||
domain_name (default is "Domain name")?
|
||||
domain_name (default is "example.com")? myreddit.com
|
||||
version (default is "0.1.0")? 0.0.1
|
||||
now (default is "2015/01/13")? 2015/01/16
|
||||
year (default is "2015")?
|
||||
|
||||
|
||||
Enter the project and take a look around::
|
||||
|
@ -114,7 +121,7 @@ First make sure to create and activate a virtualenv_, then open a terminal at th
|
|||
Then, create a PostgreSQL database and add the database configuration using the ``dj-database-url`` app pattern: ``postgres://db_owner:password@dbserver_ip:port/db_name`` either:
|
||||
|
||||
* in the ``config.common.py`` setting file,
|
||||
* or in the env variable ``DATABASE_URL``
|
||||
* or in the env variable ``DATABASE_URL``
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
{
|
||||
"project_name": "project_name is the title of the project.",
|
||||
"repo_name":"repo_name is used for describing the directory structure.",
|
||||
"project_name": "project_name",
|
||||
"repo_name": "{{ cookiecutter.project_name|replace(' ', '_') }}",
|
||||
"author_name": "Your Name",
|
||||
"github_username": "your GitHub username",
|
||||
"email": "Your email",
|
||||
"description": "A short description of the project.",
|
||||
"year": "2014",
|
||||
"domain_name": "example.com",
|
||||
"version": "0.1.0",
|
||||
"now": "2014/06/15"
|
||||
"timezone": "UTC",
|
||||
"now": "2015/01/13",
|
||||
"year": "{{ cookiecutter.now[:4] }}"
|
||||
}
|
||||
|
|
2
{{cookiecutter.repo_name}}/.gitignore
vendored
2
{{cookiecutter.repo_name}}/.gitignore
vendored
|
@ -28,5 +28,5 @@ nosetests.xml
|
|||
# npm
|
||||
node_modules/
|
||||
|
||||
# Campass
|
||||
# Compass
|
||||
.sass-cache
|
||||
|
|
|
@ -18,8 +18,7 @@ Getting up and running
|
|||
|
||||
Just follow the steps described in https://{{ cookiecutter.repo_name }}.readthedocs.org/en/latest/install.html and you'll get yourself an up and running local development environment.
|
||||
|
||||
|
||||
Deployment
|
||||
------------
|
||||
|
||||
The instructions for deployment can be found at https://{{ cookiecutter.repo_name }}.readthedocs.org/en/latest/deploy.html
|
||||
The instructions for deployment can be found at https://{{ cookiecutter.repo_name }}.readthedocs.org/en/latest/deploy.html
|
||||
|
|
|
@ -42,7 +42,7 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'{{ cookiecutter.project_name }}'
|
||||
copyright = u'{{ cookiecutter.year }}, {{ cookiecutter.author_name }}'
|
||||
copyright = u"{{ cookiecutter.year }}, {{ cookiecutter.author_name }}"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
@ -187,7 +187,7 @@ latex_documents = [
|
|||
('index',
|
||||
'{{ cookiecutter.repo_name }}.tex',
|
||||
u'{{ cookiecutter.project_name }} Documentation',
|
||||
u'{{ cookiecutter.author_name }}', 'manual'),
|
||||
u"{{ cookiecutter.author_name }}", 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
@ -217,7 +217,7 @@ latex_documents = [
|
|||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
|
||||
[u'{{ cookiecutter.author_name }}'], 1)
|
||||
[u"{{ cookiecutter.author_name }}"], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
|
@ -231,7 +231,7 @@ man_pages = [
|
|||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', '{{ cookiecutter.repo_name }}', u'{{ cookiecutter.project_name }} Documentation',
|
||||
u'{{ cookiecutter.author_name }}', '{{ cookiecutter.project_name }}',
|
||||
u"{{ cookiecutter.author_name }}", '{{ cookiecutter.project_name }}',
|
||||
'{{ cookiecutter.description }}', 'Miscellaneous'),
|
||||
]
|
||||
|
||||
|
|
|
@ -16,9 +16,9 @@ First make sure to create and activate a virtualenv_, then open a terminal at th
|
|||
|
||||
.. _virtualenv: http://docs.python-guide.org/en/latest/dev/virtualenvs/
|
||||
|
||||
You can now run the usual Django ``runserver`` command (replace ``yourapp`` with the name of the directory containing the Django project)::
|
||||
You can now run the ``runserver_plus`` command::
|
||||
|
||||
$ python yourapp/manage.py runserver
|
||||
$ python {{cookiecutter.repo_name}}/manage.py runserver_plus
|
||||
|
||||
The base app will run but you'll need to carry out a few steps to make the sign-up and login forms work. These are currently detailed in `issue #39`_.
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# This file is here because many Platforms as a Service look for
|
||||
# requirements.txt in the root directory of a project.
|
||||
pylibmc==1.2.3
|
||||
django-heroku-memcacheify==0.7
|
||||
pylibmc==1.4.1
|
||||
django-heroku-memcacheify==0.8
|
||||
-r requirements/production.txt
|
||||
|
|
|
@ -1,38 +1,38 @@
|
|||
# Bleeding edge Django
|
||||
django==1.7.1
|
||||
django==1.7.5
|
||||
|
||||
# Configuration
|
||||
django-configurations==0.8
|
||||
django-secure==1.0
|
||||
django-secure==1.0.1
|
||||
django-cache-url==0.8.0
|
||||
dj-database-url==0.3.0
|
||||
|
||||
# Forms
|
||||
django-braces==1.4.0
|
||||
django-crispy-forms==1.4.0
|
||||
django-floppyforms==1.2.0
|
||||
django-floppyforms==1.3.0
|
||||
|
||||
# Models
|
||||
django-model-utils==2.2
|
||||
|
||||
# images
|
||||
Pillow==2.6.0
|
||||
# Images
|
||||
Pillow==2.7.0
|
||||
|
||||
# For user registration, either via email or social
|
||||
# Well-built with regular release cycles!
|
||||
django-allauth==0.18.0
|
||||
django-allauth==0.19.1
|
||||
|
||||
# For the persistance stores
|
||||
psycopg2==2.5.4
|
||||
# For the persistence stores
|
||||
psycopg2==2.6
|
||||
|
||||
# Unicode slugification
|
||||
unicode-slugify==0.1.1
|
||||
unicode-slugify==0.1.3
|
||||
django-autoslug==1.7.2
|
||||
|
||||
# Useful things
|
||||
django-avatar==2.0
|
||||
|
||||
# Time zones support
|
||||
pytz==2014.7
|
||||
pytz==2014.10
|
||||
|
||||
# Your custom requirements go here
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
-r base.txt
|
||||
coverage==3.7.1
|
||||
Sphinx
|
||||
django-extensions==1.5.0
|
||||
Werkzeug==0.10.1
|
||||
|
||||
# django-debug-toolbar that works with Django 1.5+
|
||||
django-debug-toolbar==1.2.1
|
||||
django-debug-toolbar==1.2.2
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
# production that isn't in development.
|
||||
-r base.txt
|
||||
|
||||
gunicorn==19.1.1
|
||||
gunicorn==19.2.1
|
||||
django-storages==1.1.8
|
||||
Collectfast==0.2.1
|
||||
gevent==1.0.1
|
||||
boto==2.32.1
|
||||
boto==2.36.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Test dependencies go here.
|
||||
-r base.txt
|
||||
coverage==3.7.1
|
||||
flake8==2.2.3
|
||||
flake8==2.3.0
|
||||
|
|
|
@ -16,14 +16,14 @@ version = {{ cookiecutter.repo_name }}.__version__
|
|||
setup(
|
||||
name='{{ cookiecutter.project_name }}',
|
||||
version=version,
|
||||
author='{{ cookiecutter.full_name }}',
|
||||
author="{{ cookiecutter.author_name }}",
|
||||
author_email='{{ cookiecutter.email }}',
|
||||
packages=[
|
||||
'{{ cookiecutter.repo_name }}',
|
||||
],
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'Django>=1.6.5',
|
||||
'Django>=1.7.4',
|
||||
],
|
||||
zip_safe=False,
|
||||
scripts=['{{ cookiecutter.repo_name }}/manage.py'],
|
||||
|
|
|
@ -57,7 +57,6 @@ class Common(Configuration):
|
|||
# MIDDLEWARE CONFIGURATION
|
||||
MIDDLEWARE_CLASSES = (
|
||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||
'djangosecure.middleware.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
'django.middleware.common.CommonMiddleware',
|
||||
'django.middleware.csrf.CsrfViewMiddleware',
|
||||
|
@ -85,7 +84,7 @@ class Common(Configuration):
|
|||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
|
||||
# Note: This key only used for development and testing.
|
||||
# In production, this is changed to a values.SecretValue() setting
|
||||
SECRET_KEY = "CHANGEME!!!"
|
||||
SECRET_KEY = 'CHANGEME!!!'
|
||||
# END SECRET CONFIGURATION
|
||||
|
||||
# FIXTURE CONFIGURATION
|
||||
|
@ -126,8 +125,12 @@ class Common(Configuration):
|
|||
# END CACHING
|
||||
|
||||
# GENERAL CONFIGURATION
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
|
||||
TIME_ZONE = 'America/Los_Angeles'
|
||||
|
||||
# Local time zone for this installation. Choices can be found here:
|
||||
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
||||
# although not all choices may be available on all operating systems.
|
||||
# In a Windows environment this must be set to your system time zone.
|
||||
TIME_ZONE = '{{ cookiecutter.timezone }}'
|
||||
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
|
@ -149,8 +152,8 @@ class Common(Configuration):
|
|||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-context-processors
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
'django.contrib.auth.context_processors.auth',
|
||||
"allauth.account.context_processors.account",
|
||||
"allauth.socialaccount.context_processors.socialaccount",
|
||||
'allauth.account.context_processors.account',
|
||||
'allauth.socialaccount.context_processors.socialaccount',
|
||||
'django.core.context_processors.debug',
|
||||
'django.core.context_processors.i18n',
|
||||
'django.core.context_processors.media',
|
||||
|
@ -211,25 +214,25 @@ class Common(Configuration):
|
|||
|
||||
# AUTHENTICATION CONFIGURATION
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
"django.contrib.auth.backends.ModelBackend",
|
||||
"allauth.account.auth_backends.AuthenticationBackend",
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
'allauth.account.auth_backends.AuthenticationBackend',
|
||||
)
|
||||
|
||||
# Some really nice defaults
|
||||
ACCOUNT_AUTHENTICATION_METHOD = "username"
|
||||
ACCOUNT_AUTHENTICATION_METHOD = 'username'
|
||||
ACCOUNT_EMAIL_REQUIRED = True
|
||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||
ACCOUNT_EMAIL_VERIFICATION = 'mandatory'
|
||||
# END AUTHENTICATION CONFIGURATION
|
||||
|
||||
# Custom user app defaults
|
||||
# Select the correct user model
|
||||
AUTH_USER_MODEL = "users.User"
|
||||
LOGIN_REDIRECT_URL = "users:redirect"
|
||||
LOGIN_URL = "account_login"
|
||||
AUTH_USER_MODEL = 'users.User'
|
||||
LOGIN_REDIRECT_URL = 'users:redirect'
|
||||
LOGIN_URL = 'account_login'
|
||||
# END Custom user app defaults
|
||||
|
||||
# SLUGLIFIER
|
||||
AUTOSLUG_SLUGIFY_FUNCTION = "slugify.slugify"
|
||||
AUTOSLUG_SLUGIFY_FUNCTION = 'slugify.slugify'
|
||||
# END SLUGLIFIER
|
||||
|
||||
# LOGGING CONFIGURATION
|
||||
|
@ -264,4 +267,8 @@ class Common(Configuration):
|
|||
}
|
||||
# END LOGGING CONFIGURATION
|
||||
|
||||
@classmethod
|
||||
def post_setup(cls):
|
||||
cls.DATABASES['default']['ATOMIC_REQUESTS'] = True
|
||||
|
||||
# Your common stuff: Below this line define 3rd party library settings
|
||||
|
|
|
@ -22,16 +22,16 @@ class Local(Common):
|
|||
# END INSTALLED_APPS
|
||||
|
||||
# Mail settings
|
||||
EMAIL_HOST = "localhost"
|
||||
EMAIL_HOST = 'localhost'
|
||||
EMAIL_PORT = 1025
|
||||
EMAIL_BACKEND = values.Value('django.core.mail.backends.console.EmailBackend')
|
||||
# End mail settings
|
||||
|
||||
# django-debug-toolbar
|
||||
MIDDLEWARE_CLASSES = Common.MIDDLEWARE_CLASSES + ('debug_toolbar.middleware.DebugToolbarMiddleware',)
|
||||
INSTALLED_APPS += ('debug_toolbar',)
|
||||
INSTALLED_APPS += ('debug_toolbar', 'django_extensions',)
|
||||
|
||||
INTERNAL_IPS = ('127.0.0.1',)
|
||||
INTERNAL_IPS = ('127.0.0.1', '10.0.2.2',)
|
||||
|
||||
DEBUG_TOOLBAR_CONFIG = {
|
||||
'DISABLE_PANELS': [
|
||||
|
@ -41,4 +41,4 @@ class Local(Common):
|
|||
}
|
||||
# end django-debug-toolbar
|
||||
|
||||
# Your local stuff: Below this line define 3rd party libary settings
|
||||
# Your local stuff: Below this line define 3rd party library settings
|
||||
|
|
|
@ -4,7 +4,7 @@ Production Configurations
|
|||
|
||||
- Use djangosecure
|
||||
- Use Amazon's S3 for storing static files and uploaded media
|
||||
- Use sendgird to sendemails
|
||||
- Use sendgrid to send emails
|
||||
- Use MEMCACHIER on Heroku
|
||||
'''
|
||||
from configurations import values
|
||||
|
@ -37,6 +37,15 @@ class Production(Common):
|
|||
# django-secure
|
||||
INSTALLED_APPS += ("djangosecure", )
|
||||
|
||||
# MIDDLEWARE CONFIGURATION
|
||||
MIDDLEWARE_CLASSES = (
|
||||
# Make sure djangosecure.middleware.SecurityMiddleware is listed first
|
||||
'djangosecure.middleware.SecurityMiddleware',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES += Common.MIDDLEWARE_CLASSES
|
||||
# END MIDDLEWARE CONFIGURATION
|
||||
|
||||
# set this to 60 seconds and then to 518400 when you can prove it works
|
||||
SECURE_HSTS_SECONDS = 60
|
||||
SECURE_HSTS_INCLUDE_SUBDOMAINS = values.BooleanValue(True)
|
||||
|
@ -74,13 +83,13 @@ class Production(Common):
|
|||
|
||||
# see: https://github.com/antonagestam/collectfast
|
||||
AWS_PRELOAD_METADATA = True
|
||||
INSTALLED_APPS += ("collectfast", )
|
||||
INSTALLED_APPS += ('collectfast', )
|
||||
|
||||
# AWS cache settings, don't change unless you know what you're doing:
|
||||
AWS_EXPIREY = 60 * 60 * 24 * 7
|
||||
AWS_EXPIRY = 60 * 60 * 24 * 7
|
||||
AWS_HEADERS = {
|
||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (
|
||||
AWS_EXPIREY, AWS_EXPIREY)
|
||||
AWS_EXPIRY, AWS_EXPIRY)
|
||||
}
|
||||
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||
|
@ -119,4 +128,4 @@ class Production(Common):
|
|||
CACHES = values.CacheURLValue(default="memcached://127.0.0.1:11211")
|
||||
# END CACHING
|
||||
|
||||
# Your production stuff: Below this line define 3rd party libary settings
|
||||
# Your production stuff: Below this line define 3rd party library settings
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
|
||||
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
||||
|
@ -6,9 +7,27 @@ from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
|
|||
from .models import User
|
||||
|
||||
|
||||
class MyUserChangeForm(UserChangeForm):
|
||||
class Meta(UserChangeForm.Meta):
|
||||
model = User
|
||||
|
||||
|
||||
class MyUserCreationForm(UserCreationForm):
|
||||
class Meta(UserCreationForm.Meta):
|
||||
model = User
|
||||
|
||||
def clean_username(self):
|
||||
username = self.cleaned_data["username"]
|
||||
try:
|
||||
User.objects.get(username=username)
|
||||
except User.DoesNotExist:
|
||||
return username
|
||||
raise forms.ValidationError(self.error_messages['duplicate_username'])
|
||||
|
||||
|
||||
class UserAdmin(AuthUserAdmin):
|
||||
create_form_class = UserCreationForm
|
||||
update_form_class = UserChangeForm
|
||||
form = MyUserChangeForm
|
||||
add_form = MyUserCreationForm
|
||||
|
||||
|
||||
admin.site.register(User, UserAdmin)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
"""
|
||||
WSGI config for {{ project_name }} project.
|
||||
WSGI config for {{ cookiecutter.project_name }} project.
|
||||
|
||||
This module contains the WSGI application used by Django's development server
|
||||
and any production WSGI deployments. It should expose a module-level variable
|
||||
|
@ -25,7 +25,7 @@ os.environ.setdefault("DJANGO_CONFIGURATION", "Production")
|
|||
# This application object is used by any WSGI server configured to use this
|
||||
# file. This includes Django's development server, if the WSGI_APPLICATION
|
||||
# setting points here.
|
||||
from configurations.wsgi import get_wsgi_application
|
||||
from configurations.wsgi import get_wsgi_application # noqa
|
||||
application = get_wsgi_application()
|
||||
|
||||
# Apply WSGI middleware here.
|
||||
|
|
Loading…
Reference in New Issue
Block a user