Upgrade Django 1.11 to 2.2 - Checking forward compatibility automatically

2019-09-09 Thread amarshall
Hi, 

   I'm looking for a way to test my code automatically for Django 2.2 
compatibility when I make changes in my Django 1.11 environment so that 
when I do upgrade I will not have any issues. Is there a way to do this 
automatically?  
Similar to what Pylint does for checking python3 compatibility. 

thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bc264b7-b481-43ed-8884-8a58c59585e9%40googlegroups.com.


Re: server connection reset when click on localhost: Python error: wsgiref-> simple_server.py "noneType" object has no attribute split

2016-03-21 Thread amarshall
Figured it out.. In case anyone else was wondering or comes across this. I 
went into the wsgiref/simple_server.py file and commented out that line of 
code:
/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
self.status.split(' ',1)[0], self.bytes_sent

After commenting that out another set of errors arose. More detailed and 
told me I was missing a package. So I installed that package and all was 
well. Guess I forgot to do another pip freeze into my requirements 
file..Really simple thing that I completely missed. So if anyone else has 
this issue you may be missing a package and Django isn't telling you 
because it hasn't reached a certain line of code yet or some other reason.

On Thursday, March 17, 2016 at 9:08:41 PM UTC-4, amarshall wrote:
>
>
> So I'm moving my work environment from one environment to the next. I did 
> a pip install -r requirements for a list of packages I had. setup the DB. 
> Migration went good. I do runserver and that runs. BUT when I click on the 
> link to the homepage it says "The Connection was reset" in my browser. In 
> my stacktrace is the below message. I've searched and found similar errors 
> on the internet but none django related with a fix. any help
>
> Here's the traceback I get:
>
> Exception happened during processing of request from ('127.0.0.1', 56784)
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/SocketServer.py", line 593, in 
> process_request_thread
> self.finish_request(request, client_address)
>   File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
> self.RequestHandlerClass(request, client_address, self)
>   File 
> "/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
> , line 102, in __init__
> super(WSGIRequestHandler, self).__init__(*args, **kwargs)
>   File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
> self.handle()
>   File 
> "/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
> , line 182, in handle
> handler.run(self.server.get_app())
>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 92, in run
> self.close()
>   File "/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
> self.status.split(' ',1)[0], self.bytes_sent
> AttributeError: 'NoneType' object has no attribute 'split'
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8f5cd8ae-690c-44bb-8581-7707b15dd431%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


server connection reset when click on localhost: Python error: wsgiref-> simple_server.py "noneType" object has no attribute split

2016-03-18 Thread amarshall

So I'm moving my work environment from one environment to the next. I did a 
pip install -r requirements for a list of packages I had. setup the DB. 
Migration went good. I do runserver and that runs. BUT when I click on the 
link to the homepage it says "The Connection was reset" in my browser. In 
my stacktrace is the below message. I've searched and found similar errors 
on the internet but none django related with a fix. any help

Here's the traceback I get:

Exception happened during processing of request from ('127.0.0.1', 56784)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 593, in 
process_request_thread
self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File 
"/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
, line 102, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 649, in __init__
self.handle()
  File 
"/home/adrian/.virtualenvs/sneak8env/local/lib/python2.7/site-packages/django/core/servers/basehttp.py"
, line 182, in handle
handler.run(self.server.get_app())
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 92, in run
self.close()
  File "/usr/lib/python2.7/wsgiref/simple_server.py", line 33, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cc20b9d6-7ed1-43a1-90fd-f4f9cd52fdde%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade to django 1.7- ImproperlyConfigured -Tastypie label duplicate? help

2016-01-25 Thread amarshall
Been a while.I forgot if I solved it using that. However I did create 
different environments using env wrapper and do an uninstall of old django 
and complete install to the newest version. Fixing small errors as they 
arise.

On Saturday, May 30, 2015 at 10:21:45 AM UTC-4, dc wrote:
>
> Were you able to solve the problem @amarshall? I have the exact same 
> error, do let me know please!
>
> On Tuesday, March 31, 2015 at 8:04:23 PM UTC+5:30, Filipe Ximenes wrote:
>>
>> Thats strange.
>> Are you using pip to install dependencies? Try uninstalling everything 
>> and reinstalling again. 
>> Make sure INSTALLED_APPS is not being defined somewhere else in the code. 
>> Does the error persists if you set DEBUG = False locally?
>>
>> On Tue, Mar 31, 2015 at 10:21 AM, amarshall  wrote:
>>
>>> Hi Filipe,
>>>
>>> I have few apps installed. When I comment out the tastypie line my app 
>>> builds but gets an error in production because tastypie app isn't found. 
>>> Here it is:
>>>
>>> INSTALLED_APPS = (
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>> 'rest_framework',
>>># 'south',   // commented out after upgrade to Django 1.7
>>> 'tastypie',
>>> 'lokal',#my app
>>> )
>>>
>>>
>>>
>>> On Tuesday, March 31, 2015 at 5:52:55 AM UTC-4, Filipe Ximenes wrote:
>>>>
>>>> Can you show us your INSTALED_APPS?
>>>> It may be the case you have a lot of apps installed and is not seeing a 
>>>> duplicate reference to tastypie.
>>>> On Mar 29, 2015 9:43 PM, "amarshall"  wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>>  So I updated my django project from django 1.6 to 1.7.7 and when I 
>>>>> run "python manage.py migrate" I get this error stating that I have a 
>>>>> duplicate label. 
>>>>>
>>>>> Here's the traceback
>>>>>
>>>>>   Creating tables...
>>>>>   Installing custom SQL...
>>>>>   Installing indexes...
>>>>> Running migrations:
>>>>>   Applying tastypie.0001_initial...Traceback (most recent call last):
>>>>>   File "manage.py", line 11, in 
>>>>> execute_from_command_line(sys.argv)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/core/
>>>>> management/__init__.py", line 385, in execute_from_command_line
>>>>> utility.execute()
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/core/
>>>>> management/__init__.py", line 377, in execute
>>>>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/core/
>>>>> management/base.py", line 288, in run_from_argv
>>>>> self.execute(*args, **options.__dict__)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/core/
>>>>> management/base.py", line 338, in execute
>>>>> output = self.handle(*args, **options)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/core/
>>>>> management/commands/migrate.py", line 161, in handle
>>>>> executor.migrate(targets, plan, fake=options.get("fake", False))
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/db/
>>>>> migrations/executor.py", line 68, in migrate
>>>>> self.apply_migration(migration, fake=fake)
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/db/
>>>>> migrations/executor.py", line 96, in apply_migration
>>>>> if self.detect_soft_applied(migration):
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/db/
>>>>> migrations/executor.py", line 140, in detect_soft_applied
>>>>> apps = project_state.render()
>>>>>   File "/usr/local/lib/python2.7/dist-packages/django/db/
>>>>> migrations/state.py", line 57, in render
>>>>> self.apps = Apps([AppConfigStub(label) for label in 
>>>>> sorted(s

Re: Commenting system to use to build with REST API

2016-01-12 Thread amarshall
Thank you. I ended up doing just that and writing my own. works great :D

On Wednesday, December 23, 2015 at 1:18:52 PM UTC-5, Dheerendra Rathor 
wrote:
>
> You can write your own system with just two models - Post and Comment. 
> Then write custom serializers and viewsets to submit comments. 
> It's an easy task and won't take much of your time. 
>
> I've worked in similar fashion on few of my own works. Here is a link of 
> custom models I wrote: 
> https://github.com/bird-labs/MHRDApp-Server/blob/master/post/models.py
>
>
> On Wed, 23 Dec 2015 at 23:40 amarshall > 
> wrote:
>
>> Hi, I'm working on an android app and using django as the backend. I 
>> created an api using django rest framework and everything is fine so far. I 
>> want to add commenting to my main object. i.e - lets call it a "Post". I 
>> want each post to have a set of comments associated with it. simple 
>> comments.one after the other. I'm not looking to do threaded commenting. 
>> What is the best way I should go about doing this? 
>>
>> I see apps like Disquis and django-comments-xtd 
>> <https://django-comments-xtd.readthedocs.org/en/latest/index.html>, but 
>> they all seem to just use the templating system on the web front end. I 
>> just want the data in some text/JSON format and send it to android(or any 
>> other device). i.e [ comments: {id:1,user: User23,comment: I totally agree 
>> } }
>>
>> Also, I seen this post: 
>> http://stackoverflow.com/questions/28369418/struggling-to-get-django-comments-to-work-with-django-rest-framework
>>  
>>
>> and wondered should I try still using django.contrib.comments even though 
>> it's depreciated ? 
>>
>> I'm using Django verson 1.8.4 
>>
>> Any advice would be great. Thanks.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/12c52875-c1f1-4465-ade7-37dc5dca75c1%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/12c52875-c1f1-4465-ade7-37dc5dca75c1%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f48693a7-a629-49ca-a956-255e7cbc4fd1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Not getting any results back using DRF Haystack

2016-01-12 Thread amarshall
So I've used django rest framework to serialize my data to make api calls. 
Great, that all worked well. Now I wanted to implement a search and return 
the serialized data in JSON format like I do with normal data. I feel like 
I followed the drf-haystack basic usage guide(
https://drf-haystack.readthedocs.org/en/latest/basic_usage.html) correctly 
to get started. But I'm not getting any results when I make a call to the 
url. So, I'm going to use this event app. I want to be able to search 
through the titles. i.e( "party downtown")

So here's what I'm working with.

Model: 

class Event(models.Model):

business = models.ForeignKey(Business)
title = models.CharField(max_length=75)
event_date = models.DateField(blank=True,default=datetime.date.today)   
 
startTime = models.DateTimeField(blank=True,default=datetime.datetime.
now) 
endTime = models.DateTimeField(blank=True,null=True)
description = models.TextField(blank=True)


search_indexes.py:



class EventIndex(indexes.SearchIndex,indexes.Indexable):

text = indexes.CharField(document=True,use_template=True)
title = indexes.CharField(model_attr="title")
description = indexes.CharField(model_attr="description")

))

def get_model(self):
return Event

def index_queryset(self,using=None):
return self.get_model().objects.all()


Serializer(EventSearchSerializer):
class EventSearchSerializer(HaystackSerializer):

class Meta:
# The `index_classes` attribute is a list of which search indexes
# we want to include in the search.
index_classes = [EventIndex]

# The `fields` contains all the fields we want to include.
# NOTE: Make sure you don't confuse these with model attributes. 
These
# fields belong to the search index!
fields = [
"text", "title", "description"
]




Views: ( I've tried both ways mentioned in the docs. With viewsets and 
without):

class EventSearchView(HaystackViewSet):
# `index_models` is an optional list of which models you would like to 
include
# in the search result. You might have several models indexed, and this 
provides
# a way to filter out those of no interest for this particular view.
# (Translates to `SearchQuerySet().models(*index_models)` behind the 
scenes.
index_models = [Event]   

serializer_class = EventSearchSerializer

class EventSearchView2(ListModelMixin, HaystackGenericAPIView):

serializer_class = EventSearchSerializer

def get(self,request, *args,**kwargs):
return self.list(request,*args,**kwargs)



Urls:
router = routers.DefaultRouter()
router.register("event/search", EventSearchView, base_name="event-search")

urlpatterns = [
# api url for User to Create, Read, View 
url(r'^~api/v1/', include(router.urls)),

url(
regex=r'^~api/v2/search/$',
view = views.EventSearchView2.as_view(),
name="event_search_api"
),]

I perform a search in the url:
url:  http://localhost/events/~api/v2/search/?title=club
and I get nothing,but there's data there for sure with that title. I get a 
200 OK code back. But 0 results

I'm trying to figure this out, but I got nothing so far. Thanks for reading 
this far.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/450186a9-2b7f-4dc9-9803-aa156d669f21%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Commenting system to use to build with REST API

2015-12-23 Thread amarshall
Hi, I'm working on an android app and using django as the backend. I 
created an api using django rest framework and everything is fine so far. I 
want to add commenting to my main object. i.e - lets call it a "Post". I 
want each post to have a set of comments associated with it. simple 
comments.one after the other. I'm not looking to do threaded commenting. 
What is the best way I should go about doing this? 

I see apps like Disquis and django-comments-xtd 
, but 
they all seem to just use the templating system on the web front end. I 
just want the data in some text/JSON format and send it to android(or any 
other device). i.e [ comments: {id:1,user: User23,comment: I totally agree 
} }

Also, I seen this post: 
http://stackoverflow.com/questions/28369418/struggling-to-get-django-comments-to-work-with-django-rest-framework
 

and wondered should I try still using django.contrib.comments even though 
it's depreciated ? 

I'm using Django verson 1.8.4 

Any advice would be great. Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/12c52875-c1f1-4465-ade7-37dc5dca75c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrade to django 1.7- ImproperlyConfigured -Tastypie label duplicate? help

2015-03-31 Thread amarshall
Hi Filipe,

I have few apps installed. When I comment out the tastypie line my app 
builds but gets an error in production because tastypie app isn't found. 
Here it is:

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
   # 'south',   // commented out after upgrade to Django 1.7
'tastypie',
'lokal',#my app
)



On Tuesday, March 31, 2015 at 5:52:55 AM UTC-4, Filipe Ximenes wrote:
>
> Can you show us your INSTALED_APPS?
> It may be the case you have a lot of apps installed and is not seeing a 
> duplicate reference to tastypie.
> On Mar 29, 2015 9:43 PM, "amarshall" > 
> wrote:
>
>> Hi,
>>
>>  So I updated my django project from django 1.6 to 1.7.7 and when I run 
>> "python manage.py migrate" I get this error stating that I have a duplicate 
>> label. 
>>
>> Here's the traceback
>>
>>   Creating tables...
>>   Installing custom SQL...
>>   Installing indexes...
>> Running migrations:
>>   Applying tastypie.0001_initial...Traceback (most recent call last):
>>   File "manage.py", line 11, in 
>> execute_from_command_line(sys.argv)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py"
>> , line 385, in execute_from_command_line
>> utility.execute()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py"
>> , line 377, in execute
>> self.fetch_command(subcommand).run_from_argv(self.argv)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>> line 288, in run_from_argv
>> self.execute(*args, **options.__dict__)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
>> line 338, in execute
>> output = self.handle(*args, **options)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py"
>> , line 161, in handle
>> executor.migrate(targets, plan, fake=options.get("fake", False))
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py"
>> , line 68, in migrate
>> self.apply_migration(migration, fake=fake)
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py"
>> , line 96, in apply_migration
>> if self.detect_soft_applied(migration):
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py"
>> , line 140, in detect_soft_applied
>> apps = project_state.render()
>>   File 
>> "/usr/local/lib/python2.7/dist-packages/django/db/migrations/state.py", 
>> line 57, in render
>> self.apps = Apps([AppConfigStub(label) for label in 
>> sorted(self.real_apps 
>> + list(app_labels))])
>>   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
>> line 56, in __init__
>> self.populate(installed_apps)
>>   File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
>> line 89, in populate
>> "duplicates: %s" % app_config.label)
>> django.core.exceptions.ImproperlyConfigured: Application labels aren't 
>> unique, duplicates: tastypie
>>
>>
>> Not sure what to do here. I remove tastypie from the list of 
>> INSTALLED_APPS in my settings and everything works fine. but I do need it. 
>> Any suggestions ?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/7e4cfbf8-d3e0-4e0e-a38c-b83930ffa3b6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/7e4cfbf8-d3e0-4e0e-a38c-b83930ffa3b6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5128dd5e-faa1-4c6a-9cf4-0a59f7d0bc2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Upgrade to django 1.7- ImproperlyConfigured -Tastypie label duplicate? help

2015-03-29 Thread amarshall
Hi,

 So I updated my django project from django 1.6 to 1.7.7 and when I run 
"python manage.py migrate" I get this error stating that I have a duplicate 
label. 

Here's the traceback

  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  Applying tastypie.0001_initial...Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 385, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", 
line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 288, in run_from_argv
self.execute(*args, **options.__dict__)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", 
line 338, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python2.7/dist-packages/django/core/management/commands/migrate.py"
, line 161, in handle
executor.migrate(targets, plan, fake=options.get("fake", False))
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", 
line 68, in migrate
self.apply_migration(migration, fake=fake)
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", 
line 96, in apply_migration
if self.detect_soft_applied(migration):
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/executor.py", 
line 140, in detect_soft_applied
apps = project_state.render()
  File 
"/usr/local/lib/python2.7/dist-packages/django/db/migrations/state.py", 
line 57, in render
self.apps = Apps([AppConfigStub(label) for label in sorted(self.real_apps 
+ list(app_labels))])
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
line 56, in __init__
self.populate(installed_apps)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", 
line 89, in populate
"duplicates: %s" % app_config.label)
django.core.exceptions.ImproperlyConfigured: Application labels aren't 
unique, duplicates: tastypie


Not sure what to do here. I remove tastypie from the list of INSTALLED_APPS 
in my settings and everything works fine. but I do need it. Any suggestions 
?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e4cfbf8-d3e0-4e0e-a38c-b83930ffa3b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin can't display user detail view: 500 error

2014-08-30 Thread amarshall
Okay, I got everything working. I was totally over thinking things I think. 
I added the ADMINS variable in my settings to get a traceback and it seems 
a package(django-tastypie) I installed on my development side I forgot to 
install on the production side. Once I installed it, I migrated it's new 
tables using South and everything worked.

On Thursday, August 28, 2014 8:22:00 PM UTC-4, amarshall wrote:
>
> I've deployed my django application using Nginx and uWSGI. 
>
> In development I can login to my django admin-> users-> [username] and it 
> shows the users information. However in development once I click on a user 
> I get a "server 500" error. I have the same code for both deployment and 
> development. I can't think of what the problem could be ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bb542db8-0dad-44fc-995d-3443afad9070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin can't display user detail view: 500 error

2014-08-29 Thread amarshall
I see now that I think the best course of action is to get the traceback by 
adding the ADMINS settings. So I did that. Now I need to restart the uwsgi 
server process. Any suggestions on how to kind of brute force do that right 
now? 

I see on their site they suggest "uwsgi --reload /tmp/project-master.pid". 
I see this everywhere but no where has any site/tut said "create a 
project-master.pid file for  reasons".  I'm assuming it's supposed 
to contain a list of all the uwsgi worker processes? I created a blank file 
at that directory and tried to run my command to start the service over 
again adding the "pidfile=/tmp/project-master.pid" tag and I go to check 
the file and nothing is there. So I'm not sure if the uwsgi command is 
restarting . All so I can see and get my traceback.. Sorry about this 
tanget. 

On Thursday, August 28, 2014 8:22:00 PM UTC-4, amarshall wrote:
>
> I've deployed my django application using Nginx and uWSGI. 
>
> In development I can login to my django admin-> users-> [username] and it 
> shows the users information. However in development once I click on a user 
> I get a "server 500" error. I have the same code for both deployment and 
> development. I can't think of what the problem could be ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/95ab3aad-77aa-4bc4-a614-540a3d23ff2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin can't display user detail view: 500 error

2014-08-29 Thread amarshall
I didn't have my uwsgi setup to log. So I did with this command : 

uwsgi --socket :8001 --wsgi-file wsgi.py --master --processes 5 --threads 2 
--daemonize /var/log/uwsgi/lokalapp.log


So I went to the site to reach the 500 error to see if anything updates and 
nothing is updated in the log file when I check it.

This is the only thing it logs: 

*** Starting uWSGI 2.0.6 (64bit) on [Fri Aug 29 15:43:09 2014] ***
compiled with version: 4.8.2 on 24 July 2014 15:50:13
os: Linux-3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
nodename: web01
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /var/www/lokalapp.co
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
your processes number limit is 15802
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI is running on the same address (:8001).
bind(): Address already in use [core/socket.c line 759]
*** Starting uWSGI 2.0.6 (64bit) on [Fri Aug 29 15:45:57 2014] ***
compiled with version: 4.8.2 on 24 July 2014 15:50:13
os: Linux-3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
nodename: web01
machine: x86_64
clock source: unix
detected number of CPU cores: 2
current working directory: /var/www/lokalapp.co
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) *** 
your processes number limit is 15802
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
probably another instance of uWSGI is running on the same address (:8001).
bind(): Address already in use [core/socket.c line 759]


So, it doesn't show anything. Also, at first I was running that command 
without the --daemonize tag. Since I have I can't kill the server to 
restart it. Wanted to try to kill it with "kill -9 [process id] " but when 
I do another process comes in it's place. 


On Friday, August 29, 2014 11:59:11 AM UTC-4, amarshall wrote:
>
> I'm pretty sure my ALLOWED_HOST is setup right to allow all url locations 
> after the main domain.  I have not setup the EMAIL to send me notifications 
> upon 500 server error. Will do now.  About to check my uwsgi log and post 
> it as well

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/3273b9da-e7aa-41b6-a18b-32c0bd95b150%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django admin can't display user detail view: 500 error

2014-08-29 Thread amarshall
I'm pretty sure my ALLOWED_HOST is setup right to allow all url locations after 
the main domain.  I have not setup the EMAIL to send me notifications upon 500 
server error. Will do now.  About to check my uwsgi log and post it as well

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/00d70175-5d1e-4c3e-8962-b42956f013e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django admin can't display user detail view: 500 error

2014-08-28 Thread amarshall
I've deployed my django application using Nginx and uWSGI. 

In development I can login to my django admin-> users-> [username] and it 
shows the users information. However in development once I click on a user 
I get a "server 500" error. I have the same code for both deployment and 
development. I can't think of what the problem could be ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/176e31ad-5b35-429b-ad61-33753bcd30c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: User to Model relationship- implement a "like" feature on a Model

2014-08-25 Thread amarshall
Thanks ! I'll get to work on that and see how it goes!

On Monday, August 25, 2014 8:26:35 PM UTC-4, Tim Chase wrote:
>
> On 2014-08-25 17:00, amarshall wrote: 
> > Hmm, That may work. I should have also noted one thing. I'm 
> > actually using Django as the backend for mobile application. Both 
> > *Android* and iOS. So I'd like to do something like this, in the 
> > simplest matter: 
> > 
> > pseudocode: 
> >   
> >   get information from the server. 
> >   if this_user HAS NOT "liked"  this event , 
> >   event_likes_count += 1 
> >  else 
> >   keep the like count the same. make like button inactive 
>
> You may want to try phrasing the problem as "select count of all the 
> likes where the event=$THIS_EVENT and the user != $THIS_USER" which 
> is pretty close to the underlying SQL and shouldn't be too hard to 
> translate into a a Django query.  Something like this untested 
>
>   # [models.py] 
>   class Event(Model): 
> likes = ManyToMany(through="Like") 
> # ... 
>
>   class Like(Model): 
> event = ForeignKey(Event) 
> user = ForeignKey(User) 
> class Meta: 
>   unique_together = [ 
> ("event", "user"), 
> ] 
>
># [views.py] 
>this_event = #... 
>this_user = #... 
>Like.objects.filter(event=this_event).exclude(user=this_user).Count(id) 
>
> As mentioned, it's untested, but should get you pretty close. 
>
>
> -tkc 
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c38a3d47-852c-42fe-82a9-b1097846105a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: User to Model relationship- implement a "like" feature on a Model

2014-08-25 Thread amarshall
Hmm, That may work. I should have also noted one thing. I'm actually using 
Django as the backend for mobile application. Both *Android* and iOS. So 
I'd like to do something like this, in the simplest matter:

pseudocode:
  
  get information from the server.
  if this_user HAS NOT "liked"  this event ,
  event_likes_count += 1
 else
  keep the like count the same. make like button inactive
 

On Monday, August 25, 2014 6:57:09 PM UTC-4, somecallitblues wrote:
>
> The other way would be to simply wire a cookie to user's browser and use 
> js to disable the the like button if the cookie is present if you can get 
> away with it. Not sure if you need to store that info against the user to 
> see which items they liked...
> On 26/08/2014 8:41 am, "amarshall" > 
> wrote:
>
>> Hi, 
>>
>>I'm trying to implement likes on a Model in which 1 user will be able 
>> to like an a model (named "event") "once" and only once. 
>>
>> so, I have a model like this: 
>>
>> class Event(models.Model):
>>
>> user = models.ForeignKey(User)
>> . #other fields
>> .
>> likes = models.PositiveIntegerField(default=0,null=True)
>>
>>
>>
>>
>> How do I implement it so that only one user can "like" an event (increase 
>> by 1) ? Brainstorming I'm thinking should I make a new class called "like" 
>> and have it have "Event" as a foreign key and a oneToOne relationship with 
>> User ? not really sure how to go about doing this.
>>
>> class Like(models.Model):
>> 
>>event = models.ForeignKey(Event)
>>
>>user = model.ManyToMany(User) 
>>user_liked = models.BooleanField(default=false)
>>total_count = models.PositiveIntegerField(default=0)
>>
>>
>> ?   Then when an event is created a "Like" is created as well ? This may 
>> be doing to much and there's a simpler way?
>>
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/05ade3fc-f182-49be-a7d3-043fad68131b%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/05ade3fc-f182-49be-a7d3-043fad68131b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/52b64696-a720-4c6e-99a1-f4ea5b97acdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


User to Model relationship- implement a "like" feature on a Model

2014-08-25 Thread amarshall
Hi, 

   I'm trying to implement likes on a Model in which 1 user will be able to 
like an a model (named "event") "once" and only once. 

so, I have a model like this: 

class Event(models.Model):

user = models.ForeignKey(User)
. #other fields
.
likes = models.PositiveIntegerField(default=0,null=True)




How do I implement it so that only one user can "like" an event (increase 
by 1) ? Brainstorming I'm thinking should I make a new class called "like" 
and have it have "Event" as a foreign key and a oneToOne relationship with 
User ? not really sure how to go about doing this.

class Like(models.Model):

   event = models.ForeignKey(Event)
   
   user = model.ManyToMany(User) 
   user_liked = models.BooleanField(default=false)
   total_count = models.PositiveIntegerField(default=0)


?   Then when an event is created a "Like" is created as well ? This may be 
doing to much and there's a simpler way?


   

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/05ade3fc-f182-49be-a7d3-043fad68131b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.