Skip to content

Commit d904197

Browse files
authored
Merge pull request #386 from PyAr/dev
new release from "dev"
2 parents 39fba39 + 3824cb9 commit d904197

Some content is hidden

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

66 files changed

+1379
-428
lines changed

.env

-9
This file was deleted.

.gitignore

+100-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,110 @@
1+
### Python template
2+
# Byte-compiled / optimized / DLL files
3+
__pycache__/
4+
*.py[cod]
5+
*$py.class
6+
7+
# C extensions
8+
*.so
9+
10+
# Distribution / packaging
11+
.Python
12+
env/
13+
build/
14+
develop-eggs/
15+
dist/
16+
downloads/
17+
eggs/
18+
.eggs/
19+
lib/
20+
lib64/
21+
parts/
22+
sdist/
23+
var/
24+
wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.coverage
43+
.coverage.*
44+
.cache
45+
nosetests.xml
46+
coverage.xml
47+
*,cover
48+
.hypothesis/
49+
50+
# Translations
51+
*.mo
52+
*.pot
53+
54+
# Django stuff:
55+
*.log
56+
local_settings.py
57+
58+
# Flask stuff:
59+
instance/
60+
.webassets-cache
61+
62+
# Scrapy stuff:
63+
.scrapy
64+
65+
# Sphinx documentation
66+
docs/_build/
67+
68+
# PyBuilder
69+
target/
70+
71+
# Jupyter Notebook
72+
.ipynb_checkpoints
73+
74+
# pyenv
75+
.python-version
76+
77+
# celery beat schedule file
78+
celerybeat-schedule
79+
80+
# SageMath parsed files
81+
*.sage.py
82+
83+
# dotenv
84+
.env
85+
86+
# virtualenv
87+
.venv
88+
venv/
89+
ENV/
90+
91+
# Spyder project settings
92+
.spyderproject
93+
94+
# Rope project settings
95+
.ropeproject
96+
97+
### PyAR Stuff
198
*.pyc
299
*.swp
3100
*.swo
4101
.venv
102+
.vscode/
5103
db.sqlite3
6104
waliki_data
7105
waliki_attachments
8106
media
9107
.vagrant
10-
src
11-
pyarweb
12-
celerybeat-schedule
13-
local_settings.py
14-
15-
16108

109+
### PyCharm stuff
110+
.idea/

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
- DJANGO=1.8 SECRET_KEY=supersecret DB_PORT=5432 DB_SERVICE=localhost DB_PASS="" DB_USER=postgres DB_NAME=postgres
1616

1717
install:
18-
- pip install -r requirements.txt
18+
- pip install -r dev_requirements.txt
1919

2020
script:
2121
- python manage.py test

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ en el botón "Fork" que lo podes encontrar en la parte superior a la derecha.
3131

3232
3. Una vez forkeado el proyecto, te lo clonas. Siempre recordar trabajar
3333
sobre el branch "develop". A continuación un ejemplo:
34-
34+
```
3535
[edvm@laptop mixes] $ git clone [email protected]:edvm/pyarweb.git pyar
3636
Cloning into 'pyar'...
3737
remote: Counting objects: 3007, done.
@@ -53,7 +53,7 @@ sobre el branch "develop". A continuación un ejemplo:
5353
* branch develop -> FETCH_HEAD
5454
Already up-to-date.
5555
[edvm@laptop pyar] (develop)
56-
56+
```
5757

5858
4. Hacer tus modificaciones en el branch "develop" no es la mejor práctica.
5959
Un pull-request en github representa una peticion de merge (de pull = fetch + merge),

Dockerfile

+12-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
FROM ubuntu:14.04
2-
1+
FROM python:3.4
32
ENV PYTHONUNBUFFERED 1
4-
5-
RUN apt-get -qq update && apt-get install -y --no-install-recommends \
6-
build-essential \
7-
git \
8-
python3 \
3+
ENV PYTHONPATH /code:$PYTHONPATH
4+
# runtime dependencies
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
96
python3-dev \
10-
gettext \
11-
libpq-dev \
12-
libffi-dev \
13-
libssl-dev \
147
libxml2-dev \
15-
libxslt1-dev \
8+
libxslt1-dev \
169
zlib1g-dev \
17-
libjpeg-dev \
18-
libpng12-dev \
19-
python3-pip \
10+
libffi-dev \
2011
&& rm -rf /var/lib/apt/lists/*
2112

2213
RUN mkdir /code
2314
WORKDIR /code
24-
25-
ADD . /code/
26-
RUN pip3 install -U pip setuptools
27-
RUN pip3 install -r requirements.txt
15+
# update pip (to use wheels)
16+
RUN wget -O - https://bootstrap.pypa.io/get-pip.py | python3
17+
COPY dev_requirements.txt /code
18+
COPY requirements.txt /code
19+
RUN pip install -r dev_requirements.txt
20+
COPY . /code/

INSTALLATION.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Installation Notes
2+
3+
## Prerequisites
4+
5+
Make sure you have installed...
6+
7+
```bash
8+
sudo apt-get install python3-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev openssl-dev
9+
```
10+
11+
## Create virtualenv
12+
13+
You should use virtualenv (or [FADES](https://github.com/PyAr/fades)). Currently supports 3.5.
14+
Create a virtualenv named `pyarweb`
15+
16+
### Pyenv
17+
18+
```bash
19+
pyvenv3 pyarweb
20+
```
21+
22+
### Virtualenvwrapper
23+
24+
If you don't know how to use `virtualenvwrapper` please check [official documentation](https://virtualenvwrapper.readthedocs.io/en/latest/)
25+
26+
```bash
27+
mkvirtualenv -p $(which python3) pyarweb
28+
```
29+
30+
## Install requirements
31+
32+
```bash
33+
pip install -r dev_requirements.txt
34+
```
35+
36+
## Create PostgresSQL DB
37+
38+
### with Docker engine
39+
40+
```bash
41+
docker run --name pyarweb-db -e POSTGRES_DB=pyarweb -p 5432:5432 -d postgres
42+
```
43+
44+
### with PostgreSQL
45+
46+
```bash
47+
su - postgres
48+
createdb pyarweb
49+
```
50+
51+
## Initialize DB
52+
53+
```bash
54+
./manage.py makemigrations # because Waliki presents some bug...
55+
./manage.py migrate
56+
```
57+
58+
## Run some test
59+
```bash
60+
./manage.py test
61+
```
62+
63+
# Run service
64+
65+
```bash
66+
./manage.py runserver
67+
```

README.md

+6-38
Original file line numberDiff line numberDiff line change
@@ -11,48 +11,16 @@ Decenas de personas han colaborado de [diversas maneras](https://github.com/PyAr
1111

1212
## ¿Cómo arranco / instalo el proyecto en mi máquina?
1313

14+
### Vía virtualenv (recomendado)
1415

15-
### Via [Docker](http://docker.com) (recomendando):
16-
17-
18-
1. Instalar [docker-compose](https://docs.docker.com/compose/install/) de la manera recomendada
19-
para tu sistema operativo.
20-
21-
22-
2. Hacé un fork y cloná el proyecto localmente.
23-
24-
25-
2. Construir la imágen para la aplicación. Esto bajará e instalará todas las dependencias dentro
26-
de un contenedor, sin modificar el equipo anfitrión:
27-
28-
$ cd path/to/pyarweb
29-
$ docker-compose build
30-
31-
3. Inicializá la base de datos.
32-
33-
$ docker-compose run web ./initialize.sh
34-
35-
36-
4. Levantá los servicios
37-
38-
$ docker-compose up -d
39-
40-
41-
¡Listo! Visitá la dirección [`http://localhost:8000`](http://localhost:8000) para ver el sitio.
42-
Un usuario administrador `admin` con password `admin` ya debería estar cargado.
43-
44-
De ahora en más, para ejecutar comandos dentro del container debés precederlos con `docker-compose run web`.
45-
Por ejemplo, para entrar en el shell de django, ejecutá:
46-
47-
$ docker-compose run web python3 manage.py shell
16+
Si querés podés instalar todo el entorno en tu propia maquina, podés ver
17+
instrucciones generales en [esta página de la wiki](https://github.com/PyAr/pyarweb/wiki/Instalaci%C3%B3n-manual)
4818

49-
También podés ejecutar `docker-compose run web bash` y directamente *pasarte* a la consola bash del
50-
contenedor
19+
### Via [Docker](http://docker.com) (No soportada por el momento):
5120

52-
### ¿Y sin docker?
21+
Estamos trabajando para soportar docker, mientras tanto podés ver las
22+
instrucciones en [esta página de la wiki](https://github.com/PyAr/pyarweb/wiki/Instalacion-con-Docker)
5323

54-
Si no te gusta o no podés usar docker y querés instalar todo el entorno en tu propia maquina, podés ver
55-
instrucciones generales en [esta página de la wiki](https://github.com/PyAr/pyarweb/wiki/Instalaci%C3%B3n-manual)
5624

5725
## Más info
5826

community/admin.py

-3
This file was deleted.

community/models.py

+10-9
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@
88
@receiver(user_signed_up)
99
def create_acl_for_user_wiki_own_page(sender, **kwargs):
1010
user = kwargs['user']
11-
perms = Permission.objects.filter(content_type__app_label='waliki',
12-
codename__in=('add_page', 'change_page')).values_list(
13-
'id', flat=True)
11+
perms = Permission.objects.filter(
12+
content_type__app_label='waliki',
13+
codename__in=('add_page', 'change_page')
14+
).values_list('id', flat=True)
1415

15-
rule, created = ACLRule.objects.get_or_create(name='pagina propia {}'.format(str(user)),
16-
slug='miembros/{}'.format(
17-
get_slug(user.username)),
18-
apply_to=ACLRule.TO_EXPLICIT_LIST,
19-
as_namespace=True
20-
)
16+
rule, created = ACLRule.objects.get_or_create(
17+
name='pagina propia {}'.format(str(user)),
18+
slug='miembros/{}'.format(get_slug(user.username)),
19+
apply_to=ACLRule.TO_EXPLICIT_LIST,
20+
as_namespace=True
21+
)
2122
if created:
2223
rule.permissions.add(*perms)
2324
rule.users.add(user)

community/templates/community/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h1><span class="bigger">Comunidad</span> Python Argentina</h1>
2323
<article class="col-sm-4">
2424
<div class="img aprendiendo_python"></div>
2525
<h3 class="text-center"><a href="{% url 'aprendiendo' %}">Aprendiendo Python</a></h3>
26-
<p class="text-center">Recopilación de recursos que los miembros de PyAr consideramos útil para quienes que se inician en este lenguaje.</p>
26+
<p class="text-center">Recopilación de recursos que los miembros de PyAr consideramos útiles para quienes que se inician en este lenguaje.</p>
2727
</article>
2828
<article class="col-sm-4">
2929
<div class="img lista_correo"></div>

community/templates/header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<a href="{% url 'events:events_list_all' %}"><span class="eventos"></span>{% trans 'Eventos' %}</a>
4949
</li>
5050
<li>
51-
<a href="{% url 'planet_index' %}"><span class="pyar"></span>{% trans 'Planeta' %}</a>
51+
<a href="http://planeta.python.org.ar"><span class="pyar"></span>{% trans 'Planeta' %}</a>
5252
</li>
5353
<li>
5454
<a href="{% url 'jobs_list_all' %}"><span class="jobs"></span>{% trans 'Trabajos' %}</a>

community/templatetags/devtags.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ def wikify(value, prefix=''):
4848
@register.filter
4949
def has_group(user, group_name):
5050
group = Group.objects.get(name=group_name)
51-
return True if group in user.groups.all() else False
51+
return True if group in user.groups.all() else False

community/tests.py

-3
This file was deleted.

community/urls.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from django.conf.urls import patterns, url
44

55

6-
urlpatterns = patterns('',
6+
urlpatterns = patterns(
7+
'',
78
url(r'^', 'community.views.homepage', name='homepage'),
89
)

0 commit comments

Comments
 (0)