Re: ARGPARSE ERROR

2018-04-12 Thread Ankush Sharma
Hi Babatunde ,
I installed other listed tools ! Here the main concern im talking about is
Argsparse -
the Progressbar2 3.6.2 requires argparse, which is not installed.
Thanks in advance
Ank





On Thu, 12 Apr 2018 at 20:53, Babatunde Akinyanmi 
wrote:

> This is not a django problem. Simply install and upgrade the apps
> specified in the error message
>
> On Thu, 12 Apr 2018, 16:03 Ank,  wrote:
>
>> Hi all,
>>
>> Iḿ trying to setup Catmaid - http://catmaid.readthedocs.io/en/stable/.
>> Iḿ receiving this error when installing requirements.
>>
>> Progressbar2 3.6.2 requires argparse, which is not installed.
>> twisted 17.9.0 requires zope.interface>=3.6.0, which is not installed.
>> matplotlib 2.1.0 requires backports.functools-lru-cache, which is not
>> installed.
>> django-rest-swagger 2.1.2 has requirement djangorestframework>=3.5.4, but
>> you'll have djangorestframework 3.5.3 which is incompatible
>>
>>
>>
>>  How it can be resolved ?
>>
>> Best
>> Ank
>>
>> --
>> 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/1fb16f72-1837-48f1-a8f6-c7bd64ca212f%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/CA%2BWjgXMHx_zdBtc_NG%2Bn1JMfi4oxTPHy_1y2Pw75VpxfX%2BxuqA%40mail.gmail.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/CAALWEk2D4B%3D%3Dw%2BD1BK3TpZQ8fEwCE8-s8nDWMZztO3ZPu4tBXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ARGPARSE ERROR

2018-04-12 Thread Babatunde Akinyanmi
This is not a django problem. Simply install and upgrade the apps specified
in the error message

On Thu, 12 Apr 2018, 16:03 Ank,  wrote:

> Hi all,
>
> Iḿ trying to setup Catmaid - http://catmaid.readthedocs.io/en/stable/. Iḿ
> receiving this error when installing requirements.
>
> Progressbar2 3.6.2 requires argparse, which is not installed.
> twisted 17.9.0 requires zope.interface>=3.6.0, which is not installed.
> matplotlib 2.1.0 requires backports.functools-lru-cache, which is not
> installed.
> django-rest-swagger 2.1.2 has requirement djangorestframework>=3.5.4, but
> you'll have djangorestframework 3.5.3 which is incompatible
>
>
>
>  How it can be resolved ?
>
> Best
> Ank
>
> --
> 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/1fb16f72-1837-48f1-a8f6-c7bd64ca212f%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/CA%2BWjgXMHx_zdBtc_NG%2Bn1JMfi4oxTPHy_1y2Pw75VpxfX%2BxuqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: wrong imports channel ?

2018-04-12 Thread Andrew Godwin
Channels 2 has different objects and import paths - code from Channels 1
(like you have there) isn't compatible.

Andrew

On Thu, Apr 12, 2018 at 12:37 AM, Jules LE BRIS 
wrote:

> Hi,
>
> I would like to do something like this in views.py :
>
> message = {"message":msg}
> Channel('chat').send(message, immediately=True)
>
> but the import : from channels import Channel doen't work. I'm using
> channels==2.0.2.
>
> --
> 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/b7684c27-9568-4321-a70b-29e58c550b3d%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/CAFwN1uqCuYwJYkFpnQ%3DtcVXjNNZQi-5fx9GNj%2BmZkADntv1jLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN]: django-todo 2.0

2018-04-12 Thread Ankush Sharma
Thanks ! I will try to implement as you suggested !!
On Thu, 12 Apr 2018 at 17:31, Scot Hacker  wrote:

> On Thursday, April 12, 2018 at 1:47:14 AM UTC-7, Derek wrote:
>>
>> Interesting to hear of this.
>>
>> Unfortunately we are currently committed to Django 1.11 as it is an LTS,
>> but if you're planning on keeping this in-sync with all 2.x releases, then
>> that opens up the option to look at using this from 2.2 onwards (that's the
>> next LTS).
>>
>
> I *believe* the only Django 2-only feature in use is the URL routing.
> While untried, I suspect it would be pretty easy to get it working in a
> 1.11 project site by copying the provided urls.py into your own project,
> rewriting it in the old style, and including that from your main urls
> instead. Would be interested to hear whether this works for you.
>
> ./s
>
>
>
>
> --
> 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/114a2982-0355-455e-8edf-1535037ae680%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/CAALWEk1J4274ycj3s2L%2BGrM3yqCJMCUz8f1TfOpvrt-%3DeuG5bQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN]: django-todo 2.0

2018-04-12 Thread Scot Hacker
On Thursday, April 12, 2018 at 1:47:14 AM UTC-7, Derek wrote:
>
> Interesting to hear of this.
>
> Unfortunately we are currently committed to Django 1.11 as it is an LTS, 
> but if you're planning on keeping this in-sync with all 2.x releases, then 
> that opens up the option to look at using this from 2.2 onwards (that's the 
> next LTS).
>

I *believe* the only Django 2-only feature in use is the URL routing. While 
untried, I suspect it would be pretty easy to get it working in a 1.11 
project site by copying the provided urls.py into your own project, 
rewriting it in the old style, and including that from your main urls 
instead. Would be interested to hear whether this works for you.

./s


 

-- 
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/114a2982-0355-455e-8edf-1535037ae680%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ARGPARSE ERROR

2018-04-12 Thread Ank
Hi all, 

Iḿ trying to setup Catmaid - http://catmaid.readthedocs.io/en/stable/. Iḿ 
receiving this error when installing requirements. 

Progressbar2 3.6.2 requires argparse, which is not installed.
twisted 17.9.0 requires zope.interface>=3.6.0, which is not installed.
matplotlib 2.1.0 requires backports.functools-lru-cache, which is not 
installed.
django-rest-swagger 2.1.2 has requirement djangorestframework>=3.5.4, but 
you'll have djangorestframework 3.5.3 which is incompatible



 How it can be resolved ? 

Best
Ank

-- 
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/1fb16f72-1837-48f1-a8f6-c7bd64ca212f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: wrong imports channel ?

2018-04-12 Thread N. Srinivasan
Thank you Sir!

On Thu, Apr 12, 2018 at 3:37 AM, Jules LE BRIS  wrote:

> Hi,
>
> I would like to do something like this in views.py :
>
> message = {"message":msg}
> Channel('chat').send(message, immediately=True)
>
> but the import : from channels import Channel doen't work. I'm using
> channels==2.0.2.
>
> --
> 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/b7684c27-9568-4321-a70b-29e58c550b3d%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/CAEAcyBZpVtPgJhHdrvYR5Wg-em0nM%3DEdcqxJ9gvhHfWeP91ziA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: username and allowed alphanumeric, why?

2018-04-12 Thread Stefano Tranquillini
My question was related why only that set of extrachars, adding a '=' is a 
dangerous step or not?
Reading the rest of the page it seems that everyhing is supported with 
unicode.

On Wednesday, April 11, 2018 at 4:03:04 PM UTC+2, Melvyn Sopacua wrote:
>
> On dinsdag 10 april 2018 11:10:33 CEST Stefano Tranquillini wrote: 
>
> > mostly curiosity, why does the username 
> > 
> https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth 
> > .models.User.username allow only _, @, +, . and - characters? 
> > is there a reason for that? 
>
> Yeah. It's explained a few lines below in the box titled "Usernames and 
> unicode". The special chars mentioned are just as random I presume. 
>
>
> -- 
> Melvyn Sopacua 
>

-- 
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/35193314-5e2f-4172-98c3-ec83dfe872ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


retain form data when a user session expires while filling a form

2018-04-12 Thread Vijay Shanker


I have to code this scenario:

Some user comes to fill a form and while user is at it, session expires; 
User tries to submit form, as session has expired it will take him to login 
page after which he is rediredted to form page with a prefilled form with 
data he filled previously.

my propsed solution: on form submit, check if user session is expired with 
an ajax call, if yes, drop a cookie with values of filled form, user comes 
back to same form, prefill the form from cookie value.

how far I got: not much; I used ajax call to check session expiry with a 
backend call to this function:

def check_valid_session(request):
session_expiry_date = request.session.get_expiry_date()
now = datetime.now()
seconds_left = (session_expiry_date - now).total_seconds()
if seconds_left <= 0:
return JsonResponse({'session_expired': True, 'seconds_left': 
seconds_left })
else:
return JsonResponse({'session_expired':False, 'seconds_left': 
seconds_left})

in my settings I have:

SESSION_COOKIE_NAME = "sso-sessionid"
SESSION_COOKIE_HTTPONLY = False
SESSION_COOKIE_AGE = 10 
SESSION_COOKIE_DOMAIN = '.mydomain.com'
SESSION_COOKIE_SECURE = True
SESSION_EXPIRE_AT_BROWSER_CLOSE = True

but in response, I always get seconds_left as something close to 9.999. and 
session_expiry_date keeps increasing itself by 10 seconds each time i hit 
submit and call the backend code above. How to get correct session expire 
time?

-- 
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/e623b707-2014-4511-91f4-7a00420fe196%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


wrong imports channel ?

2018-04-12 Thread Jules LE BRIS
Hi,

I would like to do something like this in views.py :

message = {"message":msg}
Channel('chat').send(message, immediately=True)

but the import : from channels import Channel doen't work. I'm using 
channels==2.0.2.

-- 
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/b7684c27-9568-4321-a70b-29e58c550b3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tips On Migrating DB from other website to django with Postgresql

2018-04-12 Thread Mike Dewhirst

On 12/04/2018 12:44 PM, tango ward wrote:
Sorry for the follow up question, when you say run migration locally, 
this is running python manage.py makemigrations and python manage.py 
migrate, right?  Please let me know if I got these steps correctly:


- make a postgres test db
- changed database settings in settings.py and point it to test db in 
postgres
- If i run makemigrations and migrate, the only db and tables that 
will be saved in test db are the ones in our models.py


Should I modify the models.py to match the fields in the dump file? or 
should I just check the existing data from the dump file and see which 
model and fields it fits in our existing system?


That's a bit hit-and-miss.

https://docs.djangoproject.com/en/1.11/ref/django-admin/#inspectdb

Run manage.py inspectdb over your MySQL db and that will give you a set 
of models. You should be able to fire up the Django Admin to examine 
what's in there. If necessary.


Edit those generated models as required to match your existing 
Django/Postgres system and run manage.py makemigrations and migrate. 
That should give you two databases with the same schema.


At that point do a MySQL SQL dump file and drop/create/load Postgres 
using that dump file.


Since the name of the database is in the dump file you might need to 
edit it if you want a different db name in Postgres. Don't use test 
because Django uses that for unit testing.


There may be wrinkles. However, you should be able to iron them out by 
adjusting the generated models so they look more and more like the 
existing models. It may need a few migrations and you may need to start 
again and again with what you learn refining your procedures. The data 
transfer process needs to run  reliably enough for the eventual 
switchover so the customers don't get hurt.


hth

Mike



My only experience with changing backend database in Django was when I 
changed one of my pet projects db from SQLite to Postgres which I did 
in settings.py.


On Thu, Apr 12, 2018 at 8:59 AM, tango ward > wrote:


At the moment, I am comparing the fields from the dump file and
the fields in our models.py. There are fields that exist on the
dump file that are not yet in our existing model/models that why I
want to know if should I modify the schema of our database to
match the dump file of the client. I'm lost on this, sorry.

On Thu, Apr 12, 2018 at 8:46 AM, Mike Dewhirst
> wrote:

On 12/04/2018 9:47 AM, tango ward wrote:

Hi Mike,


Thanks for the advice.

May I ask as well, on Django side, since we have already
an existing system, how should I adjust the fields that
are existing from the dump file to the Django? Should I
just add fields in models.py?


Treat that as a separate task. You can do it before the
migration or after. I would preferdo it afterwards because I
am more comfortable with Postgres. And I suspect Postgres will
be a better fit with Django.

However, I'm not sure what you mean exactly by adjusting
fields. Your last question above indicates you want to change
the schema in an existing Django project. You need to consider
when the fields need to be changed in the context of
real-world pressures from your production system users. It
might need to be sooner rather than later and that may force
adjustments prior to the move to Postgres.

If there are problems with the existing MySQL system it would
be best to fix them before switching.

The bottom line is that preparations and testing for the move
has to happen in parallel with ongoing support and maintenance
and possibly ongoing development of the production system.
When you are ready to switch and happy that it will go like
clockwork the actual switch can be scheduled as a definable
task in the ongoing workflow. All developers will have to
switch at the same time - or prior if they can have access to
your completed scripts for their personal development databases.

hth

Mike


On Thu, Apr 12, 2018 at 6:42 AM, Mike Dewhirst

>> wrote:

    On 11/04/2018 11:40 PM, tango ward wrote:

        Hi there,

        This will be my first time to migrate a database
in my first
        programming job. I checked the dump file today and
load it in
        MySQL benchmark to view the ERD. The database that
I need to
        migrate has 48 tables and has existing data already.


        I 

Re: [ANN]: django-todo 2.0

2018-04-12 Thread Derek
Interesting to hear of this.

Unfortunately we are currently committed to Django 1.11 as it is an LTS, 
but if you're planning on keeping this in-sync with all 2.x releases, then 
that opens up the option to look at using this from 2.2 onwards (that's the 
next LTS).

On Tuesday, 10 April 2018 17:50:17 UTC+2, Scot Hacker wrote:
>
> “django-todo is a *pluggable*, multi-user, multi-group, multi-list todo 
> and ticketing system - a reusable app designed to be dropped into any 
> existing Django project. Users can create tasks for themselves or for 
> others, or create ”assigned tasks” that will be filed into a specific list 
> (public tickets).”
>
>
> That was the original project description, and it hasn’t changed in 10+ 
> years.
>
>
> When I first created django-todo, it was a simple “let’s learn Django” 
> project idea. I open sourced it, it’s been relatively successful, and the 
> project has received numerous contributions over the years (grateful!). 
> When I heard that it wasn’t compatible with Django 2.0, I looked back on 
> that dusty old code and realized it was time for a major refactor/upgrade. 
>
>
> The update started small, but by the end, I had made 75 commits and 
> written the first suite of working tests (finally!). Virtually every 
> module and template has been refactored, I  adopted Bootstrap as the 
> default layout engine, and finally got around to creating a live demo site 
> for the project.
>
>
> django-todo 2.0 requires Django 2.0 and Python 3.x  - no apologies. 
> Unfortunately, this is a backwards-incompatible update (you’ll need to 
> migrate old data manually, if you have any).
>
>
> Hope it’s useful to a few teams or individuals out there. Contributions 
> still very much welcome.
>
>
> Demo site: http://django-todo.org/
>
> Docs: http://django-todo.readthedocs.io/
>
> Github: https://github.com/shacker/django-todo
>
> Demo host site (which runs django-todo.org): 
> https://github.com/shacker/gtd
>
>
>

-- 
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/3d3a5672-45cd-4981-9c14-91e7e4f584d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How can i call django's buitin time or date widget in user interface?

2018-04-12 Thread squal poreover
Hello...

In the models.py i use pub_date = models.DateField(). So it shows in the 
admin interface djangos built in beautiful date widget (as it should be)


But it's not working in the user interface. How can i call  it? Thanks in 
advace

Happy coding,
Rahu

-- 
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/24b0fbef-f116-44e5-aa8d-5330e6bc133b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.