mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-11 04:07:48 +03:00
commit
8bfe28a721
|
@ -21,13 +21,12 @@ This cookiecutter template uses features that exists only in cookiecutter 0.9.0
|
||||||
Features
|
Features
|
||||||
---------
|
---------
|
||||||
|
|
||||||
* For Django 1.7
|
* For Django 1.8
|
||||||
* Twitter Bootstrap_ 3
|
* Twitter Bootstrap_ 3
|
||||||
* AngularJS_
|
* AngularJS_
|
||||||
* 12-Factor_ based settings via django-environ_
|
* 12-Factor_ based settings via django-environ_
|
||||||
* Optimized development and production settings
|
* Optimized development and production settings
|
||||||
* Registration via django-allauth_
|
* Registration via django-allauth_
|
||||||
* User avatars via django-avatar_
|
|
||||||
* Procfile_ for deploying to Heroku
|
* Procfile_ for deploying to Heroku
|
||||||
* Grunt build for compass and livereload
|
* Grunt build for compass and livereload
|
||||||
* Basic e-mail configurations for send emails via SendGrid_
|
* Basic e-mail configurations for send emails via SendGrid_
|
||||||
|
@ -47,7 +46,7 @@ Constraints
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
* Only maintained 3rd party libraries are used.
|
* Only maintained 3rd party libraries are used.
|
||||||
* PostgreSQL everywhere
|
* PostgreSQL everywhere (9.0+)
|
||||||
* Environment variables for configuration (This won't work with Apache/mod_wsgi).
|
* Environment variables for configuration (This won't work with Apache/mod_wsgi).
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ DJANGO_APPS = (
|
||||||
)
|
)
|
||||||
THIRD_PARTY_APPS = (
|
THIRD_PARTY_APPS = (
|
||||||
'crispy_forms', # Form layouts
|
'crispy_forms', # Form layouts
|
||||||
'avatar', # for user avatars
|
|
||||||
'allauth', # registration
|
'allauth', # registration
|
||||||
'allauth.account', # registration
|
'allauth.account', # registration
|
||||||
'allauth.socialaccount', # registration
|
'allauth.socialaccount', # registration
|
||||||
|
|
|
@ -21,9 +21,6 @@ urlpatterns = patterns('', # noqa
|
||||||
url(r'^users/', include("{{ cookiecutter.repo_name }}.users.urls", namespace="users")),
|
url(r'^users/', include("{{ cookiecutter.repo_name }}.users.urls", namespace="users")),
|
||||||
url(r'^accounts/', include('allauth.urls')),
|
url(r'^accounts/', include('allauth.urls')),
|
||||||
|
|
||||||
# Uncomment the next line to enable avatars
|
|
||||||
url(r'^avatar/', include('avatar.urls')),
|
|
||||||
|
|
||||||
# Your stuff: custom urls includes go here
|
# Your stuff: custom urls includes go here
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Bleeding edge Django
|
# Bleeding edge Django
|
||||||
django>=1.7.7,<1.8
|
django==1.8
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
django-environ==0.3.0
|
django-environ==0.3.0
|
||||||
|
@ -27,9 +27,6 @@ psycopg2==2.6
|
||||||
unicode-slugify==0.1.3
|
unicode-slugify==0.1.3
|
||||||
django-autoslug==1.7.2
|
django-autoslug==1.7.2
|
||||||
|
|
||||||
# Useful things
|
|
||||||
django-avatar==2.0
|
|
||||||
|
|
||||||
# Time zones support
|
# Time zones support
|
||||||
pytz==2015.2
|
pytz==2015.2
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,18 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='Site',
|
name='Site',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(verbose_name='ID', primary_key=True, serialize=False, auto_created=True)),
|
||||||
('domain', models.CharField(max_length=100, verbose_name='domain name', validators=[django.contrib.sites.models._simple_domain_name_validator])),
|
('domain', models.CharField(verbose_name='domain name', max_length=100, validators=[django.contrib.sites.models._simple_domain_name_validator])),
|
||||||
('name', models.CharField(max_length=50, verbose_name='display name')),
|
('name', models.CharField(verbose_name='display name', max_length=50)),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'ordering': ('domain',),
|
|
||||||
'db_table': 'django_site',
|
|
||||||
'verbose_name': 'site',
|
|
||||||
'verbose_name_plural': 'sites',
|
'verbose_name_plural': 'sites',
|
||||||
|
'verbose_name': 'site',
|
||||||
|
'db_table': 'django_site',
|
||||||
|
'ordering': ('domain',),
|
||||||
},
|
},
|
||||||
bases=(models.Model,),
|
managers=[
|
||||||
|
(b'objects', django.contrib.sites.models.SiteManager()),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
{% raw %}
|
|
||||||
{% extends "avatar/base.html" %}
|
|
||||||
{% load i18n avatar_tags %}
|
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<h2>{% trans "Your current avatar: " %}</h2>
|
|
||||||
{% avatar user %}
|
|
||||||
{% if not avatars %}
|
|
||||||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p>
|
|
||||||
{% endif %}
|
|
||||||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
|
|
||||||
{{ upload_avatar_form.as_p }}
|
|
||||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Upload New Image" %}" /></p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% endraw %}
|
|
|
@ -1 +0,0 @@
|
||||||
{% raw %}<img src="{{ url }}" width="{{ size }}" height="{{ size }}" class="img-thumbnail">{% endraw %}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{% raw %}{% extends "base.html" %}
|
|
||||||
|
|
||||||
{% block title %}django-avatar{% endblock %}
|
|
||||||
{% block content %}{% endblock %}
|
|
||||||
{% endraw %}
|
|
|
@ -1,29 +0,0 @@
|
||||||
{% raw %}{% extends "avatar/base.html" %}
|
|
||||||
{% load i18n avatar_tags %}
|
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<h2>{% trans "Your current avatar: " %}</h2>
|
|
||||||
{% avatar user %}
|
|
||||||
{% if not avatars %}
|
|
||||||
<p>{% trans "You haven't uploaded an avatar yet. Please upload one now." %}</p>
|
|
||||||
{% else %}
|
|
||||||
<form method="POST" action="{% url 'avatar_change' %}">
|
|
||||||
<ul>
|
|
||||||
{{ primary_avatar_form.as_ul }}
|
|
||||||
</ul>
|
|
||||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Choose new Default" %}" /></p>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
<form enctype="multipart/form-data" method="POST" action="{% url 'avatar_add' %}">
|
|
||||||
{{ upload_avatar_form.as_p }}
|
|
||||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Upload New Image" %}" /></p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% endraw %}
|
|
|
@ -1,25 +0,0 @@
|
||||||
{% raw %}{% extends "avatar/base.html" %}
|
|
||||||
{% load i18n %}
|
|
||||||
{% load url from future %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<div class="container">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<h2>{% trans "Please select the avatars that you would like to delete." %}</h2>
|
|
||||||
{% if not avatars %}
|
|
||||||
{% url 'avatar_change' as avatar_change_url %}
|
|
||||||
<p>{% blocktrans %}You have no avatars to delete. Please <a href="{{ avatar_change_url }}">upload one</a> now.{% endblocktrans %}</p>
|
|
||||||
{% else %}
|
|
||||||
<form method="POST" action="{% url 'avatar_delete' %}">
|
|
||||||
<ul>
|
|
||||||
{{ delete_avatar_form.as_ul }}
|
|
||||||
</ul>
|
|
||||||
<p>{% csrf_token %}<input type="submit" value="{% trans "Delete These" %}" /></p>
|
|
||||||
</form>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
|
||||||
{% endraw %}
|
|
|
@ -1,5 +1,4 @@
|
||||||
{% raw %}{% extends "base.html" %}
|
{% raw %}{% extends "base.html" %}
|
||||||
{% load avatar_tags %}
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
{% block title %}User: {{ object.username }}{% endblock %}
|
{% block title %}User: {{ object.username }}{% endblock %}
|
||||||
|
@ -15,13 +14,12 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if object == request.user %}
|
{% if object == request.user %}
|
||||||
<!-- Action buttons -->
|
<!-- Action buttons -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-sm-12 ">
|
<div class="col-sm-12 ">
|
||||||
<a class="btn btn-primary" href="{% url 'users:update' %}">My Info</a>
|
<a class="btn btn-primary" href="{% url 'users:update' %}">My Info</a>
|
||||||
<a class="btn btn-primary" href="{% url 'account_email' %}">E-Mail</a>
|
<a class="btn btn-primary" href="{% url 'account_email' %}">E-Mail</a>
|
||||||
<a class="btn btn-info" href="{% url 'avatar_change' %}">Avatar</a>
|
|
||||||
<!-- Your Stuff: Custom user template urls -->
|
<!-- Your Stuff: Custom user template urls -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -32,4 +30,4 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
{% raw %}{% extends "base.html" %}
|
{% raw %}{% extends "base.html" %}
|
||||||
{% load static %}{% load i18n %}
|
{% load static %}{% load i18n %}
|
||||||
{% load avatar_tags %}
|
|
||||||
|
|
||||||
{% block title %}Members{% endblock %}
|
{% block title %}Members{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12">
|
<div class="col-xs-12">
|
||||||
<h2>Users</h2>
|
<h2>Users</h2>
|
||||||
|
@ -19,15 +17,15 @@
|
||||||
<div class="list-group">
|
<div class="list-group">
|
||||||
{% for user in user_list %}
|
{% for user in user_list %}
|
||||||
<a href="{% url 'users:detail' user.username %}" class="list-group-item">
|
<a href="{% url 'users:detail' user.username %}" class="list-group-item">
|
||||||
<h4 class="list-group-item-heading">{% avatar user %} {{ user.username }}</h4>
|
<h4 class="list-group-item-heading">{{ user.username }}</h4>
|
||||||
<p class="list-group-item-text">{{ maker.tagline }}</p>
|
<p class="list-group-item-text">{{ maker.tagline }}</p>
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock content %}{% endraw %}
|
{% endblock content %}{% endraw %}
|
||||||
|
|
|
@ -3,38 +3,41 @@ from __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import models, migrations
|
from django.db import models, migrations
|
||||||
import django.utils.timezone
|
import django.utils.timezone
|
||||||
|
import django.contrib.auth.models
|
||||||
import django.core.validators
|
import django.core.validators
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
('auth', '0001_initial'),
|
('auth', '0006_require_contenttypes_0002'),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name='User',
|
name='User',
|
||||||
fields=[
|
fields=[
|
||||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
('id', models.AutoField(primary_key=True, verbose_name='ID', serialize=False, auto_created=True)),
|
||||||
('password', models.CharField(max_length=128, verbose_name='password')),
|
('password', models.CharField(max_length=128, verbose_name='password')),
|
||||||
('last_login', models.DateTimeField(default=django.utils.timezone.now, verbose_name='last login')),
|
('last_login', models.DateTimeField(null=True, verbose_name='last login', blank=True)),
|
||||||
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
|
('is_superuser', models.BooleanField(help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status', default=False)),
|
||||||
('username', models.CharField(help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True, max_length=30, verbose_name='username', validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username.', 'invalid')])),
|
('username', models.CharField(max_length=30, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.', 'invalid')], verbose_name='username', error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', unique=True)),
|
||||||
('first_name', models.CharField(max_length=30, verbose_name='first name', blank=True)),
|
('first_name', models.CharField(max_length=30, verbose_name='first name', blank=True)),
|
||||||
('last_name', models.CharField(max_length=30, verbose_name='last name', blank=True)),
|
('last_name', models.CharField(max_length=30, verbose_name='last name', blank=True)),
|
||||||
('email', models.EmailField(max_length=75, verbose_name='email address', blank=True)),
|
('email', models.EmailField(max_length=254, verbose_name='email address', blank=True)),
|
||||||
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
|
('is_staff', models.BooleanField(help_text='Designates whether the user can log into this admin site.', verbose_name='staff status', default=False)),
|
||||||
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
|
('is_active', models.BooleanField(help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active', default=True)),
|
||||||
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
|
('date_joined', models.DateTimeField(verbose_name='date joined', default=django.utils.timezone.now)),
|
||||||
('groups', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Group', blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of his/her group.', verbose_name='groups')),
|
('groups', models.ManyToManyField(related_name='user_set', blank=True, verbose_name='groups', to='auth.Group', help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_query_name='user')),
|
||||||
('user_permissions', models.ManyToManyField(related_query_name='user', related_name='user_set', to='auth.Permission', blank=True, help_text='Specific permissions for this user.', verbose_name='user permissions')),
|
('user_permissions', models.ManyToManyField(related_name='user_set', blank=True, verbose_name='user permissions', to='auth.Permission', help_text='Specific permissions for this user.', related_query_name='user')),
|
||||||
],
|
],
|
||||||
options={
|
options={
|
||||||
'abstract': False,
|
|
||||||
'verbose_name': 'user',
|
'verbose_name': 'user',
|
||||||
|
'abstract': False,
|
||||||
'verbose_name_plural': 'users',
|
'verbose_name_plural': 'users',
|
||||||
},
|
},
|
||||||
bases=(models.Model,),
|
managers=[
|
||||||
)
|
(b'objects', django.contrib.auth.models.UserManager()),
|
||||||
|
],
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user