template syntax error

2018-03-04 Thread harsh sharma
i created a model in which i have an image filed but when ever i am trying to get an uploaded image on the in my model.py image = models.ImageField(upload_to='static/pictures',) setting.py STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, "static", "./static"),

Making an object unsaveable ...

2018-03-04 Thread Bernd Wechner
An interesting question I've not been able to solve reading docs or Googling. As every posting here only after some serious research efforts including class inspections ;-). But am stumped and wonder if anyone else has any ideas. Here is the use case: 1. Load an object from database 2. Flag

Re: The cloud panel doesn't into directory in django

2018-03-04 Thread Jason
I suspect it's due to the aserisks (*) in your URL with *root*. Remove that, and change (?P[\*\w]+)/ to (?P[\w]+)/ While an asterisk is a valid character in the URL, I've never seen it used in practice. Your experiences here make me suspect you're not escaping *both* asterisks, and thus

Re: The cloud panel doesn't into directory in django

2018-03-04 Thread Safa Bayar
It doesn't work and i clap eyes on other link in html file. link is delete file, edit page,

Re: The cloud panel doesn't into directory in django

2018-03-04 Thread Safa Bayar
4 Mart 2018 Pazar 15:11:46 UTC+3 tarihinde Jason yazdı: > > I suspect it's due to the aserisks (*) in your URL with *root*. > > Remove that, and change (?P[\*\w]+)/ to (?P[\w]+)/ > > While an asterisk is a valid character in the URL, I've never seen it used > in practice. Your experiences

Djangonauts: say no to selenium drug

2018-03-04 Thread Jamesie Pic
Hello everybody, This is a message coming from the deepest of my heart. When you start applying best development practices such as TDD, you discover that you make much better software. First, you can TDD your python code with anything, django has a test runner, otherwise you have pytest and

Re: Making an object unsaveable ...

2018-03-04 Thread Dan Tagg
Two possibilities spring to mind 1. Don't grant django's database user the right to update the relevant table. If you take this approach you'll need to catch any errors if anyone writes code to attempt to do this 2. Use signals to catch any save attempts. This is easily circumvented. On 4 March

Re: Django Channels AuthMiddleware question

2018-03-04 Thread Andrew Godwin
This is a problem with _any_ ASGI app, not just middleware - doing blocking things in the __init__ is bad. I will look at the docs when I look at solving the SessionMiddleware problem as well, as the two are linked. Andrew On Sun, Mar 4, 2018 at 7:10 AM, Hugo Castilho

Re: The cloud panel doesn't into directory in django

2018-03-04 Thread Safa Bayar
you're right. i am mistake. i try to your say but doesn't work. i changed althought it is

Re: Django Channels AuthMiddleware question

2018-03-04 Thread Hugo Castilho
The example in the Channels documentation shows it being used with a consumer called consumers.AsyncChatConsumer which suggests it's safe to use with async consumers. There probably should be a note there that it's currently not safe to use with async consumers no? Regarding the

Django server and client communications

2018-03-04 Thread Richard Maceček
Hello, I need help with client and server communications. Web Application - Djang Server Side. The client is written in python, it's actually a KODI add-on. They need to deal with: 1. client authorization, 2. communications, 3. data transfer. I need to send the data I receive from the

Re: Django server and client communications

2018-03-04 Thread Avraham Serour
I suggest using DRF, It can autogenerate the schema which can be useful. It seems they also have a client to consume that, worth taking a look On 4 Mar 2018 21:58, "Richard Maceček" wrote: > Hello, I need help with client and server communications. Web Application >

Re: Django 1,11 upgrade, render template with context in template.Node

2018-03-04 Thread Bernd Wechner
Can't say I'm experienced with template.Node, but you piqued my curiosity so I found this: https://stackoverflow.com/questions/14434624/how-to-get-dictionary-of-requestcontext-imported-from-django-template which may help, but am left wondering why upgrade to 1.11 when 2.0 is out already and

Re: Making an object unsaveable ...

2018-03-04 Thread Bernd Wechner
Thanks Dan, I was actually thinking also last night of: 3. Override the save() method on the model. Not tested, not sure how robust, but as it happens there's a hook there already as all the models I'm work with have it overridden with tiny method that updates some admin fields like

Customizing mode loading ...

2018-03-04 Thread Bernd Wechner
Found this lovely doc: https://docs.djangoproject.com/en/2.0/ref/models/instances/#customizing-model-loading But it leaves me with a thirst for more knowledge. My conclusion form reading it is, that if I wanted to put a hook into some custom code that always ran after data was loaded from the

YesNoWidget(CheckBoxInput) widget woes

2018-03-04 Thread Mike Dewhirst
In some training software a student can use 'Yes', 'No' or any other string as valid answers for up to six questions in a set and all of them have to be answered correctly to get a score. When checking student answers against the set answers, we ignore case and punctuation and leading zeroes

Re: Making an object unsaveable ...

2018-03-04 Thread Derek
I think the second case is more manageable; I'd actually have a second table that has an exact duplicate structure of the first. Then you can save your newly changed copy into that -- and delete the record just afterward, or even much later, if you need to. I cannot imagine a scenario in