good pratices to write many lines on database

2017-01-04 Thread Bruno Barbosa
Hello everybody!

I have an application that receives about 1000 POST requests per second. On
each request I writte a line on my database table. On this scenario my
database can shutdown during execution.

Is it a good pratice to store these data on array in cache (redis) and on
each minute through celery get then and use a bulk_create to insert all
data on database?

Bruno
--

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


Re: New Django User

2016-04-07 Thread Bruno Barbosa
Hello Chen, welcome to Django community!

I think you can start with Django Tutorial:
https://docs.djangoproject.com/en/1.9/intro/tutorial01/

Good luck!

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br <http://brunobarbosa.com.br>*

On Thu, Apr 7, 2016 at 6:29 AM, Chen <lekhuso...@gmail.com> wrote:

> I'm new to Django.. I actually wanted to take inputs from a web user
> through web page and then using those inputs perform further operations. So
> does Django helps in connecting HTML, Python and PHP altogether?
> How do I connect a html and python file?
>
> I have a user login page which I can proceed with HTML and PHP very
> smoothly. After login, the recommendation part comes where using the user's
> activity some recommendations are made to the user. So how should I proceed
> with the recommendation part which is implemented in Python. How to track
> user's activity?
> Please suggest. I haven't worked with Python Web Framework before.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/be0e61e1-b3c0-428e-b0e3-af308117d506%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/be0e61e1-b3c0-428e-b0e3-af308117d506%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHxcCH5tX8ASvQc6kRs20bP15-1hx%3D%3D6-w1WpdV8t1wwS0_ekg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error running Django tutorial

2016-03-19 Thread Bruno Barbosa
Ruth,

Show me the code!

How is your urls.py? and the views.py?

paste your code in https://gist.github.com/ and reply this email.

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br <http://brunobarbosa.com.br>*

On Thu, Mar 17, 2016 at 3:50 PM, Ruth <rmil...@contextualgenomics.com>
wrote:

> Hi,
> I am getting the same problem, despite having include in my mysite\urls.py
> file.
> I am using Python 2.7.6, Django 1.9.4 and Ubuntu 14.04.3 LTS.
> Could it by a Python 2.7 problem?
> Thanks,
> Ruth
>
> On Wednesday, March 2, 2016 at 12:19:16 PM UTC-8, jorr...@gmail.com wrote:
>>
>> Glad you got it solved!!
>>
>>
>> On Monday, February 29, 2016 at 10:10:58 PM UTC+1, Mike Kipling wrote:
>>>
>>> I found the problem.
>>>
>>> When the mysite\urls.py file is created, it has this line already in it.
>>>
>>> from django.conf.urls import url
>>>
>>> The tutorial asks you to add the following lines to the file.
>>>
>>> from django.conf.urls import include, url
>>> from django.contrib import admin
>>>
>>> urlpatterns = [
>>> url(r'^polls/', include('polls.urls')),
>>> url(r'^admin/', admin.site.urls),
>>> ]
>>>
>>> I must did not notice that the 'include' was different, and so I had
>>> not placed it into the file.  I changed the file to add the 'include' and
>>> everything worked.
>>>
>>> Thank you for the help.
>>>
>> --
> 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/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c14e04f8-be34-4569-ae42-48e8d4135a2c%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHxcCH4nmFpXeHmVhFJddeB9f0BACF636McCUu7DNr84mwz0Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: unhashable type: 'dict'

2016-03-15 Thread Bruno Barbosa
you forgot the function name auth_views.logout as a second parameter as
mentioned above.

try it:
url(r'^logout/$', *auth_views.logout*, {'next_page': 'boardgames_home'},
name='boardgames_logout'),

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br <http://brunobarbosa.com.br>*

On Tue, Mar 15, 2016 at 10:32 AM, Deepanshu Sagar <deepansh...@gmail.com>
wrote:

> yes, thank you for the prompt reply, I am using
>
> from django.contrib.auth import views as auth_views
>
> I need to redirect my webpage to "board_games" main page when the user
> logs out.
> can you please direct me to the correct way to do that?
>
> Thanks in advance.
>
>
>
> On Tuesday, March 15, 2016 at 5:45:07 PM UTC+5:30, luisza14 wrote:
>
>> You are correct, your problem is in logout url , because you need to pass
>> a function not a duct as second parameter.
>>
>> Are you using django auth views ?
>>
>>
>>
>> https://docs.djangoproject.com/en/1.9/topics/auth/default/#django.contrib.auth.logout
>>
>>
>> El martes, 15 de marzo de 2016, Deepanshu Sagar <deepa...@gmail.com>
>> escribió:
>> > Hello,
>> > i am getting below error while accessing http://localhost:8000/login/.
>> >
>> 
>> >
>> > Below are the chaining codes.
>> > boardgames\urls.py
>> >
>> 
>> > boardgames\templates\login.html
>> >
>> 
>> >
>> > NOTE: before adding "
>> >
>> > url(r'^logout/', {'next_page': 'boardgames_home'},
>> name='boardgames_logout')
>> >
>> > to boardgames\urls.py. the access was working fine.
>> > below is the settings.py
>> >
>> > """
>> > Django settings for boardgames project.
>> >
>> > For more information on this file, see
>> > https://docs.djangoproject.com/en/1.6/topics/settings/
>> >
>> > For the full list of settings and their values, see
>> > https://docs.djangopro ect.com/en/1.6/ref/settings/
>> > """
>> >
>> > # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
>> > import os
>> > BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
>> >
>> >
>> > # Quick-start development settings - unsuitable for production
>> > # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/
>> >
>> > # SECURITY WARNING: keep the secret key used in production secret!
>> > SECRET_KEY = '_p4ga=y!6rbqqv3&4)v7a*qtjb*8tedegd3=8#(p-2dl6a@3#v'
>> >
>> > # SECURITY WARNING: don't run with debug turned on in production!
>> > DEBUG = True
>> >
>> >
>> > ALLOWED_HOSTS = []
>> >
>> >
>> > # Application definition
>> >
>> > INSTALLED_APPS = (
>> > 'django.contrib.admin',
>> > 'django.contrib.auth',
>> > 'django.contrib.contenttypes',
>> > 'django.contrib.sessions',
>> > 'django.contrib.messages',
>> > 'django.contrib.staticfiles',
>> > 'main',
>> > 'tictactoe',
>> > )
>> >
>> > MIDDLEWARE_CLASSES = (
>> > 'django.contrib.sessions.middleware.SessionMiddleware',
>> > 'django.middleware.common.CommonMiddleware',
>> > 'django.middleware.csrf.CsrfViewMiddleware',
>> > 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> > 'django.contrib.messages.middleware.MessageMiddleware',
>> > 'django.middleware.clickjacking.XFrameOptionsMiddleware',
>> > )
>> >
>> > ROOT_URLCONF = 'boardgames.urls'
>> >
>> > TEMPLATES = [
>> > {
>> > 'BACKEND': 'django.template.backends.django.DjangoTemplates',
>> > 'DIRS': [os.path.join(BASE_DIR, 'templates')],
>> > 'APP_DIRS': True,
>> > 'OPTIONS': {
>> > 'context_processors': [
>> > 'django.core.context_processors.request',
>> > 'django.template.context_processors.debug',
>> > 'django.template.context_processors.request',
>> > 'django.contrib.auth.context_processors.auth',
>> > 'django.contrib.messages.context_processors.messages',
>> > ],
>> > },
>> > },
>> > ]
>> >
>> >
>> > WSGI_APPLICATION = 'boardgames.wsgi.application'
>> >
>> >
>> > # Database
>> > # https://docs.djangoproject.com/en/1.6/ref/settings/#databases
>> >
>> > DATABASES = {
>> > 'default': {
>> > 'ENGINE': 'django.db.backends.sqlite3',
>> > 'NAME': os.path.join(BASE_

Re: Django Hello

2016-03-04 Thread Bruno Barbosa
But these tutorials are online.. you don't need download it..

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br <http://brunobarbosa.com.br>*

On Fri, Mar 4, 2016 at 5:57 PM, <direco...@infomed.sld.cu> wrote:

> I have been seeing it but I just have acces https://www.djangoproject.com/
> and this one too https://docs.djangoproject.com/en/1.9/intro/
>
> but just thouse one, I would like to get some tutorials but my big problem
> is my email, I can not get a file bigger than 2 mb  haha I live in Cuba
>
>
>
> 
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> --
> Este mensaje le ha llegado mediante el servicio de correo electronico que
> ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
> Nacional de Salud. La persona que envia este correo asume el compromiso de
> usar el servicio a tales fines y cumplir con las regulaciones establecidas
>
> Infomed: http://www.sld.cu/
>
> --
> 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/20160304155718.1243858fs518g7n2%40webmail.sld.cu
> .
>
> 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/CAHxcCH6n9h4qmRdMqOY%3DV4xHnQU-wLU7Ru5MDVfjm5dxZy5iBQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django Hello

2016-03-04 Thread Bruno Barbosa
I think that a good start point is the django official website
https://www.djangoproject.com/ and your intro tutorial:
https://docs.djangoproject.com/en/1.9/intro/

Also, you can see the Django spanish site: http://django.es/

--
Bruno Barbosa
Web Developer

On Fri, Mar 4, 2016 at 4:25 PM, <direco...@infomed.sld.cu> wrote:

> Hello I new in Django I would like to get some tutorials. I speak Spanish,
> is somobody here who speak spanish? please, help me about that
>
> 
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> --
> Este mensaje le ha llegado mediante el servicio de correo electronico que
> ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema
> Nacional de Salud. La persona que envia este correo asume el compromiso de
> usar el servicio a tales fines y cumplir con las regulaciones establecidas
>
> Infomed: http://www.sld.cu/
>
> --
> 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/20160304142552.63555kcv1s40utkw%40webmail.sld.cu
> .
> 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/CAHxcCH78Rd8h_0yRUYyobMCCjrQOnnMZinevct5JkY04BDZ40Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin page missing icons

2016-03-04 Thread Bruno Barbosa
sorry, the correct command is: python manage.py collectstatic

--
Bruno Barbosa
Web Developer

On Fri, Mar 4, 2016 at 5:09 PM, Bruno Barbosa <bsbru...@gmail.com> wrote:

> Are you running django with DEBUG=False?
> ​​
> Try run python.py manage.py collectstatic then reload page.
>
> --
> Bruno Barbosa
> Web Developer
> *brunobarbosa.com.br <http://brunobarbosa.com.br>*
>
> On Fri, Mar 4, 2016 at 4:13 PM, <aspel...@gmail.com> wrote:
>
>> In your browser enable "network inspector" and reload page, you will see
>> where is icon must locate.
>>
>> For example:
>>
>> On Friday, March 4, 2016 at 3:16:37 PM UTC+2, David Hou wrote:
>>>
>>> Hi all,
>>>
>>>
>>> I'm really new to Django and am just working through the tutorials right
>>> now.  I noticed that my admin page is missing some icons (circled in red
>>> below).  Inspecting the html at these locations shows that there is no icon
>>> being referenced here.  Is there something I'm missing in my installation
>>> or something?  I'm using Django 1.9.2
>>>
>>>
>>> Thanks for the help!
>>>
>>>
>>> <https://lh3.googleusercontent.com/-zSyvtzcnZok/VtkJT0PY57I/AJE/V2ArK1fJ92g/s1600/Capture.PNG>
>>>
>>>
>>> <https://lh3.googleusercontent.com/-wHQNPWtwfcc/VtkJpLpf8gI/AJI/xwI7-vV_7Xg/s1600/Capture.PNG>
>>>
>>>
>>>
>>> --
>> 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/a59c4475-b911-4a3a-ac42-e4ade204746c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/a59c4475-b911-4a3a-ac42-e4ade204746c%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHxcCH7UEBiLbr-G%2BugqWBwYCMfZ0rdQbsjEzRwNCbbZHHgsaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Admin page missing icons

2016-03-04 Thread Bruno Barbosa
Are you running django with DEBUG=False?
​​
Try run python.py manage.py collectstatic then reload page.

--
Bruno Barbosa
Web Developer
*brunobarbosa.com.br <http://brunobarbosa.com.br>*

On Fri, Mar 4, 2016 at 4:13 PM, <aspel...@gmail.com> wrote:

> In your browser enable "network inspector" and reload page, you will see
> where is icon must locate.
>
> For example:
>
> On Friday, March 4, 2016 at 3:16:37 PM UTC+2, David Hou wrote:
>>
>> Hi all,
>>
>>
>> I'm really new to Django and am just working through the tutorials right
>> now.  I noticed that my admin page is missing some icons (circled in red
>> below).  Inspecting the html at these locations shows that there is no icon
>> being referenced here.  Is there something I'm missing in my installation
>> or something?  I'm using Django 1.9.2
>>
>>
>> Thanks for the help!
>>
>>
>> <https://lh3.googleusercontent.com/-zSyvtzcnZok/VtkJT0PY57I/AJE/V2ArK1fJ92g/s1600/Capture.PNG>
>>
>>
>> <https://lh3.googleusercontent.com/-wHQNPWtwfcc/VtkJpLpf8gI/AJI/xwI7-vV_7Xg/s1600/Capture.PNG>
>>
>>
>>
>> --
> 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/a59c4475-b911-4a3a-ac42-e4ade204746c%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/a59c4475-b911-4a3a-ac42-e4ade204746c%40googlegroups.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHxcCH6%2Bqym_8va8EHUSFYY%3DwBtQVLq%3DdSRLFmX3cSG0tHS5wg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.