This file contains 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
http://sphinxsearch.com/downloads/ - скачать tar.gz | |
tar -xzf | |
cd | |
1) | |
./configure --without-mysql --with-pgsql --prefix=/usr/local/sphinx --with-pgsql-libs=/usr/lib/postgresql-9.1/ --with-pgsql-includes=/usr/include/postgresql-9.1/ | |
2) make | |
3) make install | |
4) cd /usr/local/sphinx/etc/ | |
создаем sphinx.conf | |
прописываем |
This file contains 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
""" User Django Rest Framework to check to see if an authenticated user | |
is in a particular group | |
Usage:: | |
from api.group_permissions import GroupAPIGETPermission | |
class SearchProductView(View): | |
permissions = (IsAuthenticated, GroupAPIGETPermission,) |
This file contains 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
#!/usr/bin/env python | |
# For this script to work you must set the Django settings file | |
# as an environment setting before importing LayerMapping | |
# Alternatively you can place | |
# export DJANGO_SETTINGS_MODULE=settings | |
# in your .bash_profile | |
# or paste this code into a $ manage.py shell |
This file contains 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
import sys | |
import pika | |
# prerequisites are that you have RabbitMQ installed | |
# create a "darkmatter" named VirtualHost (VHOST) | |
# rabbitmqctl.bat add_vhost darkmatter | |
# create a user APP_USER with associated APP_PASS word | |
# rabbitmqctl add_user darkmatteradmin <password> | |
# give the APP_USER the necessary permissions | |
# rabbitmqctl set_permissions -p darkmatter darkmatteradmin ".*" ".*" ".*" |
This file contains 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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
This file contains 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
from django.contrib.auth.models import Permission | |
from django.contrib.contenttypes.models import ContentType | |
from myapp.models import MyModel | |
content_type = ContentType.objects.get_for_model(MyModel) | |
permissions = Permission.objects.filter(content_type=content_type) |
NewerOlder