Re: Database data caching in Django?...

2018-07-09 Thread Ravi Bhushan

Can we solve this problem ?
https://stackoverflow.com/questions/51239469/cache-invalidation-is-not-working-in-browser-using-or-app-rest-api
On Thursday, August 18, 2016 at 1:04:33 AM UTC+5:30, Fred Stluka wrote:
>
> Django users,
>
> Is there an easy way to enable an automatic write-through 
> database cache in Django?
>
> I'd want memcached or something to cache all data read by the 
> Django ORM and use the cached copy on future reads, and of 
> course update the cache as well as the DB (a "write-through" 
> cache) when writing data.
>
> Is there a piece of middleware I can activate to cause the ORM
> to do this automatically for all DB queries?  Thanks!
>
> Details:
>
> I'm interested in caching the results of queries to the DB, not 
> caching the results of templates or views.  So, it is different 
> from the following, which I already know how to do:
> - Caching of template files:
>- 
> http://us5.campaign-archive1.com/?u=a8d4be66d1927077a9255182d&id=a6f7d644a7&e=c90970e145
>- 
> https://docs.djangoproject.com/en/dev/ref/templates/api/#django.template.loaders.cached.Loader
> - Caching of all Django views for an entire site:
>- 
> https://docs.djangoproject.com/en/dev/topics/cache/#the-per-site-cache
> - Caching of specific Django views:
>   - https://docs.djangoproject.com/en/dev/topics/cache/#the-per-view-cache
> - Caching of fragments of a Django Template:
>   - 
> https://docs.djangoproject.com/en/dev/topics/cache/#template-fragment-caching
>
> I'm also hoping to not have to add cache API calls throughout my
> code, as described here:
> - 
> https://docs.djangoproject.com/en/dev/topics/cache/#the-low-level-cache-api
>
> I'd like the Django ORM to make the API calls for me automatically
> when I call objects.get(), objects.filter(), save(), etc.  I'd hoped to 
> enable it simply by adding middleware or a custom manager or 
> something.
>
> Any suggestions?  I feel like I may be missing something obvious.
>
> --Fred 
> --
> Fred Stluka -- mailt...@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. 
> --
>
>

-- 
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/67053999-1707-49e9-839e-d8faf4759351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


this error occurs Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools whenever some package install..Please

2018-07-09 Thread Rupam Hazra
this error occurs Microsoft Visual C++ 14.0 is required. Get it with 
"Microsoft Visual C++ Build Tools": 
http://landinghub.visualstudio.com/visual-cpp-build-tools whenever some 
package install..Please tell me the solutinons

-- 
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/2bcf8d92-ac8f-4055-a875-25f92b4dd010%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clear view cache using @cache_page

2018-07-09 Thread Ravi Bhushan
plzz solve this problem

https://stackoverflow.com/questions/51239469/cache-invalidation-is-not-working-in-browser-using-or-app-rest-api

On Monday, November 30, 2015 at 11:13:29 PM UTC+5:30, Dimitris R wrote:
>
> Hello, 
>
> I am using Django 1.8.2 and caching my views using the @cache_page 
> decorator:
>
> @cache_page(60 * 5)
> def view_name(request, obj_id):
>   [...]
>
> Is there a way to clear the cached entry programmatically, prior of the 
> cache timeout?
>
> Thanks, 
> Dimitris
>
>

-- 
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/2a491587-c107-45d2-8156-ff4a5215d9de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Caching JSON in Django

2018-07-09 Thread Ravi Bhushan
plzz help me to solve this problem
https://stackoverflow.com/questions/51239469/cache-invalidation-is-not-working-in-browser-using-or-app-rest-api

On Wednesday, August 25, 2010 at 2:45:14 AM UTC+5:30, buddhasystem wrote:
>
>
> Hello,
>
> I'm trying to use native caching in Django as per
> http://docs.djangoproject.com/en/dev/topics/cache/
>
> I followed the setup procedure to the tee (it's not hard, of course). What 
> I
> observe is that my app caches only views that deliver HTML. Since my
> application is heavily AJAX, that's not what I want -- I want to cache JSON
> -- but it doesn't work!
>
> Any hints how I can make it work?
>
> I can always code it up myself (I have, actually), but I try to avoid that.
>
> Thanks.
>
> -- 
> View this message in context: 
> http://old.nabble.com/Caching-JSON-in-Django-tp29526535p29526535.html
> Sent from the django-users mailing list archive at Nabble.com.
>
>

-- 
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/d2a69e39-d3f3-4ccc-807e-899789e693a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Clear view cache using @cache_page

2018-07-09 Thread Ravi Bhushan
plzz solve this problem

On Monday, November 30, 2015 at 11:13:29 PM UTC+5:30, Dimitris R wrote:
>
> Hello, 
>
> I am using Django 1.8.2 and caching my views using the @cache_page 
> decorator:
>
> @cache_page(60 * 5)
> def view_name(request, obj_id):
>   [...]
>
> Is there a way to clear the cached entry programmatically, prior of the 
> cache timeout?
>
> Thanks, 
> Dimitris
>
>

-- 
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/494d66d6-6cd7-4933-ae76-133c5bb4f25c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Error: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

2018-07-09 Thread Rupam Hazra
C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe'
 
failed with exit status 2.

Please i need 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/9fa61ce9-b876-4bf0-9f59-0a24ec100be8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error: C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2

2018-07-09 Thread Kasper Laudrup

Hi Rupam,

On 07/09/2018 09:50 AM, Rupam Hazra wrote:
C:\\Program Files (x86)\\Microsoft Visual 
Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.14.26428\\bin\\HostX86\\x86\\cl.exe' 
failed with exit status 2.


Please i need help.



Which error message did the compiler (cl.exe) give you?

Kind regards,

Kasper Laudrup

--
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/b9da105e-8316-5c09-4b8f-144633ffd039%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Needs help

2018-07-09 Thread Umar Kambala
Am lost as to what to do, I try troubleshooting but couldn't fine de
answer... This are my codes

from django.contrib.auth.models import User from django.shortcuts import
render, redirect, get_object_or_404 from .models import Board, Topic, Post
def new_topic(request, pk): board = get_object_or_404(Board, pk=pk) if
request.method == 'POST': subject = request.POST['subject'] message =
request.POST['message'] user = User.objects.first() # TODO: get the
currently logged in user topic = Topic.objects.create( subject=subject,
board=board, starter=user ) post = Post.objects.create( message=message,
topic=topic, created_by=user ) return redirect('board_topics', pk=board.pk)
# TODO: redirect to the created topic page return render(request,
'new_topic.html', {'board': board})

This is the error

url(r'^$', views.home, name='home')
attributeError: module 'boards.views' has no attribute 'home'

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


Re: Needs help

2018-07-09 Thread Kasper Laudrup

Hi Umar.

On 07/09/2018 01:52 PM, Umar Kambala wrote:


This is the error

url(r'^$', views.home, name='home')
attributeError: module 'boards.views' has no attribute 'home'



Do you know what a Python module is and what an attribute on a module 
means? Then the answer is obvious.


Try to read up on that.

Kind regards,

Kasper Laudrup

--
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/9a2b1e04-5f45-ecd5-6d43-17f247a6836c%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: Needs help

2018-07-09 Thread Umar Kambala
Thanks
On Jul 9, 2018 11:57 AM, "Kasper Laudrup"  wrote:

> Hi Umar.
>
> On 07/09/2018 01:52 PM, Umar Kambala wrote:
>
>>
>> This is the error
>>
>> url(r'^$', views.home, name='home')
>> attributeError: module 'boards.views' has no attribute 'home'
>>
>>
> Do you know what a Python module is and what an attribute on a module
> means? Then the answer is obvious.
>
> Try to read up on that.
>
> Kind regards,
>
> Kasper Laudrup
>
> --
> 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/9a2b1e04-5f45-ecd5-6d43-17f247a6836c%40stacktrace.dk.
> 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/CAPkbFbbDEM%3DPCTedKB2t3D67LtmAk5KRN6MoaU%2BCxGNKHaAYyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Caching JSON in Django

2018-07-09 Thread Melvyn Sopacua
On maandag 9 juli 2018 09:19:59 CEST Ravi Bhushan wrote:

> plzz help me to solve this problem

Ask more times. It really helps getting you quality auto ignores.
-- 
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/2838446.qCC5UmfGUK%40fritzbook.
For more options, visit https://groups.google.com/d/optout.


Re: Using multiple keyword arguments with reverse()

2018-07-09 Thread Derek
Thanks Melvyn

The call to reverse() *was* included in my original code snippets: see
below.

> return HttpResponseRedirect(
> reverse('uploads:upload_details',
> kwargs={'view': view, 'mid':result.pk})

And that call does not work.

Derek

On Sun, 8 Jul 2018 at 20:49, Melvyn Sopacua  wrote:

> On zondag 8 juli 2018 13:58:33 CEST Derek wrote:
>
> > I am attempting to pass multiple keyword arguments from a reverse() call
> > (from my app called `uploads`).
>
> There's no call to reverse in your code. But to do this:
>
> reverse('upload_details', kwargs={'view': 'site', 'mid', 3})
>
> > *urls.py*
> >
> > urlpatterns = [
> > url(
> > regex=r'^add/$',
> > view=views.add_new,
> > name='add_new'),
> > url(
> > regex=r'^details/(?P[a-z.]+)/(?P\d+)?$',
> > view=views.upload_details,
> > name='upload_details'),
> > ]
> >
> > *views.py*
> >
> > def add_new(request)
> > # ... process data via a form; create a result object
> > return HttpResponseRedirect(
> > reverse('uploads:upload_details',
> > kwargs={'view': view, 'mid':result.pk})
> > )
> >
> > def upload_details(request, view='site', mid=None):
> > # ... run process based on view and mid args
> >
> >
> > When the `upload_details` view gets called, the 'mid' does not set (even
> > though it has a valid integer value); examining the
> > contrib/auth/decorators.py file in debug mode:
> >
> > def decorator(view_func):
> > @wraps(view_func, assigned=available_attrs(view_func))
> > def _wrapped_view(request, *args, **kwargs):
> > if test_func(request.user):
> > return view_func(request, *args, **kwargs)
>
> And how is that relevant as well? I think you're missing some code in your
> copy, cause this decorator also is not in your view code.
>
> --
> Melvyn Sopacua
>
> --
> 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/e2BIjOI44Bc/unsubscribe.
> To unsubscribe from this group and all its topics, 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/3786925.Ha4mB3saOt%40fritzbook
> .
> 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/CAF1Wu3P7G7QAij-vAP0_MP-J2eRSBgmNEm%3DpkzTY7P57qurN9Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: help

2018-07-09 Thread 'Anthony Flury' via Django users

On 06/07/18 13:43, Umar Kambala wrote:
  File 
"C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\site-packages\django\core\management\__init__.py", 
line 347, in execute


YOU need to add an on_delete argument to every ForeignKey definition - 
such as the one in line 13.


Learning to read tracebacks really does help - the error you posted 
contains the information you need :


  File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", 
line 13, in Topic

    board = models.ForeignKey(Board, related_name='topics')
TypeError: __init__() missing 1 required positional argument: 'on_delete'

Quite often the very last few lines of the error message will tell you 
exactly what the error is and which line - in this case :


The error is on line 13 of boards/models.py
The error is in the Topic class
the error is on the line that is : "board = models.ForeignKey(Board, 
related_name='topics')"
the actual error is that the line is missing the on_delete argument - it 
really is that simple.

--
--
Anthony Flury
email : *anthony.fl...@btinternet.com*
Twitter : *@TonyFlury *

--
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/bd827f41-6db2-a73a-c959-c322d5471901%40btinternet.com.
For more options, visit https://groups.google.com/d/optout.


Re: help

2018-07-09 Thread 'Anthony Flury' via Django users

On 05/07/18 12:49, Umar Kambala wrote:


Please am sorry am new to django, I don't really understood what u mean

I know that Tim has helped you in this occassion but  you really do need 
to  know how to find your way around a computer


the commands 'ls' and 'cd ..'

are nothing to do with Django - they are basic commands for managing 
your file system which will work regardless of whether you use Django or not


I know in a previous answer, someone suggested that you learn some basic 
Python knowledge, can I also suggest that you learn some basic console 
commands - how to change directory, list files, delete and rename files 
how to look at the file details (file size, dates etc). These are all 
useful things when you are trying to do development.



On Jul 5, 2018 11:42 AM, "Tim Vogt (Tim Vogt)" > wrote:


do $ls and find the directory where the manage.py file is.
cd.. to go one directory back




Op 5 jul. 2018, om 13:25 heeft Umar Kambala
mailto:umarkamb...@gmail.com>> het
volgende geschreven:

thanks Mr Tim
i have python 3.6 install on my computer, i try running python
manage.py migrate and this is what i got

C:\Users\Admin\Desktop\Django web>python manage.py migrate
python: can't open file 'manage.py': [Errno 2] No such file or
directory

On Thu, Jul 5, 2018 at 4:21 AM, Tim Vogt (Tim Vogt)
mailto:timtv...@gmail.com>> wrote:

perhaps run the project with python2 or
do python manage.py migrate.



Op 5 jul. 2018, om 13:18 heeft Umar Kambala
mailto:umarkamb...@gmail.com>> het
volgende geschreven:

please this what i had after running my Django-admin
startproject myproject

  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\__init__.py",
line 371, in execute_from_command_line
    utility.execute()
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\__init__.py",
line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\__init__.py",
line 216, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\__init__.py",
line 36, in load_command_class
    module = import_module('%s.management.commands.%s' %
(app_name, name))
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\importlib\__init__.py",
line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "", line 994, in _gcd_import
  File "", line 971, in
_find_and_load
  File "", line 955, in
_find_and_load_unlocked
  File "", line 665, in
_load_unlocked
  File "", line 678,
in exec_module
  File "", line 219, in
_call_with_frames_removed
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\commands\startproject.py",
line 1, in 
    from django.core.management.templates import TemplateCommand
  File

"c:\users\admin\appdata\local\programs\python\python36-32\lib\site-packages\django\core\management\templates.py",
line 17, in 
    from django.template import Context, Engine
ModuleNotFoundError: No module named 'django.template'

what should i do to debug this error please?


-- 
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/CAPkbFbatt4e_SVMPbWEHk--tBKC8VJR6xYcAEjwEJRjMFwT7Wg%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.
   

facebook python script

2018-07-09 Thread Ahmad
Hello everyone, I hope all of you will be fine.

I want a script to download facebook video (SD or HD) using python. 

if anyone has already please send me 

or if you have any other material which can help me. 

Waiting for you reply. Thanks

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


Re: facebook python script

2018-07-09 Thread Kasper Laudrup

Hi Ahmed,

On 2018-07-09 19:46, Ahmad wrote:

Hello everyone, I hope all of you will be fine.

I want a script to download facebook video (SD or HD) using python.



I highly suggest using the requests library for doing HTTP client 
communication:


http://docs.python-requests.org

It's a lot easier to use and more "pythonic" than any of the HTTP 
libraries found in the Python standard library.


You probably need a way to get the URL for the video to download. I 
don't have any experience with it, but I would probably look into this 
for a start:


https://facebook-sdk.readthedocs.io/

I imagine it should be possible to use that library to find the URL for 
whatever video it is you want to download, but as I said, I have no 
experience with that.


That's where I would start at least.

Kind regards,

Kasper Laudrup

--
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/980a18a5-3786-32ff-9ab4-6ad0448a1a83%40stacktrace.dk.
For more options, visit https://groups.google.com/d/optout.


Re: facebook python script

2018-07-09 Thread Ahmad
Thank you very much dear. It will help alot me. 

On Monday, July 9, 2018 at 10:46:34 PM UTC+5, Ahmad wrote:
>
> Hello everyone, I hope all of you will be fine.
>
> I want a script to download facebook video (SD or HD) using python. 
>
> if anyone has already please send me 
>
> or if you have any other material which can help me. 
>
> Waiting for you reply. Thanks
>

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


django template rendering performance

2018-07-09 Thread Masoud Sadri
Hi,
when rendering django(v 1.11) templates, is there any performance 
difference between python 2.7 and 3.5? 

Thanks.

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


Configuring Remote Existing DB through RDS

2018-07-09 Thread ackamal
Hi everyone,

I'm having trouble connecting an existing MySQL database through the 
settings.py file in my project and was wondering if anyone has ever 
experienced similar issues. The database section of settings.py appears as 
follows:

DATABASES = {
'default': {
'NAME': 'detectiondata-dev',
'ENGINE': 'django.db.backends.mysql',
'USER': 'user_with_admin_privileges',
'PASSWORD': 'admin_password',
'HOST': 'host_name_from_rds',
'PORT': '3306',
},
}

where 'user_with_admin_privileges' is an obscured (but working) admin 
username - same thing with the password and hostname. Port 3306 is allowed 
through my firewall, inbound/outbound.

The database is a running MySQL instance on an AWS account. Interestingly 
enough, my laptop (running environment is Windows Subsystem for Linux) 
seems to be able to recognize/connect to the database - I'm successfully 
able to view the database using the mysql command in bash:

msql -u 'user_with_admin_privileges' -p -h 'host_name_from_rds'

... where I then enter 'admin_password' and can successfully interact with 
the remote DB. Additionally, commands such as telnet and nc can connect to 
the specified host. I also tried connecting another public database and 
encountered similar errors, even though I could otherwise view the database 
remotely.

When trying to migrate the existing database, or even run the server, 
Django freaks out (see attached error files). I'm executing from within a 
virtualenv using python 3, not sure what's wrong. Searched all over the web 
and through this group and haven't found a similar problem, so I thought 
I'd post as a last resort. Thanks!

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

$ python manage.py check &> error_check.txt


Traceback (most recent call last):
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/db/backends/base/base.py",
 line 216, in ensure_connection
self.connect()
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/db/backends/base/base.py",
 line 194, in connect
self.connection = self.get_new_connection(conn_params)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/db/backends/mysql/base.py",
 line 234, in get_new_connection
return Database.connect(**conn_params)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/MySQLdb/__init__.py",
 line 85, in Connect
return Connection(*args, **kwargs)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/MySQLdb/connections.py",
 line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1049, "Unknown database 
'detectiondata_dev'")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "manage.py", line 15, in 
execute_from_command_line(sys.argv)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/__init__.py",
 line 371, in execute_from_command_line
utility.execute()
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/__init__.py",
 line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/base.py",
 line 288, in run_from_argv
self.execute(*args, **cmd_options)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/base.py",
 line 335, in execute
output = self.handle(*args, **options)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/commands/check.py",
 line 65, in handle
fail_level=getattr(checks, options['fail_level']),
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/base.py",
 line 364, in check
include_deployment_checks=include_deployment_checks,
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/management/base.py",
 line 351, in _run_checks
return checks.run_checks(**kwargs)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.6/site-packages/django/core/checks/registry.py",
 line 73, in run_checks
new_errors = check(app_configs=app_configs)
  File 
"/home/akshayck/.virtualenvs/djangodev/lib/python3.

Re: django template rendering performance

2018-07-09 Thread mottaz hejaze
i dont think so . rendering templates , though rendering templates us a
matter of the web server then users browsers

On Tue, 10 Jul 2018, 00:56 Masoud Sadri,  wrote:

> Hi,
> when rendering django(v 1.11) templates, is there any performance
> difference between python 2.7 and 3.5?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: facebook python script

2018-07-09 Thread mottaz hejaze
i think you gonna need to scrap the page first . then use requests library

On Mon, 9 Jul 2018, 20:17 Ahmad,  wrote:

> Thank you very much dear. It will help alot me.
>
> On Monday, July 9, 2018 at 10:46:34 PM UTC+5, Ahmad wrote:
>>
>> Hello everyone, I hope all of you will be fine.
>>
>> I want a script to download facebook video (SD or HD) using python.
>>
>> if anyone has already please send me
>>
>> or if you have any other material which can help me.
>>
>> Waiting for you reply. Thanks
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/1fc1f9ee-b1b6-40fe-a80b-d1c0b09a15a5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Using multiple keyword arguments with reverse()

2018-07-09 Thread mottaz hejaze
def my_view(request):
...
return redirect('some-view-name', foo='bar')

-- 
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/9767f941-e871-46df-ad9e-554252f554bf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: facebook python script

2018-07-09 Thread Masoud Sadri
Hi, 
you can use youtube-dl module.

https://github.com/rg3/youtube-dl


On Monday, July 9, 2018 at 10:16:34 PM UTC+4:30, Ahmad wrote:
>
> Hello everyone, I hope all of you will be fine.
>
> I want a script to download facebook video (SD or HD) using python. 
>
> if anyone has already please send me 
>
> or if you have any other material which can help me. 
>
> Waiting for you reply. Thanks
>

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


Re: django template rendering performance

2018-07-09 Thread Andrew Paulsen
No, Django renders the templates.

Masoud,
if you suspect there are negative difference between 2.7 and 3.5, please
try to make a minimal app showing off the problem so the devs can fix it.


On 2018-07-10 09:11, mottaz hejaze wrote:
> i dont think so . rendering templates , though rendering templates us
> a matter of the web server then users browsers
>
> On Tue, 10 Jul 2018, 00:56 Masoud Sadri,  > wrote:
>
> Hi,
> when rendering django(v 1.11) templates, is there any performance
> difference between python 2.7 and 3.5? 
>
> Thanks.
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> 
> https://groups.google.com/d/msgid/django-users/71ea0ed5-e182-4bcb-9ec6-64970f04f351%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to django-users+unsubscr...@googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHV4E-d%2Bjzs5P-dHBgS_1TYKfWjyZ8DXo%2BXW%2BzVxE9pfNy%3DiRw%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/1a7b11a8-8679-4833-12e5-2123babedd06%40x76.eu.
For more options, visit https://groups.google.com/d/optout.