Fwd:

2013-07-30 Thread Robin Lery
-- Forwarded message -- From: Robin Lery Date: Tue, Jul 30, 2013 at 9:22 PM Subject: To: django-users@googlegroups.com Hello, I am stuck at a point where i should be able to type in a search query on the page and it django should get back a list of matching pages if any. But it

django jquery

2013-07-31 Thread Robin Lery
Hi, Can any one please suggest good book or tutorials if possible regarding django and ajax (jquiry). I looked at one book "Django JavaScript Integration AJAX and jQuery", but it was very confusing and outdated as well, didn't help much.Please suggest tutorials or books with latest version. Would

Re: django jquery

2013-07-31 Thread Robin Lery
o templates? If you can be more specific in your goals, > more direction can provided. > > Jonathan > > > On Wed, Jul 31, 2013 at 10:14 AM, Robin Lery wrote: > >> Hi, >> Can any one please suggest good book or tutorials if possible regarding >> dja

Friendship model

2013-08-08 Thread Robin Lery
Hi, How do i create a Friendship model? Please guide me. Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To

Re: Friendship model

2013-08-09 Thread Robin Lery
Thank you! I'll check on it. On Fri, Aug 9, 2013 at 12:36 PM, Rahul Gaur wrote: > > > On Fri, Aug 9, 2013 at 9:38 AM, Andy McKay wrote: > >> On Thu, Aug 8, 2013 at 12:41 PM, Robin Lery wrote: >> >>> How do i create a Friendship model? Please guide me. &g

django ajax runtime error - URL doesn't end in slash

2013-08-10 Thread Robin Lery
I am practicing from a tutorial where I have reached to create a search box with jquery and ajax. Every thing is going good, except, when i press any key in the search, I get an error, RuntimeError at /articles/search You called this URL via POST, but the URL doesn't end in a slash and you have AP

Re: django ajax runtime error - URL doesn't end in slash

2013-08-10 Thread Robin Lery
nathandavidba...@gmail.com> wrote: > Can you paste the markup for your search form? > > Sent from my iPhone > > On Aug 10, 2013, at 11:46 AM, Robin Lery wrote: > > I am practicing from a tutorial where I have reached to create a search > box with jquery and ajax. Every thing

django windows user

2013-08-10 Thread Robin Lery
Hello, I am a windows user, and its great learning django and python as well. I am just curious that, when I happen to deploy my site for production, is it helpful to deploy in unix system. And if there is, please guide me to use ssh and other stuff that is required to deploy so. Any help will be h

Re: django windows user

2013-08-11 Thread Robin Lery
If you have specific questions, please ask them and the community would be > glad to assist. > > -A > > > > On Sat, Aug 10, 2013 at 3:27 PM, Robin Lery wrote: > >> Hello, >> I am a windows user, and its great learning django and python as well. I >> am jus

Re: django windows user

2013-08-12 Thread Robin Lery
Thank you all! Just one more question though, does hosting provider provides any interface like virtual machine or so? It would have been great if they were. On Mon, Aug 12, 2013 at 5:09 AM, Mike Dewhirst wrote: > On 12/08/2013 8:47am, Aaron C. de Bruyn wrote: > >> MySQL or Postgresql for your d

RequestContext and request.user

2013-08-16 Thread Robin Lery
Hello, I am all confused about these two things: context_instance = RequestContext and request.user Are they both equal? I suppose RequestContext includes a user varialble from the given template. And request.user would also give the current user's info, i guess. Can someone please give me insight

Re: RequestContext and request.user

2013-08-17 Thread Robin Lery
tes/api/#subclassing-context-requestcontext > > []'s > > Lucas Magnum. > > > 2013/8/16 Robin Lery > >> Hello, >> I am all confused about these two things: >> context_instance = RequestContext and request.user >> >> Are they both eq

django query

2013-08-17 Thread Robin Lery
Hello, I have a model like this: class Forum(models.Model): question = models.CharField(max_length=150) body = models.TextField() pub_date = models.DateTimeField(default=datetime.now) image = models.ImageField(upload_to=get_upload_file_name) creator = models.ForeignKey(User, related_name="creator_

django static files through apache in windows

2013-08-22 Thread Robin Lery
I have configured apache to serve my project. But I can't yet configure it to serve static files. Till now in my httpd.conf I have appended the code that django documentation provides and its like this: WSGIScriptAlias / C:/Users/robin/web/facebook/facebook/wsgi.py WSGIPythonPath C:/Users/

Re: django static files through apache in windows

2013-08-22 Thread Robin Lery
it has collected the static files, but its still now showing up. On Thu, Aug 22, 2013 at 10:15 PM, Tom Evans wrote: > On Thu, Aug 22, 2013 at 5:14 PM, Robin Lery wrote: > > I have configured apache to serve my project. But I can't yet configure > it > > to serve sta

Re: django static files through apache in windows

2013-08-22 Thread Robin Lery
STATICFILES_DIRS = ( ('assets','C:/Users/robin/web/facebook/static'), ) On Thu, Aug 22, 2013 at 11:36 PM, Robin Lery wrote: > my > > STATIC_ROOT = 'C:/Users/robin/web/static_files_for_facebook/' > > STATIC_URL = '/static/'

Re: django static files through apache in windows

2013-08-22 Thread Robin Lery
In my html file I have link the css with 'assets', `href="{% static "assets/css/face.css" %}">`. But there are two folders `assets` and `admin`, after I made the command collectstatic. Is it the problem? Should I direct css to `admin`? On Thu, Aug 22, 20

my django admin page don't have the css when viewed over the apache server

2013-08-24 Thread Robin Lery
I just finished to serve my pages on the internet through apache. I can see my webpage nicely, but when I try the admin, the django admin page don't have the css with it, just the html page. But my webpage's css are displaying nicely. What am I missing? Please guide me. Thank you! my http.conf sni

Re: Import Error: cannot import name timezone

2013-08-24 Thread Robin Lery
It should be 'from django.utils import timezone' and not 'from django.db.utils import timezone' On Sun, Aug 25, 2013 at 2:58 AM, Patrick Larmann wrote: > He Guys, > I am currently completing part 1 of the django tutorial and having trouble > with getting on of the modules correctly set up. > I

Re: Import Error: cannot import name timezone

2013-08-25 Thread Robin Lery
Good to hear that! On Sun, Aug 25, 2013 at 7:19 AM, Patrick Larmann wrote: > Thanks fixed it? > > > On Saturday, August 24, 2013 5:45:47 PM UTC-4, Robin Lery wrote: > >> It should be >> 'from django.utils import timezone' >> and not >> '

Passing variables to css file in django

2013-08-25 Thread Robin Lery
Is it possible to pass variables in css files, like in html file. Example: In views.py: def home(request): bgcolor = "#999" ... ... In the css file: body { background-color : {{bgcolor}}; } If yes, can you please guide me how to achieve this? I wou

Re: Passing variables to css file in django

2013-08-25 Thread Robin Lery
Oh! I am sorry. What I meant was, how do I let users customize their page if they wanted to? I suppose I could have done this without using external stylesheet, but yes, CSS is served fastest if it's static. I hope, I made myself clear. Please guide me if there's a way to achive this On Mon, Aug

Re: [] error

2013-08-26 Thread Robin Lery
You gave the .pyc file. On Mon, Aug 26, 2013 at 7:47 PM, Patrick Larmann wrote: > Hello guys I am following the django docs tutorial part 1 and am having > trouble moving on. Instead of receiving [] i get [ Poll object>]. I have tried converting the unicode to str but to no avail. > I am just

Re: Removing the logged in user's name from the list of users in django

2013-08-30 Thread Robin Lery
or likes in forum.likes.all.reverse %} > > > On Friday, August 30, 2013 10:35:46 AM UTC-5, Robin Lery wrote: >> >> I have a template that displays the numbers of likes and name of the >> users liked the forum. But I don't want the request.user's (logged in >&g

Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-04 Thread Robin Lery
I have a site, where users can upload images. And it works fine in django's own server. But I am using apache to serve both my app and statics. And when I upload any image, I can't see the pics. Only when I runcollectstatic I can see them. Do I always have to run collectstatic? Is there any better

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
it say in your Apache logs? > Try debugging this like you would an Apache configuration error. > > K > > > On Thursday, September 5, 2013 8:35:49 AM UTC-7, Robin Lery wrote: > >> I did as you told, but I can only see it, when I reload the page served >> by the

Does easy thumbnails for django work for apache server?

2013-09-05 Thread Robin Lery
I have a page, which is served by apache. When I upload images by the django's server (on localhost:8000) page, it does show me the uploaded image properly. However when I upload images by the apache server (on localhost) page, it does not show the uploaded image. Only when I reload the page on the

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
The problem was the easy-thumbnails tag! After I removed it, I was good to go. Thanks though! On Thu, Sep 5, 2013 at 10:41 PM, Robin Lery wrote: > my models.py : > > def get_upload_file_name(instance, filename): > return "uploaded_files/%s_%s" %(str(time()).repl

Re: Does easy thumbnails for django work for apache server?

2013-09-05 Thread Robin Lery
And also in the uploaded directory it was creating an extra image for the same image. On Thu, Sep 5, 2013 at 11:42 PM, Robin Lery wrote: > I have a page, which is served by apache. When I upload images by the > django's server (on localhost:8000) page, it does show me the uploa

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
tic assets, not user > submitted content. Your system is misconfigured and that is why it is > collecting user submitted files. > > K > > > On Wednesday, September 4, 2013 12:41:03 PM UTC-7, Robin Lery wrote: >> >> I have a site, where users can upload images. And

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
ub_date = models.DateTimeField(default=datetime.now) creator = models.ForeignKey(User, related_name="creator_set") likes = models.ManyToManyField(User, through="Like") class Meta: ordering = ['-pub_date'] verbose_name_plural = ('Status') def __unicode__(self): r

sorl-thumbnail or easy thumbnail with apache

2013-09-09 Thread Robin Lery
Hello, Has anyone tried sorl-thumbnail or easy_thumbnail with apache for users uploaded media images??? I am really stuck with these. When I upload it using the apache server, it does not load the uploaded image, it only loads the ones that have been run through the django's inbuilt server. And onl

Re: sorl-thumbnail or easy thumbnail with apache

2013-09-09 Thread Robin Lery
I have used it in the templates. Do i use it in the models for uploaded images??? On Tue, Sep 10, 2013 at 1:31 AM, Robin Lery wrote: > Hello, > Has anyone tried sorl-thumbnail or easy_thumbnail with apache for users > uploaded media images??? I am really stuck with these. When I

Re: Advanced Tutorial (how to write reusable app), last step does not work

2013-09-09 Thread Robin Lery
In order to create a reusable app, you have to create a new 'templates' folder in your app and place the the absolute path in the templates directory in your settings.py. And then create the html files as concerned with your app in the templates directory you created within the app. Robin On Tue

Resize image size in the view

2013-09-10 Thread Robin Lery
Hello, I have been trying to achieve thumbnail for the uploaded images, but it just don't seem to resize the image on the apache server when the page is loaded. Only when I run through the django's inbuilt server, it loads the uploaded image. So, is there any way, that I can specify the size of the

Resize image in the view

2013-09-10 Thread Robin Lery
Hello, I have been trying to achieve thumbnail for the uploaded images using sorl-thumbnail and easy_thumbnail, but it just don't seem to resize the image on the apache server when the page is loaded. Only when I run through the django's inbuilt server, it loads the uploaded image. So, is there any

Re: Resize image size in the view

2013-09-10 Thread Robin Lery
ou try use http://sorl-thumbnail.readthedocs.org/en/latest/ >> is good >> >> Cheers >> >> >> On Tue, Sep 10, 2013 at 10:53 PM, Robin Lery wrote: >> >>> Hello, >>> I have been trying to achieve thumbnail for the uploaded images, but it >&g

Re: Resize image size in the view

2013-09-11 Thread Robin Lery
;django.utils.log.RequireDebugFalse' } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailH

Iframe sandbox security

2013-10-16 Thread Robin Lery
I was planning to create an app where the users can create their own blog page and others can link it in my web, like facebook. And then, I thought about using iframe with the sandbox attribute to view the page with the safe filter in the template. So, is it safe to implement it in this way??? Or i

django-ckeditor image upload giving wrong url of the image

2013-10-17 Thread Robin Lery
When I try text editing and other text related stuffs and save it, the editor does its job nicely. But when I try to upload an image it just take a different url. I am on windows. Is it because of this, cause I saw a post on this post

django - differentiate users in the template

2013-10-30 Thread Robin Lery
So, I am trying to create a user page, and its url will be associated with its username, something like this http://domain.com/accounts/profile/robin/ And in that page, I want all the photo's uploaded by that user (here 'robin') to be displayed in the template. And another thing is, in the menu b

Django - How to combine queries in to one and display it in the template?

2013-11-03 Thread Robin Lery
Suppose this is a model for an app Blog: class Blog(models.Model): title = models.CharField(max_length=200) pub_date = models.DateTimeField(default=datetime.now) creator = models.ForeignKey(User) content = BleachField() And this is another model for an app Status: class Status(mo

Transcode video using celery and ffmpeg in django

2015-02-20 Thread Robin Lery
I would like to transcode user uploaded videos using celery. I think first I should upload the video, and spawn a celery task for transcoding. Maybe something like this in the tasks.py: subprocess.call('ffmpeg -i path/.../original path/.../output') > Just completed First steps with celery

Re: Transcode video using celery and ffmpeg in django

2015-02-20 Thread Robin Lery
;title'] # Assuming the form field is >> "title" >> video.save() # You might need to make the mp4_480 and >> mp4_720 fields "nullable" on the model >> yourapp.tasks.transcode_video.delay(video) # Assuming the task is the >> "

Add multiple objects of same model at the same time in admin

2015-06-13 Thread Robin Lery
I have a model to upload pictures: models.py: > class Snap(models.Model): > image = models.ImageField(upload_to=get_upload_file_name) > caption = models.CharField(max_length=150, blank=True, null=True) > date = models.DateField(default=date.today) > admin.py: class SnapAdmin(admin.

Get the first image src from a post

2015-06-15 Thread Robin Lery
I have a model to write blogs. In that I'm using a wysiwyg editor for the Blog's descritpion, through which I can insert an image within the description. class Blog(models.Model): title = models.CharField(max_length=150, blank=True) description = models.TextField() pubdate = models.Dat

Re: Add multiple objects of same model at the same time in admin

2015-06-15 Thread Robin Lery
; Cheers > > > > > > > On Sun, Jun 14, 2015 at 1:08 AM, Carlos Arturo Sanchez Rivera < > ing.c...@gmail.com> wrote: > >> It is easier with decorators >> >> @admin.register(Transfer) >> class TransferAdmin(admin.ModelAdmin): >>

Celery to process task and modify the model fields

2015-07-14 Thread Robin Lery
I would like to convert video into mp4 using ffmpeg and celery for the asynchronous task. When user uploads a video, it will be for the original_video and save it. After that I want celery to convert it into a different version for the mp4_720 field. However I am confused on how to apply that logic

Re: Celery to process task and modify the model fields

2015-07-14 Thread Robin Lery
rom... february I think, what's changed since > then? > > On Tue, Jul 14, 2015 at 3:29 PM, Robin Lery wrote: > >> I would like to convert video into mp4 using ffmpeg and celery for the >> asynchronous task. When user uploads a video, it will be for the >> original_video

Re: Thumbnails In Django

2015-07-21 Thread Robin Lery
Yes. I would like to add easy-thumbnails too. Both are great! On 22 Jul 2015 01:05, "Sadaf Noor" wrote: > In one of my projects I used sorl ( > https://github.com/mariocesar/sorl-thumbnail) instead, it was super easy > and best fit for my project. Every time it asks for a new thumbnail BUT > if i

Re: Allow users to submit django form once per day

2015-07-23 Thread Robin Lery
You can save the datetime of the last form submission and check whether its oneday or not in the view. If its one day then show pass the form or else dont. Hope this helps. On 23 Jul 2015 20:38, "Nkansah Rexford" wrote: > I want to allow users to submit a django form once, and only once > everyd

Re: Guidance needed - Real time and django

2014-09-02 Thread Robin Lery
Thank you Amirouche! I will surely look onto that. And I saw many tutorials on django + node.js and socket.io, and was just curious as to what your thoughts are on this as the new version of socket.io has also been released? On Mon, Sep 1, 2014 at 3:09 AM, Amirouche Boubekki < amirouche.boube...@

Return to the requested page after successfull @login_required by the next variable

2015-01-08 Thread Robin Lery
Suppose this is the url after `@login_required(login_url='/accounts/required_login/')`: http://ngoksy.com/accounts/login_required/?next=/article/ view for the login_require: *def required_login(request):return render(request, 'required_login.html')* I tried adding 'next', like it [

Re: Signals not working as expected

2013-11-29 Thread Robin Lery
Do i put the codes to all the app's - models.py? On Fri, Nov 29, 2013 at 9:44 PM, Tom Evans wrote: > On Fri, Nov 29, 2013 at 4:06 PM, Aamu Padi wrote: > > Thank you for the answer. I am a newbie, would be very grateful if you > could > > please show me how to do that? > > Put the code in sign

Re: Signals not working as expected

2013-11-29 Thread Robin Lery
Yes. On Fri, Nov 29, 2013 at 9:55 PM, Robin Lery wrote: > Do i put the codes to all the app's - models.py? > > > On Fri, Nov 29, 2013 at 9:44 PM, Tom Evans wrote: > >> On Fri, Nov 29, 2013 at 4:06 PM, Aamu Padi wrote: >> > Thank you for the answer. I am

Re: Signals not working as expected

2013-11-29 Thread Robin Lery
Ok, thank you all! On Fri, Nov 29, 2013 at 9:56 PM, Robin Lery wrote: > Yes. > > > On Fri, Nov 29, 2013 at 9:55 PM, Robin Lery wrote: > >> Do i put the codes to all the app's - models.py? >> >> >> On Fri, Nov 29, 2013 at 9:44 PM, Tom Evans wrote:

Difference between signals and celery

2013-11-29 Thread Robin Lery
This may be a lame question, but I am really confused with these two. I know *signals* are used to do some task when something has happened. But what about celery? In the documentation it says: *Celery is an asynchronous task queue/job queue based on distributed message passing.* Will someon

Re: Difference between signals and celery

2013-11-30 Thread Robin Lery
> Regards, > Carlos Ruvalcaba > > > On Fri, Nov 29, 2013 at 11:52 AM, Robin Lery wrote: > >> This may be a lame question, but I am really confused with these two. I >> know *signals* are used to do some task when something has happened. But >> what about celery

Re: Difference between signals and celery

2013-12-01 Thread Robin Lery
30, 2013 at 7:35 PM, Robin Lery wrote: > >> Thank all so much for you replies. Just one more question though. Does >> this means Celery needs a different server? >> >> >> On Sat, Nov 30, 2013 at 12:41 AM, Carlos Daniel Ruvalcaba Valenzuela < >> clsdan...@gmail

collectstatic is not working

2014-02-27 Thread Robin Lery
Hello, I have been trying to collect statics from the static folder but, its not collecting any files. But it did collect the admin files. What's wrong. Please help me. Thank you. *settings:* import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) STATIC_URL = '/static/' # Template loc

Re: collectstatic is not working

2014-02-27 Thread Robin Lery
oin(os.path.dirname(**BASE_DIR), "static", "static"),* ) On Thu, Feb 27, 2014 at 6:35 PM, Robin Lery wrote: > Hello, > I have been trying to collect statics from the static folder but, its not > collecting any files. But it did collect the admin files. What

Re: collectstatic is not working

2014-02-27 Thread Robin Lery
ohh my god..it should be STATICFILES_DIRS ! And not STATIC_DIRS? Thank you so much!!! On Thu, Feb 27, 2014 at 6:38 PM, Robin Lery wrote: > > if DEBUG: > MEDIA_URL = '/media/' > STATIC_ROOT = os.path.join(os.path.dirname( > BASE_DIR), "static&quo

django and amazon web services

2014-03-01 Thread Robin Lery
Hello. I have a very basic noob question, which I don't know. Please help me understand this concepts. When I use *ec2* for my application web server, and if I use the services like *autoscale *and *elastic load balancer*, do I always have to sync the database with the new *ec2* instances that are

Re: django and amazon web services

2014-03-01 Thread Robin Lery
Very nicely explained! I was actually hoping to use Amazon RDS with postgresql. Your help was very useful. Thank you! On Sat, Mar 1, 2014 at 3:03 PM, Russell Keith-Magee wrote: > Hi Robin, > > In the simplest deployment case, your entire Django (or, for that matter, > any other framework) web

memcached and redis

2014-03-01 Thread Robin Lery
Hello, Another noob question. Please bear with me. I am really very confused between memcached and redis. I know they both are used for caching. But I don't know how much does they help. And lastly, I would like know what would you use for a site with users uploaded pictures and videos too? I hope

Re: memcached and redis

2014-03-01 Thread Robin Lery
nse time. Redis > and memcache are in memory databases and are extremely fast! > > Regarding your second question, if you need to store alot of pictures and > videos, I would use Amazon S3 with the django storages backend for S3. > > Regards, > > Andréas > > > 2014-03-01 17

Re: memcached and redis

2014-03-01 Thread Robin Lery
Use cases with memcached and redis please. On Sun, Mar 2, 2014 at 1:45 AM, Andreas Kuhne wrote: > Hi again, > > Do you mean use cases with redis and memcache or with S3? > > Regards, > > Andréas > > 2014-03-01 21:00 GMT+01:00 Robin Lery : > >> Hello, >

Re: memcached and redis

2014-03-01 Thread Robin Lery
databases (key-value store) (even though redis can be persisted) and if the > server is rebooted, then the cache is empty. Also being a in memory > database means that getting information back from the key-value store is > more or less instantanious especially if you compare to a standar

Re: memcached and redis

2014-03-02 Thread Robin Lery
Thank you Andy and Russel! I guess I know a lot about those two cache methods. On Sun, Mar 2, 2014 at 5:23 AM, Andy McKay wrote: > On Sat, Mar 1, 2014 at 12:39 PM, Andreas Kuhne > wrote: > >> The main difference is that you can use redis as a session cache for >> django (save the session objec

django - commenting app for all other apps

2014-03-02 Thread Robin Lery
I have an app for forum. It has three classes *Tag*, *Question* and *Answer* . *models*: class Tag(models.Model): tag_name = models.CharField(max_length=100) timestamp = models.DateTimeField(auto_now_add=True, auto_now=False) updated = models.DateTimeField(auto_now_add

Re: memcached and redis

2014-03-02 Thread Robin Lery
Hello, Its no bother. Thank you! I have learnt a lot from you guyz! On Sun, Mar 2, 2014 at 5:27 PM, Andreas Kuhne wrote: > Hi, > > I really don't know if they exist. Check redis.io, you should be able to > see them there. > > Regards, > > Andréas > > >

Re: django and amazon web services

2014-03-04 Thread Robin Lery
Thank you Clifford for the heads up and your advice! On Sun, Mar 2, 2014 at 1:32 AM, CLIFFORD ILKAY wrote: > On 03/01/2014 11:21 AM, Robin Lery wrote: > > Very nicely explained! I was actually hoping to use Amazon RDS with > > postgresql. Your help was very useful. Thank yo

confused about sql in django

2014-03-04 Thread Robin Lery
Hello, I am really being confused. How to use sql in django? I found two: 1. Performing raw queries. 2.Executing custom SQL directly. Does it have better performance than the django's orm? And how is the performance the same between those two? And lastly, what is sqlalchemy? Are sqlalchemy and d

Re: confused about sql in django

2014-03-05 Thread Robin Lery
Thank you Alex and Tom! Its great to know something new. I think I will stick with django orm for now! Thanks again! On Wed, Mar 5, 2014 at 2:48 AM, Tom Evans wrote: > On Tue, Mar 4, 2014 at 8:08 PM, Robin Lery wrote: > > Hello, > > > > I am really being confused. How to

Confused about ContentType

2014-03-05 Thread Robin Lery
Hello, Suppose this is a model for a user's photo: class Photo(models.Model): user = models.ForeignKey(User) title = models.CharField() image = models.ImageField() pub_date = models.DateTimeFied(auto_now=True, auto_now_add=pub_date) update = models.DateTimeFied(auto_now=False, auto_now_ad

Re: Newbie: ImportError during syncdb

2014-03-05 Thread Robin Lery
What the name of the app folder? I think its just django_bookmarks. On Thu, Mar 6, 2014 at 6:43 AM, David wrote: > Dear django users, > > I am new to django and have an ImportError: No module named bookmarks > problem. > > It seems that as I tried to syncdb django does not recognize the > bookm

Re: "Authenticating Users" where should I put the code?

2014-03-06 Thread Robin Lery
This should be in your views.py. On Thu, Mar 6, 2014 at 8:15 PM, Jack Yan wrote: > in the tutorial and section "Authenticating Users": > https://docs.djangoproject.com/en/1.6/topics/auth/default/ > > where can I put code: > > from django.contrib.auth import authenticateuser = > authenticate(us

Different content type objects in django template

2014-03-06 Thread Robin Lery
I am having a hard time to understand ContentType. I am learning from a tutorial, this is the link . I have synced the database, and its working in the admin. But when I try to load the ContentType objects in the template, I get nothing. When I see the page source, the get_rendered_method is not lo

problem in setting up gunicorn and django

2014-03-17 Thread Robin Lery
I am trying to set up gunicorn for Django by following this blog. I created the *gunicorn_start* script and gave it permission: *$ sudo chown -R hello:users /webapps/hello_django* *$ sudo chmod -R g+w

Re: Custom Login page in Django

2014-03-20 Thread Robin Lery
do you have {% csrf_token % } in your forms? On Thu, Mar 20, 2014 at 7:36 PM, Aryak Sengupta wrote: > I am new to Django (but not new to python) and I am looking forward to > create a customized page using django. I have read about django's inbuilt > authentication system but I want build it f

Django and Long Polling

2014-03-22 Thread Robin Lery
Hello, I need to implement long polling in my application to retrieve the events. But I have no idea how to do it. I know the concept of long polling, i.e to leave the connection open, until an event occurs. But how do I do implement this in my project. If you could give me a simple long polling ex

Multiple websocket connection vs single websocket connection when using django channels

2018-04-06 Thread Robin Lery
Hi, Suppose an application has features like Chat, Notification and Activity feeds. I would like to know whether its recommended to have different websocket connection for different feautues for each user. Meaning for chat purpose a separate socket connection, for notification another separate

Re: Multiple websocket connection vs single websocket connection when using django channels

2018-04-07 Thread Robin Lery
. > > About the most I can say is that it works well for us. > > Ken > > > On Friday, April 6, 2018 at 5:10:41 AM UTC-4, Robin Lery wrote: >> >> Hi, >> >> Suppose an application has features like Chat, Notification and Activity >> feeds. >> >

Allow users to vote up, down or nothing

2016-06-06 Thread Robin Lery
Hello, I have made an app to create article. This is the model: class Article(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL) title = models.CharField(max_length=150) body = models.TextField() pub_date = models.DateTimeField(default=timezone.now) tags = models

Cannot login with user credentials

2016-07-23 Thread Robin Lery
I have a made custom user model. class CustomUserManager(BaseUserManager): def _create_user(self, email, username, password, first_name, last_name, date_of_birth, gender, mobile_number, is_active, is_admin, is_superuser): """ Creates and saves a user with g

Re: Cannot login with user credentials

2016-07-23 Thread Robin Lery
But again, with the superuser's credentials, I can login On Sat, Jul 23, 2016 at 12:47 PM, Robin Lery wrote: > I have a made custom user model. > > class CustomUserManager(BaseUserManager): > def _create_user(self, email, username, password, first_name, > last_name, d

Re: Happy New Year 2017

2016-12-31 Thread Robin Lery
Happy new year! On 1 Jan 2017 12:05 a.m., "pradam programmer" wrote: > Happy New Year Guys, i hope this year fill with alot of love, happiness > and Joy to everyone. > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from

Filter a contenttype with the content object's field

2017-01-03 Thread Robin Lery
I creating an app where users can post with its related tags: class Tag(models.Model): name = models.CharField(max_length=255, unique=True) class Post(models.Model): user = models.ForeignKey(User) body = models.TextField() tags = models.ManyToManyField(Tag) pub_date = models.D

Re: Filter a contenttype with the content object's field

2017-01-03 Thread Robin Lery
be with the list of content_object's (i.e. Post of Photo) field (i.e. Post.tags or Photo.tags). On Wed, Jan 4, 2017 at 12:43 AM, Robin Lery wrote: > I creating an app where users can post with its related tags: > > class Tag(models.Model): > name = models.CharField(max_l

Re: Filter a contenttype with the content object's field

2017-01-04 Thread Robin Lery
Yes, this works. Thank you. But, as there are or will be more than one ContentType objects (i.e., Post model and Photo model), how do I iterate over it? Should I query them separately? Like post_activities = Activity.objects.filter(post__tags__in=tags).distinct() photos_activities = Activity.object

Override save method to add list in the many to many field

2017-01-04 Thread Robin Lery
I have this model to save post from the users: class Tag(models.Model): name = models.CharField(max_length=255, unique=True) def add_tags(obj_id, body): object = Post.objects.get(id=obj_id) tag_list = [Tag.objects.create(name=word) for word in body.split()] for tag in tag_list:

Cannot install channels

2017-02-09 Thread Robin Lery
Hi, I already had a django channels in my other virtual env. But since its an older version of channels (0.7.0) I am trying to install a new channel version into my project which is in a different virtual environment inside a a vagrant box. I created a new virtualenv > $ mkvirtualenv newsapp >

Re: Cannot install channels

2017-02-09 Thread Robin Lery
ror. > > Andrew > > On Thu, Feb 9, 2017 at 10:51 PM, Robin Lery wrote: > >> Hi, >> >> I already had a django channels in my other virtual env. But since its an >> older version of channels (0.7.0) I am trying to install a new channel >> version into my pr

Re: Cannot install channels

2017-02-09 Thread Robin Lery
t it was happy with (the more recent releases increased the Twisted > version requirement), or the version of Twisted it downloaded did not > require compilation. > > Andrew > > On Thu, Feb 9, 2017 at 11:10 PM, Robin Lery wrote: > >> Yes that was it. Thank you. Could y

Django rest framework cannot deal with multple objects in model viewset

2017-04-20 Thread Robin Lery
I have a very simple model and its related serializer and views: class Page(models.Model): user = models.ForeignKey(User) title = models.CharField(max_length=255) pub_date = models.DateTimeField(default=timezone.now) class PageSerializer(serializers.ModelSerializer): class Meta:

Django rest framework JWT and custom authentication backend

2017-05-26 Thread Robin Lery
I have a custom user model and have created a custom authentication backend. I am using django rest framework JWT for token authentication. User model: class User(AbstractBaseUser, PermissionsMixin): e

Django runserver not working after installing redis for django channels

2017-09-11 Thread Robin Lery
I am learning the Django-channels concepts and I am stuck when after install the asgi_redis and the redis server . If I have the CHANNEL_LAYERS configured for

Re: Django runserver not working after installing redis for django channels

2017-09-12 Thread Robin Lery
Yes, i think just running `sudo apt-get install redis-server` installs the old version of redis, instead of the latest one. On Mon, Sep 11, 2017 at 6:40 PM, Artem Malyshev wrote: > Hi, > > Please check your redis installation. It should be at least minimum > required version by redis-py. > > Reg

How to authenticate a user in websocket connection in django channels when using token authentication

2017-09-14 Thread Robin Lery
I am using a frontend framework (Vuejs ) and django-rest-framework for the REST API in my project. Also, for JSON web token authentication I am using django-rest-framework-jwt . After a s

Validate and get the user using the jwt token inside a view

2017-09-14 Thread Robin Lery
I am using django-rest-framework for the REST API and django-rest-framework-jwt for JSON web token authentication. After a successful login, the user is provided with a token. I have found how to verify

  1   2   >