Re: Chart library for django

2017-03-05 Thread Lachlan Musicman
Hi Luvpreet,

There's nothing built into Django. Django is a web framework and charts are
outside of that. Django is written in Python and uses the standard web
technologies like HTML, CSS and JS.

You will need to find a charting package that can be used with any of those
and work out how you want it to plug in.

One option is to utilise the REST framework (
http://www.django-rest-framework.org/ ) to present data and use something
else to slurp in the results of that. Or ggplot or d3 as mentioned
previously.

But to answer your question, no, Django does not have a built in charting
package.

cheers
L.

--
The most dangerous phrase in the language is, "We've always done it this
way."

- Grace Hopper

On 6 March 2017 at 17:10, Luvpreet Singh  wrote:

>
> 
>
>
> 
> Hi everyone,
>
> I am looking for some solution to display django database queryset to
> django admin over graphs.
> I had used highcharts to do that earlier, but to use highcharts, I have to
> write too much scripts and functions.
>
> Is there any kind of inbuilt library that comes with django similar to
> highcharts by which I can display django database queryset in my django
> admin template ?
>
> Like in the picture above.
>
> --
> 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/814318bb-dddf-4a99-afce-e29bf22c434a%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/CAGBeqiNWwWoyssrZuK1%2Bco3BGYYN08DgxqkEpq2mMTdi2Mw69g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Chart library for django

2017-03-05 Thread Luvpreet Singh





Hi everyone,

I am looking for some solution to display django database queryset to 
django admin over graphs.
I had used highcharts to do that earlier, but to use highcharts, I have to 
write too much scripts and functions.

Is there any kind of inbuilt library that comes with django similar to 
highcharts by which I can display django database queryset in my django 
admin template ?

Like in the picture above.

-- 
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/814318bb-dddf-4a99-afce-e29bf22c434a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Andrew Godwin
If your channels get full it means your workers aren't draining the
channels fast enough - you should spin up more workers. At some point you
also need to increase the channel capacity as well to smooth out bumps, but
the channel capacity only needs to be about the same as the number of
requests per second - it's 100 by default.

Andrew

On Sun, Mar 5, 2017 at 5:17 PM, Lada B  wrote:

> I just tried to run workers in separate processes and it works great! it's
> awesome and it fails only because of redis channel memory being full. Dont
> know how to increase it tho.
>
> --
> 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/f5ca762c-b028-4445-827d-6746f02cd44c%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/CAFwN1uo62d9nFfSuxpCK5spqHBe%3DfjmoWO-%3Di0mRHXgoDoRyZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Lada B
I just tried to run workers in separate processes and it works great! it's 
awesome and it fails only because of redis channel memory being full. Dont 
know how to increase it tho.

-- 
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/f5ca762c-b028-4445-827d-6746f02cd44c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels vs serverless: how much they are alike

2017-03-05 Thread Виталик Абеткин
>From what I know serverless architectures use message queues and distribute 
tasks that handle various events to workers
pretty much in the same way django channels do. How much they are really 
alike? For instance, let's take openwhisk.org implementation

-- 
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/b9250070-386f-46e0-92d5-42809f6e6a3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do you populate an update form in a Bootstrap Modal?

2017-03-05 Thread Melvyn Sopacua
On Sunday 05 March 2017 13:40:44 Michael Chenetz wrote:
> Thanks Melvyn... I am not having issues with a generic update form.

The important stuff is in the last line. I was explaining how you can do it and 
where to 
look for inspiration.

> The problem is when using it in a Bootstrap Modal. I think it is a
> javascript/ajax issue. That is the piece I need to figure out.

That depends on your workflow. You can fill the form using an Ajax call, yes. 
But - you 
don't have to.[1]

The above is part of code I'm working on. I am actually working on handling 
duplicated 
form media in the AdditionalFormsManager, so it certainly isn't production 
quality yet - 
but it will work just fine for illustration purposes or base for your own code.

-- 
Melvyn Sopacua


[1] https://gist.github.com/melvyn-sopacua/2e848fa5b8be0f53c2a5267ba68d570e

-- 
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/3619047.4YTYs12qbr%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Lada B
Also i havent tried running workers in separate processes

Is the client and server running on the same computer?
No

And i just realized that expiry=5 is wrong because it disconnects users. 
Thats why it feels "better" now :D

-- 
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/bb9a233c-920d-458b-8e01-5d67d608fe7b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Lada B
im using asgi_redis, and somehow it's better since i changed settings to:

channel_layer = RedisChannelLayer(
capacity=1000,
expiry=5,
)

but i still dont have idea whats correct. I would like to explain what im 
trying to achiev. I have website for matchmaking of dota 2 lobby games. 
When 10 players are finding match, ready check is sent and when everyone is 
ready then Steam bot starts and hosts the game...Bot must run entire time 
when players are playing so it needs one worker for each game played...Its 
why i cannot have only 2 workers or so i guess...because when there is more 
than one game workers are busy.

Dne neděle 5. března 2017 20:14:55 UTC+1 Andrew Godwin napsal(a):
>
> Python threads are not that great at sharing I/O - I'd recommend you run 
> at most one or two per physical CPU core in your machine. 500 is just going 
> to suffocate Python in context switching.
>
> We have loadtests that definitely got above 10 messages a second - what 
> ASGI backend are you using? What size messages are you sending? Have you 
> tried running workers in separate processes?
>
> Andrew
>
> On Sun, Mar 5, 2017 at 5:26 AM, Avraham Serour  > wrote:
>
>> I don't think you need 500 workers, the number of workers depends on how 
>> long will message will take to be processed not the number of concurrent 
>> connections.
>>
>> The worker job is to get a message and send to a bunch of clients, the 
>> ASGI server, meaning the process actually holding the websocket, in your 
>> case daphne, will actually upload the data.
>>
>> Is the client and server running on the same computer?
>>
>> Don't stress test your server manually, you should write a script to do 
>> it.
>>
>> On Sun, Mar 5, 2017 at 1:28 PM, Lada B > 
>> wrote:
>>
>>> HW performance with 1 user sending message every 100ms: 
>>> https://i.imgur.com/5F4mKAI.png
>>>
>>>
>>> Yesterday i tried to use it in production and when there were 15 clients 
>>> connected (each one pinging server every 2 seconds) nobody else could 
>>> connect.
>>>
>>> I have default settings and I followed Getting started tutorial.
>>>
>>> -- 
>>> 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/d86b1eb9-3492-48bc-9460-365571585db5%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CAFWa6tJV-dX26xobzahdy1H3WA054WhSfc3Nyb5HvRenmMbbbw%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/52f035e1-04d1-46e0-b25b-ab6c77a36e97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do you populate an update form in a Bootstrap Modal?

2017-03-05 Thread Michael Chenetz
Thanks Melvyn... I am not having issues with a generic update form. The 
problem is when using it in a Bootstrap Modal. I think it is a 
javascript/ajax issue. That is the piece I need to figure out.

Mike

On Sunday, March 5, 2017 at 10:48:22 AM UTC-5, Melvyn Sopacua wrote:
>
> Hi Michael,
>
>  
>
> Disclaimer: leaving the Javascript side of things out of scope.
>
>  
>
> On Friday 03 March 2017 12:07:16 Michael Chenetz wrote:
>
> > I am trying to figure out how to populate the update model form in a
>
> > Bootstrap Modal. I can add to a form no problem but update does not
>
> > seem to pre-populate the form when it is viewed.
>
>  
>
> Look at how ModelFormMixin 
> 
>  
> does it:
>
>1. get_content_data from FormMixin calls get_form() 
>2. this gets the form class and calls get_form_kwargs() 
>3. ModelFormMixin injects the 'instance' keyword argument for the 
>ModelForm
>
> So, in order to prepopulate the form in the modal you need to provide the 
> instance argument and assign it the model instance. I assume you know what 
> model instance you need to update.
>
> -- 
>
> 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/2c0e07f3-bed2-425d-a3b2-ed6e16863c34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Andrew Godwin
Python threads are not that great at sharing I/O - I'd recommend you run at
most one or two per physical CPU core in your machine. 500 is just going to
suffocate Python in context switching.

We have loadtests that definitely got above 10 messages a second - what
ASGI backend are you using? What size messages are you sending? Have you
tried running workers in separate processes?

Andrew

On Sun, Mar 5, 2017 at 5:26 AM, Avraham Serour  wrote:

> I don't think you need 500 workers, the number of workers depends on how
> long will message will take to be processed not the number of concurrent
> connections.
>
> The worker job is to get a message and send to a bunch of clients, the
> ASGI server, meaning the process actually holding the websocket, in your
> case daphne, will actually upload the data.
>
> Is the client and server running on the same computer?
>
> Don't stress test your server manually, you should write a script to do it.
>
> On Sun, Mar 5, 2017 at 1:28 PM, Lada B  wrote:
>
>> HW performance with 1 user sending message every 100ms:
>> https://i.imgur.com/5F4mKAI.png
>>
>>
>> Yesterday i tried to use it in production and when there were 15 clients
>> connected (each one pinging server every 2 seconds) nobody else could
>> connect.
>>
>> I have default settings and I followed Getting started tutorial.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/django-users/d86b1eb9-3492-48bc-9460-365571585db5%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/CAFWa6tJV-dX26xobzahdy1H3WA054WhSfc3Nyb5
> HvRenmMbbbw%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/CAFwN1uqOQ_Mu%3D5GqNedpRW2bJ6udjBH5BCUb2QJx2Kh3yNA%3DKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: new to Django

2017-03-05 Thread ludovic coues
If you haven't done so, you should do the django tutorial. It will
give you a good view of what is available to django user.

Then there is a few page in the documentation about contributing.
https://docs.djangoproject.com/en/dev/internals/contributing/

What you'll need to learn depend on what aspect of django you want to
contribute to. But networking and GUI shouldn't be needed beyond some
basic knowledge. Django is a framework for building the server side of
web application. It provide really few GUI components and the
networking stuff is delegated to real webserver like nginx.

2017-03-05 18:10 GMT+01:00 jayant jain :
> Hi all users,
> I am a new user of Django
> with a basic knowledge of  Python language .Please recommend me what more to
> learn to start contributing to Django and how to start contributing.
> Example if i do need to know about networking, GUI ,etc.
>
> --
> 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/c749c6ac-ceca-44f6-9457-d6b045fdf924%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

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


new to Django

2017-03-05 Thread jayant jain
Hi all users,
I am a new user of* Django*
with a basic knowledge of * Python* language .Please recommend *me what 
more to learn* to start contributing to Django and how to 
*start contributing.Example if *i do need to know about networking, GUI 
,etc.

-- 
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/c749c6ac-ceca-44f6-9457-d6b045fdf924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do you populate an update form in a Bootstrap Modal?

2017-03-05 Thread Melvyn Sopacua
Hi Michael,

Disclaimer: leaving the Javascript side of things out of scope.

On Friday 03 March 2017 12:07:16 Michael Chenetz wrote:
> I am trying to figure out how to populate the update model form in a
> Bootstrap Modal. I can add to a form no problem but update does not
> seem to pre-populate the form when it is viewed.

Look at how ModelFormMixin[1] does it:
 1. get_content_data from FormMixin calls get_form()
 2. this gets the form class and calls get_form_kwargs()
 3. ModelFormMixin injects the 'instance' keyword argument for the ModelForm
So, in order to prepopulate the form in the modal you need to provide the 
instance 
argument and assign it the model instance. I assume you know what model 
instance 
you need to update.
-- 
Melvyn Sopacua


[1] 
https://ccbv.co.uk/projects/Django/1.10/django.views.generic.edit/ModelFormMixin/

-- 
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/2169415.EA0TWpXO2k%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread Melvyn Sopacua
On Friday 03 March 2017 20:37:29 Tom Tanner wrote:
> When the iframe requests
> `/interactive`, it loads `interactive-1/index.html`.

But the iframe still loads /interactive. So it's base url is /interactive and a 
request for scripts/main.js is /interactive/scripts/main.js.

Unless you either:
1/ Do a redirect, which is the simplest
2/ Request your resources incorporating the session id

I still would go for 1/, simply because that fixes the disconnect between 
template path / view path and requested url.
-- 
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/1534032.trWzQqoBk9%40devstation.
For more options, visit https://groups.google.com/d/optout.


Re: Writing your first Django app, part 4

2017-03-05 Thread ludovic coues
You didn't share your code, so all we can do is guess.
My guess is that your poll don't have any answer so there is nothing to render.

Try using this form:

{{ question.question_text }}

{% if error_message %}{{ error_message }}{% endif %}


{% csrf_token %}
{% for choice in question.choice_set.all %}

{{ choice.choice_text
}}
{% else %}
There is no choice for this question! Add one in the admin.
{% endfor %}



2017-03-05 15:10 GMT+01:00  :
> I'm in the process of learning Django and working throught the tutorial,
> Writing your first Django app. I'm getting stuck on part 4.  The form n
> detail.html doesn't display radio buttons.  Thus there is nothing to select
> and when I submit the form, I get the message, "You didn't select a choice."
>
> Thoughts?
>
> Thanks,
> Phil
>
> --
> 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/1ccefa6a-4a5a-46bd-8b21-139349da8782%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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/CAEuG%2BTb4PqXR59J9KXxHvE0nLfeVhV8zfGag-MyH3k-0mRtmiw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello I am new to django

2017-03-05 Thread ludovic coues
Sorry, I forget to mention it is to replace email =
models.OneToOneField in UserProfile. Or more exactly, add the
related_name argument to the email field.

2017-03-05 11:51 GMT+01:00 sarfaraz ahmed :
> Where to include
> models.OneToOneField(CustomUser, related_name='profile')
>
> I tried including this in customuser model it does not understand.
>
>
>
> On 5 March 2017 at 14:24, ludovic coues  wrote:
>>
>> You should look at the related_name argument of relationship. Using
>> `models.OneToOneField(CustomUser, related_name='profile')` will add a
>> profile property to your custom user object.
>>
>> Then your function became something like that :
>>
>> def get_full_name(self):
>> full_name = '%s %s' %(self.profile.first_name,
>> self.profile.last_name)
>> return full_name.strip()
>>
>> Don't forget to write some test and to take into account what happens if
>> you user have no UserProfile associated
>>
>> On 5 Mar 2017 1:09 a.m., "sarfaraz ahmed"  wrote:
>>
>> I am trying to create custom user authentication using abstractbaseuser.
>> All worked fine. but I wanted to move first_name and last_name to other
>> models
>>
>>
>> from django.db import models
>> from django.contrib.auth.models import
>> AbstractBaseUser,BaseUserManager,PermissionsMixin
>> from django.core.mail import send_mail
>> from django.utils.translation import ugettext_lazy as _
>> #now=time.strftime('%Y-%M-%D %H:%m:%S.%u%Z')
>> import datetime
>> from datetime import timedelta
>>
>> from django.utils import timezone
>>
>> tomorrow = datetime.date.today() + timedelta(days=1)
>>
>> class CustomUserManager(BaseUserManager):
>> def _create_user(self,email,password,is_staff,is_superuser,
>> **extra_fields):
>>
>> if not email:
>> raise ValueError('The given email must be set')
>>
>> email=self.normalize_email(email)
>> user= self.model(email=email,
>>  is_staff=is_staff,
>>  is_active = True,
>>  is_superuser =is_superuser,
>>  last_login=timezone.now(),
>>  date_joined=timezone.now(),
>> **extra_fields)
>> user.set_password(password)
>> user.save(using=self._db)
>> return user
>>
>> def create_user(self, email,password=None,**extra_fields):
>> return
>> self._create_user(email,password,False,False,**extra_fields)
>>
>> def create_superuser(self, email,password,**extra_fields):
>> return self._create_user(email,password,True,True,**extra_fields)
>>
>> class CustomUser(AbstractBaseUser,PermissionsMixin):
>> username =models.CharField(max_length =256, unique = True,blank =
>> True,null= True)
>> email =models.EmailField(blank=False, unique =True)
>> date_joined  = models.DateTimeField(_('date joined'),
>> default=timezone.now())
>> is_active= models.BooleanField(default=True)
>> is_admin = models.BooleanField(default=False)
>> is_staff = models.BooleanField(default=False)
>> is_superuser = models.BooleanField(default=False)
>>
>> USERNAME_FIELD ='email'
>> REQUIRED_FIELD =['user_name','date_joined']
>>
>> objects=CustomUserManager()
>>
>> class Meta:
>> verbose_name=_('user')
>> verbose_name_plural=_('users')
>>
>> def get_absolute_url(self):
>> return "/user/%s" %urlquote(self.email)
>>
>> def get_full_name(self):
>>
>> #a=UserProfile.objects.get(id=id)
>> #self.first_name=a.first_name
>> #self.last_name= a.last_name
>> full_name = '%s %s' %(self.first_name,self.last_name)
>> return full_name.strip()
>>
>> def get_short_name(self):
>> self.first_name='a'
>> return self.first_name
>>
>> def email_user(self,subject,message,from_email=None):
>> send_mail(subject,message,from_email,[self.email])
>>
>>
>> #code
>>
>> class UserProfile(models.Model):
>>
>> email = models.OneToOneField(CustomUser)
>> first_name=models.CharField(max_length =256, blank = True)
>> last_name=models.CharField(max_length =256, blank = True)
>> activation_key = models.CharField(max_length=40,blank=True)
>> gender = models.CharField(max_length=6, choices=(
>> ('male', 'Male'),
>> ('female', 'Female'),))
>> date_of_birth=models.DateField(null=True)
>> key_expires = models.DateTimeField(default=timezone.now())
>>
>> def __str__(self):
>> full_name = '%s %s' %(self.first_name,self.last_name)
>> return full_name
>>
>> class Meta:
>> verbose_name=u'User profile'
>> verbose_name_plural=u'User profiles'
>>
>>
>> class UserAddress(models.Model):
>> address_contact=models.CharField(max_length=300,blank=False)
>> address_line1=models.CharField(max_length=300,blank=False)
>> address_line2=models.CharField(max_length=300,blank=True)
>> land_mark=models.CharField(max_length=100,b

Writing your first Django app, part 4

2017-03-05 Thread friscosoftware
I'm in the process of learning Django and working throught the tutorial, 
Writing 
your first Django app . I'm 
getting stuck on part 4.  The form n detail.html doesn't display radio 
buttons.  Thus there is nothing to select and when I submit the form, I get 
the message, "You didn't select a choice."

Thoughts?

Thanks,
Phil

-- 
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/1ccefa6a-4a5a-46bd-8b21-139349da8782%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to unsubscribe?

2017-03-05 Thread Andréas Kühne
It's managed by google groups. Go your google groups settings and remove
you subscription there.

Regards,

Andréas

2017-03-05 8:17 GMT+01:00 Marco Miani :

> Hi.
>
> can anyone please explain how I get off this list?
>
> I have tried to click the link at the jottom of this mail, where it says
> 'unsubscribe' but the reply i got was that I couldnt be unsubscribe because
> myemail address would not belong to the list (unknown).
>
> Who is the owner of this list? who is administrating it?
>
> Thank you
> Marco
>
> --
> 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/3ku3an01ei15yrg8lg2c4h7t.1488698229355%40email.android.
> 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/CAK4qSCe9k5qzPQKGMAH_bDQi2Q8PvedVu70Dcj_ozDH8Gb8%2B1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: can i use the listview which the django-admin used im my tempate

2017-03-05 Thread Andréas Kühne
Hi,

I don't really understand what you mean, but there is a ListView in the
generic views package. To use that all you really need to do is to tell the
listview class what model you are using. For example:

class UserList(ListView):
model = User

You can see the information about the view here :
https://docs.djangoproject.com/en/1.10/ref/class-based-views/generic-display/#listview

Regards,

Andréas

2017-03-05 9:46 GMT+01:00 刘夏 :

> can i use the listview which the django-admin used im my tempate?
>
>
>
> 发自我的小米手机
>
> --
> 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/1r8nrgiuljvspqcct5jrkv0g.1488703561559%40email.android.
> 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/CAK4qSCeRzqt4DgdB7mXPcXjmM_x5b6i_myb1OviHXhCcMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Avraham Serour
I don't think you need 500 workers, the number of workers depends on how
long will message will take to be processed not the number of concurrent
connections.

The worker job is to get a message and send to a bunch of clients, the ASGI
server, meaning the process actually holding the websocket, in your case
daphne, will actually upload the data.

Is the client and server running on the same computer?

Don't stress test your server manually, you should write a script to do it.

On Sun, Mar 5, 2017 at 1:28 PM, Lada B  wrote:

> HW performance with 1 user sending message every 100ms:
> https://i.imgur.com/5F4mKAI.png
>
>
> Yesterday i tried to use it in production and when there were 15 clients
> connected (each one pinging server every 2 seconds) nobody else could
> connect.
>
> I have default settings and I followed Getting started tutorial.
>
> --
> 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/d86b1eb9-3492-48bc-9460-365571585db5%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/CAFWa6tJV-dX26xobzahdy1H3WA054WhSfc3Nyb5HvRenmMbbbw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Having trouble with Django tutorial

2017-03-05 Thread Yves S. Garret
Yes, that did it.  I placed the file into learning_python/learning_python and 
everything just worked.

Thank you

-- 
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/87d03d8e-7652-4abc-9ef8-713685f874c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Channels - slow with limited number of connections

2017-03-05 Thread Lada B


HW performance with 1 user sending message every 100ms: 
https://i.imgur.com/5F4mKAI.png


Yesterday i tried to use it in production and when there were 15 clients 
connected (each one pinging server every 2 seconds) nobody else could 
connect.

I have default settings and I followed Getting started tutorial.

-- 
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/d86b1eb9-3492-48bc-9460-365571585db5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello I am new to django

2017-03-05 Thread sarfaraz ahmed
Where to include
models.OneToOneField(CustomUser, related_name='profile')

I tried including this in customuser model it does not understand.



On 5 March 2017 at 14:24, ludovic coues  wrote:

> You should look at the related_name argument of relationship. Using `
> models.OneToOneField(CustomUser, related_name='profile')` will add a
> profile property to your custom user object.
>
> Then your function became something like that :
>
> def get_full_name(self):
> full_name = '%s %s' %(self.profile.first_name, self.profile.last_
> name)
> return full_name.strip()
>
> Don't forget to write some test and to take into account what happens if
> you user have no UserProfile associated
>
> On 5 Mar 2017 1:09 a.m., "sarfaraz ahmed"  wrote:
>
> I am trying to create custom user authentication using abstractbaseuser.
> All worked fine. but I wanted to move first_name and last_name to other
> models
>
>
> from django.db import models
> from django.contrib.auth.models import AbstractBaseUser,BaseUserManag
> er,PermissionsMixin
> from django.core.mail import send_mail
> from django.utils.translation import ugettext_lazy as _
> #now=time.strftime('%Y-%M-%D %H:%m:%S.%u%Z')
> import datetime
> from datetime import timedelta
>
> from django.utils import timezone
>
> tomorrow = datetime.date.today() + timedelta(days=1)
>
> class CustomUserManager(BaseUserManager):
> def _create_user(self,email,password,is_staff,is_superuser,
> **extra_fields):
>
> if not email:
> raise ValueError('The given email must be set')
>
> email=self.normalize_email(email)
> user= self.model(email=email,
>  is_staff=is_staff,
>  is_active = True,
>  is_superuser =is_superuser,
>  last_login=timezone.now(),
>  date_joined=timezone.now(),
> **extra_fields)
> user.set_password(password)
> user.save(using=self._db)
> return user
>
> def create_user(self, email,password=None,**extra_fields):
> return self._create_user(email,passwo
> rd,False,False,**extra_fields)
>
> def create_superuser(self, email,password,**extra_fields):
> return self._create_user(email,password,True,True,**extra_fields)
>
> class CustomUser(AbstractBaseUser,PermissionsMixin):
> username =models.CharField(max_length =256, unique = True,blank =
> True,null= True)
> email =models.EmailField(blank=False, unique =True)
> date_joined  = models.DateTimeField(_('date joined'),
> default=timezone.now())
> is_active= models.BooleanField(default=True)
> is_admin = models.BooleanField(default=False)
> is_staff = models.BooleanField(default=False)
> is_superuser = models.BooleanField(default=False)
>
> USERNAME_FIELD ='email'
> REQUIRED_FIELD =['user_name','date_joined']
>
> objects=CustomUserManager()
>
> class Meta:
> verbose_name=_('user')
> verbose_name_plural=_('users')
>
> def get_absolute_url(self):
> return "/user/%s" %urlquote(self.email)
>
> def get_full_name(self):
>
>
>
> *#a=UserProfile.objects.get(id=id)
> #self.first_name=a.first_name#self.last_name= a.last_name*
> full_name = '%s %s' %(self.first_name,self.last_name)
> return full_name.strip()
>
> def get_short_name(self):
> self.first_name='a'
> return self.first_name
>
> def email_user(self,subject,message,from_email=None):
> send_mail(subject,message,from_email,[self.email])
>
>
> #code
>
> class UserProfile(models.Model):
>
> email = models.OneToOneField(CustomUser)
> first_name=models.CharField(max_length =256, blank = True)
> last_name=models.CharField(max_length =256, blank = True)
> activation_key = models.CharField(max_length=40,blank=True)
> gender = models.CharField(max_length=6, choices=(
> ('male', 'Male'),
> ('female', 'Female'),))
> date_of_birth=models.DateField(null=True)
> key_expires = models.DateTimeField(default=timezone.now())
>
> def __str__(self):
> full_name = '%s %s' %(self.first_name,self.last_name)
> return full_name
>
> class Meta:
> verbose_name=u'User profile'
> verbose_name_plural=u'User profiles'
>
>
> class UserAddress(models.Model):
> address_contact=models.CharField(max_length=300,blank=False)
> address_line1=models.CharField(max_length=300,blank=False)
> address_line2=models.CharField(max_length=300,blank=True)
> land_mark=models.CharField(max_length=100,blank=False)
> city=models.CharField(max_length=140,blank=False)
> state=models.CharField(max_length=100,blank=False)
> pin_code = models.BigIntegerField()
> mobile_no=models.CharField(max_length=13,blank=True)
> last_shipped_flag=models.BooleanField(default=False)
> is_active_flag=models.BooleanField(default=True)
>  

can i use the listview which the django-admin used im my tempate

2017-03-05 Thread 刘夏
can i use the listview which the django-admin used im my tempate?



发自我的小米手机



-- 
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/1r8nrgiuljvspqcct5jrkv0g.1488703561559%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


templatetags for easy to edit content

2017-03-05 Thread John Wieland
Hi Everyone,

I've written a template tag that looks up an object and returns a field. 
For instance:
@register.simple_tag
def content(name):
return mark_safe(Content.objects.get(name=name).content)

These tags are used to make it easier to edit content on the site. I just 
need to add a {% content "about" %} to the template and modify the object 
in the admin console. The above is a simple example, there are some error 
messages displayed if the object is not found, but I'd like to do something 
else to make it easier to see what content needs to be written by iterating 
the templates to find where this tag has been used and creating the objects 
needed.

My idea was to monkey patch the templatetags to create the empty objects 
and then iterate over all the templates calling render_to_string() for 
each. The monkey patching would look something like this:
def create_content(name):
   if not Content.objects.filter(name=name).exists():
 content = Content()
 content.content = "Fill in %s" % name
 content.save()

   return ""

app.templatetags.content = create_content


Should this work? I haven't been able to get the 'create_content' function 
to execute when running my initialization script. I've also tried 
re-registering the tags with the same name.

Is there a better way to implement the functionality (either the editable 
content or the initialization process)?

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/1cbda48e-ab4f-42b6-8f1f-e7f8435e0fa9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Channels - slow with limited number of connections

2017-03-05 Thread Lada B
Hi, im using django-1.10 + channels + asgi_redis + daphne + uwsgi + nginx 
but i have problem with workers+daphne being slow. 

Im developing chat and I tried how fast its by holding ENTER button 
(spamming messages one after one and it doesn't even respond until i stop 
sending messages.

When i try to test performance (sending message to websocket every 10 ms) i 
get kicked after 5 seconds..when i try to do it every 100 ms, nobody else 
can connect. I checked CPU usage and when i set runworker --threads 500 
there is running like 250 threads of workers...when i set 10 threads then 
its like no way to use it

Am I doing something wrong? Why are workers so slow in processing of one 
websocket message that is empty string?

-- 
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/b022e088-cbd6-4d1d-9ae3-3051535c286a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to unsubscribe?

2017-03-05 Thread Marco Miani
Hi. 
can anyone please explain how I get off this list? 
I have tried to click the link at the jottom of this mail, where it says 
'unsubscribe' but the reply i got was that I couldnt be unsubscribe because 
myemail address would not belong to the list (unknown).
Who is the owner of this list? who is administrating it? 
Thank youMarco 


-- 
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/3ku3an01ei15yrg8lg2c4h7t.1488698229355%40email.android.com.
For more options, visit https://groups.google.com/d/optout.


Re: Hello I am new to django

2017-03-05 Thread ludovic coues
You should look at the related_name argument of relationship. Using `
models.OneToOneField(CustomUser, related_name='profile')` will add a
profile property to your custom user object.

Then your function became something like that :

def get_full_name(self):
full_name = '%s %s' %(self.profile.first_name, self.profile.last_
name)
return full_name.strip()

Don't forget to write some test and to take into account what happens if
you user have no UserProfile associated

On 5 Mar 2017 1:09 a.m., "sarfaraz ahmed"  wrote:

I am trying to create custom user authentication using abstractbaseuser.
All worked fine. but I wanted to move first_name and last_name to other
models


from django.db import models
from django.contrib.auth.models import AbstractBaseUser,BaseUserManager,
PermissionsMixin
from django.core.mail import send_mail
from django.utils.translation import ugettext_lazy as _
#now=time.strftime('%Y-%M-%D %H:%m:%S.%u%Z')
import datetime
from datetime import timedelta

from django.utils import timezone

tomorrow = datetime.date.today() + timedelta(days=1)

class CustomUserManager(BaseUserManager):
def _create_user(self,email,password,is_staff,is_superuser,
**extra_fields):

if not email:
raise ValueError('The given email must be set')

email=self.normalize_email(email)
user= self.model(email=email,
 is_staff=is_staff,
 is_active = True,
 is_superuser =is_superuser,
 last_login=timezone.now(),
 date_joined=timezone.now(),
**extra_fields)
user.set_password(password)
user.save(using=self._db)
return user

def create_user(self, email,password=None,**extra_fields):
return self._create_user(email,password,False,False,**extra_fields)

def create_superuser(self, email,password,**extra_fields):
return self._create_user(email,password,True,True,**extra_fields)

class CustomUser(AbstractBaseUser,PermissionsMixin):
username =models.CharField(max_length =256, unique = True,blank =
True,null= True)
email =models.EmailField(blank=False, unique =True)
date_joined  = models.DateTimeField(_('date joined'),
default=timezone.now())
is_active= models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)
is_staff = models.BooleanField(default=False)
is_superuser = models.BooleanField(default=False)

USERNAME_FIELD ='email'
REQUIRED_FIELD =['user_name','date_joined']

objects=CustomUserManager()

class Meta:
verbose_name=_('user')
verbose_name_plural=_('users')

def get_absolute_url(self):
return "/user/%s" %urlquote(self.email)

def get_full_name(self):



*#a=UserProfile.objects.get(id=id)
#self.first_name=a.first_name#self.last_name= a.last_name*
full_name = '%s %s' %(self.first_name,self.last_name)
return full_name.strip()

def get_short_name(self):
self.first_name='a'
return self.first_name

def email_user(self,subject,message,from_email=None):
send_mail(subject,message,from_email,[self.email])


#code

class UserProfile(models.Model):

email = models.OneToOneField(CustomUser)
first_name=models.CharField(max_length =256, blank = True)
last_name=models.CharField(max_length =256, blank = True)
activation_key = models.CharField(max_length=40,blank=True)
gender = models.CharField(max_length=6, choices=(
('male', 'Male'),
('female', 'Female'),))
date_of_birth=models.DateField(null=True)
key_expires = models.DateTimeField(default=timezone.now())

def __str__(self):
full_name = '%s %s' %(self.first_name,self.last_name)
return full_name

class Meta:
verbose_name=u'User profile'
verbose_name_plural=u'User profiles'


class UserAddress(models.Model):
address_contact=models.CharField(max_length=300,blank=False)
address_line1=models.CharField(max_length=300,blank=False)
address_line2=models.CharField(max_length=300,blank=True)
land_mark=models.CharField(max_length=100,blank=False)
city=models.CharField(max_length=140,blank=False)
state=models.CharField(max_length=100,blank=False)
pin_code = models.BigIntegerField()
mobile_no=models.CharField(max_length=13,blank=True)
last_shipped_flag=models.BooleanField(default=False)
is_active_flag=models.BooleanField(default=True)
creation_date=models.DateTimeField(auto_now_add=True,editable=False)
updation_date=models.DateTimeField(auto_now=True,editable=False)
user=models.ForeignKey(UserProfile,default=0)

def __str__(self):
return self.address_contact


class Meta:
verbose_name=u'User Address'
verbose_name_plural=u'User Addresses'


Now get_full_name is part of customuser model where was first_name and
las

Re: Issue using django-admin

2017-03-05 Thread chris rose
if you are new to django you don't want to download the development 
edition, this is more for contributing

firstly you need pip.

secondly, do your self a huge favour and install virtualenv and read the 
getting started docs now rather than later

once you have made a virtualenv directory and made it your current 
directory, you with need to activate the environment.

run pip install django

you shouldn't have a problem from here running the relevant django commands

-- 
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/6786d674-d199-4f3a-8677-d9a96f568539%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Iframe'd page in Django template can't find it's Javascript or CSS files, 404 error

2017-03-05 Thread chris rose
there is a lack of information here, though you last post suggests maybe 
you missed a couple of template tags

at the start of you index.html add:

{% load staticfiles %}

and then when adding you scripts use:



-- 
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/a87d42ff-b73d-4c59-b384-e77a5a52971d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.