mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-11 08:32:21 +03:00
change requiriments, urls, remove S3 dependencies, add new dependencies and fix templates
This commit is contained in:
parent
a6a2a73fdb
commit
618aa896be
58
.gitignore
vendored
58
.gitignore
vendored
|
@ -1,5 +1,61 @@
|
||||||
|
*.py[cod]
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# C extensions
|
||||||
|
*.so
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Packages
|
||||||
|
*.egg
|
||||||
|
*.egg-info
|
||||||
|
dist
|
||||||
|
build
|
||||||
|
eggs
|
||||||
|
parts
|
||||||
|
bin
|
||||||
|
var
|
||||||
|
sdist
|
||||||
|
develop-eggs
|
||||||
|
.installed.cfg
|
||||||
|
lib
|
||||||
|
lib64
|
||||||
|
__pycache__
|
||||||
|
|
||||||
|
# Installer logs
|
||||||
|
pip-log.txt
|
||||||
|
|
||||||
|
# Unit test / coverage reports
|
||||||
|
.coverage
|
||||||
|
.tox
|
||||||
|
nosetests.xml
|
||||||
|
|
||||||
|
# Translations
|
||||||
|
*.mo
|
||||||
|
*.pot
|
||||||
|
|
||||||
|
# Mr Developer
|
||||||
|
.mr.developer.cfg
|
||||||
|
.project
|
||||||
|
.pydevproject
|
||||||
|
|
||||||
|
# Pycharm
|
||||||
|
.idea
|
||||||
|
|
||||||
|
# Vim
|
||||||
|
|
||||||
|
*~
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# Django
|
||||||
|
local_settings.py
|
||||||
|
repo_name
|
||||||
|
|
||||||
*.log
|
*.log
|
||||||
*.pot
|
*.pot
|
||||||
*.pyc
|
*.pyc
|
||||||
local_settings.py
|
local_settings.py
|
||||||
repo_name
|
repo_name
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,11 @@ Create a GitHub repo and push it there::
|
||||||
|
|
||||||
Now take a look at your repo. Don't forget to carefully look at the generated README. Awesome, right?
|
Now take a look at your repo. Don't forget to carefully look at the generated README. Awesome, right?
|
||||||
|
|
||||||
|
|
||||||
|
Now install all the supporting libraries into your virtualenv::
|
||||||
|
|
||||||
|
$ pip install -r requirements/local.txt
|
||||||
|
|
||||||
It's time to write the code!!!
|
It's time to write the code!!!
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,3 +37,23 @@ django-avatar==2.0
|
||||||
|
|
||||||
|
|
||||||
# Your custom requirements go here
|
# Your custom requirements go here
|
||||||
|
|
||||||
|
#Bootstrap 3 integration with Django. Easily generate Bootstrap3 compatible HTML using template tags.
|
||||||
|
#https://github.com/dyve/django-bootstrap3
|
||||||
|
django-bootstrap3
|
||||||
|
django-bootstrap-toolkit
|
||||||
|
|
||||||
|
# autocomplete
|
||||||
|
django-autocomplete-light
|
||||||
|
|
||||||
|
# django admin theme
|
||||||
|
django-suit
|
||||||
|
|
||||||
|
# suporte a internaciolizacao para o Brasil
|
||||||
|
django-localflavor-br
|
||||||
|
|
||||||
|
# Django Extra Views provides a number of additional class-based generic views to complement those provide by Django itself.
|
||||||
|
# http://django-extra-views.readthedocs.org/
|
||||||
|
# https://github.com/AndrewIngram/django-extra-views
|
||||||
|
-e git://github.com/AndrewIngram/django-extra-views.git#egg=django-extra-views
|
||||||
|
|
||||||
|
|
|
@ -8,3 +8,5 @@ Sphinx
|
||||||
# django-debug-toolbar that works with Django 1.6
|
# django-debug-toolbar that works with Django 1.6
|
||||||
django-debug-toolbar==0.11.0
|
django-debug-toolbar==0.11.0
|
||||||
|
|
||||||
|
# collection of snipplets for django. Utilizado para criacao automatica do usuario admin
|
||||||
|
django-snippetscream
|
||||||
|
|
|
@ -13,13 +13,13 @@ https://docs.djangoproject.com/en/dev/ref/settings/
|
||||||
import os
|
import os
|
||||||
from os.path import join
|
from os.path import join
|
||||||
|
|
||||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||||
try:
|
#try:
|
||||||
from S3 import CallingFormat
|
# from S3 import CallingFormat
|
||||||
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
|
# AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
|
||||||
except ImportError:
|
#except ImportError:
|
||||||
# TODO: Fix this where even if in Dev this class is called.
|
# # TODO: Fix this where even if in Dev this class is called.
|
||||||
pass
|
# pass
|
||||||
|
|
||||||
from configurations import Configuration, values
|
from configurations import Configuration, values
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class Common(Configuration):
|
||||||
|
|
||||||
# Useful template tags:
|
# Useful template tags:
|
||||||
# 'django.contrib.humanize',
|
# 'django.contrib.humanize',
|
||||||
|
'django-suit', # django-admin theme
|
||||||
# Admin
|
# Admin
|
||||||
'django.contrib.admin',
|
'django.contrib.admin',
|
||||||
)
|
)
|
||||||
|
@ -48,6 +48,14 @@ class Common(Configuration):
|
||||||
'south', # Database migration helpers:
|
'south', # Database migration helpers:
|
||||||
'crispy_forms', # Form layouts
|
'crispy_forms', # Form layouts
|
||||||
'avatar', # for user avatars
|
'avatar', # for user avatars
|
||||||
|
'autocomplete_light',
|
||||||
|
'municipios', # for Brazilian cities and states
|
||||||
|
'django_localflavor_br',
|
||||||
|
'bootstrap_toolkit',
|
||||||
|
#Bootstrap 3 integration with Django. Easily generate Bootstrap3 compatible HTML using template tags.
|
||||||
|
#https://github.com/dyve/django-bootstrap3
|
||||||
|
'bootstrap3',
|
||||||
|
'extra_views',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Apps specific for this project go here.
|
# Apps specific for this project go here.
|
||||||
|
@ -66,6 +74,14 @@ class Common(Configuration):
|
||||||
'allauth.account', # registration
|
'allauth.account', # registration
|
||||||
'allauth.socialaccount', # registration
|
'allauth.socialaccount', # registration
|
||||||
)
|
)
|
||||||
|
|
||||||
|
########## django-suit
|
||||||
|
# http://django-suit.readthedocs.org/en/develop/configuration.html
|
||||||
|
SUIT_CONFIG = {
|
||||||
|
'ADMIN_NAME': '{{cookiecutter.repo_name}}'
|
||||||
|
}
|
||||||
|
|
||||||
|
########## END django-suit CONFIGURATION
|
||||||
########## END APP CONFIGURATION
|
########## END APP CONFIGURATION
|
||||||
|
|
||||||
########## MIDDLEWARE CONFIGURATION
|
########## MIDDLEWARE CONFIGURATION
|
||||||
|
@ -117,7 +133,8 @@ class Common(Configuration):
|
||||||
|
|
||||||
########## DATABASE CONFIGURATION
|
########## DATABASE CONFIGURATION
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
|
||||||
DATABASES = values.DatabaseURLValue('postgres://localhost/{{cookiecutter.repo_name}}')
|
#DATABASES = values.DatabaseURLValue('postgres://localhost/{{cookiecutter.repo_name}}')
|
||||||
|
DATABASES = values.DatabaseURLValue('sqlite:////{0}.sqlite'.format(join(BASE_DIR, '{{cookiecutter.repo_name}}')))
|
||||||
########## END DATABASE CONFIGURATION
|
########## END DATABASE CONFIGURATION
|
||||||
|
|
||||||
########## CACHING
|
########## CACHING
|
||||||
|
@ -133,10 +150,10 @@ class Common(Configuration):
|
||||||
|
|
||||||
########## GENERAL CONFIGURATION
|
########## GENERAL CONFIGURATION
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#time-zone
|
||||||
TIME_ZONE = 'America/Los_Angeles'
|
TIME_ZONE = 'America/Araguaina'
|
||||||
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#language-code
|
||||||
LANGUAGE_CODE = 'en-us'
|
LANGUAGE_CODE = 'pt-br'
|
||||||
|
|
||||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
|
# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
@ -296,6 +313,12 @@ class Local(Common):
|
||||||
}
|
}
|
||||||
########## end django-debug-toolbar
|
########## end django-debug-toolbar
|
||||||
|
|
||||||
|
########## django-snippetscream - https://github.com/shaunsephton/django-snippetscream
|
||||||
|
# autocreate a superuser: user: admin , pass: admin
|
||||||
|
CREATE_DEFAULT_SUPERUSER = True
|
||||||
|
INSTALLED_APPS += ('snippetscream', )
|
||||||
|
########## end django-snippetscream
|
||||||
|
|
||||||
########## Your local stuff: Below this line define 3rd party libary settings
|
########## Your local stuff: Below this line define 3rd party libary settings
|
||||||
|
|
||||||
|
|
||||||
|
@ -331,32 +354,32 @@ class Production(Common):
|
||||||
|
|
||||||
INSTALLED_APPS += ("gunicorn", )
|
INSTALLED_APPS += ("gunicorn", )
|
||||||
|
|
||||||
########## STORAGE CONFIGURATION
|
########### STORAGE CONFIGURATION
|
||||||
# See: http://django-storages.readthedocs.org/en/latest/index.html
|
## See: http://django-storages.readthedocs.org/en/latest/index.html
|
||||||
INSTALLED_APPS += (
|
#INSTALLED_APPS += (
|
||||||
'storages',
|
# 'storages',
|
||||||
)
|
#)
|
||||||
|
|
||||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||||
STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
#STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||||
|
|
||||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||||
AWS_ACCESS_KEY_ID = values.SecretValue()
|
#AWS_ACCESS_KEY_ID = values.SecretValue()
|
||||||
AWS_SECRET_ACCESS_KEY = values.SecretValue()
|
#AWS_SECRET_ACCESS_KEY = values.SecretValue()
|
||||||
AWS_STORAGE_BUCKET_NAME = values.SecretValue()
|
#AWS_STORAGE_BUCKET_NAME = values.SecretValue()
|
||||||
AWS_AUTO_CREATE_BUCKET = True
|
#AWS_AUTO_CREATE_BUCKET = True
|
||||||
AWS_QUERYSTRING_AUTH = False
|
#AWS_QUERYSTRING_AUTH = False
|
||||||
|
|
||||||
# AWS cache settings, don't change unless you know what you're doing:
|
## AWS cache settings, don't change unless you know what you're doing:
|
||||||
AWS_EXPIREY = 60 * 60 * 24 * 7
|
#AWS_EXPIREY = 60 * 60 * 24 * 7
|
||||||
AWS_HEADERS = {
|
#AWS_HEADERS = {
|
||||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
|
# '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
|
## See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||||
STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
|
#STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
|
||||||
########## END STORAGE CONFIGURATION
|
########### END STORAGE CONFIGURATION
|
||||||
|
|
||||||
########## EMAIL
|
########## EMAIL
|
||||||
DEFAULT_FROM_EMAIL = values.Value(
|
DEFAULT_FROM_EMAIL = values.Value(
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.conf.urls import patterns, include, url
|
from django.conf.urls import patterns, include, url
|
||||||
from django.conf.urls.static import static
|
from django.conf.urls.static import static
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
import autocomplete_light
|
||||||
|
autocomplete_light.autodiscover()
|
||||||
|
|
||||||
# Uncomment the next two lines to enable the admin:
|
# Uncomment the next two lines to enable the admin:
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
admin.autodiscover()
|
admin.autodiscover()
|
||||||
|
@ -32,3 +36,16 @@ urlpatterns = patterns('',
|
||||||
|
|
||||||
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns += patterns('',
|
||||||
|
url(r'^autocomplete/', include('autocomplete_light.urls')),
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
urlpatterns += patterns('',
|
||||||
|
url(r'^municipios_app/', include('municipios.urls')),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
urlpatterns += staticfiles_urlpatterns()
|
||||||
|
|
||||||
|
|
|
@ -1 +1,33 @@
|
||||||
/*! project specific CSS goes here. */
|
/*! project specific CSS goes here. */
|
||||||
|
|
||||||
|
/* bootstrap alert CSS, translated to the django-standard levels of
|
||||||
|
** debug, info, success, warning, error */
|
||||||
|
.alert-debug {
|
||||||
|
color: black;
|
||||||
|
background-color: white;
|
||||||
|
border-color: #d6e9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-info {
|
||||||
|
color: #3a87ad;
|
||||||
|
background-color: #d9edf7;
|
||||||
|
border-color: #bce8f1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-success {
|
||||||
|
color: #468847;
|
||||||
|
background-color: #dff0d8;
|
||||||
|
border-color: #d6e9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-warning {
|
||||||
|
color: black;
|
||||||
|
background-color: orange;
|
||||||
|
border-color: #d6e9c6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.alert-error {
|
||||||
|
color: #b94a48;
|
||||||
|
background-color: #f2dede;
|
||||||
|
border-color: #eed3d7;
|
||||||
|
}
|
||||||
|
|
|
@ -28,7 +28,8 @@
|
||||||
{% block angular %}
|
{% block angular %}
|
||||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
|
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
{% block extrahead %}
|
||||||
|
{% endblock extrahead %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
@ -53,6 +54,12 @@
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
|
{% if messages %}
|
||||||
|
{% for message in messages %}
|
||||||
|
<div class="alert {% if message.tags %}alert-{{ message.tags }}"{% endif %}>{{ message }}</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<p>Use this document as a way to quick start any new project.</p>
|
<p>Use this document as a way to quick start any new project.</p>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
@ -76,6 +83,11 @@
|
||||||
<!-- place project specific Javascript in this file -->
|
<!-- place project specific Javascript in this file -->
|
||||||
<script src="{% static 'js/project.js' %}"></script>
|
<script src="{% static 'js/project.js' %}"></script>
|
||||||
{% endblock javascript %}
|
{% endblock javascript %}
|
||||||
|
{% block autocompleteligth %}
|
||||||
|
<!--/. autocomplete_light static files-->
|
||||||
|
{% include 'autocomplete_light/static.html' %}
|
||||||
|
<!--/. end autocomplete_light static files -->
|
||||||
|
{% endblock autocompleteligth %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user