This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( event.which == 13) { | |
var value = $(this).val() | |
//value.replace(" ","W3Schools"); | |
var category = $('#list-category').val() | |
var host = window.location.host; | |
url="http://"+host+"/search/#/0/"+category+"/0/0/0/0/"+value; | |
$(location).attr('href',url); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-HOST | |
------------------- | |
1) sudo a2enmod rewrite | |
2) “/etc/hosts” ->editar (127.0.0.1 project.local) | |
3) sudo gedit /etc/apache2/sites-available/project-local.conf | |
<VirtualHost *:80> | |
ServerName project.local | |
DocumentRoot /var/www/project | |
</VirtualHost> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
console.log('hello'); | |
var country = $('#id_country').change(setStates); | |
var state = $('#id_state').change(setCity); | |
//Saber que formulario estamos utilizando | |
if ($('#id_city').length){ | |
var city = $('#id_city'); | |
} else { | |
var city = $('#id_id'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_form(self, form_class): | |
_form = super(ProductModelCreateView, self).get_form(form_class) | |
_form.fields["maximum_order"].initial = 0 | |
_form.fields["maximum_order"].widget = HiddenInput() | |
=================================== | |
Campo requerido en vista |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name '*.pyc' -delete | |
./manage.py migrate --delete-ghost-migrations |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1)Paso 1: | |
sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev checkinstall mercurial | |
2) Paso 2: | |
hg clone https://bitbucket.org/pygame/pygame | |
*Si no se puede clonar directamente descargarlo. | |
3) Paso 3: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) sudo apt-get install mongodb mongodb-clients mongodb-server | |
2) sudo service mongodb start | |
3) Consola mongo: | |
mongo | |
4) Salir | |
ctrl c | |
5) Añadir al inicio: | |
sudo update -rc.d mongodb defaults | |
6) entrar interfaz grafica |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install python-software-properties | |
sudo apt-add-repository ppa:chris lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs | |
npm install socket.io |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def upload_file(self, request): | |
form = FileUploadForm(request.POST, request.FILES) | |
if form.is_valid(): | |
self.handle_uploaded_file(request.FILES['file']) | |
return True | |
def handle_uploaded_file(self, file): | |
destination = open(settings.MEDIA_ROOT + '/filename', 'wb+') | |
for chunk in file.chunks(): | |
destination.write(chunk) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo rm /var/lib/mongodb/mongod.lock | |
sudo service mongodb restart |
OlderNewer