Re: Authentication Django RestFramework

2018-04-19 Thread Andréas Kühne
Hi Musharef, Yes, everything you are asking for is possible. However as far as I know there is no standard solution for your problem, you will have to write all of that by yourself. That being said, it's not that hard: 1. A view for registration - returns a created username / password - or the use

Re: Adding stored procedures

2018-04-19 Thread Larry Martell
There are django-mssql and django_pyodbc but I was never able to get either of those to work for me. I ended up using odbc - I couldn't use the ORM, but I still was able to connect to the MSSQL DB from my django app using raw queries. On Wed, Apr 18, 2018 at 8:55 AM, Matthew Pava wrote: > Hi Chri

Re: perhap buys in autodetector.py

2018-04-19 Thread Zheng Gu
Yes, you are right, I removed all migrations folder, include any files in it(such as 0001_initial.py), and as you said, I have to run "makemigrations app_name" to generate new codes. To avoid these tedious work, I made a change: [questioner.py:42] return self.defaults.get("ask_initial", False) ==>

Re: username and allowed alphanumeric, why?

2018-04-19 Thread Melvyn Sopacua
On donderdag 12 april 2018 15:59:50 CEST Stefano Tranquillini wrote: > 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. Everything except non-printables and contro

Re: Error with channels and celery

2018-04-19 Thread Melvyn Sopacua
On woensdag 18 april 2018 10:05:23 CEST Sergio Lopez wrote: > Mi error is: > > raise OSError(err, 'Connect call failed %s' % (address,)) > ConnectionRefusedError: [Errno 10061] Connect call failed ('::1', 6379) Somewhere you have configured the redis connection to [::1] (IPv6) or localhost (and

Authentication Django RestFramework

2018-04-19 Thread Musharaf Baig
There is not register/login mechanism for users. I need two types of authentication: 1. To make it available I would like to let the user use it for free with a limited number of call s or time - for example after the API is called 50 times, I would like that the token expi

Re: Adding stored procedures

2018-04-19 Thread Jani Tiainen
Hi. Django migrations are run only once. If you want to change you stored procedure you always need a new migration. In case of being last migration you could develop it by having drop clause im reverse migration. But if there is another migration(s) between current and new stored procedure you n

Re: Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread Jani Tiainen
Hi again, and as I said, Django templating language is not a programming language and it doesn't support it (it's by design). If your graphobject is a list of items, use iterating it over as Matthew Pava suggested in his reply. Otherwise you need to either create custom tag/filter that returns w

Re: Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread shawnmhy
As I said, the data is already stored in variable: graphobject, I can simply achieve my goal by coding like this: {{% graphobject.1%}}, {{% graphobject.2 %}} .. But I want a loop to do that 在 2018年4月19日星期四 UTC+2下午6:29:18,Jani Tiainen写道: > > Hi. Django templating language isn't programming la

RE: Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread Matthew Pava
Is there something stopping you from using this construct? {% for item in graphobject %} From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Jani Tiainen Sent: Thursday, April 19, 2018 11:29 AM To: django-users@googlegroups.com Subject: Re: Use self-increasing

Re: Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread Jani Tiainen
Hi. Django templating language isn't programming language. It can't do that. You need to prepare data suitable for displaying in your view. On Thu, Apr 19, 2018 at 7:01 PM, wrote: > I am currently working on django. > > I have a list of values which stored in 'graphobject', and 'metarange' is >

Use self-increasing arguments in numeric for-loop in Django

2018-04-19 Thread shawnmhy
I am currently working on django. I have a list of values which stored in 'graphobject', and 'metarange' is defined as range(0,59). In that case, how could I use numbers as argument to display the value stored in graphobject? I tried using following codes but it doesn't work {% for i in met

Re: Login with email address, mobile number or username.

2018-04-19 Thread Andy
Firt of all you should start with you own user model because changing it afterwards is not that easy like stated in the docs. >From there you can change the username restrictions to your liking and implement the cell_phone field. Then implement you own version of ModelBackend which is also check

Re: Input and output is single page using forms.py

2018-04-19 Thread sathish ponaganti
Hi Jason, Thanks for your response, i'm pretty new to Django framework , could you prove the sample code if you have. On Thu, Apr 19, 2018 at 4:21 PM, Jason wrote: > If you're making a single page application, then you're probably using > something like angular, vue or react for the browser

RE: Adding stored procedures

2018-04-19 Thread Matthew Pava
Hi Chris, The migrations will be run whenever you execute the migrate command. When I want to make changes to an unmanaged model, in the next migration file I add a DROP statement to RunSQL, and then the new code to generate the VIEW. I haven’t attempted reversing a migration, though. I try t

Re: perhap buys in autodetector.py

2018-04-19 Thread Tim Graham
When you say, "remove all previous migration codes" -- you mean you removed all the migration files such as 0001_initial.py? In that case, make sure you don't remove the __init__.py file, otherwise you must use "makemigrations app_name". On Thursday, April 19, 2018 at 7:18:02 AM UTC-4, guzheng2

Re: Adding stored procedures

2018-04-19 Thread Chris Wedgwood
Thanks Matthew I probably need to think about this some more I think using runsql will work. Do you know if you can set migrations to be rerunnable? It would be useful to be able to change something like a stored procedure and then it gets dropped and recreated each deployment Saying that the

Re: Django generated migration fails with KeyError for field that was removed from the model.

2018-04-19 Thread Jani Tiainen
Hi, Is that complete model definition? Since exception seems to go through modifying composed index (unique_together) where you might still have reference to deleted field. On Thu, Apr 19, 2018 at 3:36 PM, James Farris wrote: > My guess is that field is not empty in the database or it’s being

Re: Django generated migration fails with KeyError for field that was removed from the model.

2018-04-19 Thread James Farris
My guess is that field is not empty in the database or it’s being called in a view or template still. Sent from my mobile device > On Apr 18, 2018, at 2:59 PM, jackotonye wrote: > > A migration generated with `python manage.py makemigrations` Fails to execute > using `python manage.py migrat

Login with email address, mobile number or username.

2018-04-19 Thread lakshitha kumara
Hello Guys , what is the best way to implement Login with email address, mobile number or username. all those field save as a different field in user table. user can login with any criteria that user provided to registered. its look like how instagram.com does it. i need know what is the best w

perhap buys in autodetector.py

2018-04-19 Thread guzheng2000
Hi, Django prompts "no changes..." when I want to re-create migration codes by calling makemigrations after remove all previous migration codes. After some digs, I found it can be fixed by changing: [autodetector.py:151] "al not in self.from_state.real_apps " ==> "al not in self.to_state.real_a

Re: Input and output is single page using forms.py

2018-04-19 Thread Jason
If you're making a single page application, then you're probably using something like angular, vue or react for the browser side development. Check out Django Rest Framework for ease of building a RESTful API that you can use. On Wednesday, April 18, 2018 at 3:18:09 PM UTC-4, sathish ponaganti

cors and images via dj-static

2018-04-19 Thread Andy
Hi, is there a way to serve media files via dj-static with the addition of CORS headers? -- 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.