Re: Possible bug Django 2.0 CreateView generic CBV

2017-12-29 Thread Etienne Robillard

Hi Steven,

Could you put a "import pdb; pdb.set_trace()" somewhere in your code?

This way it would be pretty easy to inspect where the code is breaking.

Besides, why upgrading to Class-based-views if your previous Django 1.11 
implementation was working fine?


HTH

Etienne




Le 2017-12-28 à 20:44, Steven Meyer a écrit :
I hope I've got the right group this time. I originally posted it on 
Django core membership but Tim Graham emailed me to say it was the 
wrong group.


I am very new to Django - been at it for five weeks. Not sure whether 
this is a bug or my own stupidity.


Here is my model in an app called gcbv (for generic class-based view)

from django.db import models
from core.models import TimeStampModel
from django.urls import reverse
# Create your models here.

class Vehicle(TimeStampModel):
maker = models.CharField(max_length=100)
model_year = models.IntegerField()
vehicle_type = models.CharField(max_length=100)
slug = models.SlugField(max_length=100, unique=True)
vehicle_model = models.CharField(max_length=100)
website = models.URLField(max_length=100, blank=True)
email = models.EmailField(max_length=100, blank=True)
notes = models.TextField(blank=True, default='')
def __str__(self):
x = self.maker + ' ' + self.vehicle_model
return x

And here are the URLs

from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
from . import views
from django.urls import reverse
#from django.views.generic.base import TemplateView

app_name = 'gcbv'

urlpatterns = [
    path('sub1/', views.SubView.as_view(), name='sub1'),
    path('vehicle_list/', views.VehicleListView.as_view(),
        name = 'vehicle_list'),
    path('vehicle//',
        views.VehicleDetailView.as_view(),
        name='vehicle_detail'),
    path('vehicle/create', views.VehicleCreateView.as_view(),
        name='vehicle_create'),
    path('', views.IndexTemplateView.as_view(), name='index'),
]

And here is the relevant view

class VehicleCreateView(CreateView):
model = Vehicle
fields = ['maker', 'model_year', 'vehicle_type', 'slug',
'vehicle_model', 'website', 'email', 'notes']
labels = {'maker':'Maker', 'model_year':'Year',
'vehicle_type':'Type', 'vehicle_model':'Model',
'website':'Website', 'email':'Email', 'notes':'Notes'}


Here is the template:

{% extends "core/base.html" %}
{% block body_block %}
Vehicle Create for GCBV



  {% csrf_token %}
  {{ form.as_p }}
  Submit


End Vehicle Create for GCBV
{% endblock %}

I've attached screenshots of:

--The rendered form template

--What happens after I click submit

It looks as if the data is not being saved to the database.

If I add the same data from admin everything works fine. I've attached 
another screenshot showing that VehicleDetailView has found the 
relevant template and rendered the information.


Any help would be greatly appreciated.

NB: This all worked fine when I was using function views and regex 
instead of path.




--
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/5aa037bb-25d5-442d-b1a6-b1bbc558dead%40googlegroups.com 
.

For more options, visit https://groups.google.com/d/optout.


--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
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/94338840-e876-ffbc-d3cd-2fd3a127f15d%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


Re: DRF JWT Token with Mobile

2017-12-29 Thread Avraham Serour
instead of:
curl -X POST -d "mobile=1234567890" http://localhost:8000/api-token-auth/

could you just use:
curl -X POST -d "username=1234567890" http://localhost:8000/api-token-auth/

In any case what's the use case here? This doesn't seem secure at all, to
log in someone only using the username, even more using a public know
information

On Fri, Dec 29, 2017 at 8:21 AM, Andréas Kühne 
wrote:

> Hi,
>
> You will have to implement your own authentication backend to make that
> work.
>
> See here for an example:
> https://chrisbartos.com/articles/how-to-implement-
> custom-authentication-with-django-rest-framework/
>
> Regards,
>
> Andréas
>
> 2017-12-29 5:25 GMT+01:00 Mukul Mantosh :
>
>> Django Rest Framework JWT (http://getblimp.github.io/dja
>> ngo-rest-framework-jwt/) as specified that JWT token can be obtained by
>> passing username and password.
>>
>> Example:
>> $ curl -X POST -d "username=admin&password=password123" http://localhost:
>> 8000/api-token-auth/
>>
>> How to obtain the JWT Token using only mobile number.
>> $ curl -X POST -d "mobile=1234567890" http://localhost:8000/api-toke
>> n-auth/
>>
>> Normally JWT works with the combination of username and password but i
>> want the token using the mobile number only.
>>
>>
>> On Thursday, December 28, 2017 at 6:22:07 PM UTC+5:30, Krishnasagar
>> Subhedarpage wrote:
>>>
>>> Can you elaborate question? Please add some background for it.
>>> ---
>>> Krishnasagar
>>>
>>>
>>>
>>> On Thu, Dec 28, 2017 at 1:40 PM, Mukul Mantosh 
>>> wrote:
>>>
 How to get JWT Token in DRF using only mobile number as the parameter
 instead of email and password..

 --
 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...@googlegroups.com.
 To post to this group, send email to django...@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/ms
 gid/django-users/1b3ae8bb-2039-4aa9-8a9f-2c4ddb2ffc55%40goog
 legroups.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/ms
>> gid/django-users/b0d5e227-7488-4c86-b757-681c287a1558%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/CAK4qSCc1g6LP0dC%3DSAUzOD17A5dEkTYtTHM96EP6rgNS
> 3XerUA%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/CAFWa6t%2BLqAiRZ83osVUHqVQdcZ0-aqF8%2B94X8j3omep7Mwpy0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


404 for some matching urls too (Version 2)

2017-12-29 Thread Sundararajan Seshadri
I do not know the mistake I am likely to be committing. In Django Version 
2, I have a feeling that URL matching fails whenever there are query 
variables. 

When I try to log into Admin module, the login screen comes. But when a 
'next' query variable is attached, I get a 404. Similarly when I try to 
jump to a page in the records listing, I get 404. (Color has been added for 
highlighting)

http://localhost:8000/admin/login/?next=/admin/

Using the URLconf defined in sundar.urls, Django tried these URL patterns, 
in this order:

admin/ [name='index']
admin/ login/ [name='login']
admin/ logout/ [name='logout']
admin/ password_change/ [name='password_change']
admin/ password_change/done/ [name='password_change_done']
admin/ jsi18n/ [name='jsi18n']
admin/ r/// [name='view_on_site']
.. (corresponds to the tables defined)
admin/ ^(?Prsi|auth)/$ [name='app_list']
login/ [name='login']
logout/ [name='logout']
authissue [name='authissue']
.

The current path, admin/login/?next=/admin/, didn't match any of these.

Any help is appreciated.



-- 
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/89e14511-03d3-43e8-9603-0aaccdf7ca91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Possible bug: OutputWrapper: TypeError: write() argument must be str, not bytes

2017-12-29 Thread emi
Hello all!
I'm new to the list and mostly new to Django.

I am adding django-encrypted-model-fields to my Django project and one of 
the steps to install it is to generate a key using a ./manage.py command:
$ ./manage.py generate_encryption_key

When executing it, an error is raised:
Traceback (most recent call last):
  File "./manage.py", line 22, in 
execute_from_command_line(sys.argv)
  File 
"/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 371, in execute_from_command_line
utility.execute()
  File 
"/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", 
line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/usr/local/lib/python3.6/site-packages/django/core/management/base.py", 
line 288, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/usr/local/lib/python3.6/site-packages/django/core/management/base.py", 
line 335, in execute
output = self.handle(*args, **options)
  File 
"/usr/local/lib/python3.6/site-packages/encrypted_model_fields/management/commands/generate_encryption_key.py",
 
line 15, in handle
self.stdout.write(key, ending=b'\n')
  File 
"/usr/local/lib/python3.6/site-packages/django/core/management/base.py", 
line 106, in write
self._out.write(style_func(msg))
TypeError: write() argument must be str, not bytes


I have found a workaround for this, decoding output before writing to 
stdout, on django/core/management/base.py, line 106:

$ diff django/core/management/base.py-original 
django/core/management/base.py
106c106
< self._out.write(style_func(msg))
---
> self._out.write(style_func(msg).decode(self._out.encoding))

Do I have to do a pull request to Django or try to debug 
django-encrypted-model-fields and talk to their developers?

Thanks in advance!
em and best regardsi

-- 
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/b7372388-ea45-4ec7-b62e-84d0540a365a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[SOS] Django-Oscar Front end(theme) replacement

2017-12-29 Thread Fred Grey
Hi,

Does anybody use django-oscar to build a commerce website? I have done most 
of the things to make it online. But the default theme is ugly and not 
matched with the commodity's style.

We are a startup company and no UXD for the website design right now. Is 
there any other websites I can reference, and do a code based modification 
to get a better user experience?

Any feedback and suggestion is welcome, Thanks in advance! :)

The default theme is like below:

[image: 内嵌图片 1]

Best Regards,
-Gary

-- 
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/0100ca86-a562-4b57-a4c0-96bac855123c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug: OutputWrapper: TypeError: write() argument must be str, not bytes

2017-12-29 Thread pradam
hi,

i think your trying to write bytes instead of str. please have look at
below example it might help you:
name = b'i_m byte bro'
print(name.decode('utf-8'))  // just decode the byte to str
o/p: i_m byte bro


On Fri, Dec 29, 2017 at 2:29 PM, emi  wrote:

> Hello all!
> I'm new to the list and mostly new to Django.
>
> I am adding django-encrypted-model-fields to my Django project and one of
> the steps to install it is to generate a key using a ./manage.py command:
> $ ./manage.py generate_encryption_key
>
> When executing it, an error is raised:
> Traceback (most recent call last):
>   File "./manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 371, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 365, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 288, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 335, in execute
> output = self.handle(*args, **options)
>   File "/usr/local/lib/python3.6/site-packages/encrypted_model_
> fields/management/commands/generate_encryption_key.py", line 15, in handle
> self.stdout.write(key, ending=b'\n')
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 106, in write
> self._out.write(style_func(msg))
> TypeError: write() argument must be str, not bytes
>
>
> I have found a workaround for this, decoding output before writing to
> stdout, on django/core/management/base.py, line 106:
>
> $ diff django/core/management/base.py-original
> django/core/management/base.py
> 106c106
> < self._out.write(style_func(msg))
> ---
> > self._out.write(style_func(msg).decode(self._out.encoding))
>
> Do I have to do a pull request to Django or try to debug
> django-encrypted-model-fields and talk to their developers?
>
> Thanks in advance!
> em and best regardsi
>
> --
> 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/b7372388-ea45-4ec7-b62e-84d0540a365a%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/CAGGVXBMrEkrOumsqm7b8tz0aQRJsH7rKi-qm%3DjBY8TO6m46iYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [SOS] Django-Oscar Front end(theme) replacement

2017-12-29 Thread Matemática A3K
On Fri, Dec 29, 2017 at 5:14 AM, Fred Grey  wrote:

> Hi,
>

Hi!

>
> Does anybody use django-oscar to build a commerce website? I have done
> most of the things to make it online. But the default theme is ugly and not
> matched with the commodity's style.
>
> We are a startup company and no UXD for the website design right now. Is
> there any other websites I can reference, and do a code based modification
> to get a better user experience?
>
>
No, I don't use it, but it's a Django project, template override /
modifications apply just as a regular Django app:
https://docs.djangoproject.com/en/2.0/howto/overriding-templates/


> Any feedback and suggestion is welcome, Thanks in advance! :)
>
>
https://github.com/django-oscar/django-oscar/tree/master/src/oscar/templates/oscar



> The default theme is like below:
>
> [image: 内嵌图片 1]
>
> Best Regards,
> -Gary
>
> --
> 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/0100ca86-a562-4b57-a4c0-96bac855123c%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%2BFDnhL6iKVzve5sq79EV76cpqTG9eJaGLyahTPW66k3JyLN5Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug: OutputWrapper: TypeError: write() argument must be str, not bytes

2017-12-29 Thread Matemática A3K
On Fri, Dec 29, 2017 at 5:59 AM, emi  wrote:

> Hello all!
> I'm new to the list and mostly new to Django.
>
> I am adding django-encrypted-model-fields to my Django project and one of
> the steps to install it is to generate a key using a ./manage.py command:
> $ ./manage.py generate_encryption_key
>
> When executing it, an error is raised:
> Traceback (most recent call last):
>   File "./manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 371, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 365, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 288, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 335, in execute
> output = self.handle(*args, **options)
>   File "/usr/local/lib/python3.6/site-packages/encrypted_model_
> fields/management/commands/generate_encryption_key.py", line 15, in handle
> self.stdout.write(key, ending=b'\n')
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 106, in write
> self._out.write(style_func(msg))
> TypeError: write() argument must be str, not bytes
>
>
> I have found a workaround for this, decoding output before writing to
> stdout, on django/core/management/base.py, line 106:
>
> $ diff django/core/management/base.py-original
> django/core/management/base.py
> 106c106
> < self._out.write(style_func(msg))
> ---
> > self._out.write(style_func(msg).decode(self._out.encoding))
>
> Do I have to do a pull request to Django or try to debug
> django-encrypted-model-fields and talk to their developers?
>

I don't think you should patch the core management for only a third-party
app, instead you should modify the third-party to match what django expects
(i.e. convert to string at generate_encryption_key.py). I think you may
contact their developers for including it on the package


>
> Thanks in advance!
> em and best regardsi
>
> --
> 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/b7372388-ea45-4ec7-b62e-84d0540a365a%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%2BFDnhLbke9V9e6kZqSeZv7VO4ZVJKNqwfkgj6Ojf6Yhx1DnGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 for some matching urls too (Version 2)

2017-12-29 Thread Matemática A3K
Please post your urls.py, this looks strange:

admin/ [name='index']
> admin/ login/ [name='login']
> admin/ logout/ [name='logout']
> admin/ r/// [name='view_on_site']
> admin/ ^(?Prsi|auth)/$ [name='app_list']
> login/ [name='login']
> logout/ [name='logout']
> authissue [name='authissue']
>

-- 
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%2BFDnhLJs8SWgvHiE2fg4jbyV%3DVWuLAGBALEZWi4X5V3DQNRDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Possible bug: OutputWrapper: TypeError: write() argument must be str, not bytes

2017-12-29 Thread Jani Tiainen
Hi,

As pointed out problem is not Django but that third party package that
tries to output data as bytes but Django expects to have string instead.

First make sure that 3rd party app works with Django version you're using.
If not you need to contact that 3rd party app developers to fix the actual
issue there.

29.12.2017 14.42 "emi"  kirjoitti:

> Hello all!
> I'm new to the list and mostly new to Django.
>
> I am adding django-encrypted-model-fields to my Django project and one of
> the steps to install it is to generate a key using a ./manage.py command:
> $ ./manage.py generate_encryption_key
>
> When executing it, an error is raised:
> Traceback (most recent call last):
>   File "./manage.py", line 22, in 
> execute_from_command_line(sys.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 371, in execute_from_command_line
> utility.execute()
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py",
> line 365, in execute
> self.fetch_command(subcommand).run_from_argv(self.argv)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 288, in run_from_argv
> self.execute(*args, **cmd_options)
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 335, in execute
> output = self.handle(*args, **options)
>   File "/usr/local/lib/python3.6/site-packages/encrypted_model_
> fields/management/commands/generate_encryption_key.py", line 15, in handle
> self.stdout.write(key, ending=b'\n')
>   File 
> "/usr/local/lib/python3.6/site-packages/django/core/management/base.py",
> line 106, in write
> self._out.write(style_func(msg))
> TypeError: write() argument must be str, not bytes
>
>
> I have found a workaround for this, decoding output before writing to
> stdout, on django/core/management/base.py, line 106:
>
> $ diff django/core/management/base.py-original
> django/core/management/base.py
> 106c106
> < self._out.write(style_func(msg))
> ---
> > self._out.write(style_func(msg).decode(self._out.encoding))
>
> Do I have to do a pull request to Django or try to debug
> django-encrypted-model-fields and talk to their developers?
>
> Thanks in advance!
> em and best regardsi
>
> --
> 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/b7372388-ea45-4ec7-b62e-84d0540a365a%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/CAHn91oeXEyS4f7sf25AXu_R_G2Vm%3DvYqUmKt8O6fg8j2eZCqPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Migrate doen't recognize my apps to migrate

2017-12-29 Thread Fellipe Henrique
Hi all,

I have these apps, on my django site:

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',

# erp apps:
'erp.apps.base',
'erp.apps.login',
'erp.apps.cadastro',
'erp.apps.vendas',
'erp.apps.compras',
'erp.apps.fiscal',
'erp.apps.financeiro',
'erp.apps.estoque',
]


I try to run: $ python manage.py migrate  and get these:

Operations to perform:
  Apply all migrations: admin, auth, contenttypes, sessions
Running migrations:
  No migrations to apply.


I have several migration files on each app, but migrate doesn't recognize
them...

I`m using Django 1.10.1

How can I fix that?

regards


T.·.F.·.A.·. S+F
*Fellipe Henrique P. Soares*

e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge'
*Fedora Ambassador: https://fedoraproject.org/wiki/User:Fellipeh
*
*Blog: *http:www.fellipeh.eti.br
*GitHub: https://github.com/fellipeh *
*Twitter: @fh_bash*

-- 
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/CAF1jwZEcR1VoXT9eXHppithuE7_Swb9xQ4TMPEomy-fOyLx1qg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Migrate doen't recognize my apps to migrate

2017-12-29 Thread Jason
If you haven't made the migrations, then you don't have any to actually 
apply.

You can use 
https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-showmigrations
 to 
show the migrations that have been created and those that have been applied

-- 
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/6d2620b0-a7d0-4992-94eb-6b6ff88fb0d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: 404 for some matching urls too (Version 2)

2017-12-29 Thread James Schneider
admin/ [name='index']
admin/ login/ [name='login']
admin/ logout/ [name='logout']
admin/ password_change/ [name='password_change']
admin/ password_change/done/ [name='password_change_done']
admin/ jsi18n/ [name='jsi18n']
admin/ r/// [name='view_on_site']
.. (corresponds to the tables defined)
admin/ ^(?Prsi|auth)/$ [name='app_list']
login/ [name='login']
logout/ [name='logout']
authissue [name='authissue']
.

The current path, admin/login/?next=/admin/, didn't match any of these.


It looks like you have two different URL's named 'login'. Try changing one
of them so that they are unique.

-James

-- 
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%2Be%2BciXnKD3g5QG1mfpKVJ3jtr%2BrPU2iDPTkV-HU3m6oEZoD9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Still having trouble with django-filebrowser

2017-12-29 Thread Mike Dewhirst

On 18/12/2017 8:23 PM, Etienne Robillard wrote:
Looks likes this is using javascript. What does the javascript 
console says? Is the markup of the page valid HTML?




The javascript is slightly different between dev on localhost and 
staging and I'm totally outta my depth :(


In the  section of the staging site which DOES show the upload 
widget there is a line which isn't in the localhost dev site ...




... which bothers me. It doesn't seem to be a js script???

Another difference is directly beneath the TinyMCE HTMLField textarea. 
See NOT IN LOCALHOST SCRIPT below.


(
function($){
    function tinymce4_init(selector){
    var tinymce4_config={
    'file_browser_callback':djangoFileBrowser, < NOT IN LOCALHOST SCRIPT
setup:function(editor){editor.on('change',function(){editor.save();});},
    "language":"en",
    "contextmenu":"formats | link image",
    "statusbar":true,
    "toolbar1":"formatselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | link image | codesample | preview code",
    "directionality":"ltr",
    "height":360,
    "width":"auto",
    "theme":"modern",
    "plugins":"link image preview codesample contextmenu table code lists",
    "inline":false,
    "selector":"textarea#id_instruction",
    "menubar":false
    };
    if(typeof selector!='undefined'){
    tinymce4_config['selector']=selector;
    }
    tinymce.init(tinymce4_config);
    }tinymce4_init();
})();


I have found file_browser_callback in a number of files but really don't 
understand javascript well enough to make sense of it. Re-venving and 
reinstalling everything


bleach==2.1.2
certifi==2017.11.5
chardet==3.0.4
Django==1.11.8
django-filebrowser-no-grappelli==3.7.3
django-tinymce4-lite==1.7.0
html5lib==1.0.1
idna==2.6
jsmin==2.2.2
olefile==0.44
Pillow==4.3.0
psycopg2==2.7.3
pytz==2017.3
requests==2.18.4
six==1.11.0
urllib3==1.22
webencodings==0.5.1

... doesn't make any difference.

On reflection I'm giving up. It is working on the Ubuntu side and while 
I don't understand why I don't have any more time to put into it.


Thank you all very much for your input. It makes this community - and 
Django - special.


Cheers

Mike


--
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/79151495-a3ac-5604-bd75-176909fd8d97%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Still having trouble with django-filebrowser

2017-12-29 Thread Etienne Robillard

Hey Mike,

Please take a look at this: 
https://stackoverflow.com/questions/3231432/admin-field-fails-to-save-with-tinymce-and-filebrowser-in-django


Best regards,

Etienne


Le 2017-12-29 à 17:30, Mike Dewhirst a écrit :

On 18/12/2017 8:23 PM, Etienne Robillard wrote:
Looks likes this is using javascript. What does the javascript 
console says? Is the markup of the page valid HTML?




The javascript is slightly different between dev on localhost and 
staging and I'm totally outta my depth :(


In the  section of the staging site which DOES show the upload 
widget there is a line which isn't in the localhost dev site ...




... which bothers me. It doesn't seem to be a js script???

Another difference is directly beneath the TinyMCE HTMLField textarea. 
See NOT IN LOCALHOST SCRIPT below.


(
function($){
    function tinymce4_init(selector){
    var tinymce4_config={
    'file_browser_callback':djangoFileBrowser, < NOT IN LOCALHOST SCRIPT
setup:function(editor){editor.on('change',function(){editor.save();});},
    "language":"en",
    "contextmenu":"formats | link image",
    "statusbar":true,
    "toolbar1":"formatselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | link image | codesample | preview code",
    "directionality":"ltr",
    "height":360,
    "width":"auto",
    "theme":"modern",
    "plugins":"link image preview codesample contextmenu table code lists",
    "inline":false,
    "selector":"textarea#id_instruction",
    "menubar":false
    };
    if(typeof selector!='undefined'){
    tinymce4_config['selector']=selector;
    }
    tinymce.init(tinymce4_config);
    }tinymce4_init();
})();


I have found file_browser_callback in a number of files but really 
don't understand javascript well enough to make sense of it. 
Re-venving and reinstalling everything


bleach==2.1.2
certifi==2017.11.5
chardet==3.0.4
Django==1.11.8
django-filebrowser-no-grappelli==3.7.3
django-tinymce4-lite==1.7.0
html5lib==1.0.1
idna==2.6
jsmin==2.2.2
olefile==0.44
Pillow==4.3.0
psycopg2==2.7.3
pytz==2017.3
requests==2.18.4
six==1.11.0
urllib3==1.22
webencodings==0.5.1

... doesn't make any difference.

On reflection I'm giving up. It is working on the Ubuntu side and 
while I don't understand why I don't have any more time to put into it.


Thank you all very much for your input. It makes this community - and 
Django - special.


Cheers

Mike




--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

--
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/35d61861-45bb-6af5-e0f3-86998897f69f%40yandex.com.
For more options, visit https://groups.google.com/d/optout.


Re: Still having trouble with django-filebrowser

2017-12-29 Thread Mike Dewhirst

Etienne

TINYMCE_FILEBROWSER = True

Did the trick.

Vous etes fantastique!

:))

Mike


On 30/12/2017 10:11 AM, Etienne Robillard wrote:

Hey Mike,

Please take a look at this: 
https://stackoverflow.com/questions/3231432/admin-field-fails-to-save-with-tinymce-and-filebrowser-in-django


Best regards,

Etienne


Le 2017-12-29 à 17:30, Mike Dewhirst a écrit :

On 18/12/2017 8:23 PM, Etienne Robillard wrote:
Looks likes this is using javascript. What does the javascript 
console says? Is the markup of the page valid HTML?




The javascript is slightly different between dev on localhost and 
staging and I'm totally outta my depth :(


In the  section of the staging site which DOES show the upload 
widget there is a line which isn't in the localhost dev site ...




... which bothers me. It doesn't seem to be a js script???

Another difference is directly beneath the TinyMCE HTMLField 
textarea. See NOT IN LOCALHOST SCRIPT below.


(
function($){
    function tinymce4_init(selector){
    var tinymce4_config={
    'file_browser_callback':djangoFileBrowser, < NOT IN LOCALHOST SCRIPT
setup:function(editor){editor.on('change',function(){editor.save();});},
    "language":"en",
    "contextmenu":"formats | link image",
    "statusbar":true,
    "toolbar1":"formatselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent | table | link image | codesample | preview code",
    "directionality":"ltr",
    "height":360,
    "width":"auto",
    "theme":"modern",
    "plugins":"link image preview codesample contextmenu table code lists",
    "inline":false,
    "selector":"textarea#id_instruction",
    "menubar":false
    };
    if(typeof selector!='undefined'){
    tinymce4_config['selector']=selector;
    }
    tinymce.init(tinymce4_config);
    }tinymce4_init();
})();


I have found file_browser_callback in a number of files but really 
don't understand javascript well enough to make sense of it. 
Re-venving and reinstalling everything


bleach==2.1.2
certifi==2017.11.5
chardet==3.0.4
Django==1.11.8
django-filebrowser-no-grappelli==3.7.3
django-tinymce4-lite==1.7.0
html5lib==1.0.1
idna==2.6
jsmin==2.2.2
olefile==0.44
Pillow==4.3.0
psycopg2==2.7.3
pytz==2017.3
requests==2.18.4
six==1.11.0
urllib3==1.22
webencodings==0.5.1

... doesn't make any difference.

On reflection I'm giving up. It is working on the Ubuntu side and 
while I don't understand why I don't have any more time to put into it.


Thank you all very much for your input. It makes this community - and 
Django - special.


Cheers

Mike






--
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/fa5d6fde-9ce2-4a14-c0f8-a5d7f7ad686f%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.