utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-21 Thread fábio andrews rocha marques
I have a template called cadastrarnovomaterial.html that is a page with a textfield and a file selection button. The user should select a .csv file with the file selector. It is like this: Cadastrar um novo material 'Cadastre um novo material que pode ser usado para criar provas' {% csrf_token

Re: AttributeError: 'Settings' object has no attribute 'SATIC_ROOT'

2017-09-21 Thread Lachlan Musicman
The problem's right there in the error. there is no satic_root. In urls.py *urlpatterns += static(settings.STATIC_URL, document_root=settings.SATIC_ROOT)* Should read *urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)* Cheers L. -- You received this

Re: coming back to register user page after not filling a text field is causing the already filled text fields come with an annexed "/" at the end of the values

2017-09-21 Thread James Schneider
On Thu, Sep 21, 2017 at 11:07 AM, fábio andrews rocha marques < fabioandrewsrochamarq...@gmail.com> wrote: > Solved it: If i remove the "/" from all my tags, it's solved. > Before: > nomeusuariocadastro }}/> > After: > nomeusuariocadastro }}> > You should be encapsulating the value of

AttributeError: 'Settings' object has no attribute 'SATIC_ROOT'

2017-09-21 Thread Ian Likono
Iam following up a tuitorial on Django https://www.youtube.com/watch?v=9Wbfk16jEOk=192s. I have followed everything up as he has instructed but after running server i get the error: (tryTen) root@likono:~/Desktop/tryTen/tryten# python manage.py runserver Performing system checks... Unhandled

Re: utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-21 Thread Antonis Christofides
Hi, in addition to what James said, it is unusual to write f.read().decode('utf-8'). Usually the result of f.read() is already decoded (unless you opened the file as a binary file, but you would normally not do that for a file containing text). It depends on how you opened the file, and the

Re: HOMEPAGE

2017-09-21 Thread m712
Django is not Wordpress, you don't use "plugins" to create a website for you. You have to program your own homepage for yourself, or just install Wordpress/any prefabricated template website and be done with it. On September 21, 2017 1:17:36 PM GMT+03:00, TECH ROYAL

HOMEPAGE

2017-09-21 Thread TECH ROYAL
which extension may i use a creating homepage im using django -- 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

Re: HOMEPAGE

2017-09-21 Thread Andréas Kühne
You can use django cms (https://www.django-cms.org/) to create functionality like wordpress. But it's a bit overkill if all you want is a wordpress site - use wordpress. Regards, Andréas 2017-09-21 14:29 GMT+02:00 m712 : > Django is not Wordpress, you don't use

Creating my own user registration View and displaying "user created" on the same page after register

2017-09-21 Thread fábio andrews rocha marques
I'm trying to create my own View to register a new User in my website. I'm using this tutorial to help me with authentication: https://docs.djangoproject.com/en/1.11/topics/auth/default/# But my problem is: in the same View that i have my form that i use to create a new User, i want to, when

Mixing Q objects and lookups with When conditionals

2017-09-21 Thread Jason
I have a model in which I was trying to get a count for records that matched three variable values and found an interesting edge case not in the documents for conditional expressions . Specifically, if you have

Re: Mixing Q objects and lookups with When conditionals

2017-09-21 Thread Simon Charette
Hello Jason, I don't think this is explicitly documented but I feel like the TypeError raised explicitly states that this isn't supported: __init__() takes either a Q object or lookups as keyword arguments > Did you end up in this situation by following along the documentation or trial and

Re: Mark as deleted instead of actually deleting in DeleteView

2017-09-21 Thread James Schneider
On Sep 21, 2017 2:39 AM, "Rakhee Menon" wrote: Hello Everyone , Can anyone tell me how to write views where, when clicked on delete button the data shouldn't get deleted only the flag should turn 0 Just use a standard update view that toggles the field that you are

Re: Mixing Q objects and lookups with When conditionals

2017-09-21 Thread Jason
Hi Simon, That's how I feel about it too, but couldn't find anything specifically related to it, thus prompting my question. I basically fell into this because django lookups can't handle exclusion (NOT). I suspect there's an alternative to use exclude before the aggregation, like

Re: [Django Channels] Can I use the same redis server as message backend and cache backend the same time?

2017-09-21 Thread CrazyNPC
Thank you! And your channels! Excellent project! On Saturday, August 5, 2017 at 8:07:41 PM UTC+8, Andrew Godwin wrote: > > 1. You can - Channels namespaces itself away from most keys you might use > (and you add a custom prefix with the "prefix" option). > > 2. Yes, as long as both sites have a

Re: django newb, python newb. HELP! URL link worked for days, now has stopped working. Have I found a bug?

2017-09-21 Thread Melvyn Sopacua
Did you really write "focus_pk= 0"? So a space there? On Tue, Sep 19, 2017 at 2:15 AM, Manches spainspots wrote: > >

Re: cors headers in django

2017-09-21 Thread Andréas Kühne
Hi, Did you add the plugin itself as well? Because it's not the only settings that are required, if you look at the code it also has middleware and other things. Regards, Andréas 2017-09-21 6:55 GMT+02:00 Rakhee Menon : > Hey!!Thanks...But I tried adding those in

Re: utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-21 Thread Melvyn Sopacua
0x93 is windows-1252 for opening fancy quote . I think the quoting for your csv is incorrect. http://www.i18nqa.com/debug/utf8-debug.html On Fri, Sep 22, 2017 at 5:42 AM, James Bennett wrote: > The issue you're running into is that the sequence of bytes you passed in is >

Re: utf-8' codec can't decode byte 0x93 in position 31 even though i use read().decode('utf-8') when i read a UploadedFile i get from a file selector in a View in django

2017-09-21 Thread James Bennett
The issue you're running into is that the sequence of bytes you passed in is not UTF-8, but you're trying to decode it as UTF-8. The character 'ô' -- that's U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX -- is 0xC3 0xB4 in UTF-8. And the byte 0x93 can never be valid as the beginning of a

Re: ABOUT DJANGO

2017-09-21 Thread Andréas Kühne
Hi, I'm sorry - your questions are a bit too broad to cover here. If you have specific question about the django framework or a problem with how you are supposed to use django, feel free to ask those questions here. If you don't have any experience in django, I recommend looking at the following

Re: coming back to register user page after not filling a text field is causing the already filled text fields come with an annexed "/" at the end of the values

2017-09-21 Thread fábio andrews rocha marques
Solved it: If i remove the "/" from all my tags, it's solved. Before: After: On Thursday, September 21, 2017 at 2:46:36 PM UTC-3, fábio andrews rocha marques wrote: > > My register User View is like this: > > def cadastrarprofessor(request): > # if this is a POST request we need to process

Re: Autocomplete

2017-09-21 Thread Mitul Tyagi
It is done. Need to use def create(item) function to do so. Thanks for the reply. On Thursday, September 21, 2017 at 1:33:57 PM UTC+5:30, Melvyn Sopacua wrote: > > What is City1Autocomplete? Show that code, specifically what it inherits > from. > > On Tue, Sep 19, 2017 at 7:58 PM, Mitul Tyagi

Re: django

2017-09-21 Thread Alceu Rodrigues de Freitas Junior
http://www.catb.org/esr/faqs/smart-questions.html Em 21/09/2017 14:13, TECH ROYAL escreveu: how to create a  social interactivity website  with using django?? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

django

2017-09-21 Thread TECH ROYAL
how to create a social interactivity website with using django?? -- 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

Re: Creating my own register User page, when i want to go back to same page but with text fields filled with previous values, i'm getting slashes(/)

2017-09-21 Thread Alceu Rodrigues de Freitas Junior
http://catb.org/~esr/faqs/smart-questions.html Em 21/09/2017 14:38, fábio andrews rocha marques escreveu: My register page View is like this: | | | Entercode here... | | | -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

ABOUT DJANGO

2017-09-21 Thread TECH ROYAL
how to make website faster in python -- 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

Creating my own register User page, when i want to go back to same page but with text fields filled with previous values, i'm getting slashes(/)

2017-09-21 Thread fábio andrews rocha marques
My register page View is like this: Enter code here... -- 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

coming back to register user page after not filling a text field is causing the already filled text fields come with an annexed "/" at the end of the values

2017-09-21 Thread fábio andrews rocha marques
My register User View is like this: def cadastrarprofessor(request): # if this is a POST request we need to process the form data if request.method == 'POST': nomeusuario = request.POST['usuario'] nomesenha = request.POST['senha'] nomeemail = request.POST['email'] if not nomeusuario: return

Mark as deleted instead of actually deleting in DeleteView

2017-09-21 Thread Rakhee Menon
Hello Everyone , Can anyone tell me how to write views where, when clicked on delete button the data shouldn't get deleted only the flag should turn 0 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Mark as deleted instead of actually deleting in DeleteView

2017-09-21 Thread Fabio C. Barrionuevo da Luz
try use : SoftDeletableModel and SoftDeletableManager of django-model-utils https://django-model-utils.readthedocs.io/en/latest/models.html#softdeletablemodel https://django-model-utils.readthedocs.io/en/latest/managers.html#softdeletablemanager

Re: submit form as superuser vs regular user

2017-09-21 Thread Melvyn Sopacua
It doesn't reach form_valid because the form is not valid. It reaches `form_invalid`. You can inspect things there for debugging. But the error is probably with your authentication backed, since request.user is not filled in. The obvious being that your superuser exists in `auth_user` and other

Re: Autocomplete

2017-09-21 Thread Melvyn Sopacua
What is City1Autocomplete? Show that code, specifically what it inherits from. On Tue, Sep 19, 2017 at 7:58 PM, Mitul Tyagi wrote: > Any help for this...Need to create new fields in case no match works for > autocomplete > > > On Tuesday, September 19, 2017 at 1:37:29

Re: django select related select field in template form

2017-09-21 Thread Melvyn Sopacua
http://django-autocomplete-light.readthedocs.io/en/master/tutorial.html#filtering-results-based-on-the-value-of-other-fields-in-the-form On Tue, Sep 19, 2017 at 7:53 PM, Anuj Sharma wrote: > I'm working in Django 1.11 > > I have three apps, country, state and address >

Re: cors headers in django

2017-09-21 Thread Rakhee Menon
Hey, > Yes i have installed cors headers and added it in installed apps and in >> middleware > > > -- 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: collectstatic fails

2017-09-21 Thread Melvyn Sopacua
File "/var/www/ssds/common/utils.py", line 18, in from django.test import TestCase You probably shouldn't do that, regardless of the errors. VersionInfo objects do have semantic_version method in current pbr. So make sure you've not accidentally upgraded a virtualenv and are now executing with

Re: cors headers in django

2017-09-21 Thread Melvyn Sopacua
The only thing I can see that might be the error is 'http://127.0.0.1:4200' in CORS_ORIGIN_WHITELIST. It's requested with 'http://localhost:4200' as can be seen in the error message. If that's simple string matching, OPTIONS request will fail. On Thu, Sep 21, 2017 at 10:51 AM, Rakhee Menon