import DjangoREST+Geodjango

2017-06-13 Thread Gabriel Sansigolo
Hello everyone, my name is Gabriel Sansigolo. Last week I came across a 
little problem during the development of a project.

The problem appeared when I needed to import a function from a class, which 
was in another folder.
Captura_1: Organização dos Arquivos 

At first I thought it was wrong in the way I wrote import.
Captura_2: O Erro 
 
The source pointed to by the error was the urls.py file, as the image shows:
Captura_3: urls.py 
 
It should be noted that PyCharm did not identify it as an error. After 
researching on the subject I noticed that many said that probably the 
problem was in the "INSTALLED_APPS" inside the settings.py file, thinking 
about it follow image of my installed apps:
Captura_4: Installed Apps 

his may be a trivial mistake in Django, but as I do not know much, I'm a 
beginner, I can not see the solution.
Links of the prints, for those who do not appear the hyperlinks:

Http://imgur.com/deEWMqn
Http://imgur.com/F9kPZ0W
Http://imgur.com/kR7PUHI
Http://imgur.com/zsM3qBo

Thanks for the space.

regards.Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


TypeError in test.py for requests

2017-06-13 Thread Jacob Niebloom
I couldn't figure out if this should be a discussion group question of a 
Github issue... Thank you in advance.
Steps to reproduce

python manage.py test --noinput alloy.modules.super_tester

class SuperTester(APITestCase):

def test1(self):
client = APIClient()
data = client.get('/')
print(data)

Expected behavior

I expect to see the data of the json that the get request produces.
This used to work and all my integration tests were passing.
Actual behavior

==
ERROR: test1 (alloy.modules.super_tester.SuperTester)
--
Traceback (most recent call last):
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/alloy/modules/super_tester.py", line 
15, in test1
data = client.get('/')
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/rest_framework/test.py",
 line 282, in get
response = super(APIClient, self).get(path, data=data, **extra)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/rest_framework/test.py",
 line 208, in get
return self.generic('GET', path, **r)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/django/test/client.py",
 line 416, in generic
return self.request(**r)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/rest_framework/test.py",
 line 279, in request
return super(APIClient, self).request(**kwargs)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/rest_framework/test.py",
 line 231, in request
request = super(APIRequestFactory, self).request(**kwargs)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/django/test/client.py",
 line 483, in request
response = self.handler(environ)
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/django/test/client.py",
 line 131, in __call__
self.load_middleware()
  File 
"/Users/Jacob/Dropbox/Github/edu-chat-core/educhatenv/lib/python3.6/site-packages/django/core/handlers/base.py",
 line 82, in load_middleware
mw_instance = middleware(handler)
TypeError: __init__() takes 1 positional argument but 2 were given


asdfadsfasf

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: pre_save and post_save replacement methods in DRF 3.6.2

2017-06-13 Thread Xavier Ordoquy
Hi,

it means you can perform the pre save before calling super’s 
perform_create/update and then call the post_save from you override 
perform_create/update.

Regards,
Xavier Ordoquy,
Linovia.

> Le 13 juin 2017 à 11:09, Priyanka Thakur  a écrit :
> 
> Hi,
> 
> Though i have gone through DRF 3.6 docs, but just to be clear from concept  
> p.o.v.
> 
> I understand that pre_save , post_save methods have been removed from DRF 3.x 
> version onwards and perform_create and perform_update methods are their 
> replacement .
> 
> Does it mean that post_save method has to be replaced with "perform_update" 
> method while pre_save is replaced with "perform_create" method?
> 
> 
> Regards,
> Priyanka
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-rest-framework+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-rest-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.