mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 03:24:01 +03:00
add flake8 and setup.cfg for linting
some changes to pass flake8 linting. added setup.cfg for flake8 configuration. Ignoring E265 can be added to this file because config/settings.py is flooded with this error. After #105 gets merged it'll be OK.
This commit is contained in:
parent
3719db26de
commit
10e3e8f6ab
|
@ -1,3 +1,4 @@
|
|||
# Test dependencies go here.
|
||||
-r base.txt
|
||||
coverage==3.7.1
|
||||
flake8==2.2.2
|
||||
|
|
4
{{cookiecutter.repo_name}}/setup.cfg
Normal file
4
{{cookiecutter.repo_name}}/setup.cfg
Normal file
|
@ -0,0 +1,4 @@
|
|||
[flake8]
|
||||
#ignore = E265
|
||||
max-line-length = 120
|
||||
exclude = .tox,.git,*/migrations/*,*/static/CACHE/*,docs
|
|
@ -23,7 +23,7 @@ setup(
|
|||
],
|
||||
include_package_data=True,
|
||||
install_requires=[
|
||||
'Django>=1.6.1',
|
||||
'Django>=1.6.5',
|
||||
],
|
||||
zip_safe=False,
|
||||
scripts=['{{ cookiecutter.repo_name }}/manage.py'],
|
||||
|
|
|
@ -173,9 +173,9 @@ class Common(Configuration):
|
|||
)
|
||||
|
||||
TEMPLATE_LOADERS = (
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)
|
||||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
)
|
||||
|
||||
# See: http://django-crispy-forms.readthedocs.org/en/latest/install.html#template-packs
|
||||
CRISPY_TEMPLATE_PACK = 'bootstrap3'
|
||||
|
@ -270,7 +270,6 @@ class Common(Configuration):
|
|||
}
|
||||
########## END LOGGING CONFIGURATION
|
||||
|
||||
|
||||
########## Your common stuff: Below this line define 3rd party libary settings
|
||||
|
||||
|
||||
|
@ -364,7 +363,7 @@ class Production(Common):
|
|||
AWS_EXPIREY = 60 * 60 * 24 * 7
|
||||
AWS_HEADERS = {
|
||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
|
||||
AWS_EXPIREY)
|
||||
AWS_EXPIREY)
|
||||
}
|
||||
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||
|
@ -373,7 +372,7 @@ class Production(Common):
|
|||
|
||||
########## EMAIL
|
||||
DEFAULT_FROM_EMAIL = values.Value(
|
||||
'{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>')
|
||||
'{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>')
|
||||
EMAIL_HOST = values.Value('smtp.sendgrid.com')
|
||||
EMAIL_HOST_PASSWORD = values.SecretValue(environ_prefix="", environ_name="SENDGRID_PASSWORD")
|
||||
EMAIL_HOST_USER = values.SecretValue(environ_prefix="", environ_name="SENDGRID_USERNAME")
|
||||
|
@ -405,4 +404,3 @@ class Production(Common):
|
|||
########## END CACHING
|
||||
|
||||
########## Your production stuff: Below this line define 3rd party libary settings
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ from django.contrib import admin
|
|||
admin.autodiscover()
|
||||
|
||||
urlpatterns = patterns('',
|
||||
url(r'^$',
|
||||
url(r'^$', # noqa
|
||||
TemplateView.as_view(template_name='pages/home.html'),
|
||||
name="home"),
|
||||
url(r'^about/$',
|
||||
|
@ -31,4 +31,3 @@ urlpatterns = patterns('',
|
|||
# Your stuff: custom urls go here
|
||||
|
||||
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ from django.conf.urls import patterns, url
|
|||
from users import views
|
||||
|
||||
urlpatterns = patterns('',
|
||||
# URL pattern for the UserListView
|
||||
# URL pattern for the UserListView # noqa
|
||||
url(
|
||||
regex=r'^$',
|
||||
view=views.UserListView.as_view(),
|
||||
|
@ -28,4 +28,4 @@ urlpatterns = patterns('',
|
|||
view=views.UserUpdateView.as_view(),
|
||||
name='update'
|
||||
),
|
||||
)
|
||||
)
|
||||
|
|
|
@ -30,7 +30,7 @@ class UserRedirectView(LoginRequiredMixin, RedirectView):
|
|||
|
||||
def get_redirect_url(self):
|
||||
return reverse("users:detail",
|
||||
kwargs={"username": self.request.user.username})
|
||||
kwargs={"username": self.request.user.username})
|
||||
|
||||
|
||||
class UserUpdateView(LoginRequiredMixin, UpdateView):
|
||||
|
@ -43,7 +43,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
|
|||
# send the user back to their own page after a successful update
|
||||
def get_success_url(self):
|
||||
return reverse("users:detail",
|
||||
kwargs={"username": self.request.user.username})
|
||||
kwargs={"username": self.request.user.username})
|
||||
|
||||
def get_object(self):
|
||||
# Only get the User record for the user making the request
|
||||
|
|
Loading…
Reference in New Issue
Block a user