Tuesday, May 31, 2016

Re: passing url variables to views

Yeah

In your view you can access it by kwargs.get('user_del')



On Wed, 1 Jun 2016 at 02:33 dk <demiank@gmail.com> wrote:
and then i can use it in the view? as an argument?


On Tuesday, May 31, 2016 at 12:33:55 PM UTC-5, Akhil Lawrence wrote:
Hi,

The URL you are calling is wrong.. 


No need to pass it as an query parameter.




On Tuesday, 31 May 2016 15:03:59 UTC+5:30, dk wrote:
this is the URS i get


and i want to be able to get the string  ccc_ccc***a_b***

my url pattern is: 
url(r'^run_delete/(?P<user_del>\w+)/$', views.run_delete, name='run_delete')


but it looks like is not catching it,   i am missing something? i am using django 1.9

thanks guys

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/kTYP0d5btHI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@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/a864bc58-bc60-4863-bba8-85e2740f97ef%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+unsubscribe@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/CAJLQkkbsPqgpVWqi%2BdV4cg6OmhTbbJr--AvXtiKpDa6J9nm%2BNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: why blank page when load a list or dictionary into web to display a list

if checked a few check box and save, 

how to add check box field and get the value of checkboxes?


https://drive.google.com/file/d/0Bxs_ao6uuBDUeW9BQzA1RTlHZEE/view?usp=sharing

the number of rows in http://x.x.x.x/reg/approval.html
depend on data in csv, 



On Saturday, May 28, 2016 at 10:22:01 PM UTC+8, Akhil Lawrence wrote:
Dude,

You need to make the following changes.

1. you need to pass a dictionary as the context in your views

     return render(request, 'approval.html', {'posts': posts})

2. the prefer the posts to be list of dict

    change 

    posts = {}
    ...............................
    LL = [(1,eachbracket)]
    posts.update(LL)

    to
    
    posts = []
    ..........................................
    posts.append(eachbracket)

 3. you templates syntax is wrong correct it, use {{ }}

    {% block content %}
    <table>
    {% for post in posts %}
      <tr>
        <td>
          {{ post.project }}
        </td>
        <td>
          {{ post.company }}
        </td>
        <td>
          {{ post.name }}
        </td>
        <td>
          {{ post.businessType }}
        </td>
        <td>
          {{ post.userType }}
        </td>
      </tr>
    {% endfor %}
    </table>
{% endblock %}
     
    

--
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+unsubscribe@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/93bf8fd9-299a-4028-892e-f4638773ab35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

how to add a dynamic number of check field and save?

https://drive.google.com/file/d/0Bxs_ao6uuBDUeW9BQzA1RTlHZEE/view?usp=sharing

the number of rows in http://x.x.x.x/reg/approval.html
depend on data in csv, 

if checked a few check box and save, 

how to add check box field and get the value of checkboxes?

--
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+unsubscribe@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/18234f8c-abee-494b-bf00-363008ab1802%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: how to upload file with pjango

after following the web,

it only run one time first time the function in views.py
but after press button, it do not run post method because console did not show POST.

where is wrong?

https://drive.google.com/file/d/0Bxs_ao6uuBDUdGpUX3p0TjZrRGM/view?usp=sharing



On Friday, May 27, 2016 at 9:50:29 PM UTC+8, Wyrven no L2Radamanthys wrote:
Hello,

add enctype="multipart/form-data" param in you html form

see more info




2016-05-27 6:45 GMT-03:00 meInvent bbird <jobma...@gmail.com>:
how to upload file with pjango ?

--
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/f68770a9-58ae-4cf3-9893-c8793b192fa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Ricardo Daniel Quiroga

--
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+unsubscribe@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/8dbb457f-07b7-4839-aa5b-757348a2b266%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: why blank page when load a list or dictionary into web to display a list

really really thanks

after tried, it works.

On Saturday, May 28, 2016 at 10:22:01 PM UTC+8, Akhil Lawrence wrote:
Dude,

You need to make the following changes.

1. you need to pass a dictionary as the context in your views

     return render(request, 'approval.html', {'posts': posts})

2. the prefer the posts to be list of dict

    change 

    posts = {}
    ...............................
    LL = [(1,eachbracket)]
    posts.update(LL)

    to
    
    posts = []
    ..........................................
    posts.append(eachbracket)

 3. you templates syntax is wrong correct it, use {{ }}

    {% block content %}
    <table>
    {% for post in posts %}
      <tr>
        <td>
          {{ post.project }}
        </td>
        <td>
          {{ post.company }}
        </td>
        <td>
          {{ post.name }}
        </td>
        <td>
          {{ post.businessType }}
        </td>
        <td>
          {{ post.userType }}
        </td>
      </tr>
    {% endfor %}
    </table>
{% endblock %}
     
    

--
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+unsubscribe@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/1753c0f9-de42-407b-83f5-1b0e0cac234f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

django.db.migrations.graph.NodeNotFoundError:

When new project start,   commands makemigrations and runserver  get  error message.    I do not know what I did wrong.   I cannot find solution to fix it.  Please  any suggestion ? 


------------------------------------------------------------------------------------------------------------------------------------------------------------------------

System check identified no issues (0 silenced).

Unhandled exception in thread started by <function wrapper at 0x0391B9B0>

Traceback (most recent call last):

  File "C:\Python27\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper

    fn(*args, **kwargs)

  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 116, in inner_run

    self.check_migrations()

  File "C:\Python27\lib\site-packages\django\core\management\commands\runserver.py", line 168, in check_migrations

    executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])

  File "C:\Python27\lib\site-packages\django\db\migrations\executor.py", line 19, in __init__

    self.loader = MigrationLoader(self.connection)

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 47, in __init__

    self.build_graph()

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 318, in build_graph

    _reraise_missing_dependency(migration, parent, e)

  File "C:\Python27\lib\site-packages\django\db\migrations\loader.py", line 288, in _reraise_missing_dependency

    raise exc

django.db.migrations.graph.NodeNotFoundError: Migration auth.0007_user_following dependencies reference nonexistent parent node (u'account', u'0003_contact')

--
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+unsubscribe@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/f3165ac1-87c3-4205-b22e-c5cab0b6bbf8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: passing url variables to views

and then i can use it in the view? as an argument?

On Tuesday, May 31, 2016 at 12:33:55 PM UTC-5, Akhil Lawrence wrote:
Hi,

The URL you are calling is wrong.. 


No need to pass it as an query parameter.




On Tuesday, 31 May 2016 15:03:59 UTC+5:30, dk wrote:
this is the URS i get


and i want to be able to get the string  ccc_ccc***a_b***

my url pattern is: 
url(r'^run_delete/(?P<user_del>\w+)/$', views.run_delete, name='run_delete')


but it looks like is not catching it,   i am missing something? i am using django 1.9

thanks guys

--
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+unsubscribe@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/a864bc58-bc60-4863-bba8-85e2740f97ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: DjangoCon Philly July 17-22. See you there?...

Python programmers, Consultants and Job Seekers,

Today's the last day of early bird pricing for DjangoCon, the
world-wide Django conference, which is in Philly this year!

With the $50 early-bird discount, this 6-day event costs only
$295 (individual), $495 (corporate), with a student/diversity
price of only $195. For those of us who are local, with no
airfare or hotel costs, that's dirt cheap.

It's a great place to dive deep into the Web framework that you've
come to know and love, or to get a jumpstart on a new technology
that you've been dying to learn.

I've been using Python/Django for nearly 4 years. I'm a huge fan.

Details:
- Sun July 17 - Fri July 22
- Wharton School, University of Pennsylvania
3620 Locust Walk, Philadelphia, PA 19104
- $295 for all 6 days ($195 for students)
- 1 day of tutorials
- 3 days of talks
- 2 days of sprints (working on the actual Django code base)
- Financial aid is available for tickets, travel and other expenses
- 500 people attending
- https://2016.djangocon.us/

Sessions/Speakers:
------------------

- A new look into APIs - Graphene (Syrus Akbary)

- Full Auto Django: Scaling and HA with Docker, Kubernetes and Atomic
(Josh Berkus)

- Happy Asset Deployments with Webpack & Django (Scott Burns)

- Git in Control, Version Control and How it Could Save Your Life
(Rachell Calhoun)

- Websockets: Intro to messaging. (Josue Balandrano Coronel)

- High-Availability Django (Frankie Dintino)

- Building Dynamic Dashboards with Django and D3 (Clinton Dreisbach)

- Beyond PO: How to make Django work for right-to-left languages (Cho
Garcia & Payam)

- Solving problems with Django Forms. (Kirt Gittens)

- I Didn't Know QuerySets Could Do That (Charlie Guo)

- Geospatial Analysis with GeoDjango (Don Holloway)

- SSL all the things (Markus Holtermann)

- An Intro To Web Accessibility In Django (Annalee Flower Horne)

- Readability Counts (Trey Hunner)

- People are coming to my beginning workshop, what now? (Nicholle
James)

- Frog and Toad Learn About Django Security (Philip James)

- Things your mother didn't teach you about sharing your toys (Russell
Keith-Magee)

- This Old Pony: Working with Legacy Django Apps (Ben Lopatin)

- Walking Down the A11y Road - Lessons Learnt from Working on
Accessibility of a Django Project (Radina Matic)

- Django and React: Perfect Together (Jack McCloy)

- Stress Testing your Code of Conduct in Production (Baptiste Mispelon
& Ola Sendecka)

- Django Supporting Virtual Reality Game Development (Rudy Mutter)

- Django, Python, and Health Care Data (Becca Nock)

- Dispelling the 'Genius Programmer' Myth Through Code Review (Ashwini
Oruganti)

- Rub-a-Dub Rubber Duck: Don't Be Afraid to Debug! (Anna Ossowski)

- Spicing up Django: An introduction to Mezzanine CMS (Ed Rivas)

- MBaaS Framework: Built with Django & Django REST Framework
(Kartikeya Rokde)

- Building JSON APIs with Django / Pinax (Brian Rosner)

- How We Used NLP and Django to Build a Movie Suggestion Website &
Twitterbot (Vince Salvino)

- Django for IoT: From hackathon to production (Anna Schneider)

- Angular 2 and You (Pam Selle)

- Pushing the Pony's boundaries -- Django Admin Customization (Ola
Sitarska)

- Sign Me Up - Choosing & using a registration package for your Django
project (Eleanor Stribling)

- Just Enough Typography (Joni Trythall)

- Under the Hood of Modern CSS Frameworks (Michael Trythall)

- Atomic Wagtail (Kurt Wall)

- Making the most Out of Code Reviews (Mariatta Wijaya)

- Entomology 101: Effective Bug Hunting (Frank Wiles)

- The Fraud Police are Coming: Work, Leadership, and Imposter Syndrome
(Amanda Clark & Briana Morgan)

- From Developer to Manager (Sean O'Connor)

- Design for Non-Designers (Tracy Osborn)

- The City as Cyborg: a history of Civic Tech in the first quarter of
the 21st Century (Mjumbe Poe)

- The Full Stack of User Experience (Alicia C. Raciti)

- Healthy Minds in a Healthy Community (Erik Romijn)

- It Is Darkest Before Dawn: Alcoholism and Addiction in Tech (Timothy
Allen)

- The impact of women learning to code in developing countries:
benefits and challenges. (Aisha Bello & Ibrahim Diop)


See my earlier email appended below for more details and what I like
about Django.

See you at DjangoCon?

--Fred
---------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
---------------------------------------------------------------------

From: fred@bristle.com
List: Stluka_Python_List
List: Stluka_Consultants_List
List: Stluka_Job_Wanted_List
Subject: DjangoCon Philly July 17-22. See you there?...
Date: Sat Apr 09 16:43:04 EDT 2016

Python programmers, Consultants and Job Seekers,

DjangoCon, the world-wide Django conference, is in Philly this year!

It's a great place to dive deep into the Web framework that you've
come to know and love, or to get a jumpstart on a new technology
that you've been dying to learn.

I've been using Python/Django for nearly 4 years. I'm a huge fan.

Details:
- Sun July 17 - Fri July 22
- Wharton School, University of Pennsylvania
3620 Locust Walk, Philadelphia, PA 19104
- $295 for all 6 days ($195 for students)
- 1 day of tutorials
- 3 days of talks
- 2 days of sprints (working on the actual Django code base)
- Financial aid is available for tickets, travel and other expenses
- 500 people attending
- https://2016.djangocon.us/

Register now to attend.

Or sign up to be a speaker and attend for free. There's a team
of speaker mentors if you have good info to share but are not
comfortable speaking to a large crowd. They can help you with
proposing, preparing and presenting your talk.

Or sign up as a volunteer like me to:
- Review talks and tutorials
- Spread the word
- Work on the website
- Run sessions, helping the speaker and attendees with logistics
- Man the registration desk
- Stuff swag bags

For those of you new to Django, here's what I like about it:
- MVC Framework (models, templates, views)
- ORM, DB migrations, syncdb, inspectdb
- Makes simple things easy, and complex things possible
- Automatic data validation
- Automated regression tests
- Middleware
- VERY friendly and helpful user community

See you at DjangoCon?

--Fred
---------------------------------------------------------------------
Fred Stluka -- mailto:fred@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
---------------------------------------------------------------------

LIST INFO:
This message was sent to list(s):
Stluka_Python_List
Stluka_Consultants_List
Stluka_Job_Wanted_List
You are subscribed as: django-users@googlegroups.com
To unsubscribe: Reply to this message, asking to be removed.
Archives of tips: http://bristle.com
Descriptions of lists: http://bristle.com/invite.htm
To subscribe to additional lists: Reply, specifying list name(s).

Copyright (c) 2016, Bristle Software, Inc.

--
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+unsubscribe@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/1046333844.469.1464722004995.JavaMail.fred%40mbp4.local.
For more options, visit https://groups.google.com/d/optout.

Re: how to append all-auth in my django project


This might help http://piratelearner.com/en/C/course/computer-science/django/django-all-auth-all-you-need-to-know/8/



On Sunday, 29 May 2016 22:15:56 UTC+5:30, pratyush singh wrote:
i started a project and now i dont understand how to add all-auth to my project i am having problem to understand its documentation actually i want to embed it with a already created web page of login and signup so how should i use all-auth authentication system in that i mean how to link all auth to those particular fields please help me is there any 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+unsubscribe@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/ffabd35c-476c-48e3-b984-94dc1cb3d202%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Adding view permission by default to auth_permission

Ander,

Please add your suggestion as a ticket in django ticketing system.

https://code.djangoproject.com/newticket



On Monday, 30 May 2016 23:43:18 UTC+5:30, Ander Ustarroz wrote:
I am surprised this feature is not implemented yet, at the moment when we create a new model  three permissions are created automatically:
  • add_permission
  • change_permission
  • delete_permission
We really missing the view_permission here, when we want staff to be able to see the content but not being able to modify it. Searching a bit,  you can find many different implementations to achieve this, but all of them are extending django.contrib.admin.ModelAdmin. Having so many people rewriting these methods in my opinion is a clear sign that this feature should be part of the core. 

Regards,

--
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+unsubscribe@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/cef6376c-4893-42d9-97c8-c09a59710751%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django: Begginer Problems

As Ryan mentioned. Go through the forms tutorial. Formsets may also help. Have a look.


https://docs.djangoproject.com/en/1.9/topics/forms/formsets/




On Monday, 30 May 2016 04:54:16 UTC+5:30, David Zárate wrote:
Hi! I'm making a financial analysis app in Django and to have some data to play with i have to store historical data of balance sheets and profit/loss statements. I need some suggestions on how i can accomplish that.

These are my models so far:

class Entity(models.Model):
"""
Holds information about entities as banks, finance and insurance companies.
"""
ENTITY_TYPE = (
('BNK', 'Bank'),
('FNC', 'Finance'),
('INS', 'Insurance'),
('UNK', 'Otros'),
)
name = models.CharField(max_length=255, unique=True)
type = models.CharField(choices=ENTITY_TYPE, max_length=3)

def __str__(self):
return self.name


class Statement(models.Model):
"""
Hold info about a Financial Statement.
"""
name = models.CharField(max_length=255)

def __str__(self):
return self.name


class AccountGroup(models.Model):
"""
Model to group accounts together i.e.: Asset, Liability, Equity, Income, Expense
"""
parent_group = models.ForeignKey('AccountGroup', null=True, blank=True)
name = models.CharField(max_length=255)

def __str__(self):
return self.name


class Account(models.Model):
"""
Represents each account of a Financial Statement.
"""
# TODO this needs to be improved
order = models.IntegerField(unique=True, default='0000')
group = models.ForeignKey('AccountGroup')
name = models.CharField(max_length=255)

def __str__(self):
return self.name


class FinancialStatement(models.Model):
entity = models.ForeignKey('Entity')
statement = models.ForeignKey('Statement')
period = models.DateField()
accounts = models.ForeignKey('Account', default='0.00')
amount = models.DecimalField(max_digits=12, decimal_places=2, default='0.00')

def __str__(self):
return self.entity

Since it's not an accounting app i have to only store data from a monthly statement report, my question here is how can i make a form that brings all accounts for a statement in a column and helps me introduce its corresponding amount in other column. My Account model really needs better logic for the account "order" or "number" part. For comparison purposes every instance of FinancialStatement() needs to hold a date representing the date when the statement was published. And that's my problem.

Hope you can help me.

--
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+unsubscribe@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/4734f2c7-37f8-4eb8-b096-86475d35e8f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Looking for a good Django Forum


Me too - I'm looking for something simple; I have only looked at packages that were updated in 2016, so far I have examined:

    Pybbm - I tried this - the templates, views and models were complicated and hard to customize though the documentation was good.  I may go back to this.
    Spirit -  the file structure put me off. it seems needlessly complicated with several apps and the templates stored in different directories.  I will try this next.
    Machina and Misago both say not to use in production .

    I am going to try lbforum now.

Adam


On Friday, September 4, 2015 at 1:45:30 AM UTC-7, Frankline wrote:
Hi all,

Anyone know of a good forum that integrates nicely with django? Specifically both the Forum and django app should use the same userbase. Also something that is easy to integrate and theme.

I have been looking at both LBForum and DjangoBB.

Interested to hear from those who have actually implemented it.

./FO

--
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+unsubscribe@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/208e6ba8-2ba7-4788-9cbf-231465f59cc1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Django websites for study and improvement

You can get many django based applications from github. 

https://github.com/taigaio/taiga-back
https://github.com/mayan-edms/mayan-edms/
https://github.com/stephenmcd/cartridge

You can also refer

https://github.com/rosarior/awesome-django
https://github.com/search?q=django


Even though you are not interested in django internals.. this might be helpful

http://ccbv.co.uk/



On Tuesday, 31 May 2016 23:26:39 UTC+5:30, Ankush Thakur wrote:
Are there any large-ish (I mean, beyond blogs, polls, etc.) websites (web apps?) out there that are open source and can help me learn in the real world? I have covered the basics, even converted my own blog into Django, but I feel I don't know anything about how Django is used out in the wild.

I can choose to study the django.contrib apps, but my focus is not on diving into Django's internals right now.

Any recommendations?

Regards,
Ankush Thakur

--
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+unsubscribe@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/708cc5f0-ce90-4f89-9ff9-e803815b073d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Django websites for study and improvement

Are there any large-ish (I mean, beyond blogs, polls, etc.) websites (web apps?) out there that are open source and can help me learn in the real world? I have covered the basics, even converted my own blog into Django, but I feel I don't know anything about how Django is used out in the wild.

I can choose to study the django.contrib apps, but my focus is not on diving into Django's internals right now.

Any recommendations?

Regards,
Ankush Thakur

--
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+unsubscribe@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/CALX%3DrKLxPaV6XeJJCDphaXUpHc7VdyjMepTUE0bH%2BGZaSU-4pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Simultaneous Web Requests appending responses in function based views

The code and output you've shown us don't make any sense. You're really going to have to provide a complete, minimal project.

On Tue, May 31, 2016 at 9:40 AM, cr katz <crkatz411@gmail.com> wrote:
Thanks Stephen. As suggested, below is the output. 'p' is being overwritten before the first response is completely read and sent to the browser.

<Request: 039ADED0> Hello, I am X
<Request: 039ADED0> Hello, I am Y
<Request: 039ADED0> Hello, I am A
Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>

hd-www-stage
2016-05-30 00:00:00 UTC
<Request: 03A07A10> Hello, I am X
<Request: 039ADED0> Hello, I am B
<Request: 03A07A10> Hello, I am Y
[31/May/2016 10:25:15] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 932
<Request: 03A07A10> Hello, I am A
<Request: 03A07A10> Hello, I am B
[31/May/2016 10:25:37] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 932
        
On the browser, I see below in 1 request
Hello, I am X
Hello, I am B
Hello, I am Y     

2 simultaneous request prints as below on the browser:
 Hello, I am X
Hello, I am B
Hello, I am Y
Hello, I am A
Hello, I am B


On Monday, May 30, 2016 at 10:51:26 PM UTC-4, Stephen Butler wrote:
Ohhh... you're looking at the server logs? Those are never going to be sequential. Your requests operate in parallel. That's why you see interleaved outputs. Modify your print statement like this to see what's happening:

print "<Request: {0:08X}> {1}".format(id(request), func)

You should see the proper results, but for each individual request, not for the server process as a whole.

If you need sequential processing then you will have to use locks, either at the OS level or some shared resource (like the database).

On Mon, May 30, 2016 at 9:16 PM, cr katz <crka...@gmail.com> wrote:
The code I shared is where the problem is. Here is the output once again from the server logs. It is evident that the second request is running into the first and appending the responses.

The text in BOLD 'Entered Search' is the entry point for each request. I suspect a problem with looping qList or appending 'p'.

Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>
Hello, I am X
Hello, I am Y
Hello, I am A
Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>
Hello, I am X
Hello, I am B
Hello, I am Y
[30/May/2016 22:00:35] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 893
Hello, I am A
Hello, I am B
[30/May/2016 22:00:58] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 1475


On Monday, May 30, 2016 at 9:32:47 PM UTC-4, Stephen Butler wrote:
I don't see anything in your pasted code that would cause that in the browser. Have you provided us a complete example that exhibits that behavior? Reduce your project down to the smallest set of code that exhibits the problem and then upload it somewhere we can see it.

On Mon, May 30, 2016 at 8:13 PM, cr katz <crka...@gmail.com> wrote:
Single request from the user gives the correct output as below. Please see the appended response further below when a user submits 2 requests from 2 different browsers on the same dev machine.

I don't want the users to see appended responses, rather, each request must return response as intended with in the request context.

Hello, I am A
Hello, I am X
Hello, I am B
Hello, I am Y


Appended response when user submits 2 requests simultaneously from 2 diff browsers:

Hello, I am A
Hello, I am X
Hello, I am B
Hello, I am Y
Hello, I am A
Hello, I am B

On Monday, May 30, 2016 at 6:52:12 PM UTC-4, Stephen Butler wrote:
What's your actual output vs. what's your desired output?

Also, the RequestContext is meant for the render() function. If you just want to access request.GET then you can do it directly (request is passed in as the first parameter to your view func). You also don't need to pre-assign qList and cd, as long as they are assigned before they are accessed you are OK.

On Mon, May 30, 2016 at 5:18 PM, cr katz <crka...@gmail.com> wrote:
Hello James,
        Here below is my code:

qList in the code below, actually take a list of functions and uses the parameters received thru the request, processes and appends the response to 'p'. In this code, I eliminated those functions and hardcoded with a list of strings.

def search(request):

p = []
cd = {}
qList=[]
request_context = RequestContext(request)

if request_context.request.GET:
form = SearchForm(request_context.request.GET)
# print form
if form.is_valid():
cd = request_context.request.GET
projectId = cd['project']
app = cd['app']
if cd['days'] != '0':
daysAgo = '-' + cd['days']
else:
daysAgo = cd['days']
sdtime = cd['sdtime']
edtime = cd['edtime']

qList = ["Hello, I am X", "Hello, I am Y", "Hello, I am A", "Hello, I am B"]

for func in qList:
print func
t.sleep(10)
p.append(func)
context = {'query_output': p, 'id_project': projectId,
'app': app, 'pOutput': p}
return render(request, 'temp.html', context)

else:
form = SearchForm()
return render_to_response('search_form.html', {'form': form})

Thanks
crkatz

On Monday, May 30, 2016 at 2:10:17 AM UTC-4, James Schneider wrote:


On May 29, 2016 4:23 PM, "cr katz" <crka...@gmail.com> wrote:
>
> Hello,
>         I am new to django. I developed a web application using form based views. When I submit a single web request from the dev env, the response is returned correctly. When submit 2 simultaneously from 2 browsers, I see appended responses for each request. 
>
> How can I process requests independently?

That would certainly be odd behavior, although I'm not exactly sure what you mean. Can you post the output that you're seeing and the view in question?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@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/04067a15-d2cd-48d9-810c-8abe5760278c%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/7be9a742-26dc-4a85-b6c1-2ab6def4696f%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/2851f295-6f8f-4ad3-b1d1-8768532b3fac%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+unsubscribe@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/9c5d164e-6f61-48a6-b8e6-7c0c36d0a02e%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+unsubscribe@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/CAD4ANxW1oLHKSUDM3w-4fLPDoxAeU-VNsJiK8zMys1Kp%3Dr-o5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: passing url variables to views

Hi,

The URL you are calling is wrong.. 


No need to pass it as an query parameter.




On Tuesday, 31 May 2016 15:03:59 UTC+5:30, dk wrote:
this is the URS i get


and i want to be able to get the string  ccc_ccc***a_b***

my url pattern is: 
url(r'^run_delete/(?P<user_del>\w+)/$', views.run_delete, name='run_delete')


but it looks like is not catching it,   i am missing something? i am using django 1.9

thanks guys

--
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+unsubscribe@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/a380a70c-ba3a-4bcf-9f7a-b026568a2685%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: passing url variables to views

i was looking for something like this

the tutorial use d  for getting the number of the years,   =(     i am skipping a step?

--
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+unsubscribe@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/62645261-8a24-4950-8cf5-06503dd809b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: parent: [ 'Invalid pk "0" - object does not exist.' ] and null or blank value not store in mysql



On Tue, May 31, 2016 at 5:21 AM, L K Singh <lksingh.india@gmail.com> wrote:
class AccountType(ModelBase):
parent = models.ForeignKey('self',on_delete = models.SET_NULL, null=True, blank=True, default=None )

class AccountTypeSerializer(serializers.ModelSerializer):
parent = serializers.PrimaryKeyRelatedField(queryset=AccountType.objects.all(), required=False,null=True, blank=True)
class Meta:
model = AccountType
fields = ('id','parent','account_type_name')

how to set null and empty value in parent field
A null value and an empty value are two separate and different things (None != ''). DRF will exclude 'parent' from the serialized data if it is not included in your input data and you have no default= in your serializer definition. 

If I understand you right, you want a parent=None key-value pair in your serializer output, even if one isn't provided by the model you are serializing. In that case, I believe all you need to do is add 'default=None' to your 'parent' field in your serializer.


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciWUWkP6L-RKdgUZBMuj9Nv%3DAzzJ-EFz4GNLQQM%2BR3R-eA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Simultaneous Web Requests appending responses in function based views

Thanks Stephen. As suggested, below is the output. 'p' is being overwritten before the first response is completely read and sent to the browser.

<Request: 039ADED0> Hello, I am X
<Request: 039ADED0> Hello, I am Y
<Request: 039ADED0> Hello, I am A
Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>

hd-www-stage
2016-05-30 00:00:00 UTC
<Request: 03A07A10> Hello, I am X
<Request: 039ADED0> Hello, I am B
<Request: 03A07A10> Hello, I am Y
[31/May/2016 10:25:15] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 932
<Request: 03A07A10> Hello, I am A
<Request: 03A07A10> Hello, I am B
[31/May/2016 10:25:37] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 932
        
On the browser, I see below in 1 request
Hello, I am X
Hello, I am B
Hello, I am Y     

2 simultaneous request prints as below on the browser:
 Hello, I am X
Hello, I am B
Hello, I am Y
Hello, I am A
Hello, I am B


On Monday, May 30, 2016 at 10:51:26 PM UTC-4, Stephen Butler wrote:
Ohhh... you're looking at the server logs? Those are never going to be sequential. Your requests operate in parallel. That's why you see interleaved outputs. Modify your print statement like this to see what's happening:

print "<Request: {0:08X}> {1}".format(id(request), func)

You should see the proper results, but for each individual request, not for the server process as a whole.

If you need sequential processing then you will have to use locks, either at the OS level or some shared resource (like the database).

On Mon, May 30, 2016 at 9:16 PM, cr katz <crka...@gmail.com> wrote:
The code I shared is where the problem is. Here is the output once again from the server logs. It is evident that the second request is running into the first and appending the responses.

The text in BOLD 'Entered Search' is the entry point for each request. I suspect a problem with looping qList or appending 'p'.

Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>
Hello, I am X
Hello, I am Y
Hello, I am A
Entered Search
<QueryDict: {u'project': [u'project1'], u'app': [u'app'], u'sdtime': [u'2016-05-30 00:00:00 UTC'], u'days': [u'0'], u'edtime': [u'2016-05-30 00:02:00 UTC']}>
Hello, I am X
Hello, I am B
Hello, I am Y
[30/May/2016 22:00:35] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 893
Hello, I am A
Hello, I am B
[30/May/2016 22:00:58] "GET /search/?project=project1&app=app&days=0&sdtime=2016-05-30+00%3A00%3A00+UTC&edtime=2016-05-30+00%3A02%3A00+UTC HTTP/1.1" 200 1475


On Monday, May 30, 2016 at 9:32:47 PM UTC-4, Stephen Butler wrote:
I don't see anything in your pasted code that would cause that in the browser. Have you provided us a complete example that exhibits that behavior? Reduce your project down to the smallest set of code that exhibits the problem and then upload it somewhere we can see it.

On Mon, May 30, 2016 at 8:13 PM, cr katz <crka...@gmail.com> wrote:
Single request from the user gives the correct output as below. Please see the appended response further below when a user submits 2 requests from 2 different browsers on the same dev machine.

I don't want the users to see appended responses, rather, each request must return response as intended with in the request context.

Hello, I am A
Hello, I am X
Hello, I am B
Hello, I am Y


Appended response when user submits 2 requests simultaneously from 2 diff browsers:

Hello, I am A
Hello, I am X
Hello, I am B
Hello, I am Y
Hello, I am A
Hello, I am B

On Monday, May 30, 2016 at 6:52:12 PM UTC-4, Stephen Butler wrote:
What's your actual output vs. what's your desired output?

Also, the RequestContext is meant for the render() function. If you just want to access request.GET then you can do it directly (request is passed in as the first parameter to your view func). You also don't need to pre-assign qList and cd, as long as they are assigned before they are accessed you are OK.

On Mon, May 30, 2016 at 5:18 PM, cr katz <crka...@gmail.com> wrote:
Hello James,
        Here below is my code:

qList in the code below, actually take a list of functions and uses the parameters received thru the request, processes and appends the response to 'p'. In this code, I eliminated those functions and hardcoded with a list of strings.

def search(request):

p = []
cd = {}
qList=[]
request_context = RequestContext(request)

if request_context.request.GET:
form = SearchForm(request_context.request.GET)
# print form
if form.is_valid():
cd = request_context.request.GET
projectId = cd['project']
app = cd['app']
if cd['days'] != '0':
daysAgo = '-' + cd['days']
else:
daysAgo = cd['days']
sdtime = cd['sdtime']
edtime = cd['edtime']

qList = ["Hello, I am X", "Hello, I am Y", "Hello, I am A", "Hello, I am B"]

for func in qList:
print func
t.sleep(10)
p.append(func)
context = {'query_output': p, 'id_project': projectId,
'app': app, 'pOutput': p}
return render(request, 'temp.html', context)

else:
form = SearchForm()
return render_to_response('search_form.html', {'form': form})

Thanks
crkatz

On Monday, May 30, 2016 at 2:10:17 AM UTC-4, James Schneider wrote:


On May 29, 2016 4:23 PM, "cr katz" <crka...@gmail.com> wrote:
>
> Hello,
>         I am new to django. I developed a web application using form based views. When I submit a single web request from the dev env, the response is returned correctly. When submit 2 simultaneously from 2 browsers, I see appended responses for each request. 
>
> How can I process requests independently?

That would certainly be odd behavior, although I'm not exactly sure what you mean. Can you post the output that you're seeing and the view in question?

-James

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@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/04067a15-d2cd-48d9-810c-8abe5760278c%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/7be9a742-26dc-4a85-b6c1-2ab6def4696f%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/2851f295-6f8f-4ad3-b1d1-8768532b3fac%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+unsubscribe@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/9c5d164e-6f61-48a6-b8e6-7c0c36d0a02e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.