Re: Chat application application

2018-04-23 Thread Vineet Kothari
start reading channels

On Tuesday, April 24, 2018, sathish ponaganti 
wrote:

> Hi All,
>
> I want to create chat application , using Django frame work. I quite new
> to this.
> what is the workflow for this.
>
>
> My requirement is :if i entered the text  via chat window , it should
> display of the class type object and address of the object.
>
>
>
> if any one have the code could you please share with em
>
> --
> 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/8de55997-09a7-4a51-847f-781b56f1a1d7%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/CAAcanst7eUb06-ZX%3DKWy6-H-s3m4PZ9iDH_NYQnQKVsGFx1RkA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Chat application application

2018-04-23 Thread sathish ponaganti
Hi All,

I want to create chat application , using Django frame work. I quite new to 
this.
what is the workflow for this.


My requirement is :if i entered the text  via chat window , it should 
display of the class type object and address of the object.



if any one have the code could you please share with em

-- 
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/8de55997-09a7-4a51-847f-781b56f1a1d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Python Sqlalchemy filter by date range

2018-04-23 Thread sum abiut
I have two date picker fields that i want the users to select from date to
end date. and i want to display data between the two dates that was
selected. From example form date: 2/14/2018 to date:3/15/2018. when the
function is called i want to extract and display data between this two
dates.

i just need some help with the query to accomplish that.

I am using sqlalchemy to pull data from an mssql db

Cheers

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


Re: How do I move my development data tables to production server?

2018-04-23 Thread Mike Dewhirst

On 24/04/2018 8:57 AM, Anthony Flury wrote:

You can use manage.py dumpdata and manage.py loaddata

And you can do this per app - or even per table.


Thank you Anthony

I had totally forgotten that. In fact I actually script dumpdata for 
dumping test data (ie fixtures) but loaddata never worked for me. So 
much so that I was easily able to expunge it from my overloaded 
brainspace :)


Cheers

Mike



The challenge is if your production server already has data in it, and 
uses Auto Incrementing Ids, then the ids from the development wont be 
valid in the production server.


You also have the challenge that your data-base might not allow you to 
Insert values into a field which is meant to be based on an 
incrementing sequence.


--
Tony

On 23/04/18 23:41, Mike Dewhirst wrote:

On 24/04/2018 5:50 AM, Tom Tanner wrote:
Hey all, I have a bunch of tables on my local Django project. I set 
up the project on my production server and ran `manage.py migrate`. 
That set up the tables, but now I want to move the rows from my 
local tables to the ones on the production server. Both local and 
production server use Postgres. Is there a Django way to move the 
table data to production?


Not unless someone has written one and made it available. I haven't 
googled that so I don't know.


My approach would be to dump and reload if you want identical 
databases in dev and prd. You are looking for pgdump to make a dump 
file and to load at the other end you probably want dropdb, createdb 
and psql.


It is worthwhile writing a couple of scripts to manage that.

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/f65cd8eb-6399-4ee7-8830-84b19ea9b689%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/13aef0e9-04bd-527b-47ef-d783789b7a11%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: How do I move my development data tables to production server?

2018-04-23 Thread Mike Dewhirst

On 24/04/2018 5:50 AM, Tom Tanner wrote:
Hey all, I have a bunch of tables on my local Django project. I set up 
the project on my production server and ran `manage.py migrate`. That 
set up the tables, but now I want to move the rows from my local 
tables to the ones on the production server. Both local and production 
server use Postgres. Is there a Django way to move the table data to 
production?


Not unless someone has written one and made it available. I haven't 
googled that so I don't know.


My approach would be to dump and reload if you want identical databases 
in dev and prd. You are looking for pgdump to make a dump file and to 
load at the other end you probably want dropdb, createdb and psql.


It is worthwhile writing a couple of scripts to manage that.

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/f65cd8eb-6399-4ee7-8830-84b19ea9b689%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/0285a217-bb7f-1a4c-9b4d-fd847c837cf7%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Advice needed: One big model or many apps with highly interlinked data tables?

2018-04-23 Thread Mikkel Kromann
Thank you to all three of you. 
This was exactly the advice I've been looking for, and increased my 
understanding of Django as well as of my own app.
I will go carefully through the relations between my different models, and 
split them up between several model files, and cross-import as needed.

cheers, Mikkel

lørdag den 14. april 2018 kl. 16.10.27 UTC+2 skrev Mikkel Kromann:
>
> Hi.
>
> I'm new to Django, and I'm working my way into Django by going through the 
> nice Djangoproject.com turorial. 
> I'm trying to find out whether Django is the right tool for my task, which 
> is maybe a bit unusual for Django.
>
> My task is to build a web interface to a database for an calculation tool 
> made in Python. 
> The database will contain maybe up to 100.000 pieces of data (mostly 
> decimal fields), and the tool will import this data, do some calculations 
> and write some results back to the database.
>
> My Django web interface should allow the user to view, add, delete and 
> edit the data in the database, and view the results with tables and charts.
> The data is organised in various chunks:
>
> - "Sets" which lend themselves very nicely to Django models, i.e. 
> HouseholdType, Item, City, Month, Year
> - "Maps", which are user defined ManyToOne or ManyToMany relations between 
> the various sets (can probably be worked into the "sets" models)
> - "Data Tables", which contains the main load of data, having the "sets" 
> as foreign keys (e.g. "Demand" for each HouseholdType, Item, City, Month 
> and year)
> - "Results tables", calculated by the tool but in structure quite similar 
> to the "Data tables"
>
> I will have roughly 10 sets, 10 maps. 20-30 data tables and 10-20 result 
> tables.
> I understand that putting all these into a one app will create biiig 
> models.py and views.py files, which is probably a bad idea.
>
> On the other hand, splitting the sets, maps and tables into several apps 
> does not seem to be an ideal solution either.
> All the tables and the maps will be models that have foreign keys to the 
> "sets" models.
> My understanding so far is, that it is also bad to have a lot of 
> interlinkage between the various apps.
>
> An intermediate solution might be, that if I make a "Sets" app containing 
> all the models that are going to be primary key in the other apps, then the 
> interlinkages between the apps is somewhat simplified.
>
> Any thoughts or advice?
>
>
> cheers, Mikkel 
>
>
>

-- 
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/1bb4ab4f-7e47-4d06-aacf-5c2c0f0606f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How do I move my development data tables to production server?

2018-04-23 Thread Tom Tanner
Hey all, I have a bunch of tables on my local Django project. I set up the 
project on my production server and ran `manage.py migrate`. That set up 
the tables, but now I want to move the rows from my local tables to the 
ones on the production server. Both local and production server use 
Postgres. Is there a Django way to move the table data to production?

-- 
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/f65cd8eb-6399-4ee7-8830-84b19ea9b689%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Trying to understand two messages from `manage.py check --deploy`

2018-04-23 Thread Tom Tanner
I get these two messages after running `python manage.py check --deploy`

?: (security.W001) You do not have 
'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE_CLASSES 
so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, 
SECURE_BROWSER_XSS_FILTER, and SECURE_SSL_REDIRECT settings will have no 
effect.
?: (security.W019) You have 
'django.middleware.clickjacking.XFrameOptionsMiddleware' in your 
MIDDLEWARE_CLASSES, but X_FRAME_OPTIONS is not set to 'DENY'. The default 
is 'SAMEORIGIN', but unless there is a good reason for your site to serve 
other parts of itself in a frame, you should change it to 'DENY'.

I do not understand what each of them mean or if I should be worried. Can 
anyone translate these to plain English?

-- 
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/1c0b2ca2-644c-4eac-9494-d3239e22f220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Updating reCaptcha (widget) in django-based OSQA

2018-04-23 Thread DougN
Hi Melvyn -

Same. Could you include the URL to the repository of the captcha 
> implementation you're using? I've looked at 2 now and neither of them have 
> the 
> code you posted. 
>

I did a little write up with a .zip file of the code at the end here:

https://www.poweradmin.com/blog/updating-django-osqa-to-use-recaptcha-2/

I hope it's helpful.

Doug 

-- 
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/350c5aad-c2a7-42d7-b808-6a3da2154d85%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: if statement for development/production mode in templates?

2018-04-23 Thread Alexander Joseph
I found the answer here.
https://stackoverflow.com/questions/1271631/how-to-check-the-template-debug-flag-in-a-django-template
 Thanks

On Monday, April 23, 2018 at 8:04:02 AM UTC-6, larry@gmail.com wrote:
>
> Somewhere in the code is a place where data is passed to the template. 
> Did you write the app? 
>
> On Mon, Apr 23, 2018 at 9:55 AM, Alexander Joseph 
>  wrote: 
> > I dont know what that means 
> > 
> > On Monday, April 23, 2018 at 7:49:25 AM UTC-6, larry@gmail.com 
> wrote: 
> >> 
> >> On Mon, Apr 23, 2018 at 9:34 AM, Alexander Joseph 
> >>  wrote: 
> >> > Hello, is there a way to make an if statement that is based on 
> whether 
> >> > you 
> >> > are running in development mode or production mode? Or based on which 
> >> > settings file you are using? 
> >> > 
> >> > My app allows users to login with their office365 account instead of 
> >> > with 
> >> > django allauth and I'd like to only give them that option, however I 
> do 
> >> > need 
> >> > to login with allauth while developing because the settings for 
> logging 
> >> > in 
> >> > to Office365 dont work with a development server. So I'd like to 
> display 
> >> > the 
> >> > allauth login form and allow the user to login if it is in 
> development 
> >> > mode, 
> >> > otherwise I'd only like to display the Office365 login. 
> >> 
> >> Just pass in something in the context from the server to the template 
> >> and test that. 
> > 
> > -- 
> > 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/5aae6def-df66-40a1-90cc-733b2afa22b1%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/32bd1f8a-c865-4e34-830e-883d5fcc8591%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: if statement for development/production mode in templates?

2018-04-23 Thread Larry Martell
Somewhere in the code is a place where data is passed to the template.
Did you write the app?

On Mon, Apr 23, 2018 at 9:55 AM, Alexander Joseph
 wrote:
> I dont know what that means
>
> On Monday, April 23, 2018 at 7:49:25 AM UTC-6, larry@gmail.com wrote:
>>
>> On Mon, Apr 23, 2018 at 9:34 AM, Alexander Joseph
>>  wrote:
>> > Hello, is there a way to make an if statement that is based on whether
>> > you
>> > are running in development mode or production mode? Or based on which
>> > settings file you are using?
>> >
>> > My app allows users to login with their office365 account instead of
>> > with
>> > django allauth and I'd like to only give them that option, however I do
>> > need
>> > to login with allauth while developing because the settings for logging
>> > in
>> > to Office365 dont work with a development server. So I'd like to display
>> > the
>> > allauth login form and allow the user to login if it is in development
>> > mode,
>> > otherwise I'd only like to display the Office365 login.
>>
>> Just pass in something in the context from the server to the template
>> and test that.
>
> --
> 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/5aae6def-df66-40a1-90cc-733b2afa22b1%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/CACwCsY4ykA0BHtP_PbfzQ%3DrsYYLHg3U_562C2Nn0qt%2B0U8DXhw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: if statement for development/production mode in templates?

2018-04-23 Thread Julio Biason
You could, on your views, get the DEBUG setting (using django.conf) and pass it 
to the templates, as you do with all other variable.


From: django-users@googlegroups.com  on behalf 
of Alexander Joseph 
Sent: Monday, April 23, 2018 10:55:52 AM
To: Django users
Subject: Re: if statement for development/production mode in templates?

I dont know what that means

On Monday, April 23, 2018 at 7:49:25 AM UTC-6, larry@gmail.com wrote:
On Mon, Apr 23, 2018 at 9:34 AM, Alexander Joseph
 wrote:
> Hello, is there a way to make an if statement that is based on whether you
> are running in development mode or production mode? Or based on which
> settings file you are using?
>
> My app allows users to login with their office365 account instead of with
> django allauth and I'd like to only give them that option, however I do need
> to login with allauth while developing because the settings for logging in
> to Office365 dont work with a development server. So I'd like to display the
> allauth login form and allow the user to login if it is in development mode,
> otherwise I'd only like to display the Office365 login.

Just pass in something in the context from the server to the template
and test that.

--
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/5aae6def-df66-40a1-90cc-733b2afa22b1%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/DM5PR18MB14191215E1DA33E55F88F380AE890%40DM5PR18MB1419.namprd18.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


Re: if statement for development/production mode in templates?

2018-04-23 Thread Alexander Joseph
I dont know what that means

On Monday, April 23, 2018 at 7:49:25 AM UTC-6, larry@gmail.com wrote:
>
> On Mon, Apr 23, 2018 at 9:34 AM, Alexander Joseph 
>  wrote: 
> > Hello, is there a way to make an if statement that is based on whether 
> you 
> > are running in development mode or production mode? Or based on which 
> > settings file you are using? 
> > 
> > My app allows users to login with their office365 account instead of 
> with 
> > django allauth and I'd like to only give them that option, however I do 
> need 
> > to login with allauth while developing because the settings for logging 
> in 
> > to Office365 dont work with a development server. So I'd like to display 
> the 
> > allauth login form and allow the user to login if it is in development 
> mode, 
> > otherwise I'd only like to display the Office365 login. 
>
> Just pass in something in the context from the server to the template 
> and test that. 
>

-- 
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/5aae6def-df66-40a1-90cc-733b2afa22b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: if statement for development/production mode in templates?

2018-04-23 Thread Larry Martell
On Mon, Apr 23, 2018 at 9:34 AM, Alexander Joseph
 wrote:
> Hello, is there a way to make an if statement that is based on whether you
> are running in development mode or production mode? Or based on which
> settings file you are using?
>
> My app allows users to login with their office365 account instead of with
> django allauth and I'd like to only give them that option, however I do need
> to login with allauth while developing because the settings for logging in
> to Office365 dont work with a development server. So I'd like to display the
> allauth login form and allow the user to login if it is in development mode,
> otherwise I'd only like to display the Office365 login.

Just pass in something in the context from the server to the template
and test that.

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


if statement for development/production mode in templates?

2018-04-23 Thread Alexander Joseph
Hello, is there a way to make an if statement that is based on whether you 
are running in development mode or production mode? Or based on which 
settings file you are using?

My app allows users to login with their office365 account instead of with 
django allauth and I'd like to only give them that option, however I do 
need to login with allauth while developing because the settings for 
logging in to Office365 dont work with a development server. So I'd like to 
display the allauth login form and allow the user to login if it is in 
development mode, otherwise I'd only like to display the Office365 login.

Thanks

-- 
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/e2977d30-9f7c-48d9-981e-abc66800437e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: Cannot find template files for 1.11

2018-04-23 Thread Matthew Pava
Actually, I just use this construct:
'DIRS': [
# insert your TEMPLATE_DIRS here
os.path.join(BASE_DIR, 'project_name', 'templates'),
],


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of John Wilkinson
Sent: Monday, April 23, 2018 7:47 AM
To: Django users
Subject: Cannot find template files for 1.11

I am having trouble setting up django to find my template file I have created.

The settings.py has, among other sections, the following:


INSTALLED_APPS = [
'designer.apps.DesignerConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': 
["/home/john/git/primaryWindingsCalculator/windingCalculator/designer/template"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

If I take the entry out of the DIRS array, django won't be able to find my 
template file, I have put in a directory:

designer/template/designer/

I thought that if my app was in the INSTALLED_APPS list, then it would look in 
there dor my templates, and in
designer/static/designer/

for all static files, that it can't find also by the way.

Any help much appreciated.

Many thanks,
John.
--
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/f86815a6-9d73-4ede-a65d-f6c62919e8eb%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/ef4cb7c15a2045a3b1ba3c44d3c76922%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


RE: Cannot find template files for 1.11

2018-04-23 Thread Matthew Pava
DIRS does not have the path that you indicated it has.  Try changing it.
DIRS = ['designer/template/designer/']


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of John Wilkinson
Sent: Monday, April 23, 2018 7:47 AM
To: Django users
Subject: Cannot find template files for 1.11

I am having trouble setting up django to find my template file I have created.

The settings.py has, among other sections, the following:


INSTALLED_APPS = [
'designer.apps.DesignerConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': 
["/home/john/git/primaryWindingsCalculator/windingCalculator/designer/template"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

If I take the entry out of the DIRS array, django won't be able to find my 
template file, I have put in a directory:

designer/template/designer/

I thought that if my app was in the INSTALLED_APPS list, then it would look in 
there dor my templates, and in
designer/static/designer/

for all static files, that it can't find also by the way.

Any help much appreciated.

Many thanks,
John.
--
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/f86815a6-9d73-4ede-a65d-f6c62919e8eb%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/0c94e784ecb34622acfc144c397afedd%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Cannot find template files for 1.11

2018-04-23 Thread John Wilkinson
I am having trouble setting up django to find my template file I have 
created.

The settings.py has, among other sections, the following:


INSTALLED_APPS = [
'designer.apps.DesignerConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]


TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': 
["/home/john/git/primaryWindingsCalculator/windingCalculator/designer/template"],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

If I take the entry out of the DIRS array, django won't be able to find my 
template file, I have put in a directory:

designer/template/designer/

I thought that if my app was in the INSTALLED_APPS list, then it would look 
in there dor my templates, and in 
designer/static/designer/

for all static files, that it can't find also by the way.

Any help much appreciated.

Many thanks,
John.

-- 
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/f86815a6-9d73-4ede-a65d-f6c62919e8eb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


RE: django.db.migrations.exceptions.NodeNotFoundError while upgrading django

2018-04-23 Thread Matthew Pava
Did you try running makemigrations first?

./manage.py makemigrations

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Akhi
Sent: Monday, April 23, 2018 1:38 AM
To: Django users
Subject: django.db.migrations.exceptions.NodeNotFoundError while upgrading 
django

I am upgrading my django project from django1.5 to django1.11.10. while 
upgrading when I run ./manange.py migrate I am getting 
django.db.migrations.exceptions.NodeNotFoundError

django.db.migrations.exceptions.NodeNotFoundError: Migration 
account.0004_auto_20180419_1309 dependencies reference nonexistent parent node 
(u'admin', 
u'0003_advertisements_alignedcourses_api_integration_appreciation_certificate_company_company_types_contrib')


I could not find any migration files from my project and I followed some of the 
solution which I found in internet.

django.db.migrations.exceptions.NodeNotFoundError Migration authentication 
nonexistent parent 
node

Can't get rid of "nonexistent parent node" in django 
1.11

I reinstalled django.Deleted all .pyc files. deleted all migrations files. 
Still I am getting the same error.Please help me and can you please explain why 
it is happening?

I have attached my project structure.

[https://lh3.googleusercontent.com/-T8myMeiuk7E/Wt1-7clrS6I/FMA/H4HvwfJCjjYrBgJbXOpuduuuIZ0r1q2gACLcBGAs/s1600/Untitled%2BDiagram.jpg]





admin/apps.py



class AdminConfig(AppConfig):

name = 'apps.admin'

label = 'admin_app'

account/apps.py

class AccountConfig(AppConfig):
name = 'account'
label = 'account_app'

and I have mentioned meta properties for all the admin app models.

class Meta:
'''
Meta properties for this model
'''
app_label = 'admin_app'




--
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/0d5e63a8-0281-4e53-ab18-8f56030b2787%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/be2f4ffa5fe245ad8217483b00c4f68c%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: ImageSlider in Django

2018-04-23 Thread deviya sweety
yes I did.. here is the error:
Traceback (most recent call last):
File "C:\Users\hp\ENV\lib\site-packages\django\core\handlers\exception.py", 
line 41, in inner
response = get_response(request)
File "C:\Users\hp\ENV\lib\site-packages\django\core\handlers\base.py", line 
217, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\hp\ENV\lib\site-packages\django\core\handlers\base.py", line 
215, in _get_response
response = response.render()
File "C:\Users\hp\ENV\lib\site-packages\django\template\response.py", line 
107, in render
self.content = self.rendered_content
File "C:\Users\hp\ENV\lib\site-packages\django\template\response.py", line 
82, in rendered_content
template = self.resolve_template(self.template_name)
File "C:\Users\hp\ENV\lib\site-packages\django\template\response.py", line 
66, in resolve_template
return get_template(template, using=self.using)
File "C:\Users\hp\ENV\lib\site-packages\django\template\loader.py", line 
25, in get_template
raise TemplateDoesNotExist(template_name, chain=chain)
django.template.exceptions.TemplateDoesNotExist: admin/hvad/change_form.html

-- 
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/67b2cd0c-a8a9-4244-88bb-df27bbcc9b4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I know this question has been asked before, but I haven't found an answer that solves my situation. I'm looking at the Django tutorial, and I've set up the first URLs exactly as the tutorial has i

2018-04-23 Thread Emma Amechu
Hi Vikram,

Am also a few days new into Django but if you are using Python 3, then I
suggest you try without the regular expressions. Update your URLs to the
below and try loading your sites.

polls/urls.py

from django.conf.urls import url
from . import views
urlpatterns = [
url('', views.index, name='index'),]


mysite/urls.py

from django.contrib import adminfrom django.conf.urls import include, url
urlpatterns = [
url('', include('polls.urls')),
url('admin', admin.site.urls),]

Regards
Emma

On 22 April 2018 at 22:10,  wrote:

>  I have made few changes take a look at it and try this one. I hope this
> will work.
>
> On Sunday, April 22, 2018 at 10:53:58 PM UTC+5:30, Avitab Ayan Sarmah
> wrote:
>>
>> polls/views.py
>>
>> from django.http import HttpResponse
>>
>> def index(request):
>> return HttpResponse("Hello, world. You're at the polls index.")
>>
>>
>> polls/urls.py
>>
>> from django.conf.urls import url
>> from . import views
>> urlpatterns = [
>> url(r'^$', views.index, name='index'),]
>>
>>
>> mysite/urls.py
>>
>> from django.contrib import adminfrom django.conf.urls import include, url
>> urlpatterns = [
>> url(r'', include('polls.urls')),
>> url(r'^admin/', admin.site.urls),]
>>
>> --
> 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/fcc6b586-8ab1-4886-9e59-ba4a3d75c3aa%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/CAJO1krDRsHM-3LzS-Mb%3DmsQtMuoFwjKpFC4rCRyTGEtAa9cnKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Updating reCaptcha (widget) in django-based OSQA

2018-04-23 Thread Jani Tiainen
Hi,

I've been using following implementation:
https://github.com/praekelt/django-recaptcha
Which has similar code.


Currently I'm actually using invisible ReCaptcha which works just fine with
field.



On Sat, Apr 21, 2018 at 9:52 PM, Melvyn Sopacua 
wrote:

> On vrijdag 20 april 2018 16:17:05 CEST DougN wrote:
>
> > Thanks for any pointers.
>
> Same. Could you include the URL to the repository of the captcha
> implementation you're using? I've looked at 2 now and neither of them have
> the
> code you posted.
>
> --
> Melvyn Sopacua
>
> --
> 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/4794741.qnXsq2Tx5h%40fritzbook.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Jani Tiainen

- Well planned is half done, and a half done has been sufficient before...

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


Re: Crazy Idea: OOP for "Hyperlink"

2018-04-23 Thread Adrien Cossa

Hi,

On 04/23/2018 10:59 AM, guettli wrote:

I have a vague idea to use OOP for a hyperlink.

A hyperlink has these attributes for me:

- href
- verbose name
- Permission: Is the current user allowed to follow the link?
- Preview (on-mouse-over tooltip)


We have developed something similar in the company I work for. The use 
case is not exactly the same as yours, but we end up with some "Action" 
object that are similar to your "Hyperlink".


We have a mechanism based on mixins to define actions on our models, for 
example let's say "create child node". Now each action has some 
attributes telling what to display (e.g. "Create new child node") and 
what should happen when we click on it (e.g. POST to an URL). Now the 
interesting part is that we can also define some restrictions for every 
action (e.g. "forbid if user is not part of the manager group, or if a 
child already exist for the current object, or ... etc") and we have a 
serializer mixin that would automatically embed our actions information 
when serializing the model object.


It is then the frontend's job to display whatever you like (description 
or restriction) when the mouse is over, and to make the link clickable 
or not. If the user tries to trick us with a manual request, we will not 
allow the action because the view / model method execution is protected 
with the same restriction set.


That is to say, after having defined a list of actions in a model field, 
and a list of restriction for each action, we have a fully working 
action description and restriction mechanism to manipulate our objects. 
It looks a bit like this:


class X(ModelWithActionsMixin, Model):
    actions = [ Action(id="create_child", ..., 
restrictions=[Restriction(...), ...], ]


    @protect(action_id="create")
    def add_child(self):
    ...

or if you want to check the restrictions directly in your view instead 
of protecting the method:


class NodeCreateView(...):

    def post(self, ...):
    obj = self.get_object()
    try:
    protect_action(obj, "add_child")
    except ProtectedActionError as e:
    raise Error400(...)
    else:
    obj.add_child()


Maybe you can use some similar mechanism for your implementation?

PS: we are willing to make a proper package for our stuff and the idea 
behind would be to release it as free module, but I can't tell if that 
will really happen or when... but to see that you need something similar 
will probably push us :-)



I like Django because it handles the "href" part very smart (via 
reverse()).


My current use case is the preview tooltip.

The app I develop has roughly ten different report types.

I can't remember the name, but I can remember how the report looked like.

I recall the shape and colors of the report.

That's why I would like to have a on-mouse-over tooltip for the hyperlink.

For example look at these chart types: 
https://developers.google.com/chart/interactive/docs/gallery


The tooltip should show a small version of the report/chart if I move 
the mouse over the hyperlink.


I don't want to automate the creation of the preview images.  It is 
enough if I am able to attach a small HTML snippet to

each Django-URL. This HTML snippet should be used for the preview tooltip.

What do you think?

Regards,
  Thomas
--
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/c1df4a33-d077-42c4-8fd0-94902b4fad69%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/e8166c20-ba7a-6748-7c1f-4dfd3737e2e3%40init.at.
For more options, visit https://groups.google.com/d/optout.


Crazy Idea: OOP for "Hyperlink"

2018-04-23 Thread guettli
I have a vague idea to use OOP for a hyperlink.

A hyperlink has these attributes for me:

- href
- verbose name
- Permission: Is the current user allowed to follow the link?
- Preview (on-mouse-over tooltip)

I like Django because it handles the "href" part very smart (via reverse()).

My current use case is the preview tooltip.

The app I develop has roughly ten different report types.

I can't remember the name, but I can remember how the report looked like.

I recall the shape and colors of the report.

That's why I would like to have a on-mouse-over tooltip for the hyperlink.

For example look at these chart types: 
https://developers.google.com/chart/interactive/docs/gallery

The tooltip should show a small version of the report/chart if I move the 
mouse over the hyperlink.

I don't want to automate the creation of the preview images.  It is enough 
if I am able to attach a small HTML snippet to
each Django-URL. This HTML snippet should be used for the preview tooltip.

What do you think?

Regards,
  Thomas

-- 
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/c1df4a33-d077-42c4-8fd0-94902b4fad69%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django.db.migrations.exceptions.NodeNotFoundError while upgrading django

2018-04-23 Thread Akhi
I am upgrading my django project from django1.5 to django1.11.10. while 
upgrading when I run ./manange.py migrate I am getting 
django.db.migrations.exceptions.NodeNotFoundError

django.db.migrations.exceptions.NodeNotFoundError: Migration 
account.0004_auto_20180419_1309 dependencies reference nonexistent parent 
node (u'admin', 
u'0003_advertisements_alignedcourses_api_integration_appreciation_certificate_company_company_types_contrib')

I could not find any migration files from my project and I followed some of 
the solution which I found in internet.

django.db.migrations.exceptions.NodeNotFoundError Migration authentication 
nonexistent parent node 


Can't get rid of "nonexistent parent node" in django 1.11 


I reinstalled django.Deleted all .pyc files. deleted all migrations files. 
Still I am getting the same error.Please help me and can you please explain 
why it is happening?

I have attached my project structure.






admin/apps.py


class AdminConfig(AppConfig):

name = 'apps.admin'

label = 'admin_app'

account/apps.py

class AccountConfig(AppConfig):
name = 'account'
label = 'account_app'

and I have mentioned meta properties for all the admin app models.

class Meta:
'''
Meta properties for this model
'''
app_label = 'admin_app'




-- 
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/0d5e63a8-0281-4e53-ab18-8f56030b2787%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.