Skip to content

Commit c9bfa09

Browse files
Nueva aproximacion con un poco de edicion al proyecto, incluyendo algo de modificaciones de aspecto al UI
1 parent ae90a37 commit c9bfa09

File tree

95 files changed

+11116
-16
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+11116
-16
lines changed

LICENSE.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2014 Arun Ravindran
2+
3+
Permission is hereby granted, free of charge, to any person
4+
obtaining a copy of this software and associated documentation
5+
files (the "Software"), to deal in the Software without
6+
restriction, including without limitation the rights to use,
7+
copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the
9+
Software is furnished to do so, subject to the following
10+
conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,36 @@
1-
#DJANGO BLOG
21

3-
Ejercicio del grupo Django Cali, empezando por lo basico hasta ir a lo mas pesado de crear un web app en Django.
42

5-
Se inicia en un punto en el que estan creados la estructura base de la aplicacion y la estructura inicial de la aplicacion blog. Adicionalmente, para implementar buenas practicas se uso una distribucion del archivo settings para que este distribuido y pueda usarse en diferente entornos, sin que pongan en riesgo su informacion de contraseñas y otros elementos por el estilo.
3+
# blog
64

7-
Por el momento no tiene el archivo requirements.txt porque en el estado que esta, no necesita nada mas que Django 1.8 instalado con pip para funcionar.
5+
blog is a _short description_. It is built with [Python][0] using the [Django Web Framework][1].
6+
7+
This project has the following basic apps:
8+
9+
* App1 (short desc)
10+
* App2 (short desc)
11+
* App3 (short desc)
12+
13+
## Installation
14+
15+
### Quick start
16+
17+
To set up a development environment quickly, first install Python 3.4. It
18+
comes with virtualenv built-in. So create a virtual env by:
19+
20+
1. `$ python3.4 -m venv blog`
21+
2. `$ . blog/bin/activate`
22+
23+
Install all dependencies:
24+
25+
pip install -r requirements/development.txt
26+
27+
Run migrations:
28+
29+
python manage.py migrate
30+
31+
### Detailed instructions
32+
33+
Take a look at the docs for a detailed instructions guide.
34+
35+
[0]: https://www.python.org/
36+
[1]: https://www.djangoproject.com/

accounts/__init__.py

Whitespace-only changes.

accounts/admin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.

accounts/forms.py

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
from __future__ import unicode_literals
2+
from django.contrib.auth.forms import AuthenticationForm
3+
from django import forms
4+
from crispy_forms.helper import FormHelper
5+
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
6+
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
7+
from authtools import forms as authtoolsforms
8+
from django.contrib.auth import forms as authforms
9+
from django.core.urlresolvers import reverse
10+
11+
12+
class LoginForm(AuthenticationForm):
13+
remember_me = forms.BooleanField(required=False, initial=False)
14+
15+
def __init__(self, *args, **kwargs):
16+
super(LoginForm, self).__init__(*args, **kwargs)
17+
self.helper = FormHelper()
18+
self.fields["username"].widget.input_type = "email" # ugly hack
19+
20+
self.helper.layout = Layout(
21+
Field('username', placeholder="Enter Email", autofocus=""),
22+
Field('password', placeholder="Enter Password"),
23+
HTML('<a href="{}">Forgot Password?</a>'.format(
24+
reverse("accounts:password-reset"))),
25+
Field('remember_me'),
26+
Submit('sign_in', 'Log in',
27+
css_class="btn btn-lg btn-primary btn-block"),
28+
)
29+
30+
31+
class SignupForm(authtoolsforms.UserCreationForm):
32+
33+
def __init__(self, *args, **kwargs):
34+
super(SignupForm, self).__init__(*args, **kwargs)
35+
self.helper = FormHelper()
36+
self.fields["email"].widget.input_type = "email" # ugly hack
37+
38+
self.helper.layout = Layout(
39+
Field('email', placeholder="Enter Email", autofocus=""),
40+
Field('name', placeholder="Enter Full Name"),
41+
Field('password1', placeholder="Enter Password"),
42+
Field('password2', placeholder="Re-enter Password"),
43+
Submit('sign_up', 'Sign up', css_class="btn-warning"),
44+
)
45+
46+
47+
class PasswordChangeForm(authforms.PasswordChangeForm):
48+
49+
def __init__(self, *args, **kwargs):
50+
super(PasswordChangeForm, self).__init__(*args, **kwargs)
51+
self.helper = FormHelper()
52+
53+
self.helper.layout = Layout(
54+
Field('old_password', placeholder="Enter old password",
55+
autofocus=""),
56+
Field('new_password1', placeholder="Enter new password"),
57+
Field('new_password2', placeholder="Enter new password (again)"),
58+
Submit('pass_change', 'Change Password', css_class="btn-warning"),
59+
)
60+
61+
62+
class PasswordResetForm(authtoolsforms.FriendlyPasswordResetForm):
63+
64+
def __init__(self, *args, **kwargs):
65+
super(PasswordResetForm, self).__init__(*args, **kwargs)
66+
self.helper = FormHelper()
67+
68+
self.helper.layout = Layout(
69+
Field('email', placeholder="Enter email",
70+
autofocus=""),
71+
Submit('pass_reset', 'Reset Password', css_class="btn-warning"),
72+
)
73+
74+
75+
class SetPasswordForm(authforms.SetPasswordForm):
76+
def __init__(self, *args, **kwargs):
77+
super(SetPasswordForm, self).__init__(*args, **kwargs)
78+
self.helper = FormHelper()
79+
80+
self.helper.layout = Layout(
81+
Field('new_password1', placeholder="Enter new password",
82+
autofocus=""),
83+
Field('new_password2', placeholder="Enter new password (again)"),
84+
Submit('pass_change', 'Change Password', css_class="btn-warning"),
85+
)

accounts/migrations/__init__.py

Whitespace-only changes.

accounts/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.db import models
2+
3+
# Create your models here.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% extends "base.html" %}
2+
3+
{% load crispy_forms_tags %}
4+
5+
{% block navbar %}
6+
{% endblock %}
7+
8+
{% block container %}
9+
<div class="container form-box">
10+
<div class="text-center">
11+
<h2>{% block form_heading %}{% endblock %}</h2>
12+
</div>
13+
{% block form %}
14+
{% endblock %}
15+
</div>
16+
17+
{% endblock container %}
18+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% load i18n %}{% autoescape off %}
2+
{% blocktrans %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktrans %}
3+
4+
{% trans "Please go to the following page and choose a new password:" %}
5+
{% block reset_link %}
6+
{{ protocol }}://{{ domain }}{% url 'accounts:password-reset-confirm' uidb64=uid token=token %}
7+
{% endblock %}
8+
{% trans "Your login email, in case you've forgotten, is same this email address:" %} {{ user.get_username }}
9+
10+
{% trans "Thanks for using our site!" %}
11+
12+
{% blocktrans %}The {{ site_name }} team{% endblocktrans %}
13+
14+
{% endautoescape %}
15+
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{% templatetag openblock %} load i18n {% templatetag closeblock %}{% templatetag openblock %} autoescape off {% templatetag closeblock %}
2+
{% templatetag openblock %} blocktrans {% templatetag closeblock %}Password reset on {% templatetag openvariable %} site_name {% templatetag closevariable %}{% templatetag openblock %} endblocktrans {% templatetag closeblock %}
3+
{% templatetag openblock %} endautoescape {% templatetag closeblock %}
4+

0 commit comments

Comments
 (0)