Skip to content

Instantly share code, notes, and snippets.

View jhonvidal's full-sized avatar
✍️
🐧 💻 ⚽ 🏃

Jhon Vidal jhonvidal

✍️
🐧 💻 ⚽ 🏃
View GitHub Profile
@postrational
postrational / gunicorn_start.bash
Last active April 4, 2024 12:48
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@johnkary
johnkary / symfony-live-2013-portland.md
Last active December 17, 2015 15:29
Slides from Symfony Live 2013 - Portland
@quelicm
quelicm / hosting, server, symfony2, dinahosting
Last active June 16, 2019 08:21
Configurando proyecto symfony2 en una subcarpeta del hosting #symfony
# En symfony2 por defecto debemos configurar el document_root del dominio para que responda el directorio "web", el problema viene cuando no podemos cambiar donde apunta por defecto el dominio (no tenemos acceso a la configuración del apache), esta solución no es ideal pero funciona.
#1 Nuestro dominio apunta a una carpeta raiz en el servidor web, suelen ser generalmente httpdocs, public_html, www pero podrían ser cualquier otra, en esta carpeta raiz subimos todo el contenido de symfony2
#2 En la carpeta raiz nos creamos un fichero .htaccess, similar al que tenemos dentro de la carpeta web con la siguiente configuración:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /symfony/web/app.php [QSA,L]
@jelcaf
jelcaf / Operaciones-Git
Last active March 20, 2025 08:20
Git Tips - Mini-trucos de Git para facilitarme la tarea
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
@jacobian
jacobian / models.py
Created February 15, 2011 18:11
An example of using many-to-many "through" to augment m2m relationships. See http://www.quora.com/How-do-you-query-with-a-condition-on-a-ManyToMany-model-in-Django for context.
from django.db import models
class Person(models.Model):
name = models.CharField(max_length=200)
groups = models.ManyToManyField('Group', through='GroupMember', related_name='people')
class Meta:
ordering = ['name']
def __unicode__(self):