Re: Adding Channels to and Existing Django Application

2018-11-05 Thread Andrew Godwin
Hey,

You can just add channels to an existing Django project and only use it for
the bits you need it for - even down to running two different servers for
that project, one normal WSGI one and one ASGI one to let you do async
things.

You shouldn't migrate any existing code to channels - just add it and then
use it for the new bits you need it for, basically.

Andrew

On Sun, Nov 4, 2018 at 1:16 PM  wrote:

> Greetings y'all!
>
> I'm looking for recommendations regarding adding Channels to an existing
> Django 1.11 application.
>
> Every guide I've followed assumes that one is using Channels to build an
> application from scratch, and that is OK to replace django's native calls
> by Channels.
>
> Channels' documentation suggests different ways of setting up
> authentication, sessions, etc, but it is not clear to me that every feature
> of Django 1.11 has its counterpart
> on Channels. I am afraid I'll spend days migrating my system to Channels
> only to figure out that a particular feature of Django is not supported by
> Channels. In order to avoid that I've decided to ask y'all first.
>
> Ideally, I would like to set Channels on a particular Django app, not on
> the entire Django project (other apps would not be aware of Channels being
> setup). Is that possible?
>
> If this is not possible, my best guess is that I would need to add
> Channels to an independent Django project, and have these two servers
> communicate. This 2nd server would point to the same database as the 1st,
> and thus would be able to run authentication with same credentials, among
> other data related operations.
>
> I appreciate any guidance on this matter.
>
> --
> 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/a8c4164a-ffbb-4975-8d48-f8f058466b4d%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/CAFwN1uprrm2fVuC6mpX6OdHWPb55S1v%3DT%2BJP8vss_%3Dz1_p2DMA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-05 Thread Saeed Pooladzadeh
I know visual studio and visual studio code are different.
I mean the main visual studio.


. How to set up the page admin.py
How to make it appear?

در دوشنبه 5 نوامبر 2018، ساعت 12:14:47 (UTC-8)، Holger Otto ANDRé نوشته:
>
> I  don't get what you mean by admin page.
> BTW don't get confused
> 1) Visual Studio 2017 (what I uses for Python projects)
> 2) Visual Studio Code ( an very versatile editor from MS as well)
>
> Both can be used for Python development.
>
>
> *Holger André*
> Skype: hjoab1
>
> Mobile/Whatsapp/Telegram : +(506) 8883-9645
>
> Website:  https://www.linkedin.com/in/hjoab/
>
> San José, Costa Rica, Central America.
>
>
> 
> The information contained in this e-mail is privileged and confidential, 
> this information is intended only for the use of the individual or entity 
> to which it is addressed. If you are not the intended recipient, you are 
> hereby notified that any use, dissemination, distribution, copy or taking 
> action in reliance upon this email is strictly prohibited. If you have 
> received this e-mail in error, please immediately notify the sender and 
> then delete this e-mail in its entirety.
> 
>
>
> On Mon, Nov 5, 2018 at 12:02 PM Saeed Pooladzadeh  > wrote:
>
>> Hello,
>>
>> Can anyone help me how to start the admin page in visual studio.
>> I have tried many methods but none succeeded.
>>
>> thanks
>>
>> Saeed
>>
>> -- 
>> 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/de46c47e-5d27-4ac8-8359-f8bf1e9e838d%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/760108c6-1abe-4af7-9b22-df73bab3d5c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-05 Thread Motaz Hejaze
what do you want to do exactly ?

On Mon, Nov 5, 2018 at 8:01 PM Saeed Pooladzadeh 
wrote:

> Hello,
>
> Can anyone help me how to start the admin page in visual studio.
> I have tried many methods but none succeeded.
>
> thanks
>
> Saeed
>
> --
> 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/de46c47e-5d27-4ac8-8359-f8bf1e9e838d%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/CAHV4E-fBRzoTtsefrr%2B9bEpbTdNgBQ%2B%2BKHH953HjF-SweEX9Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-05 Thread Holger Otto ANDRE
I  don't get what you mean by admin page.
BTW don't get confused
1) Visual Studio 2017 (what I uses for Python projects)
2) Visual Studio Code ( an very versatile editor from MS as well)

Both can be used for Python development.


*Holger André*
Skype: hjoab1

Mobile/Whatsapp/Telegram : +(506) 8883-9645

Website:  https://www.linkedin.com/in/hjoab/

San José, Costa Rica, Central America.



The information contained in this e-mail is privileged and confidential,
this information is intended only for the use of the individual or entity
to which it is addressed. If you are not the intended recipient, you are
hereby notified that any use, dissemination, distribution, copy or taking
action in reliance upon this email is strictly prohibited. If you have
received this e-mail in error, please immediately notify the sender and
then delete this e-mail in its entirety.



On Mon, Nov 5, 2018 at 12:02 PM Saeed Pooladzadeh 
wrote:

> Hello,
>
> Can anyone help me how to start the admin page in visual studio.
> I have tried many methods but none succeeded.
>
> thanks
>
> Saeed
>
> --
> 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/de46c47e-5d27-4ac8-8359-f8bf1e9e838d%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/CAL0dL5aXjjL4Y5BUSe3LneKOAVCzw%2BHwmCP7WD6UE1EoEzOzLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-05 Thread TimT Vogt
Did You use the terminal in visual studio?


Verstuurd vanaf mijn iPhone

> Op 5 nov. 2018 om 20:25 heeft Arturo Fernandez  het 
> volgende geschreven:
> 
> Helloo, visual studio is just an editor.
> 
> Here is the tutorial that I started with 
> https://www.youtube.com/watch?v=UmljXZIypDc=1=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p
> 
> and here is my blog, I have a lot about Visual studio code to get you 
> started: blog.arturofm.com
> 
> Hope it helps :)
> 
> 
> 
>> On Monday, November 5, 2018 at 1:02:25 PM UTC-5, Saeed Pooladzadeh wrote:
>> Hello,
>> 
>> Can anyone help me how to start the admin page in visual studio.
>> I have tried many methods but none succeeded.
>> 
>> thanks
>> 
>> Saeed
> 
> -- 
> 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/847ad8f7-b9ad-4810-bcba-15b01b389d2f%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/BC4CA4D2-94FC-4003-BD2D-56D9DAA1EE0A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Setting up admin in visual studio

2018-11-05 Thread Arturo Fernandez
Helloo, visual studio is just an editor.

Here is the tutorial that I started with 
https://www.youtube.com/watch?v=UmljXZIypDc=1=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p

and here is my blog, I have a lot about Visual studio code to get you 
started: blog.arturofm.com

Hope it helps :)



On Monday, November 5, 2018 at 1:02:25 PM UTC-5, Saeed Pooladzadeh wrote:
>
> Hello,
>
> Can anyone help me how to start the admin page in visual studio.
> I have tried many methods but none succeeded.
>
> thanks
>
> Saeed
>

-- 
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/847ad8f7-b9ad-4810-bcba-15b01b389d2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reading serialized data without json

2018-11-05 Thread oon arfiandwi
Hi,

have to try to convert the QueryDict to dictionary?
then try to get the keys as list.

>>> qdict

>>> qdict.dict()
{u'allergies[0][date]': [''], u'allergies[1][date]': [''],
u'allergies[0][subst]': ['nsaid'], u'allergies[1][subst]': ['alcohol']}
>>> qdict.dict().keys()
[u'allergies[0][date]', u'allergies[1][date]', u'allergies[0][subst]',
u'allergies[1][subst]']
>>>



still need some work to detect the list index and further keys, but now you
can compare which way is easier to parse manually or serialize via json.

-- 
sincerely,
O


On Mon, Nov 5, 2018 at 7:16 PM Joel Mathew  wrote:

> Is it possible to read serialized data from javascript without encoding to
> json?
>
> The data received by request.POST is:
>
>  [''], 'allergies[1][subst]': ['alcohol'], 'allergies[1][date]': ['']}>
>
> Sincerely yours,
>
> Joel G Mathew
>
> --
> 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/CAA%3Diw_9FW8QshYa9_K3rYMc%2BMF5vigZC3KdBFExvdH%2Bqves6ZA%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/CACUNLpXqAzZr2u16VTdFVBAmDbha60PZMXY%3DEwGo17bgHBQrfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Setting up admin in visual studio

2018-11-05 Thread Saeed Pooladzadeh
Hello,

Can anyone help me how to start the admin page in visual studio.
I have tried many methods but none succeeded.

thanks

Saeed

-- 
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/de46c47e-5d27-4ac8-8359-f8bf1e9e838d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to move readonly_fields on top of page?

2018-11-05 Thread Shashank Singh
fields = ['a', 'b', 'c']
readonly_fields = ['a', 'b']
A and b will appear before c.

On Mon, 5 Nov, 2018, 8:03 PM Karol Ołtarzewski <2004ka...@gmail.com wrote:

> I want to place normal fields below readonly_fields
>
>
> On Mon, 5 Nov 2018 at 07:08, Joel  wrote:
>
>> Explain. What do you mean move on top of page?
>>
>> On Mon, 5 Nov, 2018, 2:46 AM Karol Ołtarzewski <2004ka...@gmail.com
>> wrote:
>>
>>> Good morning guys.
>>>
>>> I have a problem namely:
>>> I have to place readonly_fields on top of
>>> /admin///change page, higher than normal fields.
>>> I was looking through docs and I can't find proper function to achieve
>>> that.
>>>
>>> What I have to do to reach my goal?
>>>
>>> --
>>> 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/2d680835-393a-4011-8599-495ef8d3da29%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/CAA%3Diw_-9u1HAJCsDh00YzCUR2ONQ6MJOW7kvT5fEPYShtr1Khw%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/CAF5bKVzRMHaEiWU3bpxTRXougkF0NQVbk-5oCj6dJ2jH3D1RwQ%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/CAD-d1sbjZR%3DycjN7ePBiLhiNvbyD1UF961Hg8NLdg_k30j_%2Byg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to move readonly_fields on top of page?

2018-11-05 Thread Karol Ołtarzewski
I want to place normal fields below readonly_fields


On Mon, 5 Nov 2018 at 07:08, Joel  wrote:

> Explain. What do you mean move on top of page?
>
> On Mon, 5 Nov, 2018, 2:46 AM Karol Ołtarzewski <2004ka...@gmail.com wrote:
>
>> Good morning guys.
>>
>> I have a problem namely:
>> I have to place readonly_fields on top of
>> /admin///change page, higher than normal fields.
>> I was looking through docs and I can't find proper function to achieve
>> that.
>>
>> What I have to do to reach my goal?
>>
>> --
>> 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/2d680835-393a-4011-8599-495ef8d3da29%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/CAA%3Diw_-9u1HAJCsDh00YzCUR2ONQ6MJOW7kvT5fEPYShtr1Khw%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/CAF5bKVzRMHaEiWU3bpxTRXougkF0NQVbk-5oCj6dJ2jH3D1RwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Virtual Groups for learning Django

2018-11-05 Thread bill . torcaso . oxfam

I hear good things about Django Girls (https://djangogirls.org/).



On Sunday, November 4, 2018 at 8:52:38 AM UTC-5, Expo Tor wrote:
>
> Anyone can recommend any online virtual groups for Django? I mean it 
> should be sth more than online tutorials - where users can come in 
> real-time with their questions.
>

-- 
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/346e144a-6b54-4992-882a-48ac47a5262c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Virtual Groups for learning Django

2018-11-05 Thread Jason
also, you can check out python developers slack at 
https://pyslackers.com/slack/


-- 
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/bcc95893-e49b-4c35-bfdc-ec8a0a084162%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread chris
I am not sure you understood. I am doing testing, and this is a model that is 
only for tests. I am attempting to achieve the test-only models solution 
outlined here: 

https://code.djangoproject.com/ticket/7835#comment:24 

Also outlined in the first paragraph of this accepted answer on stack overflow: 

https://stackoverflow.com/questions/502916/django-how-to-create-a-model-dynamically-just-for-testing?rq=1
 


app/tests/models.py or putting models in app/tests.py should result in the 
model being detected and migrated in the test database, but the model is never 
detected, so the tests fail when they are run because the tables are missing. 


From: "Phako Perez" <13.phak...@gmail.com> 
To: "django-users"  
Sent: Saturday, November 3, 2018 7:06:19 PM 
Subject: Re: Cannot get Django test migrations to detect test models.py 

I can suggest to use different name for your test app, as directory test is 
used by Django for actual test your application, maybe is that the reason your 
app is failing 

Sent from my iPhone 

On Nov 3, 2018, at 12:40 PM, [ mailto:ch...@routh.io | ch...@routh.io ] wrote: 




Hi folks, I'm trying to build a test suite for a django plugin for a field. To 
test the field I need to have a test model, but since my django app does not 
provide models, and I have the model in the /tests/models.py it's not detecting 
the model when the test db migrations are applied. I saw some suggestions on 
stack overflow to add the test app to the INSTALLED_APPS in the test app, 
however that causes an django.core.exceptions.AppRegistryNotReady: Apps aren't 
loaded yet. error, which I imagine is caused by the tests app not being a full 
blown app. What's the proper solution for Django 2.0+ ? I'd prefer not to use 
the fake models solution as I plan to open source the module and want the field 
tested against a real db on Django 2.0 and 2.1. 

Source is here: [ https://gitlab.routh.io/open-source/django-bleachfields | 
https://gitlab.routh.io/open-source/django-bleachfields ] 

Test failures and attempted configurations can be seen in the CI pipeline and 
commit history. 

Hoping someone can lend their insights. 


-- 
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 [ mailto:django-users+unsubscr...@googlegroups.com | 
django-users+unsubscr...@googlegroups.com ] . 
To post to this group, send email to [ mailto:django-users@googlegroups.com | 
django-users@googlegroups.com ] . 
Visit this group at [ https://groups.google.com/group/django-users | 
https://groups.google.com/group/django-users ] . 
To view this discussion on the web visit [ 
https://groups.google.com/d/msgid/django-users/d525bd73-0db8-4d17-b5b8-254461a9a533%40googlegroups.com?utm_medium=email_source=footer
 | 
https://groups.google.com/d/msgid/django-users/d525bd73-0db8-4d17-b5b8-254461a9a533%40googlegroups.com
 ] . 
For more options, visit [ https://groups.google.com/d/optout | 
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 [ mailto:django-users+unsubscr...@googlegroups.com | 
django-users+unsubscr...@googlegroups.com ] . 
To post to this group, send email to [ mailto:django-users@googlegroups.com | 
django-users@googlegroups.com ] . 
Visit this group at [ https://groups.google.com/group/django-users | 
https://groups.google.com/group/django-users ] . 
To view this discussion on the web visit [ 
https://groups.google.com/d/msgid/django-users/C71D5DB6-C733-4265-9B4C-EE05CEC6ED52%40gmail.com?utm_medium=email_source=footer
 | 
https://groups.google.com/d/msgid/django-users/C71D5DB6-C733-4265-9B4C-EE05CEC6ED52%40gmail.com
 ] . 
For more options, visit [ https://groups.google.com/d/optout | 
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/1144431128.10508.1541425519599.JavaMail.zimbra%40routh.io.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread chris
I'm not sure you understood the question. 


From: "amit pant"  
To: "django-users"  
Sent: Monday, November 5, 2018 2:24:51 AM 
Subject: Re: Cannot get Django test migrations to detect test models.py 

can you register your model in admin.py? 
If not then go for it. 

On Sun 4 Nov, 2018, 12:10 AM , < [ mailto:ch...@routh.io | ch...@routh.io ] > 
wrote: 



Hi folks, I'm trying to build a test suite for a django plugin for a field. To 
test the field I need to have a test model, but since my django app does not 
provide models, and I have the model in the /tests/models.py it's not detecting 
the model when the test db migrations are applied. I saw some suggestions on 
stack overflow to add the test app to the INSTALLED_APPS in the test app, 
however that causes an django.core.exceptions.AppRegistryNotReady: Apps aren't 
loaded yet. error, which I imagine is caused by the tests app not being a full 
blown app. What's the proper solution for Django 2.0+ ? I'd prefer not to use 
the fake models solution as I plan to open source the module and want the field 
tested against a real db on Django 2.0 and 2.1. 

Source is here: [ https://gitlab.routh.io/open-source/django-bleachfields | 
https://gitlab.routh.io/open-source/django-bleachfields ] 

Test failures and attempted configurations can be seen in the CI pipeline and 
commit history. 

Hoping someone can lend their insights. 


-- 
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 [ mailto:django-users+unsubscr...@googlegroups.com | 
django-users+unsubscr...@googlegroups.com ] . 
To post to this group, send email to [ mailto:django-users@googlegroups.com | 
django-users@googlegroups.com ] . 
Visit this group at [ https://groups.google.com/group/django-users | 
https://groups.google.com/group/django-users ] . 
To view this discussion on the web visit [ 
https://groups.google.com/d/msgid/django-users/d525bd73-0db8-4d17-b5b8-254461a9a533%40googlegroups.com?utm_medium=email_source=footer
 | 
https://groups.google.com/d/msgid/django-users/d525bd73-0db8-4d17-b5b8-254461a9a533%40googlegroups.com
 ] . 
For more options, visit [ https://groups.google.com/d/optout | 
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 [ mailto:django-users+unsubscr...@googlegroups.com | 
django-users+unsubscr...@googlegroups.com ] . 
To post to this group, send email to [ mailto:django-users@googlegroups.com | 
django-users@googlegroups.com ] . 
Visit this group at [ https://groups.google.com/group/django-users | 
https://groups.google.com/group/django-users ] . 
To view this discussion on the web visit [ 
https://groups.google.com/d/msgid/django-users/CAF2Ah_E4d96VrDsnamQ1DJk9tzBgFG7EgpH7RNsEjKm-B-vG9Q%40mail.gmail.com?utm_medium=email_source=footer
 | 
https://groups.google.com/d/msgid/django-users/CAF2Ah_E4d96VrDsnamQ1DJk9tzBgFG7EgpH7RNsEjKm-B-vG9Q%40mail.gmail.com
 ] . 
For more options, visit [ https://groups.google.com/d/optout | 
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/368149463.10493.1541425347709.JavaMail.zimbra%40routh.io.
For more options, visit https://groups.google.com/d/optout.


Re: Create rest service

2018-11-05 Thread PASCUAL Eric
Hi,


Have a look at the "migrate.py inspectdb" command documentation 
(https://docs.djangoproject.com/fr/2.1/ref/django-admin/#inspectdb).


This command generates the models for tables in an existing DB. To avoid 
messing with the existing data, these models are declared as non managed, which 
means that the tables are not created  nor modified by the migration process.


It should give you a good starting point.


Regards


Eric

django-admin et manage.py | Django documentation | 
Django
docs.djangoproject.com
Obtention d’aide¶ django-admin help¶. Lancez django-admin help pour afficher 
des informations d’utilisation et une liste des commandes fournies par chaque 
application.. Lancez django-admin help--commands pour afficher une liste des 
commandes disponibles.. Lancez django-admin help  pour afficher une 
description de la commande concernée et une liste de ses options disponibles.


From: django-users@googlegroups.com  on behalf 
of soumyajit banerjee 
Sent: Monday, November 5, 2018 12:55:42 PM
To: Django users
Subject: Create rest service

I have a one database (postgre). Same database currently using by one java 
application another one is php. But I want to create rest services through 
python django. Could you please guide me how to start. Actually I'm confused 
model creation, it's needed to create model or we can write direct sql query 
through view function. Please suggest me.

Regards,
Soumyajit

--
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/f37e28be-a09b-4988-a97c-015dc477e0e2%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/VI1P193MB0432621B6E7A0DF01CE89ADD8CCA0%40VI1P193MB0432.EURP193.PROD.OUTLOOK.COM.
For more options, visit https://groups.google.com/d/optout.


Create rest service

2018-11-05 Thread soumyajit banerjee
I have a one database (postgre). Same database currently using by one java 
application another one is php. But I want to create rest services through 
python django. Could you please guide me how to start. Actually I'm 
confused model creation, it's needed to create model or we can write direct 
sql query through view function. Please suggest me.

Regards,
Soumyajit

-- 
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/f37e28be-a09b-4988-a97c-015dc477e0e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to move readonly_fields on top of page?

2018-11-05 Thread Shashank Singh
Override fields and add readonly_fields first.

On Mon, 5 Nov, 2018, 11:38 AM Joel  Explain. What do you mean move on top of page?
>
> On Mon, 5 Nov, 2018, 2:46 AM Karol Ołtarzewski <2004ka...@gmail.com wrote:
>
>> Good morning guys.
>>
>> I have a problem namely:
>> I have to place readonly_fields on top of
>> /admin///change page, higher than normal fields.
>> I was looking through docs and I can't find proper function to achieve
>> that.
>>
>> What I have to do to reach my goal?
>>
>> --
>> 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/2d680835-393a-4011-8599-495ef8d3da29%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/CAA%3Diw_-9u1HAJCsDh00YzCUR2ONQ6MJOW7kvT5fEPYShtr1Khw%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/CAD-d1sab3PRLxFXdsr9DGYpnqLK9B0veKMM2yqfWxhWOuipxiA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re-Order rendering of input fields of django-contact-form?

2018-11-05 Thread Aashutosh Rathi
Yes, this works for me.
Make sure


super(AddLabForm, self).__init__(*args, **kwargs)
   fields_keyOrder = ['id', 'date', 'start_time', 'end_time']
   if 'keyOrder' in self.fields:
   self.fields.keyOrder = fields_keyOrder
   else:
   self.fields = OrderedDict((k, self.fields[k]) for k in 
fields_keyOrder)




On Thursday, January 22, 2015 at 1:06:59 AM UTC+5:30, Tobias Dacoir wrote:
>
> It still complained about the request, but I was finally able to get it to 
> work using this code:
> def __init__(self, request, *args, **kwargs):
> super(CustomContactForm, self).__init__(request=request, *args, **
> kwargs)
> fields_keyOrder = ['name', 'reason', 'email', 'body']
> if (self.fields.has_key('keyOrder')):
> self.fields.keyOrder = fields_keyOrder
> else:
> self.fields = OrderedDict((k, self.fields[k]) for k in 
> fields_keyOrder)
>
>
> However it still does not re-order the fields, I searched stackoverflow 
> again and found this for Django 1.7: 
> https://github.com/pennersr/django-allauth/issues/356#issuecomment-24758824
> But it still does not work. The order doesn't change it all. sigh :(
>

-- 
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/67309700-3cfc-4199-a789-8bc8653b1022%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Passing an ID through a Modal to delete a user in a View

2018-11-05 Thread Mauro Caresimo
Hello Im having some issues trying to pass an id through a modal. Basically 
I want to pass an id through a modal, via urls.py and to hit a function in 
the views to delete the user.
This is my modal:

Much appreciated for any help. Fairly new to Django. Really hope someone 
can come to my rescue :-)




   
   
   
   {% trans 'Delete My Account' %}
   
   ×
   
   
   
   {% trans 'Are you sure you want to delete your account?' %}
   
   
   
   {% trans 'Cancel' 
%}
   
   

   {% trans 'Yes, 
delete me' %}
   
   
   
   




{% block bottomjs %}

$(function () {
   $('#delete-account').on('click', function () {
   $('#ms-preload, #status').show();
   });
});

{% endblock %}



URLS>PY

from django.urls import path

from .views import subscriptions, subscribe, unsubscribe,deleteme, 
get_discounted_value, plan_details, my_subscription, manage_account


urlpatterns = [
   path('my-subscription/', my_subscription, name='my_subscription'),
   path('manage-account/', manage_account, name='manage_account'),
   path('subscriptions/', subscriptions, name='subscriptions'),
   path('subscribe/', subscribe, name='subscribe'),
   path('unsubscribe/', unsubscribe, name='unsubscribe'),
   path('deleteme//', deleteme, name='deleteme'),
   path('discounted-value/', get_discounted_value, name='discounted-value'),
   path('plan-details/', plan_details, name='plan-details'),
   # 
re_path('discounted-value/(?P([^/]+))/(?P([0-9.]+))/',
   # get_discounted_value, name='assessment_question'),
]


VIEWS
@csrf_exempt
def deleteme(request):
   request.user.deleteme(request.POST)
   return redirect('free_dashboard_index')

-- 
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/b3aace83-d3f1-43a7-9f10-5a1a07442608%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reading serialized data without json

2018-11-05 Thread Joel Mathew
Is it possible to read serialized data from javascript without encoding to json?

The data received by request.POST is:



Sincerely yours,

Joel G Mathew

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


Re: Migrating a flask app to Django

2018-11-05 Thread amit pant
According to my knowledge both are different framework so you need to
implement again.

On Sat 3 Nov, 2018, 6:09 PM oganga chantal,  wrote:

> Hi,
> i have a front end in django and the back end in flask.
> i need help in combining the two
>
> --
> 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/fdab12ff-0381-4179-97d9-e489838e47f3%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/CAF2Ah_EXQrVoOQYtq4Sk788%3DS6Aw27tCqJbs4j9iUDmNfEpw7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Cannot get Django test migrations to detect test models.py

2018-11-05 Thread amit pant
can you register your model in admin.py?
If not then go for it.

On Sun 4 Nov, 2018, 12:10 AM ,  wrote:

> Hi folks, I'm trying to build a test suite for a django plugin for a
> field. To test the field I need to have a test model, but since my django
> app does not provide models, and I have the model in the /tests/models.py
> it's not detecting the model when the test db migrations are applied. I saw
> some suggestions on stack overflow to add the test app to the
> INSTALLED_APPS in the test app, however that causes an
> django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. error,
> which I imagine is caused by the tests app not being a full blown app.
> What's the proper solution for Django 2.0+ ? I'd prefer not to use the fake
> models solution as I plan to open source the module and want the field
> tested against a real db on Django 2.0 and 2.1.
>
> Source is here: https://gitlab.routh.io/open-source/django-bleachfields
>
> Test failures and attempted configurations can be seen in the CI pipeline
> and commit history.
>
> Hoping someone can lend their insights.
>
> --
> 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/d525bd73-0db8-4d17-b5b8-254461a9a533%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/CAF2Ah_E4d96VrDsnamQ1DJk9tzBgFG7EgpH7RNsEjKm-B-vG9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to move readonly_fields on top of page?

2018-11-05 Thread Nelson Varela
Yeah. If you define read only fields in django model admin it places the 
read only fields after non-readonly fields by default in the change view

-- 
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/973221ba-1df3-40e6-ab1e-45b5d2773cb0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.