Re: Django's cache framework problem

2018-06-27 Thread 林挺滨
I use cache api to keep model instances, but "@cache_property" isn't work. Now I use the module global var to keep model instances. 赖信桃 于2018年6月28日周四 下午1:29写道: > One is cached framework , one is just a better "property". Use cache api > if you want to keep some instances. > On Thu, Jun 28, 2018

Re: Django's cache framework problem

2018-06-27 Thread 赖信桃
One is cached framework , one is just a better "property". Use cache api if you want to keep some instances. On Thu, Jun 28, 2018 at 13:11 林挺滨 wrote: > > https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional > Say: > The cached result will persist as long as the

Re: Django's cache framework problem

2018-06-27 Thread 林挺滨
https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional Say: The cached result will persist as long as the instance does, so if the instance is passed around and the function subsequently invoked, the cached result will be returned.

Re: better way to create a dictionary in Django model?

2018-06-27 Thread prateek gupta
Thanks Mark for sharing every step! It helps a lot. On Wednesday, June 27, 2018 at 7:57:25 PM UTC+5:30, mark wrote: > > The way I work with json data in the admin is rather complicated. Here are > a the steps I use - check the django documentation and Google for details. > > As an example,

Re: Django's cache framework problem

2018-06-27 Thread 赖信桃
Django's cached framework and @cached_property are two different things, though both has "cached" it doesn't mean that they share memory https://docs.djangoproject.com/zh-hans/2.0/topics/cache/ https://docs.djangoproject.com/zh-hans/2.0/ref/utils/#module-django.utils.functional Read the

Re: Django's cache framework problem

2018-06-27 Thread 林挺滨
class Log(models.Model): type = models.CharField(max_length=200, unique=True) column = SortedManyToManyField(Column, blank=True) min_column_cnt = models.IntegerField(blank=True, default=0, help_text='0 equal NULL') @cached_property def column_list_name(self): return

Queryset calculation and then filter/exclude/limit data rendered

2018-06-27 Thread rod termaat
I have a small checkbook application where I store transactions (expenses and income) amounts by date. I render these to a template using python to add the cumulative balance prior to render. This work fine for my little application, but not too sure how scalable it will be over time. My

Beginner

2018-06-27 Thread Harsh Rawat
I have learnt Django a little bit. I need help regarding the ticket https://code.djangoproject.com/ticket/28905 .What should I learn in Django to be able to contribute via this ticket. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Invalid URLs passing validation by URLValidator

2018-06-27 Thread Tim Bell
On Friday, 22 June 2018 20:53:54 UTC+10, Jason wrote: > > Interesting find.. the only time I've used that kind of URL convention is > by connecting to redis with the python redis library. It also fits db url > connection strings too. > > What's the actual use case for the URL schema? > The

Re: Invalid URLs passing validation by URLValidator

2018-06-27 Thread Tim Bell
Just picking up on a few points... On Friday, 22 June 2018 21:51:01 UTC+10, Melvyn Sopacua wrote: > > > However, officially, HTTP urls do not allow for username and password as > outlined in section 3.3: > > > > An HTTP URL takes the form: > > > http://:/? > > > where and are as

Re: Admin site not working properly using passenger on shared hosting. Need help setting it up properly

2018-06-27 Thread Pato
Ahmed, Did you manage to figure out what was the problem? I ran into the same problem. All POST requests are throwing Page not found (404) Request Method: POST Let me know Thanks On Friday, March 2, 2018 at 7:19:10 AM UTC-5, Tanvir Ahmed wrote: > > Hello, > > I am fairly new to the web

Re: Deploy on Heroku

2018-06-27 Thread TimT Vogt
Also the instruction is in the screen to $ heroku config:set DISABLE_COLLECTSTATIC=1 Seems heroku want you to type this command Verstuurd vanaf mijn iPhone > Op 27 jun. 2018 om 14:29 heeft Fabio C. Barrionuevo da Luz > het volgende geschreven: > > The error is explicitly here: > >

Re:

2018-06-27 Thread Mikhailo Keda
you can use external service, for example https://www.mailgun.com https://simpleisbetterthancomplex.com/tutorial/2017/05/27/how-to-configure-mailgun-to-send-emails-in-a-django-app.html середа, 27 червня 2018 р. 16:53:02 UTC+3 користувач john speny написав: > > What is the best way of sending

Re: better way to create a dictionary in Django model?

2018-06-27 Thread Mark Phillips
The way I work with json data in the admin is rather complicated. Here are a the steps I use - check the django documentation and Google for details. As an example, assume you have a table Documents with a JSON field called metadata and other "normal" django fields. The metadata is a dictionary

Re: Why do we need @cached_property behave like property when access from class?

2018-06-27 Thread laixintao
> but still I can *NOT* think out one useful situation. Sorry for the typo. 在 2018年6月27日星期三 UTC+8下午10:10:29,laixintao写道: > > Hi, I'm reading the django's source code, and I am quite confused by > https://github.com/django/django/pull/812/files and >

Why do we need @cached_property behave like property when access from class?

2018-06-27 Thread 赖信桃
Hi, I'm reading the django's source code, and I am quite confused by https://github.com/django/django/pull/812/files and https://code.djangoproject.com/ticket/19872#no2 Why @cached_property need to return self when access from class?

Re: better way to create a dictionary in Django model?

2018-06-27 Thread Bill Torcaso
You might find it helpful to look at the Wagtail CMS (wagtail.io). It may not solve your problem, but Wagtail stores page-layout information in JSON format in a database column. The JSON can be revised without modifying the database schema. On Wednesday, June 27, 2018 at 8:18:09 AM UTC-4,

[no subject]

2018-06-27 Thread john speny
What is the best way of sending email message to another email user...The one on the django.docs makes your account unsecure -- 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

Re: better way to create a dictionary in Django model?

2018-06-27 Thread prateek gupta
It has some limit- The configuration object can only be changed, there's no link for "add" (1) On Wednesday, June 27, 2018 at 6:41:41 PM UTC+5:30, Egor Smolyakov wrote: > > Better way it to use packages like this > https://github.com/lazybird/django-solo > > On 27 June 2018 at 15:18, prateek

Re: better way to create a dictionary in Django model?

2018-06-27 Thread Yehor Smoliakov
Better way it to use packages like this https://github.com/lazybird/django-solo On 27 June 2018 at 15:18, prateek gupta wrote: > Hi All, > > I am using Django 2.0.6 with Python 3.6 and MySql and created a model > which maps the db tables to django. > In my database, I have a column 'config' of

Re: Django's cache framework problem

2018-06-27 Thread 赖信桃
Show me your code snippet. 林挺滨 于2018年6月27日周三 下午8:44写道: > When I use cache framework api to cache a model instance, @cached_property > of the instance doesn't work. Why? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe

Re: Newbie : Object copy - weird error :-)

2018-06-27 Thread Julio Biason
Hi Mikael, The problem is happening because of this: __init__() takes from 1 to 2 positional arguments but 11 were given On your new __init__(), you added just 2 parameters: `self` and `source`. But you overwrote the default `models.Model` init, which receives way more parameters (the original

Django's cache framework problem

2018-06-27 Thread 林挺滨
When I use cache framework api to cache a model instance, @cached_property of the instance doesn't work. Why? -- 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

Re: Can't access my django runserver

2018-06-27 Thread Joshua Kayode
I think you need to give more details, we are all ready to help! On Jun 27, 2018 10:41, "Umar Kambala" wrote: > Please after going through my django polls, now if I runserver I gets this > error > > 'APP_DIRS' : True, > SyntaxError: invalid syntax. > Please wat do I do? > > -- > You received

Re: Deploy on Heroku

2018-06-27 Thread Fabio C. Barrionuevo da Luz
The error is explicitly here: django.core.exceptions.ImproperlyConfigured: sets the REDIS_URL environment variable that is, you have not enabled the Redis plugin in Heroku. As shown in the cookiecutter-django tutorial, it's just you, inside the folder of your project, run: heroku

better way to create a dictionary in Django model?

2018-06-27 Thread prateek gupta
Hi All, I am using Django 2.0.6 with Python 3.6 and MySql and created a model which maps the db tables to django. In my database, I have a column 'config' of type json. This column stores the data in a dictionary format like below- {"user_id": "a...@example.com", "password": "xyz"} I need to

Deploy on Heroku

2018-06-27 Thread Elias Coutinho
Good Morning, Following the deploy model of this tutorial , I was not successful. Below the traceback of the terminal and then the heroku logs. Where did I go wrong? I did not identify what the message meant.

Can't access my django runserver

2018-06-27 Thread Umar Kambala
Please after going through my django polls, now if I runserver I gets this error 'APP_DIRS' : True, SyntaxError: invalid syntax. Please wat do I do? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: simple django application since im a beginner I'm unable to doit..

2018-06-27 Thread 'Anthony Flury' via Django users
On 25/06/18 15:57, mr.sathee...@gmail.com wrote: I want to know the IP is malicious or not by simple web application since I'm a beginner I unable to do it. help me Define malicious ? You would need to look  at how it is normally defined (normally companies use blacklists of IP address ranges -