mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-11 00:22:29 +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
|
||||
*.pot
|
||||
*.pyc
|
||||
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 install all the supporting libraries into your virtualenv::
|
||||
|
||||
$ pip install -r requirements/local.txt
|
||||
|
||||
It's time to write the code!!!
|
||||
|
||||
|
||||
|
|
|
@ -37,3 +37,23 @@ django-avatar==2.0
|
|||
|
||||
|
||||
# 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==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
|
||||
from os.path import join
|
||||
|
||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
try:
|
||||
from S3 import CallingFormat
|
||||
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
|
||||
except ImportError:
|
||||
# TODO: Fix this where even if in Dev this class is called.
|
||||
pass
|
||||
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
#try:
|
||||
# from S3 import CallingFormat
|
||||
# AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
|
||||
#except ImportError:
|
||||
# # TODO: Fix this where even if in Dev this class is called.
|
||||
# pass
|
||||
|
||||
from configurations import Configuration, values
|
||||
|
||||
|
@ -40,7 +40,7 @@ class Common(Configuration):
|
|||
|
||||
# Useful template tags:
|
||||
# 'django.contrib.humanize',
|
||||
|
||||
'django-suit', # django-admin theme
|
||||
# Admin
|
||||
'django.contrib.admin',
|
||||
)
|
||||
|
@ -48,6 +48,14 @@ class Common(Configuration):
|
|||
'south', # Database migration helpers:
|
||||
'crispy_forms', # Form layouts
|
||||
'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.
|
||||
|
@ -66,6 +74,14 @@ class Common(Configuration):
|
|||
'allauth.account', # 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
|
||||
|
||||
########## MIDDLEWARE CONFIGURATION
|
||||
|
@ -117,7 +133,8 @@ class Common(Configuration):
|
|||
|
||||
########## DATABASE CONFIGURATION
|
||||
# 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
|
||||
|
||||
########## CACHING
|
||||
|
@ -133,10 +150,10 @@ class Common(Configuration):
|
|||
|
||||
########## GENERAL CONFIGURATION
|
||||
# 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
|
||||
LANGUAGE_CODE = 'en-us'
|
||||
LANGUAGE_CODE = 'pt-br'
|
||||
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#site-id
|
||||
SITE_ID = 1
|
||||
|
@ -296,6 +313,12 @@ class Local(Common):
|
|||
}
|
||||
########## 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
|
||||
|
||||
|
||||
|
@ -331,32 +354,32 @@ class Production(Common):
|
|||
|
||||
INSTALLED_APPS += ("gunicorn", )
|
||||
|
||||
########## STORAGE CONFIGURATION
|
||||
# See: http://django-storages.readthedocs.org/en/latest/index.html
|
||||
INSTALLED_APPS += (
|
||||
'storages',
|
||||
)
|
||||
########### STORAGE CONFIGURATION
|
||||
## See: http://django-storages.readthedocs.org/en/latest/index.html
|
||||
#INSTALLED_APPS += (
|
||||
# 'storages',
|
||||
#)
|
||||
|
||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
#STATICFILES_STORAGE = DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
|
||||
|
||||
# See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
AWS_ACCESS_KEY_ID = values.SecretValue()
|
||||
AWS_SECRET_ACCESS_KEY = values.SecretValue()
|
||||
AWS_STORAGE_BUCKET_NAME = values.SecretValue()
|
||||
AWS_AUTO_CREATE_BUCKET = True
|
||||
AWS_QUERYSTRING_AUTH = False
|
||||
## See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings
|
||||
#AWS_ACCESS_KEY_ID = values.SecretValue()
|
||||
#AWS_SECRET_ACCESS_KEY = values.SecretValue()
|
||||
#AWS_STORAGE_BUCKET_NAME = values.SecretValue()
|
||||
#AWS_AUTO_CREATE_BUCKET = True
|
||||
#AWS_QUERYSTRING_AUTH = False
|
||||
|
||||
# AWS cache settings, don't change unless you know what you're doing:
|
||||
AWS_EXPIREY = 60 * 60 * 24 * 7
|
||||
AWS_HEADERS = {
|
||||
'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
|
||||
AWS_EXPIREY)
|
||||
}
|
||||
## AWS cache settings, don't change unless you know what you're doing:
|
||||
#AWS_EXPIREY = 60 * 60 * 24 * 7
|
||||
#AWS_HEADERS = {
|
||||
# 'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIREY,
|
||||
# AWS_EXPIREY)
|
||||
#}
|
||||
|
||||
# See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||
STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
|
||||
########## END STORAGE CONFIGURATION
|
||||
## See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url
|
||||
#STATIC_URL = 'https://s3.amazonaws.com/%s/' % AWS_STORAGE_BUCKET_NAME
|
||||
########### END STORAGE CONFIGURATION
|
||||
|
||||
########## EMAIL
|
||||
DEFAULT_FROM_EMAIL = values.Value(
|
||||
|
|
|
@ -1,11 +1,15 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.conf import settings
|
||||
from django.conf.urls import patterns, include, url
|
||||
from django.conf.urls.static import static
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
import autocomplete_light
|
||||
autocomplete_light.autodiscover()
|
||||
|
||||
# Uncomment the next two lines to enable the admin:
|
||||
from django.contrib import admin
|
||||
admin.autodiscover()
|
||||
|
@ -32,3 +36,16 @@ urlpatterns = patterns('',
|
|||
|
||||
) + 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. */
|
||||
|
||||
/* 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 %}
|
||||
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block extrahead %}
|
||||
{% endblock extrahead %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -53,6 +54,12 @@
|
|||
|
||||
<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 %}
|
||||
<p>Use this document as a way to quick start any new project.</p>
|
||||
{% endblock content %}
|
||||
|
@ -76,6 +83,11 @@
|
|||
<!-- place project specific Javascript in this file -->
|
||||
<script src="{% static 'js/project.js' %}"></script>
|
||||
{% endblock javascript %}
|
||||
{% block autocompleteligth %}
|
||||
<!--/. autocomplete_light static files-->
|
||||
{% include 'autocomplete_light/static.html' %}
|
||||
<!--/. end autocomplete_light static files -->
|
||||
{% endblock autocompleteligth %}
|
||||
</body>
|
||||
</html>
|
||||
{% endraw %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user