Skip to content

Commit

Permalink
Merge pull request #386 from PyAr/dev
Browse files Browse the repository at this point in the history
new release from "dev"
  • Loading branch information
gilgamezh authored Mar 27, 2017
2 parents 39fba39 + 3824cb9 commit d904197
Show file tree
Hide file tree
Showing 66 changed files with 1,379 additions and 428 deletions.
9 changes: 0 additions & 9 deletions .env

This file was deleted.

106 changes: 100 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,110 @@
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

### PyAR Stuff
*.pyc
*.swp
*.swo
.venv
.vscode/
db.sqlite3
waliki_data
waliki_attachments
media
.vagrant
src
pyarweb
celerybeat-schedule
local_settings.py



### PyCharm stuff
.idea/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
- DJANGO=1.8 SECRET_KEY=supersecret DB_PORT=5432 DB_SERVICE=localhost DB_PASS="" DB_USER=postgres DB_NAME=postgres

install:
- pip install -r requirements.txt
- pip install -r dev_requirements.txt

script:
- python manage.py test
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ en el botón "Fork" que lo podes encontrar en la parte superior a la derecha.

3. Una vez forkeado el proyecto, te lo clonas. Siempre recordar trabajar
sobre el branch "develop". A continuación un ejemplo:

```
[edvm@laptop mixes] $ git clone [email protected]:edvm/pyarweb.git pyar
Cloning into 'pyar'...
remote: Counting objects: 3007, done.
Expand All @@ -53,7 +53,7 @@ sobre el branch "develop". A continuación un ejemplo:
* branch develop -> FETCH_HEAD
Already up-to-date.
[edvm@laptop pyar] (develop)

```

4. Hacer tus modificaciones en el branch "develop" no es la mejor práctica.
Un pull-request en github representa una peticion de merge (de pull = fetch + merge),
Expand Down
31 changes: 12 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
FROM ubuntu:14.04

FROM python:3.4
ENV PYTHONUNBUFFERED 1

RUN apt-get -qq update && apt-get install -y --no-install-recommends \
build-essential \
git \
python3 \
ENV PYTHONPATH /code:$PYTHONPATH
# runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
python3-dev \
gettext \
libpq-dev \
libffi-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
libxslt1-dev \
zlib1g-dev \
libjpeg-dev \
libpng12-dev \
python3-pip \
libffi-dev \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /code
WORKDIR /code

ADD . /code/
RUN pip3 install -U pip setuptools
RUN pip3 install -r requirements.txt
# update pip (to use wheels)
RUN wget -O - https://bootstrap.pypa.io/get-pip.py | python3
COPY dev_requirements.txt /code
COPY requirements.txt /code
RUN pip install -r dev_requirements.txt
COPY . /code/
67 changes: 67 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Installation Notes

## Prerequisites

Make sure you have installed...

```bash
sudo apt-get install python3-dev libxml2-dev libxslt1-dev zlib1g-dev libffi-dev openssl-dev
```

## Create virtualenv

You should use virtualenv (or [FADES](https://github.com/PyAr/fades)). Currently supports 3.5.
Create a virtualenv named `pyarweb`

### Pyenv

```bash
pyvenv3 pyarweb
```

### Virtualenvwrapper

If you don't know how to use `virtualenvwrapper` please check [official documentation](https://virtualenvwrapper.readthedocs.io/en/latest/)

```bash
mkvirtualenv -p $(which python3) pyarweb
```

## Install requirements

```bash
pip install -r dev_requirements.txt
```

## Create PostgresSQL DB

### with Docker engine

```bash
docker run --name pyarweb-db -e POSTGRES_DB=pyarweb -p 5432:5432 -d postgres
```

### with PostgreSQL

```bash
su - postgres
createdb pyarweb
```

## Initialize DB

```bash
./manage.py makemigrations # because Waliki presents some bug...
./manage.py migrate
```

## Run some test
```bash
./manage.py test
```

# Run service

```bash
./manage.py runserver
```
44 changes: 6 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,16 @@ Decenas de personas han colaborado de [diversas maneras](https://github.com/PyAr

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

### Vía virtualenv (recomendado)

### Via [Docker](http://docker.com) (recomendando):


1. Instalar [docker-compose](https://docs.docker.com/compose/install/) de la manera recomendada
para tu sistema operativo.


2. Hacé un fork y cloná el proyecto localmente.


2. Construir la imágen para la aplicación. Esto bajará e instalará todas las dependencias dentro
de un contenedor, sin modificar el equipo anfitrión:

$ cd path/to/pyarweb
$ docker-compose build

3. Inicializá la base de datos.

$ docker-compose run web ./initialize.sh


4. Levantá los servicios

$ docker-compose up -d


¡Listo! Visitá la dirección [`http://localhost:8000`](http://localhost:8000) para ver el sitio.
Un usuario administrador `admin` con password `admin` ya debería estar cargado.

De ahora en más, para ejecutar comandos dentro del container debés precederlos con `docker-compose run web`.
Por ejemplo, para entrar en el shell de django, ejecutá:

$ docker-compose run web python3 manage.py shell
Si querés podés instalar todo el entorno en tu propia maquina, podés ver
instrucciones generales en [esta página de la wiki](https://github.com/PyAr/pyarweb/wiki/Instalaci%C3%B3n-manual)

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

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

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

## Más info

Expand Down
3 changes: 0 additions & 3 deletions community/admin.py

This file was deleted.

19 changes: 10 additions & 9 deletions community/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
@receiver(user_signed_up)
def create_acl_for_user_wiki_own_page(sender, **kwargs):
user = kwargs['user']
perms = Permission.objects.filter(content_type__app_label='waliki',
codename__in=('add_page', 'change_page')).values_list(
'id', flat=True)
perms = Permission.objects.filter(
content_type__app_label='waliki',
codename__in=('add_page', 'change_page')
).values_list('id', flat=True)

rule, created = ACLRule.objects.get_or_create(name='pagina propia {}'.format(str(user)),
slug='miembros/{}'.format(
get_slug(user.username)),
apply_to=ACLRule.TO_EXPLICIT_LIST,
as_namespace=True
)
rule, created = ACLRule.objects.get_or_create(
name='pagina propia {}'.format(str(user)),
slug='miembros/{}'.format(get_slug(user.username)),
apply_to=ACLRule.TO_EXPLICIT_LIST,
as_namespace=True
)
if created:
rule.permissions.add(*perms)
rule.users.add(user)
2 changes: 1 addition & 1 deletion community/templates/community/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h1><span class="bigger">Comunidad</span> Python Argentina</h1>
<article class="col-sm-4">
<div class="img aprendiendo_python"></div>
<h3 class="text-center"><a href="{% url 'aprendiendo' %}">Aprendiendo Python</a></h3>
<p class="text-center">Recopilación de recursos que los miembros de PyAr consideramos útil para quienes que se inician en este lenguaje.</p>
<p class="text-center">Recopilación de recursos que los miembros de PyAr consideramos útiles para quienes que se inician en este lenguaje.</p>
</article>
<article class="col-sm-4">
<div class="img lista_correo"></div>
Expand Down
2 changes: 1 addition & 1 deletion community/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<a href="{% url 'events:events_list_all' %}"><span class="eventos"></span>{% trans 'Eventos' %}</a>
</li>
<li>
<a href="{% url 'planet_index' %}"><span class="pyar"></span>{% trans 'Planeta' %}</a>
<a href="http://planeta.python.org.ar"><span class="pyar"></span>{% trans 'Planeta' %}</a>
</li>
<li>
<a href="{% url 'jobs_list_all' %}"><span class="jobs"></span>{% trans 'Trabajos' %}</a>
Expand Down
2 changes: 1 addition & 1 deletion community/templatetags/devtags.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ def wikify(value, prefix=''):
@register.filter
def has_group(user, group_name):
group = Group.objects.get(name=group_name)
return True if group in user.groups.all() else False
return True if group in user.groups.all() else False
3 changes: 0 additions & 3 deletions community/tests.py

This file was deleted.

3 changes: 2 additions & 1 deletion community/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from django.conf.urls import patterns, url


urlpatterns = patterns('',
urlpatterns = patterns(
'',
url(r'^', 'community.views.homepage', name='homepage'),
)
Loading

0 comments on commit d904197

Please sign in to comment.