Skip to content

Instantly share code, notes, and snippets.

UIViewController *viewController = [[UIViewController alloc] init];
[viewController setNeworkWorker:self.networkWorker];
class Matches(models.Model):
product_one = models.ForeignKey(Product, related_name = 'product_one')
product_two = models.ForeignKey(Product, related_name = 'product_two')
class MatchedProducts(APIView):
def get(self, request, *args, **kwargs):
product_id = kwargs.get('product_id')
matched_ids = []
class get_contact_list(APIView):
def get(self, request, *args, **kwargs):
print "here"
social_user = request.user.social_auth.filter( provider='twitter', ).first()
if social_user:
url = 'https://api.twitter.com/1.1/friends/list.json'.format(social_user.extra_data['access_token'],)
print social_user.extra_data['access_token']
request = urlopen(url)
friends = json.loads(urllib2.urlopen(request).read()).get('data')
for friend in friends:
class return_my_connections(APIView):
serializer_class = GetConnectedUsersSerializer
def get(self, request, *args, **kwargs):
user = request.user
fetch_objc = ConnectedUsers.objects.filter(Q(from_user=user) | Q(to_user=user))
data = []
for connectedUser in fetch_objc:
temp_obj = ConnectedUsers.objects.get(pk = connectedUser.id)
class ConnectionRequestSerializer(serializers.ModelSerializer):
from_data = CustomUserSerializer(source='from_user')
to_data = CustomUserSerializer(source='to_user')
class Meta:
model = ConnectionRequest
class request_connection(APIView):
request = kwargs.get('request')
current_url = settings.INSTALL_URL
location = current_url + 'profile'
res = HttpResponse(location, status=302)
res['Location'] = location
return res
server {
listen 443;
server_name ***.***.com;
access_log /var/log/***.com/nginx.access.log;
error_log /var/log/***.com/nginx.error.log;
root /home/web/***/app/;
charset utf-8;
ssl on;
{
"name": "angular-seed",
"description": "A starter project for AngularJS",
"version": "0.0.0",
"homepage": "https://github.com/angular/angular-seed",
"license": "MIT",
"private": true,
"dependencies": {
"angular": "1.2.x",
"angular-route": "1.2.x",
drwxr-xr-x 26 root root 4096 Oct 22 12:33 .
drwxr-xr-x 4 root root 4096 Oct 22 12:32 ..
drwxr-xr-x 6 root root 4096 Oct 22 12:33 allauth
drwxr-xr-x 4 root root 4096 Oct 22 12:33 bootstrapform
drwxr-xr-x 2 root root 4096 Oct 22 12:33 corsheaders
drwxr-xr-x 17 root root 4096 Oct 22 12:33 django
drwxr-xr-x 2 root root 4096 Oct 22 12:33 Django-1.7.dist-info
drwxr-xr-x 2 root root 4096 Oct 22 12:33 django_allauth-0.18.0-py2.7.egg-info
drwxr-xr-x 2 root root 4096 Oct 22 12:33 django_bootstrap_form-3.1-py2.7.egg-info
drwxr-xr-x 2 root root 4096 Oct 22 12:33 django_cors_headers-0.13-py2.7.egg-info
Error: class uri 'gevent' invalid or not found:
[Traceback (most recent call last):
File "/root/venvs/project1/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/util.py", line 139, in load_class
mod = import_module('.'.join(components))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/root/venvs/project1/local/lib/python2.7/site-packages/gunicorn-19.1.1-py2.7.egg/gunicorn/workers/ggevent.py", line 22, in <module>
raise RuntimeError("You need gevent installed to use this worker.")
RuntimeError: You need gevent installed to use this worker.