channels v2.0.0 disconnect function not triggering

2018-02-05 Thread Ahmed Magdy
It seems like I cannot get the disconnect function in the consumer to get 
called at all.

class ChatConsumer(WebsocketConsumer):
   def connect(self):
   self.accept()

def disconnect(self):
   print('disconnected')

Using self.close from the consumer, or closing the javascript websocket 
doesn't trigger the print at all, though it does write in the log that the 
websocket disconnected.

[2018/02/06 09:50:32] WebSocket HANDSHAKING /sessions/ [127.0.0.1:7854]
[2018/02/06 09:50:32] WebSocket CONNECT /sessions/ [127.0.0.1:7854]
[2018/02/06 09:50:39] WebSocket DISCONNECT /sessions/ [127.0.0.1:7854]

Am I using it incorrectly?

-- 
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/520a3775-4a2b-4f9d-959f-bbe13491f6ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


chemistry character set

2018-02-05 Thread Mike Dewhirst
Chemical names start with both upper and lower case as well as Greek 
characters. Chemical names also exist in multiple non-western non-latin 
languages.


To get lists of chemicals sorting more or less "correctly" I currently 
slugify with allow_unicode=True.


This for example gets tert-Butyl... sorted nicely among names starting 
with upper-case T.


Unfortunately the α-terpineol or beta this or  ε that all sink to the 
end of the list instead of sorting into the A, B or Es.


My google-fu indicates I can sort on a property but that is slow. I have 
thought about tweaking slugify to include a table of equivalences 
between Greek and Western chars but that doesn't necessarily cater for 
non-Western character sets. Maybe an ever expanding table of equivalences?


Thanks for any ideas ...

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/4160ee4d-8b36-1118-1bec-2ba8ab40d891%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


I hope to increase OneToOne mode GenericForeignKey

2018-02-05 Thread Ma Mars
I hope to increase OneToOne mode GenericForeignKey,
For example, a passport (one user has only one passport, but there are many 
user roles, such as staff, drivers, customers, but they are one to one)

-- 
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/41d3d6c1-16ec-4f61-badb-4522c7caad4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: javascript transpilers

2018-02-05 Thread Mike Dewhirst

Much appreciated. I'll definitely take your advice.

Cheers

M

On 6/02/2018 2:26 AM, Matemática A3K wrote:



On Thu, Feb 1, 2018 at 8:27 PM, Mike Dewhirst > wrote:


On 2/02/2018 12:54 AM, Jason wrote:

https://caniuse.com/#feat=wasm


 IIRC wasm is not polyfillable or transpilable, so if you're
targeting users on any of those red cells, then wasm is not
for you.


Agreed. I think it is interesting anyway but I already decided it
is not within my event horizon.


I wasn't sure about writing this, but anyway...

Mike,

I know how you feel, I have been there (avoiding JS), this is how I 
solved it:

https://books.google.com.pe/books/about/JavaScript.html?id=PXa2bby0oQ0C=frontcover=kp_read_button_esc=y#v=onepage=false
and:
http://learn.knockoutjs.com/#/?tutorial=intro
(it will give you the concepts about ""modern"" UI development in JS 
(not "pure" jQuery) before jumping into the big js framework world, 
and it also may solve your UI needs)


About the python transpiler, you still need to write code for the JS 
libraries, so you need to understand roughly how they work and how the 
coding is done for the browser. The problem is not JS here (which can 
be grasped easily with Crockford's book), but the coding pattern you 
have apply and how things are done - and you get that only by coding 
on it. Once you know that, you can write it on Python or JS.


When reading JS articles, have in mind this:
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

HTH




-- 
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/19bbbae1-eac0-4fea-b6f2-a1c72cfdb471%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/1f24a791-1a13-ecd8-f97c-6d5118ef8d41%40dewhirst.com.au

.


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%2BFDnh%2BPxgV9drcsO8r38mvBBpU1eJra2sTcQ2BdstdRpEhErg%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 

Re: import eror views

2018-02-05 Thread sum abiut
shows us your url.py

On Tue, Feb 6, 2018 at 12:11 AM, sarvit sarvit 
wrote:

> hello
> please help for dibog
> Traceback (most recent call last):
>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in
> 
> from . import views
> ImportError: cannot import name 'views'
>
> --
> 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/a019be7f-1240-4f31-8655-b36c758a709a%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/CAPCf-y6h-yts1tfAv8ZC_f1z2pGggRVv9OTr4xC%2B3NuMi1SPRw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django-channels 2.0 websocket connection problem (error 500)

2018-02-05 Thread Andrew Godwin
Have you upgraded to the most recent version of Daphne? There was a bug
where tracebacks weren't printing sometimes that I fixed over the weekend.

Andrew

On Mon, Feb 5, 2018 at 9:21 AM, Alberto Buratti <
alberthohenstau...@gmail.com> wrote:

> Hello,
> I've just installed django-channels 2 and followed the installation
> instructions. I've got this error while trying to connect a websocket to my
> application:
>
> Browser console:
> websocketbridge.js:118 WebSocket connection to 'ws://127.0.0.1:8000/
> userlocation/' failed: Error during WebSocket handshake: Unexpected
> response code: 500
>
> Django runserver:
> [2018/02/05 18:12:56] WebSocket HANDSHAKING /userlocation/ [127.0.0.1:
> 36137]
> [2018/02/05 18:12:57] WebSocket DISCONNECT /userlocation/ [127.0.0.1:36137
> ]
>
> I cannot make the output more verbose (already running with -v 3).
>
>
> consumers.py
>
> from channels.generic.websocket import JsonWebsocketConsumer
>
>
> class UserLocationConsumer(JsonWebsocketConsumer):
> def receive_json(self, content, **kwargs):
> print(content)
>
>
> routing.py
>
> from django.urls import path
> from channels.routing import ProtocolTypeRouter, URLRouter
> from channels.auth import AuthMiddlewareStack
> from mobile.consumers import UserLocationConsumer
>
> application = ProtocolTypeRouter({
> "websocket": AuthMiddlewareStack(
> URLRouter([
> path('userlocation/', UserLocationConsumer),
> ]))
> ,
> })
>
>
>
> Running on ubuntu 16.04 with python 3.5.2, Django 2.0.2
> Am I missing something?
>
>
>
> --
> 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/46ab0475-da21-4e53-9da7-3e3e4036134a%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/CAFwN1urGC%2BPDwOJK%3DwhDWdOCRwcOuWs%3DXvggvsufvquJf3mGaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django-channels 2.0 websocket connection problem (error 500)

2018-02-05 Thread Alberto Buratti
Hello,
I've just installed django-channels 2 and followed the installation 
instructions. I've got this error while trying to connect a websocket to my 
application:

Browser console:
websocketbridge.js:118 WebSocket connection to 
'ws://127.0.0.1:8000/userlocation/' failed: Error during WebSocket handshake
: Unexpected response code: 500

Django runserver:
[2018/02/05 18:12:56] WebSocket HANDSHAKING /userlocation/ [127.0.0.1:36137]
[2018/02/05 18:12:57] WebSocket DISCONNECT /userlocation/ [127.0.0.1:36137]

I cannot make the output more verbose (already running with -v 3).


consumers.py

from channels.generic.websocket import JsonWebsocketConsumer


class UserLocationConsumer(JsonWebsocketConsumer):
def receive_json(self, content, **kwargs):
print(content)


routing.py

from django.urls import path
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from mobile.consumers import UserLocationConsumer

application = ProtocolTypeRouter({
"websocket": AuthMiddlewareStack(
URLRouter([
path('userlocation/', UserLocationConsumer),
]))
,
})



Running on ubuntu 16.04 with python 3.5.2, Django 2.0.2
Am I missing something? 



-- 
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/46ab0475-da21-4e53-9da7-3e3e4036134a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Andy Grabow
Thx i will test those versions myself.

-- 
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/etPan.5a788dd7.5ce0d2ef.135%40freilandkiwis.de.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Matemática A3K
(.env) rodrigo@enoch:~/code/django-secrets$ python --version
Python 3.5.2
(.env) rodrigo@enoch:~/code/django-secrets$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"
(.env) rodrigo@enoch:~/code/django-secrets$


On Mon, Feb 5, 2018 at 1:50 PM, Andy  wrote:

> which python version did you use and which operating system?
>
>
> Am Montag, 5. Februar 2018 16:49:26 UTC+1 schrieb Matemática A3K:
>
>> rodrigo@enoch:~/code$ git clone g...@github.com:kakulukia/djang
>> o-secrets.git
>> Clonar en «django-secrets»...
>> remote: Counting objects: 157, done.
>> remote: Compressing objects: 100% (58/58), done.
>> remote: Total 157 (delta 48), reused 66 (delta 30), pack-reused 67
>> Receiving objects: 100% (157/157), 34.45 KiB | 0 bytes/s, done.
>> Resolving deltas: 100% (74/74), done.
>> Comprobando la conectividad… hecho.
>> rodrigo@enoch:~/code$ cd django-
>> bash: cd: django-: No existe el archivo o el directorio
>> rodrigo@enoch:~/code$ cd django-secrets/
>> rodrigo@enoch:~/code/django-secrets$ ls
>> django_secrets  LICENSE  Makefile  manage.py  Pipfile  README.rst
>> setup.cfg  setup.py
>> rodrigo@enoch:~/code/django-secrets$ python3 -m venv .env
>> rodrigo@enoch:~/code/django-secrets$ source .env/bin/activate
>> (.env) rodrigo@enoch:~/code/django-secrets$ pip install --upgrade pip
>> Collecting pip
>>   Using cached pip-9.0.1-py2.py3-none-any.whl
>> Installing collected packages: pip
>>   Found existing installation: pip 8.1.1
>> Uninstalling pip-8.1.1:
>>   Successfully uninstalled pip-8.1.1
>> Successfully installed pip-9.0.1
>> (.env) rodrigo@enoch:~/code/django-secrets$ cd django_secrets/
>> (.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ ls
>> __init__.py  management  settings.py  startup.py  tests.py  urls.py
>> utils.py  wsgi.py
>> (.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ cd ..
>> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
>> Traceback (most recent call last):
>>   File "manage.py", line 7, in 
>> from django_secrets.startup import check
>>   File "/home/rodrigo/code/django-secrets/django_secrets/startup.py",
>> line 4, in 
>> from six.moves import input
>> ImportError: No module named 'six'
>> (.env) rodrigo@enoch:~/code/django-secrets$ pip install six
>> Collecting six
>>   Using cached six-1.11.0-py2.py3-none-any.whl
>> Installing collected packages: six
>> Successfully installed six-1.11.0
>> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
>>
>> Secret definitions initialized under secrets/definitions.py
>> Add your secrets there and fill the values on the next use of a manage.py
>> command.
>>
>>
>>
>> Secret missing, please fill in the blanks ..
>>
>> SECRET_KEY: secret
>> Traceback (most recent call last):
>>   File "manage.py", line 12, in 
>> from django.core.management import execute_from_command_line
>> ImportError: No module named 'django'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 18, in 
>> import django  # noqa
>> ImportError: No module named 'django'
>>
>> During handling of the above exception, another exception occurred:
>>
>> Traceback (most recent call last):
>>   File "manage.py", line 21, in 
>> "Couldn't import Django. Are you sure it's installed and "
>> ImportError: Couldn't import Django. Are you sure it's installed and
>> available on your PYTHONPATH environment variable? Did you forget to
>> activate a virtual environment?
>> (.env) rodrigo@enoch:~/code/django-secrets$ pip install django
>> Collecting django
>>   Downloading Django-2.0.2-py3-none-any.whl (7.1MB)
>> 100% || 7.1MB 203kB/s
>> Collecting pytz (from django)
>>   Using cached pytz-2017.3-py2.py3-none-any.whl
>> Installing collected packages: pytz, django
>> Successfully installed django-2.0.2 pytz-2017.3
>> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
>> Creating test database for alias 'default'...
>> System check identified no issues (0 silenced).
>> .
>> Secret definitions initialized under secrets/definitions.py
>> Add your secrets there and fill the values on the next use of a manage.py
>> command.
>>
>>
>> got secret from environment variable (SECOND_SECRET)
>> E
>> Use these lines to initialize your secrets ..
>>
>> export SECRET_KEY="secret"
>> E
>> ==
>> ERROR: test_creating_secrets_folder (django_secrets.tests.SecretTest)
>> --
>> Traceback (most recent call last):
>>   File "/home/rodrigo/code/django-secrets/django_secrets/tests.py", line
>> 24, in test_creating_secrets_folder
>> check()
>>   File "/home/rodrigo/code/django-secrets/django_secrets/startup.py",
>> line 100, in check
>> reload_module(secrets)
>>   File 

Re: Travis Problem

2018-02-05 Thread Andy
which python version did you use and which operating system?


Am Montag, 5. Februar 2018 16:49:26 UTC+1 schrieb Matemática A3K:
>
> rodrigo@enoch:~/code$ git clone g...@github.com:kakulukia/django-secrets.git
> Clonar en «django-secrets»...
> remote: Counting objects: 157, done.
> remote: Compressing objects: 100% (58/58), done.
> remote: Total 157 (delta 48), reused 66 (delta 30), pack-reused 67
> Receiving objects: 100% (157/157), 34.45 KiB | 0 bytes/s, done.
> Resolving deltas: 100% (74/74), done.
> Comprobando la conectividad… hecho.
> rodrigo@enoch:~/code$ cd django-
> bash: cd: django-: No existe el archivo o el directorio
> rodrigo@enoch:~/code$ cd django-secrets/
> rodrigo@enoch:~/code/django-secrets$ ls
> django_secrets  LICENSE  Makefile  manage.py  Pipfile  README.rst  
> setup.cfg  setup.py
> rodrigo@enoch:~/code/django-secrets$ python3 -m venv .env
> rodrigo@enoch:~/code/django-secrets$ source .env/bin/activate
> (.env) rodrigo@enoch:~/code/django-secrets$ pip install --upgrade pip
> Collecting pip
>   Using cached pip-9.0.1-py2.py3-none-any.whl
> Installing collected packages: pip
>   Found existing installation: pip 8.1.1
> Uninstalling pip-8.1.1:
>   Successfully uninstalled pip-8.1.1
> Successfully installed pip-9.0.1
> (.env) rodrigo@enoch:~/code/django-secrets$ cd django_secrets/
> (.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ ls
> __init__.py  management  settings.py  startup.py  tests.py  urls.py  
> utils.py  wsgi.py
> (.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ cd ..
> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
> Traceback (most recent call last):
>   File "manage.py", line 7, in 
> from django_secrets.startup import check
>   File "/home/rodrigo/code/django-secrets/django_secrets/startup.py", line 
> 4, in 
> from six.moves import input
> ImportError: No module named 'six'
> (.env) rodrigo@enoch:~/code/django-secrets$ pip install six
> Collecting six
>   Using cached six-1.11.0-py2.py3-none-any.whl
> Installing collected packages: six
> Successfully installed six-1.11.0
> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
>
> Secret definitions initialized under secrets/definitions.py
> Add your secrets there and fill the values on the next use of a manage.py 
> command.
>
>
>
> Secret missing, please fill in the blanks ..
>
> SECRET_KEY: secret
> Traceback (most recent call last):
>   File "manage.py", line 12, in 
> from django.core.management import execute_from_command_line
> ImportError: No module named 'django'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 18, in 
> import django  # noqa
> ImportError: No module named 'django'
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "manage.py", line 21, in 
> "Couldn't import Django. Are you sure it's installed and "
> ImportError: Couldn't import Django. Are you sure it's installed and 
> available on your PYTHONPATH environment variable? Did you forget to 
> activate a virtual environment?
> (.env) rodrigo@enoch:~/code/django-secrets$ pip install django
> Collecting django
>   Downloading Django-2.0.2-py3-none-any.whl (7.1MB)
> 100% || 7.1MB 203kB/s 
> Collecting pytz (from django)
>   Using cached pytz-2017.3-py2.py3-none-any.whl
> Installing collected packages: pytz, django
> Successfully installed django-2.0.2 pytz-2017.3
> (.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
> Creating test database for alias 'default'...
> System check identified no issues (0 silenced).
> .
> Secret definitions initialized under secrets/definitions.py
> Add your secrets there and fill the values on the next use of a manage.py 
> command.
>
>
> got secret from environment variable (SECOND_SECRET)
> E
> Use these lines to initialize your secrets ..
>
> export SECRET_KEY="secret"
> E
> ==
> ERROR: test_creating_secrets_folder (django_secrets.tests.SecretTest)
> --
> Traceback (most recent call last):
>   File "/home/rodrigo/code/django-secrets/django_secrets/tests.py", line 
> 24, in test_creating_secrets_folder
> check()
>   File "/home/rodrigo/code/django-secrets/django_secrets/startup.py", line 
> 100, in check
> reload_module(secrets)
>   File "/usr/lib/python3.5/importlib/__init__.py", line 166, in reload
> _bootstrap._exec(spec, module)
>   File "", line 607, in _exec
> AttributeError: 'NoneType' object has no attribute 'name'
>
> ==
> ERROR: test_export (django_secrets.tests.SecretTest)
> --
> Traceback (most recent call last):
>   File 

Re: Django 2.0.2 not work with Jinja 2 (admin side)

2018-02-05 Thread Tim Graham
The admin doesn't support Jinja2. If you're using Jinja2, you must also 
have a DjangoTemplates backend defined in your TEMPLATES to use the admin.

On Saturday, February 3, 2018 at 7:26:33 PM UTC-5, Николай Инкогнито wrote:
>
> /admin/
> - raise error 
>

-- 
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/daa48898-187f-4ce4-b671-746adefbf557%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Matemática A3K
rodrigo@enoch:~/code$ git clone g...@github.com:kakulukia/django-secrets.git
Clonar en «django-secrets»...
remote: Counting objects: 157, done.
remote: Compressing objects: 100% (58/58), done.
remote: Total 157 (delta 48), reused 66 (delta 30), pack-reused 67
Receiving objects: 100% (157/157), 34.45 KiB | 0 bytes/s, done.
Resolving deltas: 100% (74/74), done.
Comprobando la conectividad… hecho.
rodrigo@enoch:~/code$ cd django-
bash: cd: django-: No existe el archivo o el directorio
rodrigo@enoch:~/code$ cd django-secrets/
rodrigo@enoch:~/code/django-secrets$ ls
django_secrets  LICENSE  Makefile  manage.py  Pipfile  README.rst
setup.cfg  setup.py
rodrigo@enoch:~/code/django-secrets$ python3 -m venv .env
rodrigo@enoch:~/code/django-secrets$ source .env/bin/activate
(.env) rodrigo@enoch:~/code/django-secrets$ pip install --upgrade pip
Collecting pip
  Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
  Successfully uninstalled pip-8.1.1
Successfully installed pip-9.0.1
(.env) rodrigo@enoch:~/code/django-secrets$ cd django_secrets/
(.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ ls
__init__.py  management  settings.py  startup.py  tests.py  urls.py
utils.py  wsgi.py
(.env) rodrigo@enoch:~/code/django-secrets/django_secrets$ cd ..
(.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
Traceback (most recent call last):
  File "manage.py", line 7, in 
from django_secrets.startup import check
  File "/home/rodrigo/code/django-secrets/django_secrets/startup.py", line
4, in 
from six.moves import input
ImportError: No module named 'six'
(.env) rodrigo@enoch:~/code/django-secrets$ pip install six
Collecting six
  Using cached six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six
Successfully installed six-1.11.0
(.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test

Secret definitions initialized under secrets/definitions.py
Add your secrets there and fill the values on the next use of a manage.py
command.



Secret missing, please fill in the blanks ..

SECRET_KEY: secret
Traceback (most recent call last):
  File "manage.py", line 12, in 
from django.core.management import execute_from_command_line
ImportError: No module named 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 18, in 
import django  # noqa
ImportError: No module named 'django'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 21, in 
"Couldn't import Django. Are you sure it's installed and "
ImportError: Couldn't import Django. Are you sure it's installed and
available on your PYTHONPATH environment variable? Did you forget to
activate a virtual environment?
(.env) rodrigo@enoch:~/code/django-secrets$ pip install django
Collecting django
  Downloading Django-2.0.2-py3-none-any.whl (7.1MB)
100% || 7.1MB 203kB/s
Collecting pytz (from django)
  Using cached pytz-2017.3-py2.py3-none-any.whl
Installing collected packages: pytz, django
Successfully installed django-2.0.2 pytz-2017.3
(.env) rodrigo@enoch:~/code/django-secrets$ python manage.py test
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
.
Secret definitions initialized under secrets/definitions.py
Add your secrets there and fill the values on the next use of a manage.py
command.


got secret from environment variable (SECOND_SECRET)
E
Use these lines to initialize your secrets ..

export SECRET_KEY="secret"
E
==
ERROR: test_creating_secrets_folder (django_secrets.tests.SecretTest)
--
Traceback (most recent call last):
  File "/home/rodrigo/code/django-secrets/django_secrets/tests.py", line
24, in test_creating_secrets_folder
check()
  File "/home/rodrigo/code/django-secrets/django_secrets/startup.py", line
100, in check
reload_module(secrets)
  File "/usr/lib/python3.5/importlib/__init__.py", line 166, in reload
_bootstrap._exec(spec, module)
  File "", line 607, in _exec
AttributeError: 'NoneType' object has no attribute 'name'

==
ERROR: test_export (django_secrets.tests.SecretTest)
--
Traceback (most recent call last):
  File "/home/rodrigo/code/django-secrets/django_secrets/tests.py", line
32, in test_export
command.handle()
  File
"/home/rodrigo/code/django-secrets/django_secrets/management/commands/export_secrets.py",
line 15, in handle
print('export %s="%s"' % (key, getattr(secrets, key)))
AttributeError: module 'secrets.secrets' has no attribute 'SECOND_SECRET'


Re: Travis Problem

2018-02-05 Thread Andy
No, the actual problem is, that the secrets modules was not reloaded 
correctly and thus the tested SECOND_SECRET could not be found.
BUT the question is, why this is happening, because testing the same thing 
locally (under the same python version failing at travis) works like it 
should.

If you have some minutes to spare, please test it and tell me if you can 
reproduce the problem.



Am Montag, 5. Februar 2018 16:30:21 UTC+1 schrieb Matemática A3K:
>
>
>
> On Mon, Feb 5, 2018 at 12:23 PM, Andy  
> wrote:
>
>> Which line number are you referring to?
>> i didnt notice missing  vars.
>>
>
> got secret from environment variable (SECOND_SECRET)
> E
> Use these lines to initialize your secrets ..
> export SECRET_KEY="travis"
> E
>
> ...
>
> ==
> ERROR: test_export (django_secrets.tests.SecretTest)
> --
> Traceback (most recent call last):
>   File "/home/travis/build/kakulukia/django-secrets/django_secrets/tests.py", 
> line 32, in test_export
> command.handle()
>   File 
> "/home/travis/build/kakulukia/django-secrets/django_secrets/management/commands/export_secrets.py",
>  line 15, in handle
> print('export %s="%s"' % (key, getattr(secrets, key)))
> AttributeError: 'module' object has no attribute 'SECOND_SECRET'
>
>
>  
>
>>
>>
>> Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>>>
>>>
>>>
>>> On Thu, Feb 1, 2018 at 9:58 AM, Andy  wrote:
>>>
 Hi,

 im trying to convince Travis to test my app:
 https://github.com/kakulukia/django-secrets

 But its failing for all python3 versions. Because my system python 3 is 
 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at 
 Travis) 
 virtualenv and ran the tests. On my local system they are working, but 
 travis reports problems and i dont really know how to fix them when the 
 tests are not failing locally.

 Does sombody have a clue, whats wrong here?

 Weird evough: now that i pushed a new commit (not relating python code 
 though) two confgigurations do pass the tests:
 https://travis-ci.org/kakulukia/django-secrets/

>>>
>>> This is more like a Travis problem, according the log, the env vars are 
>>> not being picked by it:
>>> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>>>
>>>  
>>>

 -- 
 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/msgid/django-users/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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...@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/msgid/django-users/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%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/f71c985d-365b-46b5-858e-985025590124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Matemática A3K
On Mon, Feb 5, 2018 at 12:23 PM, Andy  wrote:

> Which line number are you referring to?
> i didnt notice missing  vars.
>

got secret from environment variable (SECOND_SECRET)
E
Use these lines to initialize your secrets ..
export SECRET_KEY="travis"
E

...

==
ERROR: test_export (django_secrets.tests.SecretTest)
--
Traceback (most recent call last):
  File "/home/travis/build/kakulukia/django-secrets/django_secrets/tests.py",
line 32, in test_export
command.handle()
  File 
"/home/travis/build/kakulukia/django-secrets/django_secrets/management/commands/export_secrets.py",
line 15, in handle
print('export %s="%s"' % (key, getattr(secrets, key)))
AttributeError: 'module' object has no attribute 'SECOND_SECRET'




>
>
> Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>>
>>
>>
>> On Thu, Feb 1, 2018 at 9:58 AM, Andy  wrote:
>>
>>> Hi,
>>>
>>> im trying to convince Travis to test my app:
>>> https://github.com/kakulukia/django-secrets
>>>
>>> But its failing for all python3 versions. Because my system python 3 is
>>> 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at Travis)
>>> virtualenv and ran the tests. On my local system they are working, but
>>> travis reports problems and i dont really know how to fix them when the
>>> tests are not failing locally.
>>>
>>> Does sombody have a clue, whats wrong here?
>>>
>>> Weird evough: now that i pushed a new commit (not relating python code
>>> though) two confgigurations do pass the tests:
>>> https://travis-ci.org/kakulukia/django-secrets/
>>>
>>
>> This is more like a Travis problem, according the log, the env vars are
>> not being picked by it:
>> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>>
>>
>>
>>>
>>> --
>>> 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/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%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%2BFDnhJ4iHGEeQBMtFX42PEgoamH1tu%2B54KD3o6Faa1BfbRksw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: javascript transpilers

2018-02-05 Thread Matemática A3K
On Thu, Feb 1, 2018 at 8:27 PM, Mike Dewhirst  wrote:

> On 2/02/2018 12:54 AM, Jason wrote:
>
>> https://caniuse.com/#feat=wasm
>>
>>
>>  IIRC wasm is not polyfillable or transpilable, so if you're targeting
>> users on any of those red cells, then wasm is not for you.
>>
>
> Agreed. I think it is interesting anyway but I already decided it is not
> within my event horizon.
>

I wasn't sure about writing this, but anyway...

Mike,

I know how you feel, I have been there (avoiding JS), this is how I solved
it:
https://books.google.com.pe/books/about/JavaScript.html?id=PXa2bby0oQ0C=frontcover=kp_read_button_esc=y#v=onepage=false
and:
http://learn.knockoutjs.com/#/?tutorial=intro
(it will give you the concepts about ""modern"" UI development in JS (not
"pure" jQuery) before jumping into the big js framework world, and it also
may solve your UI needs)

About the python transpiler, you still need to write code for the JS
libraries, so you need to understand roughly how they work and how the
coding is done for the browser. The problem is not JS here (which can be
grasped easily with Crockford's book), but the coding pattern you have
apply and how things are done - and you get that only by coding on it. Once
you know that, you can write it on Python or JS.

When reading JS articles, have in mind this:
https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f

HTH

>
>
>>
>> --
>> 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 > 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/19bbbae1-eac0-4fea-b6f2-a1c72cfdb471%40googlegroups.com
>> > 0-4fea-b6f2-a1c72cfdb471%40googlegroups.com?utm_medium=email
>> _source=footer>.
>> 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/1f24a791-1a13-ecd8-f97c-6d5118ef8d41%40dewhirst.com.au.
>
> 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%2BFDnh%2BPxgV9drcsO8r38mvBBpU1eJra2sTcQ2BdstdRpEhErg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Andy
Which line number are you referring to?
i didnt notice missing  vars.


Am Montag, 5. Februar 2018 15:50:14 UTC+1 schrieb Matemática A3K:
>
>
>
> On Thu, Feb 1, 2018 at 9:58 AM, Andy  
> wrote:
>
>> Hi,
>>
>> im trying to convince Travis to test my app:
>> https://github.com/kakulukia/django-secrets
>>
>> But its failing for all python3 versions. Because my system python 3 is 
>> 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at Travis) 
>> virtualenv and ran the tests. On my local system they are working, but 
>> travis reports problems and i dont really know how to fix them when the 
>> tests are not failing locally.
>>
>> Does sombody have a clue, whats wrong here?
>>
>> Weird evough: now that i pushed a new commit (not relating python code 
>> though) two confgigurations do pass the tests:
>> https://travis-ci.org/kakulukia/django-secrets/
>>
>
> This is more like a Travis problem, according the log, the env vars are 
> not being picked by it:
> https://travis-ci.org/kakulukia/django-secrets/jobs/336123060
>
>  
>
>>
>> -- 
>> 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/msgid/django-users/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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/08261ca0-c0dd-4d70-9ce1-e8cb2e401059%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Login Popup forms.

2018-02-05 Thread Matemática A3K
On Wed, Jan 31, 2018 at 8:36 PM, Udit Vashisht 
wrote:

> Hi, I want to create a popup form for login. I have implemented the same
> for signup by creating jsonresponse from signup view. But i could not do
> the same for the login form. Can anyone help.
>
>
Popus are regular HTML files with client-side code (javascript) to "look
like popups". Otherwise, it the same as a regular "non-popup" page (same
view, etc. on the django side)


>
> --
> 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/7f53bd94-a0ce-4ddd-9273-730b6ef5b0f4%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%2BFDnhLda3DD8xgOaFk-AFAVJW0QwU4dLY4PGi%2BuYoNAkgxfiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Customizable Invoice

2018-02-05 Thread Matemática A3K
On Thu, Feb 1, 2018 at 7:46 AM, Rakhee Menon 
wrote:

> Hi Andreas,
>
> Yeah you are right I want to create a backend solution for storing the
> information about the invoices once any changes are done in the invoice
> format.
> For instance a customer might change the fontsize of any column, add any
> column or one might change the position of their company name etc..and I
> want to store the changed positions and save it in the database ie  I want
> to create an editable invoice in all ways.
>

Still too broad :)


>
>
> Thanks Once Again
>> Regards  ,
>> Rakhee
>>
> --
> 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/cfaa0e5c-06d4-40c1-bdde-3f378aed9a0d%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%2BFDnhJ%3DBqP2DFZ_oL_Be%2B8A9P4gJyBKYQUNLtFgURdGY7Stkg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Travis Problem

2018-02-05 Thread Matemática A3K
On Thu, Feb 1, 2018 at 9:58 AM, Andy  wrote:

> Hi,
>
> im trying to convince Travis to test my app:
> https://github.com/kakulukia/django-secrets
>
> But its failing for all python3 versions. Because my system python 3 is
> 3.6.4 i just installed pyenv, created a 3.6.3 (latest python 3.6 at Travis)
> virtualenv and ran the tests. On my local system they are working, but
> travis reports problems and i dont really know how to fix them when the
> tests are not failing locally.
>
> Does sombody have a clue, whats wrong here?
>
> Weird evough: now that i pushed a new commit (not relating python code
> though) two confgigurations do pass the tests:
> https://travis-ci.org/kakulukia/django-secrets/
>

This is more like a Travis problem, according the log, the env vars are not
being picked by it:
https://travis-ci.org/kakulukia/django-secrets/jobs/336123060



>
> --
> 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/01cb4387-5ad1-4d24-9ae4-42a2b83c7ab1%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%2BFDnhLNBF-U3q2x18jYtEcFfHeX8qvkzWyJ5e5kd7y%2ByUiafA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: In the Admin, Is it possible to make filters on foreign keys usable with lots of related objects?

2018-02-05 Thread Matemática A3K
On Fri, Feb 2, 2018 at 3:23 PM, Paul Tiplady  wrote:

> Currently it's simple to configure a filter on a foreign key in the admin:
>
> `list_filter = ['theforeignkeyfield']`
>
> However in practice this is barely usable in most cases that I've
> encountered, since the admin uses RelatedFieldListFilter, which fetches the
> full list of objects from the DB and loads them into the browser. For any
> production site that either times out or makes the admin unusably slow, not
> to mention the UX is terrible as it inserts a list of all of the items into
> the filter bar that needs to be scrolled through.
>
> I'm not sure if this is fixed in 2.0 (I haven't played with the new
> select2 integration that was added), but is there a plugin / workaround to
> use something like django-autocomplete-light, or a `raw_id_field` type
> approach in pre-2.0?
>

https://djangopackages.org/grids/g/auto-complete/

> --
> 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/4e610074-ff8c-494d-977e-cf701c8cd92f%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%2BFDnhLF6YWwH6%2BQZP%3D7hPYSnLhpHaGgFrBzMUSe8UDWxvUaKw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 2.0.2 not work with Jinja 2 (admin side)

2018-02-05 Thread Matemática A3K
You have to provide a traceback in order to get some help

On Sat, Feb 3, 2018 at 9:26 PM, Николай Инкогнито  wrote:

> /admin/
> - raise error
>
> --
> 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/be335026-0d3e-4c05-ad19-e259d9ec5aa3%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%2BFDnhLqqQh1e2kYRCexMaM5%2B_GXzy%3DCK8CONaRoPDj-6WC%3Dhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2018-02-05 Thread Matemática A3K
On Mon, Feb 5, 2018 at 10:59 AM, sarvit sarvit 
wrote:

> is not app
> views.py
> from django.http import HttpRequest
>
> def index(request):
>return HttpRequest("Hello World.")
>
> urls.py
>
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from views.py import views
>
> urlpatterns = [
>path('admin/', admin.site.urls),
>url(r'^$',views.index),
>
>
> ]
>
>
>
Judging from this, you are trying to import the views from your "main"
urls.py, and generally the views are within an django app. In that case,
you should use your_app_name.views as stated before. "Relative imports"
(from . import views) will work only if the file is on the same directory
you are working (i.e. inside an app).
 .

>
>
> On Monday, February 5, 2018 at 4:54:59 PM UTC+3:30, sarvit sarvit wrote:
>>
>> Hello
>> I importing error
>> Please help me
>> from django.shortcuts import render
>> from django.conf.urls import url
>> from django.contrib import admin
>> from django.urls import path
>> from . import views
>>
>>
>> Traceback (most recent call last):
>>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in
>> 
>> from . import views
>> ImportError: cannot import name 'views'
>>
>>
>>
>> --
> 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/1d3b5804-123c-40ce-9ec9-fa4bb5fc8495%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%2BFDnhLCgR_6AjyYXSZ8Nu%2BOpkQnLsLaCpUkBSJ21Ekuw39Baw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2018-02-05 Thread sarvit sarvit
is not app 
views.py
from django.http import HttpRequest

def index(request):
   return HttpRequest("Hello World.")

urls.py

from django.shortcuts import render
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from views.py import views

urlpatterns = [
   path('admin/', admin.site.urls),
   url(r'^$',views.index),


]




On Monday, February 5, 2018 at 4:54:59 PM UTC+3:30, sarvit sarvit wrote:
>
> Hello 
> I importing error 
> Please help me 
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from . import views
>
>
> Traceback (most recent call last):
>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in 
> 
> from . import views
> ImportError: cannot import name 'views'
>
>
>
>

-- 
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/1d3b5804-123c-40ce-9ec9-fa4bb5fc8495%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: import error

2018-02-05 Thread pradam
Bro,
do it like this:
from *your_app_name* import views

On Mon, Feb 5, 2018 at 6:54 PM, sarvit sarvit 
wrote:

> Hello
> I importing error
> Please help me
> from django.shortcuts import render
> from django.conf.urls import url
> from django.contrib import admin
> from django.urls import path
> from . import views
>
>
> Traceback (most recent call last):
>   File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in
> 
> from . import views
> ImportError: cannot import name 'views'
>
>
>
> --
> 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/2ff76016-b9a4-47dc-a4c1-87a828e86c0f%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/CAGGVXBMUEiy7jmE-pHqqgk680wnixNkxV-q1fH5vL4Z%2BQHhjow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


import error

2018-02-05 Thread sarvit sarvit
Hello 
I importing error 
Please help me 
from django.shortcuts import render
from django.conf.urls import url
from django.contrib import admin
from django.urls import path
from . import views


Traceback (most recent call last):
  File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in 

from . import views
ImportError: cannot import name 'views'



-- 
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/2ff76016-b9a4-47dc-a4c1-87a828e86c0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


import eror views

2018-02-05 Thread sarvit sarvit
hello 
please help for dibog 
Traceback (most recent call last):
  File "c:\Users\saeid\Desktop\sade\env\Post\Post\urls.py", line 20, in 

from . import views
ImportError: cannot import name 'views'

-- 
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/a019be7f-1240-4f31-8655-b36c758a709a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.