Re: Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Mike Dewhirst
Have you looked at fixtures?

manage.py dumpdata will create a json file from a database. I use it to 
populate the test database from production data reference tables. dumpdata 
let's you --exclude=... the other tables. 

I know that's not exactly what you asked for but maybe you can import data 
written to files into a database for conversion into fixtures?

Mike

Connected by Motorola

Anton Melser  wrote:

>Hi,
>
>
>I can't work out whether it is expected or whether I am missing something. I 
>would like to keep the DB data that I generate during a test run to 
>inspect/persist it. --keepdb means I have empty tables at the end, strangely 
>even if I ctrl-C a test run. It would also be logical for test data to get 
>cleaned... Is there an option I can add to keep it?
>
>
>I have a lot of calls to external services that should be mocked. The json 
>returned from these calls is put in the DB as-is, so if I can just set up an 
>initial run of the tests and then get the data from the DB that would be 
>optimal. I could add file writes about the place to persist, but I want to 
>evolve the test data over time and will need to do this often, so being able 
>to do that from the DB would be very handy.
>
>
>Any pointers?
>
>
>Thanks,
>
>Anton
>
>-- 
>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/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
>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/bbkgdkufdyjjmdrv1cjsyo4j.1550034368654%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Keeping/accessing the data Django generates during a test run

2019-02-12 Thread Anton Melser
Hi,

I can't work out whether it is expected or whether I am missing something. 
I would like to keep the DB data that I generate during a test run to 
inspect/persist it. --keepdb means I have empty tables at the end, 
strangely even if I ctrl-C a test run. It would also be logical for test 
data to get cleaned... Is there an option I can add to keep it?

I have a lot of calls to external services that should be mocked. The json 
returned from these calls is put in the DB as-is, so if I can just set up 
an initial run of the tests and then get the data from the DB that would be 
optimal. I could add file writes about the place to persist, but I want to 
evolve the test data over time and will need to do this often, so being 
able to do that from the DB would be very handy.

Any pointers?

Thanks,
Anton

-- 
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/f9d2dfe3-c832-45bd-a6d3-7f3415f1293d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Messages rejected?

2019-02-12 Thread Anton Melser
Hi,
I asked a question last night with a Google for business account and had 
the message bounce - is that normal? 

Google also hasn't kept the message anywhere so it's completely lost :(.

Anton

ps. Also posted to see whether this will also bounce...

-- 
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/92d7059a-e711-45e0-9b06-053840b40991%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin form_url breakout problem

2019-02-12 Thread Mike Dewhirst

Starting a new thread with the same subject because the old thread ...
https://groups.google.com/forum/#!topic/django-users/YLbWzmPfHwU
... is too long

Progress report.

No change in the symptoms with Python 3.6 and Django 1.11 and Django 
runserver.


I deployed to the staging server Ubuntu 16.04, Python 2.7, Django 1.11 
and Apache2 to get an error generated by functools.py.


I have decided to bite the bullet and upgrade the staging server to 
Python 3.5 (I think) and then Django 2.x. It has to be done sometime. 
I'm moving my Trac instances off the staging server to a spare machine 
which can remain with Python 2.7 so everything else can go to Py3.x


A side plan is to make a Django 2.1 venv in development to see if that 
fixes anything.


More later.

Mike

--
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/58f6901b-6d4e-1775-5497-d1247c0554d8%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: 2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-12 Thread Tim Graham
This was reported as crashing on Windows 
in https://code.djangoproject.com/ticket/30184 so we might revert the 
change.

On Friday, February 1, 2019 at 3:45:39 PM UTC-5, Tim Graham wrote:
>
> I think your shell/terminal isn't configured for Unicode. Take a look here 
> for some ideas about how to solve it: 
> https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287
>
> On Friday, February 1, 2019 at 1:49:07 PM UTC-5, axel...@chaos1.de wrote:
>>
>> Hi, 
>>
>>  File 
>> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/commands/migrate.py",
>>  
>> line 266, in migration_progress_callback 
>> self.stdout.write("  Applying %s\u2026" % migration, ending="") 
>>   File 
>> "/usr/local/py_venv/erdb2-django/lib/python3.6/site-packages/django/core/management/base.py",
>>  
>> line 145, in write 
>> self._out.write(style_func(msg)) 
>> UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in 
>> position 48: ordinal not in range(128) 
>>
>> Should stdout not receive ASCII only? 
>>
>> Someone changed here 3 dots to ellipsis character: 
>> 
>> https://github.com/django/django/commit/50b8493581fea3d7137dd8db33bac7008868d23a#diff-e835ddfb52774b39749788a0d046e477
>>  
>>
>> Axel 
>> --- 
>> PGP-Key:29E99DD6  ☀  computing @ chaos claudius 
>>
>>

-- 
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/695ffb4c-46bc-4059-9807-2bf5db18c137%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django-Photologue - error deleting a photo

2019-02-12 Thread Victor H. Velasquez Rizo
Got it.
Thank you

On Tue, Feb 12, 2019 at 12:40 AM Mike Dewhirst 
wrote:

> On 12/02/2019 4:54 pm, Victor H. Velasquez Rizo wrote:
> > Hi Mike.
> > I have spend hours trying to get the code where all this crazyness is
> > happening with no good luck.
> > I would like to ask you if there is any posibility you can access my
> > computer trhoug TEAMVIWER and guide me on this.
>
> I would love to help except I am under time pressure myself. I am a
> procrastinator and frequently do small things to postpone doing my own
> hard things. That's why I responded to your original email.
>
> Let me recommend that you start a new thread with a new subject line to
> seek fresh assistance. Write a detailed description of your problem
> including what you have done to track it down. It might take you some
> hours to edit it and get it exactly right. I have found nine times out
> of ten doing that forces me to do extra research so my request for help
> doesn't look too half-baked. Usually I end up needing to check things in
> the docs and that frequently solves my problem.
>
> A fresh and well researched request for help will attract support from
> people much more expert than me.
>
> In this thread you didn't reveal everything you had tried and you didn't
> reveal the entire error trace nor any source which you suspected. I just
> saw what the error said and pointed that out. The actual error is your
> best lead. Try and follow that to write your story.
>
> Good luck
>
> Mike
>
> >
> > On Mon, Feb 11, 2019 at 9:40 PM Mike Dewhirst  > > wrote:
> >
> > On 12/02/2019 2:19 pm, Victor H. Velasquez Rizo wrote:
> > > Hello mike.
> > > Thank you for all this information.
> > >
> > > I've been checking the migrations but I don't see anything with the
> > > *sort_value*
> >
> > In that case you have asked for gallery_photos.sort_value
> > somewhere in
> > your code and that is being interpreted by the Admin as a field and
> > because it doesn't exist is calling it a programming error.
> >
> > Certainly easier to find/fix than cheating migrations!
> >
> > Cheers
> >
> > Mike
> >
> > >
> > > Photologue Galleries
> >  Add
> > > Change
> > > Photo effects Add Change
> > > Photo sizes   Add Change
> > > PhotosAdd Change
> > > Watermarks
> > >
> > >
> > > When I get into Photos, I see the whole list of pictures that
> > has been
> > > created, but once I *delete selected items, *the error comes up.
> > >
> > >
> > >   Select photo to change
> > >
> > >   * Add photo 
> > >   * Upload a zip archive
> > > 
> > >
> > > Search
> > >
> > >
> > >
> > > Action: Go 0 of 10 selected
> > >
> > > Title 
> > >
> > > Date taken 
> > >
> > > Date added 
> > >
> > > Is public 
> > >
> > > View count 
> > >
> > > Thumbnail
> > >   Paris 
> >  (None)
> > > Feb. 11, 2019, 10:02 p.m. True0
> > > 
> > >   VICTOR 
> > (None)
> > > Jan. 21, 2019, 11:50 a.m. True0
> > > 
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > On Mon, Feb 11, 2019 at 8:23 PM Mike Dewhirst
> > mailto:mi...@dewhirst.com.au>
> > > >>
> > wrote:
> > >
> > > On 12/02/2019 11:47 am, Victor H. Velasquez Rizo wrote:
> > > > Yes Mike.
> > > > I have done both:
> > >
> > > In that case, you need to inspect the database itself using
> > > PGAdmin (or
> > > similar for other databases) and confirm that the
> gallery_photos
> > > table
> > > does indeed have a sort_value column.
> > >
> > > If not - as the error message says - then the database might
> > have
> > > been
> > > rebuilt from a dump taken prior the migration which added
> > > sort_value. Or
> > > perhaps restored from an earlier backup. In any case, if it
> > doesn't
> > > exist you have to make it exist.
> > >
> > >  

Re: serializers.serialize('json', data) return text

2019-02-12 Thread Jason
Check out JSONResponse 


-- 
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/c7580fdd-dc78-4857-9359-164c28794154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


serializers.serialize('json', data) return text

2019-02-12 Thread Yossef Vecsler
hi,

i am using:
"serializers.serialize('json', data)"
to make a json (i also use json.dumps in other cases).

how can i make "serializers.serialize('json', data)" to return json to the 
js?
because now i must make:
ans = the ajax returns -> "serializers.serialize('json', data)"
JSON.parse(ans)

while when using json.dumps its straight forward with no parsing the data...

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/c467c1a3-63d7-4b29-a3b7-a64eabd8b088%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Django bugfix release 2.0.13.

2019-02-12 Thread Carlton Gibson
Details are available on the Django project weblog: 

https://www.djangoproject.com/weblog/2019/feb/12/bugfix-release/ 




-- 
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/3DF50D9E-AF47-4EFE-A570-971CE48499D2%40gmail.com.
For more options, visit https://groups.google.com/d/optout.