Hello Django Warriors!

2012-07-14 Thread Kakar
I'm very new to this Phyton and i just downloaded django package. What i 
wanted to ask was,..can i make a social site where the users itself can 
customize their themes or the layout???
M a vey newbie in programming so please explain me in detail. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/mhyU-KQlfmQJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Is it possible to create website like Squarespace or Wix in django?

2013-04-20 Thread Kakar
Hello everyone! I am really a newbie in the django world, and it might be 
to much to ask now this question, but am just curious. So, is it possible 
to make websites like Squarespace or wix where the user can itself choose 
the template or customize it later on, and also that a programmer can 
change the the css too. Please comment your views. 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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




SQLite database module name???

2013-04-21 Thread Kakar
I am in settings.py and  using SQLite3, but when i run manage.py syncdb it 
tells me: " Value Error: Empty module name." Please help me with this, i 
didn't undesrtood this part.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




SQLite3 database error!!!

2013-04-21 Thread Kakar
I am in settings.py and using SQLite3. But when i execute manage.py syncdb, 
it gives me error: "Value error: Empty module name" I didn't understood 
this part. Plz help me guyz.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Accessing django development server using internet

2013-05-07 Thread Kakar
I have my project in my pc, and on python manage.py runserver, i can view it on 
my browser. But how to view from other computer or on the internet and not 
locally?... How to make my pc a server to view it from over the internet? Plz 
help me guyz!

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Accessing django development server from internet!

2013-05-07 Thread Kakar
I have my project in my pc, and on python manage.py runserver, i can view it on 
my browser. But how to view from other computer or on the internet and not 
locally?... How to make my pc a server to view it from over the internet? Plz 
help me guyz!

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Authenticate users with both username and email

2015-01-15 Thread Kakar Nyori


I have extendted the *UserCreationForm* with email and other fields, so 
that I could authenticate a user with both its username and email.

forms.py:

> class UserCreationForm(UserCreationForm):
> class Meta:
> model = User
> fields = ('first_name', 'last_name', 'username', 'email',)


 
views.py:

def auth_view(request):
> username = request.POST.get('username','')
> password = request.POST.get('password','')
> user = auth.authenticate(username=username, password=password)
> if user is not None:
> auth.login(request, user)
> return HttpResponseRedirect('/')
> elif:
> user = auth.authenticate(email=username, password=password)
> if user is not None:
> auth.login(request, user)
> return HttpResponseRedirect('/')
> else:
> return HttpResponseRedirect('/accounts/invalid_login')


html:


> {%csrf_token%}
> Email or Username:
> 
> Password:
> 
> 
> 



In the views I tried giving both the *username* and *email *as input from 
the form as *name*, and check to see if username and password authenticate. 
If not then check whether email and password authenticate. But its not 
working. How do I solve this problem? Please kindly help 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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0cb8e818-3145-4e91-a374-7b018092f4fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Handle multiple modelforms in one html form

2015-01-17 Thread Kakar Nyori
A user will have photos which will be related with their specific album.

So this was the model for that:

class Album(models.Model):
> user = models.ForeignKey(User)
> title = models.CharField(max_length=200)
> pub_date = models.DateTimeField(auto_now_add=True, auto_now=False)
> update = models.DateTimeField(auto_now_add=False, auto_now=True)
> class Photo(models.Model):
> photo_privacy = models.CharField(max_length=1,choices=PRIVACY, 
> default='F')
> user = models.ForeignKey(User)
> caption = models.TextField()
> image = models.ImageField(upload_to=get_upload_file_name)
> pub_date = models.DateTimeField(auto_now_add=True, auto_now=False)



Views.py:

def create_album(request, user_name):
> user = User.objects.get(username=unquote(user_name))
> if request.method=='POST':
> pform = AlbumPhotoForm(request.POST, request.FILES)
> aform = AlbumForm(request.POST)
> p_valid = pform.is_valid()
> a_valid = aform.is_valid()
> if p_valid and a_valid:
> photo = pform.save(commit=False)
> album = aform.save(commit=False)
> photo.user = user
> album.user = user
> album.save()
> photo.album = album
> photo.save()
> return HttpResponseRedirect('/'+user.username+'/photos')
> else:
> return render(request, 'create_album.html',{
> 'pform':pform,
> 'aform':aform
> })
> else:
> pform = AlbumPhotoForm()
> aform = AlbumForm()
> return render(request, 'create_album.html', {
> 'pform':pform,
> 'aform':aform
> })


And the form:

 enctype="multipart/form-data">
> {% csrf_token %}
> {{ aform.as_p }}
> {{ pform.as_p }}
> 
> 


This works fine if I only have to upload one file (photo) with that form.

However what I want to do is, show minimum of three input for uploading 
photos to the new album:

 enctype="multipart/form-data">
> {% csrf_token %}
> {{ aform.as_p }}
> {{ pform.as_p }}
> {{ pform.as_p }}
> {{ pform.as_p }}
> 
> 


When doing so, only the last *pform* is gets saved. And the other two 
*pform*s are ignored. How do I get to save all the three forms of photo (
*pforms*) accordingly?

Or is there any other way around? Your help will be much appreciated! Thank 
you.

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


amazon s3 and django - Allow only the users from my website and not the anonymous users

2015-02-06 Thread Kakar Nyori
I am using amazon s3 to store uploaded user images. My problems are:

- If I permit or grantee for me, I cannot upload or download the contents.
- If I permit or grantee for everyone, all the users and (especially) 
anonymous users will be able to see the contents, which I don't want.

So, my question is, what do I do so that only the users from my website can 
upload, download and delete the content? 

In that I have conditions that:

 1. Only the users (user1, user2, user3, ...) who are following the user
(user0) can download/view the content?
 2. Only the user who uploaded the view can delete the content.

models.py:

*def get_upload_file_name(instance, filename):*
*return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), 
filename)*

*PRIVACY = (*
*('H','Hide'),*
*('F','Followers'),*
*('A','All'),*
*)*

*class Status(models.Model):*
*body = models.TextField(max_length=200)*
*image = models.ImageField(blank=True, null=True, 
upload_to=get_upload_file_name)*
*privacy = models.CharField(max_length=1,choices=PRIVACY, 
default='F')*
*pub_date = models.DateTimeField(auto_now_add=True, auto_now=False)*
*user = models.ForeignKey(User)*

settings.py:

* DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'*

* AWS_ACCESS_KEY_ID = 'AKIAJQWEN46SZLYWFDMMA'*

* AWS_SECRET_ACCESS_KEY = '2COjFM30gC+rty571E8eNSDYnTdV4cE3aEd1iFTH'*

* AWS_STORAGE_BUCKET_NAME = 'yesme'*

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/cbc5c0d5-cc42-4a67-9414-2fb74fceed1e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: amazon s3 and django - Allow only the users from my website and not the anonymous users

2015-02-07 Thread Kakar Nyori
Hello,
thank you for the response. Could you please give an example as to how to 
do that above mentioned?
Thank you.

On Friday, February 6, 2015 at 11:10:50 PM UTC+5:30, Nikolas 
Stevenson-Molnar wrote:
>
>  It sounds like you want to use signed URLs. Since you're using storages, 
> this should be the default if you use the "url" property. E.g.,
>
> signed_url = status_obj.image.url
>
> Then keep the file itself private. No one will be able to access it 
> without a signed URL, and you can control who gets a signed URL in your 
> Django app.
>
> _Nik
>
> On 2/6/2015 7:51 AM, Kakar Nyori wrote:
>  
>  I am using amazon s3 to store uploaded user images. My problems are:
>
>  - If I permit or grantee for me, I cannot upload or download the 
> contents.
> - If I permit or grantee for everyone, all the users and (especially) 
> anonymous users will be able to see the contents, which I don't want.
>
>  So, my question is, what do I do so that only the users from my website 
> can upload, download and delete the content? 
>
>  In that I have conditions that:
>
>   1. Only the users (user1, user2, user3, ...) who are following the user
> (user0) can download/view the content?
>  2. Only the user who uploaded the view can delete the content.
>
>  models.py:
>
>  *def get_upload_file_name(instance, filename):*
> *return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), 
> filename)*
>
>  *PRIVACY = (*
> *('H','Hide'),*
> *('F','Followers'),*
> *('A','All'),*
> *)*
>
>  *class Status(models.Model):*
> *body = models.TextField(max_length=200)*
> *image = models.ImageField(blank=True, null=True, 
> upload_to=get_upload_file_name)*
> *privacy = models.CharField(max_length=1,choices=PRIVACY, 
> default='F')*
> *pub_date = models.DateTimeField(auto_now_add=True, 
> auto_now=False)*
> *user = models.ForeignKey(User)*
>
>  settings.py:
>
>  * DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'*
>
>  * AWS_ACCESS_KEY_ID = 'AKIAJQWEN46SZLYWFDMMA'*
>
>  * AWS_SECRET_ACCESS_KEY = '2COjFM30gC+rty571E8eNSDYnTdV4cE3aEd1iFTH'*
>
>  * AWS_STORAGE_BUCKET_NAME = 'yesme'*
>  -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django-users...@googlegroups.com .
> To post to this group, send email to django...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/cbc5c0d5-cc42-4a67-9414-2fb74fceed1e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/cbc5c0d5-cc42-4a67-9414-2fb74fceed1e%40googlegroups.com?utm_medium=email&utm_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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/b62f01f0-c775-4b8a-afe8-4d6da8e4a351%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to make a phone number field mandatory like password.

2014-09-26 Thread Kakar Nyori
You can do it in the form itself.

On Fri, Sep 26, 2014 at 8:49 PM, Sachin Tiwari 
wrote:

> Hi
>
> I am learning django and I want to add a phone number field which would be
> mandatory when we use add user button in users section.
>
> I  tried it with blank=False or null=False but it would not work for me.
>
> I am also using django-phone-number field package.
>
>
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/0ba53eda-e569-4521-b83a-4c883ee962e3%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoK3UHV0pV3kZ9CT7kRKik70%2B20XVBcdsDv58cKDR%3Dv_kw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


no module in error log django-1.3.7

2014-10-22 Thread Kakar Nyori
Hello,
I am trying to run a python app in pythonanywhere.com. If I run the project
through the bash it runs without any error. But when I see it in the
browser with the name like myproject.pythonanywhere.com, it display
"something went wrong".
And when I check in the error log, it show me this:

no module named appname.

What went wrong?

This is the path structure of the project:

projectname
--__init__.py
--manage.py
--settings.py
--urls.py
--appname
--__init__.py
--admin.py
--forms.py
--models.py
--views.py
--tests.py
--static
--css
--style.css
--js
--ui.js
--templates
--index.html

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoLeb9u4pf5MGvKX2jkb5c1LsyUJx4CDC9qt6uD0uCeh2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: broken image on my django production site. Why is it?

2014-11-02 Thread Kakar Nyori
I think, you should add "static"/ in your html:



Or else change your directory settings.


On Sat, Nov 1, 2014 at 8:21 PM, rdyact  wrote:

>
> 
> I just product my site using Heroku and I got a odd problem with my media
> images broken. Here is my site structure on Heroku.
>
>  -- app
> -- manage.py
> -- mysite
>-- settings
>  -- __init__.py
>  -- base.py
>  -- production.py
> -- static
>-- media
>   -- product
> -- images
>   --
>-- static_dirs
>-- static_root
>
>
> In my app/mysite/settings/ *init*.py
>
> from .base import *try:
> from .local import *
> live = Falseexcept:
> live = Trueif live:
> from .production import *
>
> and in my base.py
>
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
> STATIC_URL = '/static/'
> MEDIA_URL = '/media/'
> MEDIA_ROOT = os.path.join(BASE_DIR, 'static', 'media')
> STATIC_ROOT = os.path.join(BASE_DIR, 'static', 'static_root')
> STATICFILES_DIRS = (
> os.path.join(BASE_DIR, 'static', 'static_dirs'),)
> TEMPLATE_DIRS = (
> os.path.join(BASE_DIR, 'templates'),)
>
>
> and in my production.py, I annotated as below.
>
> # Static asset configuration# import os# BASE_DIR = 
> os.path.dirname(os.path.abspath(__file__))# STATIC_ROOT = 'staticfiles'# 
> STATIC_URL = '/static/'# STATICFILES_DIRS = (# os.path.join(BASE_DIR, 
> 'static'),# )
>
> Finally, I ran server and I got still broken image shown on my page. When
> I look the image carefully through "google inspect element",I can still see
> the probably right path as below.
>
> 
>
> But when I see my /static/media/products/images/ folder, there were images
> created on development statge only, not the images I just created on
> production site. (aws.png)
>
> As still beginner for django development, It is a tough to find answer
> even after few hour's googling.
>
> Thanks always.
>
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2f1eb33e-c1c0-417f-8665-b8f239540f4d%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoLAeWvJKPDYAGcLR7XYOMDT1CohqcZWEsek3PtbpZdzXw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django + Database Connections

2014-11-11 Thread Kakar Nyori
Very nicely explained.

On Wed, Nov 12, 2014 at 2:55 AM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

> Hi Edward,
>
> On Tue, Nov 11, 2014 at 12:30 AM, Edward Armes 
> wrote:
>
>> Hi there,
>>
>> I am currently looking at Django for a personal project. While I
>> understand how a lot of it works I can't wrap my head around how the actual
>> DB querying is done specifically what part of Django actually looks at the
>> database (I'm not talking about Manager, Models or Querysets, but the
>> actual parts of Django that use the ORM's to get data from the database
>> itself).
>>
>> If a reason is required without going into detail on my current
>> half-baked idea, I'm specifically looking how to handle database operations
>> that have a significant return time by marrying asynchronous environments
>> with synchronous ones. While it may be more efficant to use a non-Django
>> database handler. For now I want to look into using the Django framework
>> without needing additional imports.
>>
>>
> It's not that a *reason* is required - it's that it's not entirely clear
> what you're asking for.
>
> The thing is, Django *itself* doesn't do a lot of querying - Django is a
> template system, and a forms layer, and a database ORM, all nicely
> integrated, so you can easily compose the pieces to do something useful.
> There are places where the forms layer will issue queries (e.g., if you
> want to display a form that has a  representing the available
> options from a model), but that's really at the level of "give me a
> queryset that represents the options I want to display".
>
> The only part of Django *itself* that "uses" Django is the contents of the
> contrib apps - most importantly, contrib.admin, but there are others.
>
> The idea of marrying async and synchronous environments isn't a new one -
> it was the subject of a Google Summer of Code project this year, the result
> of which will hopefully be committed to trunk for 1.8. The core of that
> project was to formalise the API around Django's model layer so that you
> can write a "duck typed" object that will be a substitute for a Django
> model (subject to certain constraints and limitations). Search the
> Django-Developer archive for "Meta Refactor" if you want more details.
> However, that won't let you get away "without needing additional imports" -
> at some point, you're going to need to import your async layer, because
> Django doesn't have one.
>
> I don't know if any of this helps... hopefully it does :-)
>
> Yours,
> Russ Magee %-)
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAJxq848_Oy_oWhLnu5h8dfgT1MW8CKny_ZQKZcQ4nCdO9_W%2B5g%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8oko%2BZquCXnCV5k9WRMevYRMX4Unca_EhimKTQdCCcuzqQAA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Swampdragon, the realtime framework for Django seems interesting. But will it scale ?

2014-11-11 Thread Kakar Nyori
Oooh! Nice one. But its very new though. I would also like to hear from the
experts!!! Thanks for the post though

On Wed, Nov 12, 2014 at 10:07 AM, Suren Sth  wrote:

> I recently came across Swampdragon ( Visit official site
> ). I am curious can it be used in production
> sites and will it scale ? If it can be, what is the best way?
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/74092e59-801e-48f6-ba99-9d6231516b84%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8oko%2BJX98KnUG9erPqHiKtBYLkKypVg32pmeR-dcG5__dVhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Uploadfile form and CSS Style

2014-11-13 Thread Kakar Nyori
Then you need to apply css to the form.

On Fri, Nov 14, 2014 at 1:16 AM, Russo  wrote:

> Hi,
>
> i just implemented the uploadfile form on Django, and everything goes
> greate, but i would like to do if it is possible to apply CSS styles to the
> upload botton on the forms, Anybody knows this?
>
> Regards
> Russo
>
> --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/54650A9B.8040004%40musicparticles.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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8oko%2Bawro-H19b7XG-LXnNc4r%2BmFX0qTx_7kkvSmo%3Dvkg30A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Want to change home->blog to Admin home -> blog

2014-11-15 Thread Kakar Nyori
Your question is unclear. Please try to elaborate more.

On Sat, Nov 15, 2014 at 4:37 PM, Sachin Tiwari 
wrote:

>
>
> On Thursday, November 13, 2014 7:49:28 PM UTC+5:30, Sachin Tiwari wrote:
>>
>>  Hi All,
>>
>>  I want to change Home link at admin page to Admin Home -> blog -> ...
>>
>>  I tried by modifying  base.html and base_site.html in my
>> templates/admin/, but it would not work
>>
>>  {% block breadcrumbs %}
>> 
>> {% trans ' Admin Home' %}
>> {% if title %} › {{ title }}{% endif %}
>> 
>> {% endblock %}
>>
>>
>>
> Please 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/e1a4bc9d-e946-40b9-b5a5-db87b3c75515%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoLyPKzeDyvzLTKQZFdGxN3wexqABvpSghxBK3YRwBH7Zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Uploadfile form and CSS Style

2014-11-18 Thread Kakar Nyori
Hello Russo,

You need to select the input button in the css. Something like this:

input[type=submit] {
background-color: transparent;
border:none;
cursor:pointer;
background-color:blue;
color:white;
}

Note that this will select every "submit" type button in your html. So if
you don't want all of them to be like the above, then you need to provide
the ID and and then select the submit button. You can check it by the *inspect
element tool, *as Collin has described. Or you can manually do it in your
forms as Donarb has described.

Hope this will make some sense.

Cheers!

On Tue, Nov 18, 2014 at 6:12 AM, donarb  wrote:

> On Monday, November 17, 2014 5:00:54 AM UTC-8, Russo wrote:
>>
>> Hi James,
>>
>> sorry I'm new on Django, can you give me some code example? I mean, hot
>> to define the CLASS or ID into the html with elements like this {{
>> form.docfile }} ?
>>
>> Regards
>> Russo
>>
>>
>> El jueves, 13 de noviembre de 2014 15:48:16 UTC-4:30, James Schneider
>> escribió:
>>>
>>> If you are manually expressing the form, then you can add classes and
>>> ID's to any or all elements in the form. Even if you are using something
>>> like the {{ form.as_p }} method to display the form, you can still style it
>>> using CSS styles at the tag level. Just include a custom CSS file with your
>>> template.
>>>
>>> -James
>>> On Nov 13, 2014 12:13 PM, "Russo"  wrote:
>>>
>>>>  Hi Kakar,
>>>>
>>>> but i tried and there is not way to change the bottom style, see the
>>>> html code
>>>>
>>>> 
>>>> >>> enctype="multipart/form-data">
>>>> {% csrf_token %}
>>>>
>>>> {{ form.non_field_errors }}
>>>> {{ form.docfile.label_tag }} {{ form.docfile.help_text
>>>> }}
>>>> 
>>>> {{ form.docfile.errors }}
>>>> {{ form.docfile }}
>>>> 
>>>> 
>>>> 
>>>>
>>>> as it is a form there is no way to change style ¿?
>>>>
>>>> Regards/AR
>>>>
>>>>
>>>> El 13/11/2014 a las 03:37 p.m., Kakar Nyori escribió:
>>>>
>>>> Then you need to apply css to the form.
>>>>
>>>> On Fri, Nov 14, 2014 at 1:16 AM, Russo 
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> i just implemented the uploadfile form on Django, and everything goes
>>>>> greate, but i would like to do if it is possible to apply CSS styles to 
>>>>> the
>>>>> upload botton on the forms, Anybody knows this?
>>>>>
>>>>> Regards
>>>>> Russo
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "Django users" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to django-users...@googlegroups.com.
>>>>> To post to this group, send email to django...@googlegroups.com.
>>>>> Visit this group at http://groups.google.com/group/django-users.
>>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>>> msgid/django-users/54650A9B.8040004%40musicparticles.com.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>>
>>>>  --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users...@googlegroups.com.
>>>> To post to this group, send email to django...@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> To view this discussion on the web visit https://groups.google.com/d/
>>>> msgid/django-users/CA%2B8oko%2Bawro-H19b7XG-LXnNc4r%
>>>> 2BmFX0qTx_7kkvSmo%3Dvkg30A%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/django-users/CA%2B8oko%2Bawro-H19b7XG-LXnNc4r%2BmFX0qTx_7kkvSmo%3Dvkg30A%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>>  

Review needed

2014-03-02 Thread Kakar Nyori
Hello,
This may be long, but I really need your help. I have a class *Asset*, 
which is the *base class* of another *classes *(like *Photo, Question, 
Video etc.*) Basically its a *Multiple Table Inheritance*. I need this to 
get all the post or all the *objects* of the user. And it does what I want. 
But I saw that, many were against *Multiple Table Inheritance, *or if not 
they discouraged MTI. So, I really need to know that, *how much will it 
matter*? Or is there any other way to achieve it. To get all the objects of 
a *User*? Please help me decide what to do. If I am not clear, please ask 
me. I will really appreciate if anyone would guide me through this.

Thank you.

*This are my models:*


class Asset(models.Model):
user = models.ForeignKey(User, related_name = "user_objects")
likes = models.ManyToManyField(User, through="Like", 
related_name="Liked_user")
comments = models.ManyToManyField(User, through="Comment", 
related_name="Commented_user")
timestamp = models.DateTimeField(auto_now = True, auto_now_add= False)
updated = models.DateTimeField(auto_now = False, auto_now_add = True)

class Meta:
ordering = ['-timestamp']

def __unicode__(self):
return self.__class__.__name__

class Like(models.Model):
asset = models.ForeignKey(Asset)
liked_by = models.ForeignKey(User)
liked_time = models.DateTimeField(auto_now = True, auto_now_add = False)

def __unicode__(self):
return "%s likes %s" % (self.liked_by, self.asset)

class Comment(models.Model):
asset = models.ForeignKey(Asset)
comment_by = models.ForeignKey(User)
liked_time = models.DateTimeField(auto_now = True, auto_now_add = False)

def __unicode__(self):
return "%s likes %s" % (self.comment_by, self.asset)

def get_upload_file_name(instance, filename):
return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), filename)

class Album(Asset):
title = models.CharField(max_length=200)
description = models.TextField()

def __unicode__(self):
return self.__class__.__name__


class Picture(Asset):
description = models.TextField()
image = models.ImageField(upload_to=get_upload_file_name)
album = models.ForeignKey(Album, null=True, blank=True, default = None)

def __unicode__(self):
return self.__class__.__name__

class BackgroundImage(Picture):
pass

class ProfilePicture(Picture):
pass

class Tag(models.Model):
title = models.CharField(max_length=40)
description = models.TextField()

def __unicode__(self):
return self.title

class Question(Asset):
title = models.CharField(max_length=200)
description = models.TextField()
tags = models.ManyToManyField(Tag)

def __unicode__(self):
return self.title

class Answer(Asset):
description = models.TextField()
question = models.ForeignKey(Question)

def __unicode__(self):
return self.description

-- 
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/871d20b8-17a3-4ed4-bb8e-3c0befb5121f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Django and Long Polling

2014-03-23 Thread Kakar Nyori
You mean requesting db in the given time?


On Sun, Mar 23, 2014 at 8:50 AM, Venkatraman S  wrote:

> Why not use (async)callbacks?
>
> -V
>
>
> On Sun, Mar 23, 2014 at 1:11 AM, Robin Lery  wrote:
>
>> 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 example of client side and the views i guess, I would really
>> appreciate.
>>
>> Thank you!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2B4-nGpvKHcMg-mMRbf7%2BVceCAkRwipt_8NvojEw43ALhC2YBw%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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN7tdFQKUvNQ69NA_K58R1tz2R_HW2eE%2BvwrFr-7hqVRUDO8tg%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8oko%2Bc2VGkb4Wu%2Bd-ko2_ROyD1xROjvUyYWW_QHKMNK9K_AQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re:Autoupdate

2014-04-14 Thread Kakar Nyori
Ajax is the way to go. Or else, web sockets.
On Apr 14, 2014 5:59 PM, "Saransh Mehta"  wrote:

> I want some data to autoupdate on my homepage as more entries come into
> the database. It is more or less like the news feed feature of Facebook.
> How do we do that?
>
>  --
> 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 http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/736ef367-3ca0-456b-8c8e-3f792946dca4%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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B8okoLaCnGSf7Zd8RQK_Wd8bC3jTWPaP8HUU%3DpmutJTcn%2BS8w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Create objects using a start date, an end date and time list

2018-02-15 Thread Kakar Nyori
I have an Event model, and each event will have different shows.

class Event(models.Model):
title = models.CharField(max_length=200)

class Show(models.Model):
event = models.ForeignKey(Event, on_delete=models.CASCADE)
date_time = models.DateTimeField(unique=True)

class Ticket(models.Model):
show = models.ForeignKey(Show)
seat = models.ForeignKey(Seat)

class Meta:
unique_together = ('show', 'seat')

I need to create shows based on the start date and end date provide by the 
user. Suppose this is a JSON post:

{
"event_id": 1,
"start_date": "2018-02-16",
"end_date": "2018-02-20",
"time_list": ["11:00 AM", "8:00 PM"]
}

>From the above JSON example, I need to create Show starting like this:

# Start with the start_date as the date, and for each time from the 
time_list
Show.objects.create(
event = 1,
date_time = datetime.strptime('2018-02-16 11:00 AM', "%Y-%m-%d 
%I:%M %p")
)
Show.objects.create(
event = 1,
date_time = datetime.strptime('2018-02-16 8:00 PM', "%Y-%m-%d %I:%M 
%p")
)
# Next date after the start_date, i.e., 16+1 = 17
Show.objects.create(
event = 1,
date_time = datetime.strptime('2018-02-17 8:00 PM', "%Y-%m-%d %I:%M 
%p")
)
.
.
.
# Create Show objects till the end_date and for each time from the 
time_list
Show.objects.create(
event = 1,
date_time = datetime.strptime('2018-02-20 8:00 PM', "%Y-%m-%d %I:%M 
%p")
)

Right now this is how I am creating Show objects:

def create_show_by_datetime(self, request):
event_id = request.data['event_id']
start_date = request.data['start_date']
end_date = request.data['end_date']
time_list = request.data['time_list']

format = '%Y-%m-%d'
delta_days = datetime.strptime(end_date, format).date() - 
datetime.strptime(start_date, format).date()
delta_days = delta_days.days + 1

for i in range(delta_days):
day = datetime.strptime(start_date, format) + timedelta(days=i)
for i in range(len(time_list)):
hrs = datetime.strptime(time_list[i], "%I:%M %p").hour
mins = datetime.strptime(time_list[i], "%I:%M %p").minute
event = Event.objects.get(id=event_id)
dt = day + timedelta(hours=hrs, minutes=mins)
show = Show.objects.create(
event=event,
date_time=dt
)

But I am really hoping there's much more elegant way than how I am doing. I 
am using python 3, django 2 and django rest frameowork. Could you please 
help 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 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/813ca752-f1e1-47d7-9ebb-a8bdb7e2ed59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Understanding django channels persistant data

2016-12-20 Thread Kakar Nyori
I am trying to grasp the concept of persistant data in django channels
.
I have searched the reference and other parts but didn't clear my
confusion. I would really appreciate if you help me understand better.

consumers.py:

@channel_sessiondef ws_connect(message):
# Work out room name from path (ignore slashes)
room = message.content['path'].strip("/")
# Save room in session and add us to the group
message.channel_session['room'] = room
Group("chat-%s" % room).add(message.reply_channel)

Q.1 In the above line message.channel_session['room'], is the room another
property of the message? Like it tells which session the message belongs to?

@channel_sessiondef ws_message(message):
Group("chat-%s" % message.channel_session['room']).send({
"text": message['text'],
})

Q2. In the line Group("chat-%s" % message.channel_session['room']).send({,
why are we not using the *room* variable like in the ws_connect() function,
but instead we are using the channels_session?

@channel_sessiondef ws_disconnect(message):
Group("chat-%s" %
message.channel_session['room']).discard(message.reply_channel)

Q3. Same like above, why are we not using the *room* variable to discard
from the group? Also is it not neccesary to remove the room from the
session?

-- 
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/CA%2B8okoJ70Nba%3Dfw9k-10C3UASXMwFkayR7ApdjTEVg1s23bT-Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding django channels persistant data

2016-12-20 Thread Kakar Nyori
Wow, from the creator himself! Thank you.
>
>
Just so we're clear, *message.channel_session['key']* is the same as 
*request.session['key']*, did I get you correctly?

And there's just this another confusion, why can't we us *"text": 
message.content['text']*, but instead its *"text": message['text']*?

Thank you
Kakar Nyori

-- 
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/fdf12336-d67d-4759-8d45-02493b5cd341%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Understanding django channels persistant data

2016-12-20 Thread Kakar Nyori
Hi,

Yes that was it. Although I was getting this error:
*ERROR - worker - Error processing message with consumer 
myproject.consumers.ws_message:*

But this was corrected after the *enforce_ordering *was added into the 
consumer function. Thank you so much for your help and for introducing such 
a great tool for us.

Kakar Nyori

-- 
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/bbeb22a4-4d01-4673-8f0c-2fe60de33ed0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: What is the best combination of components when installing Django on Windows 10?

2016-12-28 Thread Kakar Nyori
Hi,

I use windows, and I too was confused about these things. The best 
recommendation I got was to use *Vagrant, *and to this day I use it. 

*"Vagrant is a tool for building complete development environments."*

Basically you select an environment like ubuntu OS (called vagrant box), 
and then you add it as your vagrant environment. With this as your local 
development you get many benefits:

1. Since you will eventually be using OS like ubuntu in production, you get 
the same environment for the development as well.
2. You can play around with the environment.
3. And since you have the production like environment, you can basically do 
all the stuff you would do in production. Like you want gunicorn, ok, 
install it in your vagrant environment and use it.
4. You can administer and practice in the machine like you would do for the 
production.
5. You can have the same exact configuration that is in your production 
machine.

Hope this will be helpful to you as it was for me. And again, this may not 
be the best practice for someone else.

Cheers!

Kakar.

-- 
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/dd29d891-2f17-411c-9a5c-a102e2ce0ae2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Migrating from django user model to a custom user model

2017-03-14 Thread Kakar Nyori


I am following these two references (one 
 and two 
)
 
to have a custom user model in order to authenticate via email and also to 
add an extra field to it.


class User(AbstractBaseUser, PermissionsMixin):
email = models.EmailField(
unique=True,
max_length=254,
)
mobile_number = models.IntegerField(unique=True)
is_active = models.BooleanField(default=True)
is_admin = models.BooleanField(default=False)

objects = UserManager()
...
...
class Meta:
db_table = 'auth_user'
...
...


As you can see, I have added the db_table='auth_user' into the Meta fields 
of the class. Also, I have included AUTH_USER_MODEL = 'accounts.User' and 
the User model app (i.e., accounts) into the INSTALLED_APPS in settings.py. 
Further more, I deleted the migrations folder from the app.


Then tried migrating:

$ python manage.py makemigrations accountsMigrations for 'accounts':
  accounts/migrations/0001_initial.py:
- Create model User

$ python manage.py migrate accounts

Which gives me an error:

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration 
admin.0001_initial is applied before its dependency accounts.0001_initial 
on database 'default'.

How can I migrate from the existing django user model into a custom user 
model? Could you guys please help me out.


Thank you

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


How to django with jquery-mobile

2015-07-29 Thread Kakar Nyori
Django provides many features for the template (extends, block content
etc.) I am just learning jquery mobile, but so far when using jquery
mobile, there's just one actual html page and inside it we have to create a
page (data-role="page"). So, how can we utilize the django's templating
features with jquery mobile? Or how to django with jquery mobile? Please
help me understand this concept. Thank you.

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


Re: Hello Django Warriors!

2012-07-17 Thread Kakar Arunachal Service
On Sun, Jul 15, 2012 at 2:56 AM, Timothy Makobu  wrote:

> Django Warr  LOL!
>
> Have a look at Pinax http://pinaxproject.com/
>
>
> On Sun, Jul 15, 2012 at 5:18 AM, Kurtis Mullins 
> wrote:
>
>> On Sat, Jul 14, 2012 at 4:44 PM, Kakar 
>>
>> I'm very new to this Phyton and i just downloaded django package. What i
>>> wanted to ask was,..can i make a social site where the users itself can
>>> customize their themes or the layout???
>>> M a vey newbie in programming so please explain me in detail. Thank you.
>>>
>>> Hey,
>>
>> Welcome to Python and Django! Of course you can. I'd suggest starting
>> with the Django Tutorial to understand the framework and of course learning
>> a bit about the Python programming language before jumping into a task that
>> large.
>>
>> For an example site that provides this functionality (still a work in
>> progress), check out fireflie.com. You have to register to see the
>> functionality but feel free to ignore the subscription after 8 days --
>> unless you're a musician and want to actually use the site.
>>
>> (Disclaimer: I am the lead developer of fireflie.com, my intention is
>> not to advertise here but to show you one example of a site providing this
>> functionality with Python/Django as a back-end. If you do give it a try and
>> don't actually intend on using fireflie.com for its intended purpose,
>> please send in a Account Removal request after you've finished checking it
>> out.)
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
Thanks guys!!! N Kurtis, ur site is gr8! Specially coz m a music lover too!
But i want to add one more question, what if the users itself want to
change its background! I mean the whole theme (the header, and the
background) too? I think i cleared u ri8? Pls ask me if you ddnt
understood. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is it possible to create website like Squarespace or Wix in django?

2013-04-20 Thread Kakar Arunachal Service
Thank u so much! Now i know django is my way to go.


On Sun, Apr 21, 2013 at 10:28 AM, Shawn Milochik  wrote:

> I don't think there's any kind of site you *can't* make with Django. It's
> a Web framework, not a CMS.
>
> It's definitely possible (and trivial) to offer a wide variety of
> templates. It's also possible to allow a user to customize and save a
> template, but that comes with a whole host of security risks you'll have to
> consider.
>
> The CSS is a slightly different matter, as Django is not in the business
> of serving static content. However, if you're already customizing HTML
> templates you can customize some CSS there. For that matter, you could
> allow them to change the CSS link in the template to one of many choices
> you provide, or to their own server/CDN. Again, that's probably a bad idea
> for various security reasons, although technically possible.
>
>
>
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Accessing django development server from internet!

2013-05-07 Thread Kakar Arunachal Service
Thank you for your reply! But coud you pls explain in detail how to make it
available over the internet. And i dont have a router, m running it on my
laptop. Pls advise.


On Tue, May 7, 2013 at 11:10 PM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:

>  Keep in mind that the Django development server is designed neither for
> security nor performance, so under no circumstances should you use it as a
> production server. With that said, assuming you're using this for* 
> *development
> purposes, change your manage.py runserver command to bind to the address
> 0.0.0.0. E.g:
>
> $ python manage.py runserver 0.0.0.0
>
> This should make is available to your local network (if not, you may need
> to add the machines your accessing it from to your INTERNAL_IPS setting).
> To make it available over the internet (*not suggested!)* you'll need to
> configure your router.
>
> _Nik
>
>
> On 5/7/2013 8:43 AM, Kakar wrote:
>
> I have my project in my pc, and on python manage.py runserver, i can view it 
> on my browser. But how to view from other computer or on the internet and not 
> locally?... How to make my pc a server to view it from over the internet? Plz 
> help me guyz!
>
>
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Accessing django development server using internet

2013-05-07 Thread Kakar Arunachal Service
Sorry, i'm on win 7.


On Tue, May 7, 2013 at 9:30 PM, Shawn Milochik  wrote:

> pip install gunicorn, then run python manage.py run_gunicorn instead of
> runserver.
>
> Ensure that the port you're running your app on is being handled properly
> by your Web server app (nginx or Apache). This means that hits to your URL
> hit the Web server and are being directed internally at your listening port.
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




no module name.models

2013-05-18 Thread Kakar Arunachal Service
I'm practicing from a book Begining django e-commerce and m stuck in one
place. My project name is ecomstore, and in it i have two app, one is
preview and the other is catalog. In my preview app, there's just html in
the templates dir, and thats not the problem, because the result was fine
when i ran the server. And then i made a new app, catalog. It has two
models, Category and Product. Then to register it with the admin, i made
one admin.py file. And there i imported those two module by:
from django.contrib import admin
from django.ecomstore.catalog.models import Category, Product
...and some other forms related import.
Then when i run the server, i get an Import error: No module named
catalog.models.
I have installed my app in settings.py.  Hope u guys could solve my problem.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




no module name error

2013-05-18 Thread Kakar Arunachal Service
I'm practicing from a book Begining django e-commerce and m stuck in one
place. My project name is ecomstore, and in it i have two app, one is
preview and the other is catalog. In my preview app, there's just html in
the templates dir, and thats not the problem, because the result was fine
when i ran the server. And then i made a new app, catalog. It has two
models, Category and Product. Then to register it with the admin, i made
one admin.py file. And there i imported those two module by:
from django.contrib import admin
from django.ecomstore.catalog.models import Category, Product
...and some other forms related import.
Then when i run the server, i get an Import error: No module named
catalog.models.
I have installed my app in settings.py.  Hope u guys could solve my problem.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name error

2013-05-18 Thread Kakar Arunachal Service
Oh..m sorry. I mistyped, it was not django.ecomstore.catalog.models, but
just, ecomstore.catalog.models import Category, Product. N in the catalog
dir, it has __init__.py file, so should have done the problem. N m using
sqlite3 so i dnt need adapters too. Pls 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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name error

2013-05-18 Thread Kakar Arunachal Service
ecomstore is the project name. And within it, it has another ecomstore,
which has the __init__.py, settings.py, urls.py and wsgi.py. And yes
catalog too has the __init__.py file in it, as it was created by the
startapp command. The error says, import error: no module named
catalog.models in admin.py line 2, which is, from ecomstore.catalog.models
import Category Product.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name error

2013-05-18 Thread Kakar Arunachal Service
The directory is as follows:
ecomstore
--manage.py
--ecomstore
  __init__.py
 settings.py
 urls.py
 wsgi.py
--preview
 __init__.py
 models.py
 views.py
 test.py
--templates
 --tags
   navigation.html
 base.html
 catalog.html
 index.html
--static
 css.css
--catalog
 __init__.py
 admin.py
 forms.py
 models.py
 tests.py
 views.py

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name error

2013-05-18 Thread Kakar Arunachal Service
Ok i removed ecomstore from,
from ecomstore.catalog.models import Product, Category
to
from catalog.models import Product, Category
And i think it worked fine. But now again it gives an error:
ImproperlyConfigured at/catalog - 'ProductAdmin.exclude' refers to field
'created_at' that is missing from the form.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name error

2013-05-18 Thread Kakar Arunachal Service
And by the way thanks for being patience with me!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name erro

2013-05-18 Thread Kakar Arunachal Service
Ok i got d solution for ProductAdmin not in the form problem. But thanks
again!

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: no module name.models

2013-05-19 Thread Kakar Arunachal Service
Thanks! But i gt d solution, i just had to import catalog.models, as it was
in my project folder. Thanks by d way!

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




postgresql

2013-05-20 Thread Kakar Arunachal Service
hi guyz!
I'm new to django and python, and very new to postgresql. Can u suggest any
books or tutorial for postgresql???

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




theme generator

2013-05-21 Thread Kakar Arunachal Service
Hi!
Is there any kind of theme generator or css generator for django?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




view data tables?

2013-05-25 Thread Kakar Arunachal Service
Hi, how to view the tables in pg admin for postgresql database, or in
workbench for mysql db.?? Like there's sqlite databse browser for sqlite3.
Any other GUI maybe?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: view data tables?

2013-05-25 Thread Kakar Arunachal Service
Sad, i'm on windows! So, can u tell me how to view the tables that i
created after syncdb django in pg admin3, there were so many tables. M
sorry, m jst a begginer. I dont understand much.


On Sun, May 26, 2013 at 5:51 AM, Drew Ferguson wrote:

> On Sun, 26 May 2013 05:23:08 +0530
> Kakar Arunachal Service  wrote:
>
> > Hi, how to view the tables in pg admin for postgresql database, or in
> > workbench for mysql db.?? Like there's sqlite databse browser for
> > sqlite3. Any other GUI maybe?
> >
>
> Is this what you are looking for?
>
>
> http://stackoverflow.com/questions/835069/which-sqlite-administration-console-do-you-recommend
>
> On my Linux system, sqliteman gets the billing
>
> "The best developer's and/or admin's GUI tool for Sqlite3 in the world"
>
> someone thinks it is good. I wouldn't know
> --
> Drew Ferguson
>
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: view data tables?

2013-05-30 Thread Kakar Arunachal Service
thanks It worked pretty well!


On Sun, May 26, 2013 at 6:47 AM, Drew Ferguson wrote:

> On Sun, 26 May 2013 06:14:11 +0530
> Kakar Arunachal Service  wrote:
>
> > Sad, i'm on windows! So, can u tell me how to view the tables that i
> > created after syncdb django in pg admin3, there were so many tables. M
> > sorry, m jst a begginer. I dont understand much.
>
> So you are using Postgres and pgadmin3; below applies to all
> databases
>
> the tables you are interested in are
>
> django_* tables for the admin site
> auth_* tables for django user/group authentication
> _ tables for models you have defined
>
> Tables created from your model classes in models.py are named using your
> application name followed by the model name.
> If your application is called "my_app" and you define a model "my_model"
> then the table in the database will be
>
> my_app_my_model
>
> unless you over-ride it
>
> see also
> https://docs.djangoproject.com/en/1.5/ref/models/options/#table-names
>
>
> >
> >
> > On Sun, May 26, 2013 at 5:51 AM, Drew Ferguson
> > wrote:
> >
> > > On Sun, 26 May 2013 05:23:08 +0530
> > > Kakar Arunachal Service  wrote:
> > >
> > > > Hi, how to view the tables in pg admin for postgresql database, or in
> > > > workbench for mysql db.?? Like there's sqlite databse browser for
> > > > sqlite3. Any other GUI maybe?
> > > >
> > >
> > > Is this what you are looking for?
> > >
> > >
> > >
> http://stackoverflow.com/questions/835069/which-sqlite-administration-console-do-you-recommend
> > >
> > > On my Linux system, sqliteman gets the billing
> > >
> > > "The best developer's and/or admin's GUI tool for Sqlite3 in the world"
> > >
> > > someone thinks it is good. I wouldn't know
> > > --
> > > Drew Ferguson
> > >
> > > --
> > > 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 http://groups.google.com/group/django-users?hl=en.
> > > For more options, visit https://groups.google.com/groups/opt_out.
> > >
> > >
> > >
> >
>
>
>
> --
> Drew Ferguson
>
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




linux or windows

2013-05-31 Thread Kakar Arunachal Service
Hi!
I know this question is one absurd question, but just out of curiosity, is
it important to use linux other than the windows, related to django. Cause
i'm in windows, and if it is, then i was thinking to use Ubuntu. Please
advise.

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-05-31 Thread Kakar Arunachal Service
thanks!! So, for the production purpose, one must use linux?


On Fri, May 31, 2013 at 4:49 PM, Avraham Serour  wrote:

> for development purposes it shouldn't make a difference, on your server I
> believe ubuntu would be a better choice than windows
> on the other hand if your server is ubuntu some might choose to use it for
> development also, to be as close as possible to the production environment
>
>
> On Fri, May 31, 2013 at 2:15 PM, Jonas Geiregat wrote:
>
>>
>> On 31 May 2013, at 13:11, Kakar Arunachal Service wrote:
>>
>> > Hi!
>> > I know this question is one absurd question, but just out of curiosity,
>> is it important to use linux other than the windows, related to django.
>> Cause i'm in windows, and if it is, then i was thinking to use Ubuntu.
>> Please advise.
>>
>> The platform is unimportant, if you feel at home in windows then use
>> windows else use whatever you like as long as it is supported by django.
>>
>> On a UNIX based system, you could perfectly run/debug django, without
>> touching anything like a shell, inside your IDE of choice .
>>
>> --
>> 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 http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-05-31 Thread Kakar Arunachal Service
ok thanks!


On Fri, May 31, 2013 at 5:07 PM, Huy T  wrote:

> Without regarding any other topics, you will find more information dealing
> with *nix and django/python versus a Windows environment. So from an
> information perspective, you'd be doing yourself a disservice if you
> weren't familiar with a unix/linux flavor (not saying you aren't).
>
> Also, security is better historically (may have to check on that one.)
>
>
> On Fri, May 31, 2013 at 7:26 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> thanks!! So, for the production purpose, one must use linux?
>>
>>
>> On Fri, May 31, 2013 at 4:49 PM, Avraham Serour wrote:
>>
>>> for development purposes it shouldn't make a difference, on your server
>>> I believe ubuntu would be a better choice than windows
>>> on the other hand if your server is ubuntu some might choose to use it
>>> for development also, to be as close as possible to the production
>>> environment
>>>
>>>
>>> On Fri, May 31, 2013 at 2:15 PM, Jonas Geiregat wrote:
>>>
>>>>
>>>> On 31 May 2013, at 13:11, Kakar Arunachal Service wrote:
>>>>
>>>> > Hi!
>>>> > I know this question is one absurd question, but just out of
>>>> curiosity, is it important to use linux other than the windows, related to
>>>> django. Cause i'm in windows, and if it is, then i was thinking to use
>>>> Ubuntu. Please advise.
>>>>
>>>> The platform is unimportant, if you feel at home in windows then use
>>>> windows else use whatever you like as long as it is supported by django.
>>>>
>>>> On a UNIX based system, you could perfectly run/debug django, without
>>>> touching anything like a shell, inside your IDE of choice .
>>>>
>>>> --
>>>> 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 http://groups.google.com/group/django-users?hl=en.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>  --
>>> 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 http://groups.google.com/group/django-users?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> 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 http://groups.google.com/group/django-users?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-05-31 Thread Kakar Arunachal Service
Ok! Thank u so much!

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-05-31 Thread Kakar Arunachal Service
Thanks! Learned many things!


On Fri, May 31, 2013 at 6:57 PM, Javier Guerra Giraldez
wrote:

> On Fri, May 31, 2013 at 7:55 AM, Mike Dewhirst 
> wrote:
> > I don't know of anyone voluntarily using Windows as a Django production
> > server platform.
>
>
> not sure if it counts as "voluntarily", but if you _have_ to use MS
> SQL Server, the DB client options on Linux aren't getting any better,
> so soon the best option will be to put the appserver on windows too.
>
> so it seems a very good reason to avoid MS SQL Server.  it's sad,
> since that was by far the best server product from MS.  Fortunately,
> the other big DBs (PostgeSQL, DB2, Oracle) count Linux frienship as a
> core strategy
>
>
> --
> Javier
>
> --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: linux or windows

2013-06-01 Thread Kakar Arunachal Service
Thanks!


On Sat, Jun 1, 2013 at 9:04 PM, Artem Zinoviev  wrote:

> Django is a python. And nothing more... if you want be a python developer
> linux is must have. Of course you can develop in windows and play with you
> code some times... But a lot of python package don`t work in windows. if
> you want meet new problem every day - windows is your choice :)
>
> пятница, 31 мая 2013 г., 14:11:23 UTC+3 пользователь Kakar написал:
>
>> Hi!
>> I know this question is one absurd question, but just out of curiosity,
>> is it important to use linux other than the windows, related to django.
>> Cause i'm in windows, and if it is, then i was thinking to use Ubuntu.
>> Please advise.
>>
>  --
> 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 http://groups.google.com/group/django-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




postgresql 64 bit in python 32 bit

2013-06-03 Thread Kakar Arunachal Service
Hi,
I just uninstalled python 64 bit and reinstalled python 32 bit. So i have
postgresql 64 bit in my system. Will it a problem later if i use 32 bit
python in 64 bit postresql?

-- 
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 http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: What is the best practice to learn Django 1.5?

2013-06-28 Thread Kakar Arunachal Service
For me, Beginning Django E-commerce by James McGaw was very helpful! Hope
this helped you.


On Fri, Jun 28, 2013 at 8:08 PM, Mike Dewhirst wrote:

> On 28/06/2013 11:47pm, Roberto López López wrote:
>
>> Two scoops of django is also a good book https://django.2scoops.org/
>>
>
> +1
>
>
>
>>
>> On 06/28/2013 03:45 PM, Gabriel wrote:
>>
>>>
>>> Hey, you could also try Getting Started With Djangorest, that's a
>>> series of classes in everything you might need to become a Django dev.
>>>
>>> -Gabe
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to 
>>> django-users+unsubscribe@**googlegroups.com
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> Visit this group at 
>>> http://groups.google.com/**group/django-users
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to 
> django-users+unsubscribe@**googlegroups.com
> .
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/django-users
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out
> .
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




nginx and apache

2013-07-01 Thread Kakar Arunachal Service
Hi,
I am very confused with these two. I know about apache, but not much. And
then i came across nginx and that its much faster and easier than apache.
Please guide me.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




django admin

2013-07-02 Thread Kakar Arunachal Service
Hi!
I am really confused here Can i change the admin url??? Or does it always
have to be
"www.example.com/admin"   ???

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nginx and apache

2013-07-02 Thread Kakar Arunachal Service
Thanks. So, nginx is good for both static and app files too?


On Tue, Jul 2, 2013 at 3:18 AM, Rafael E. Ferrero
wrote:

> i installed apache, its strong but seems to nginx its more faster... i'll
> planning change to nginx... are some people using nginx for static server
> and apache for app server... others says that nginx with lighttpd its more
> faster (and better for concurrency).
> For now im using only one web-server.
>
> Cheers
>
>
> 2013/7/1 Kakar Arunachal Service 
>
>> Hi,
>> I am very confused with these two. I know about apache, but not much. And
>> then i came across nginx and that its much faster and easier than apache.
>> Please guide me.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: django admin

2013-07-02 Thread Kakar Arunachal Service
Thanks a ton! :D


On Tue, Jul 2, 2013 at 9:13 PM, Deepak Sharma wrote:

> On Tue, Jul 2, 2013 at 9:05 PM, Kakar Arunachal Service
>  wrote:
> > I am really confused here Can i change the admin url??? Or does it always
> > have to be
> > "www.example.com/admin"   ???
>
>
> Hi,
>
> Yes, you can change this. At the place of www.example.com give your IP
> address or if you are using this on localhost, change same with
> localhost.
>
> --
> Deepak Kumar Sharma
> Blog:
> http://deekysharma.wordpress.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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nginx and apache

2013-07-02 Thread Kakar Arunachal Service
Can you please suggest any good tutorial regarding this. And i'm on
windows. :(

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nginx and apache

2013-07-03 Thread Kakar Arunachal Service
Thanks Rafael!


On Wed, Jul 3, 2013 at 12:08 AM, Rafael E. Ferrero  wrote:

> https://code.djangoproject.com/wiki/DjangoAndNginx
> http://wiki.nginx.org/DjangoFastCGI
>
> its a start. ;)
>
>
> 2013/7/2 Kakar Arunachal Service 
>
>> Can you please suggest any good tutorial regarding this. And i'm on
>> windows. :(
>>
>> --
>> 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 http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>
>
> --
> Rafael E. Ferrero
> Claro: (03562) 15514856
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




alternate to gunicorn

2013-07-03 Thread Kakar Arunachal Service
Hi,
If i was to use nginx in windows, is ther any alternate to Gunicorn for
windows environment.

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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




model relationship

2013-07-05 Thread Kakar Arunachal Service
Hello,
Please guide me in model relationship. When to use many to many, many to
one, one to one relationships??? I'm all confused.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




redirct page

2013-07-06 Thread Kakar Arunachal Service
Hi,
I am having trouble with redirecting the login page to index page. Please
guide me.

Here's the html snippet:

User Login
{% if form.errors %}
Your username and password didn't match.
Please try again.
{% endif %}

Username:{{ form.username
}}
Password:{{ form.password
}}





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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Kakar Arunachal Service
Hello! Thanks for the correction! But even after the {% csrf_token %} tag
its not redirecting to the main index page. :(


On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich wrote:

> Hi there,
> you're certaily missing {% csfr_token %} in your form.
>
> If it doesn't solve the problem, you need to provide more info and be more
> specific about your "trouble".
>
> Dne Sat, 6 Jul 2013 17:44:04 +0530
> Kakar Arunachal Service  napsal(a):
>
> > Hi,
> > I am having trouble with redirecting the login page to index page. Please
> > guide me.
> >
> > Here's the html snippet:
> > 
> > User Login
> > {% if form.errors %}
> > Your username and password didn't match.
> > Please try again.
> > {% endif %}
> > 
> > Username:{{
> form.username
> > }}
> > Password:{{
> form.password
> > }}
> > 
> > 
> > 
> > 
> >
> > 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: redirct page

2013-07-06 Thread Kakar Arunachal Service
thank you much! That did solved the problem!


On Sat, Jul 6, 2013 at 7:15 PM, Black9design.com wrote:

> I noticed in the snippet that you provided that it says "form methon". See
> if that is the issue.
>
> On Jul 6, 2013, at 6:29 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
> Hello! Thanks for the correction! But even after the {% csrf_token %} tag
> its not redirecting to the main index page. :(
>
>
> On Sat, Jul 6, 2013 at 6:45 PM, Tomas Ehrlich wrote:
>
>> Hi there,
>> you're certaily missing {% csfr_token %} in your form.
>>
>> If it doesn't solve the problem, you need to provide more info and be
>> more specific about your "trouble".
>>
>> Dne Sat, 6 Jul 2013 17:44:04 +0530
>> Kakar Arunachal Service  napsal(a):
>>
>> > Hi,
>> > I am having trouble with redirecting the login page to index page.
>> Please
>> > guide me.
>> >
>> > Here's the html snippet:
>> > 
>> > User Login
>> > {% if form.errors %}
>> > Your username and password didn't match.
>> > Please try again.
>> > {% endif %}
>> > 
>> > Username:{{
>> form.username
>> > }}
>> > Password:{{
>> form.password
>> > }}
>> > 
>> > 
>> > 
>> > 
>> >
>> > 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 http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>  --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>  --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




CSRF verification failed

2013-07-06 Thread Kakar Arunachal Service
Hello!
I am getting CSRF verification failed error, even after i added {%
csrf_token %} tag in the html file.

Here's my html file:

{% extends "base.html" %}
{% block title %} User Registration {% endblock %}
{% block head %} User Registration {% endblock %}
{% block content %}

{% csrf_token %}
{{ form.as_p }}


{% endblock %}

and my views.py:

def register_page(request):
if request.method == 'POST':
form = RegisrationForm(request.POST)
if form.is_valid():
user = User.objects.create_user(
username = form.cleaned_data['username'],
password = form.cleaned_data['password1'],
email = form.cleaned_data['email']
)
return HttpResponseRedirect('/')
else:
form = RegisrationForm()
variables = RequestContext(request, {
'form': form
})
return render_to_response('registration/register.html',
variables)
else:
return render_to_response('registration/register.html')

Where am i doing wrong???

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: CSRF verification failed

2013-07-06 Thread Kakar Arunachal Service
Thank you Sanjay!


On Sun, Jul 7, 2013 at 4:08 AM, Sanjay Bhangar wrote:

> On Sat, Jul 6, 2013 at 9:38 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> Hello!
>> I am getting CSRF verification failed error, even after i added {%
>> csrf_token %} tag in the html file.
>>
>> Here's my html file:
>>
>> {% extends "base.html" %}
>> {% block title %} User Registration {% endblock %}
>> {% block head %} User Registration {% endblock %}
>> {% block content %}
>> 
>> {% csrf_token %}
>> {{ form.as_p }}
>> 
>> 
>> {% endblock %}
>>
>> and my views.py:
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegisrationForm(request.POST)
>> if form.is_valid():
>> user = User.objects.create_user(
>> username = form.cleaned_data['username'],
>> password = form.cleaned_data['password1'],
>> email = form.cleaned_data['email']
>> )
>> return HttpResponseRedirect('/')
>> else:
>> form = RegisrationForm()
>> variables = RequestContext(request, {
>> 'form': form
>> })
>> return render_to_response('registration/register.html',
>> variables)
>> else:
>> return render_to_response('registration/register.html')
>>
>> else:
>   return render_to_response("registration/register.html",
> RequestContext(request, {})
>
>
>> Where am i doing wrong???
>>
>
> In your outer else statement, you need to return a RequestContext instance
> ..
>
> You could also use the 'render' shortcut:
> from django.shortcuts import render
>
> .
>
> return render(request, "registration/register.html")
>
> Basically, you need to make sure the template has the context created by
> RequestContext, otherwise csrf_token will not be available as a variable on
> the template.
>
> Hope that helps,
> Sanjay
>
>
>
>>
>>  --
>> 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 http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Big Picture?

2013-07-07 Thread Kakar Arunachal Service
True!


On Sun, Jul 7, 2013 at 7:35 PM, Amirouche Boubekki <
amirouche.boube...@gmail.com> wrote:

> Hi,
>
> I have a diagram I call big picture, you might find it useful (see
> attachment).
>
> Anything green is most of the time provided by the framework at least it
> is the case in Django.
>
> Anything gray you have to make a choice for.
>
> Anything blue is your code.
>
> Arrows are kind of inspired snakes I'm not sure of the meaning of each of
> them ;)
>
>
> 2013/7/7 ron 
>
>> I need help with getting the big picture in so far as what Django can
>> help me accomplish.
>
>
> Have a look at Django CMS: mezzanine, djangocms amstrongcms. There is also
> a nice demo of django xadmin.
>
>
>> I need to replace an antiquated online attendance-taking system. My first
>> thought was to just build from scratch using Apache, Python, MySQL,
>> HTML/JavaScript.
>
>
> Sounds like a lot of work (see next answer)
>
>
>> My first stop was researching how to integrate Python and Apache, but
>> that led me down the rabbit hole of programming.
>
>
> Python interface itself with servers using the WSGI protocol, this might
> help. Also there is a framework I'm working 
> on(not tested with Apache but should 
> work) that might give insight on what is
> needed to get a framework up.
>
>
>> I kept running across using "Frameworks". From my reading so far, I can't
>> determine if Django, as a framework, will yeild any advantage over just
>> implementing the standalone bits and pieces.
>
>
> Yes it will provide :)
>
>
>> I'm putting out the word, here on the kist, for direction in this
>> matter. My mail confusion is, does Django ome with its own database, and is
>> this the same type database that I'm referring to to when I mentioned doing
>> this task using the autonomous pieces?
>>
>
> I'm not sure I fully understand what you mean here but I try to answer.
> Django was built from the ground up to contains everything needed to build
> a CMS with. This is not anymore True as-is, since there are now somewhat
> common componenent of a website that are not part of Django but developped
> outside, at least the following are very helpful:
>
> - Django compressor
> - South
> - Django debug toolbar
> - Sentry
> - Django social auth
> - Celery
> - Haystack
> - There are e-commerce django appliations but I have no insight on them
> - Django crispy forms is getting some traction
>
> You don't have to use them, but you might need them, just like Django
> Admin.
>
> And a miriad of other application that can help you in your developpement
> at least to bootstrap your project commonly known as django applications.
> Those are specific to Django, aka. most of the time you can't use them with
> other frameworks. There is different kind of apps, apps that provides user
> features, other that are only technical, some of them also are useful
> goodies (django debug toolbar, django extended choices) etc... all this
> makes developpement and learning easier because most of the time you have
> something to copy or learn from and loads of documentation and people that
> can help.
>
> As far as I'm concerned, I went to (somewhat) autonomous pieces route by
> reusing what is done by others because I want to experiement with a
> somewhat new API (and learn new stuff). Rolling it's own framework is not
> difficult if you reuse pieces from others, but you have to have a good idea
> of what you want to achieve and what your solution will make easier (for a
> specific case?). If you have very specific needs and you know what you are
> doing go explore other frameworks mostly Pyramid which is said to be easy
> to customise and scales well or mini-frameworks which have their community
> too and share ressources among the rest of Python community that said you
> won't always benefit from Django ecosystem. *If you want to get things
> done, Django is an answer.*
>
> Also, I might sound a Django enthusiastic fanboy, but I'm not, I find it's
> has many flows not major flows but still thing could be nicer, more elegant
> et al. and other stuff. In my case the «ecosystem is great» is not
> appealing, most of the time I can handle issues on my own, or adapt stuff
> from a Django solution, but for starter, it's a game changer. Anyway, if I
> want to build something right now, I use Django and it's not only because I
> know it, but also because there is this great ecosystem and also it answers
> most of the requirements I encounter.
>
> another link: https://www.djangopackages.com/
>
> HTH,
>
> Amirouche
>
>  --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups

change buttons or widgets

2013-07-07 Thread Kakar Arunachal Service
Hi,
I think this is too early for me to ask bcoz m still learning the whole web
thig. But i'm just very curious. So my question is, how do i change the
button or widgets if i had to? I'm sorry if i named or termed it in a wrong
way.

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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: change buttons or widgets

2013-07-08 Thread Kakar Arunachal Service
Thank you so much That's just what i needed! And while i was searching
for this, i came across this: django-crispy (
http://django-crispy-forms.readthedocs.org/en/1.1.1/index.html). Just
wanted to share!


On Mon, Jul 8, 2013 at 6:48 PM, Derek  wrote:

> Widgets: https://docs.djangoproject.com/en/dev/ref/forms/widgets/
>
> For changing the way buttons look; try Twitter Bootstrap:
> http://twitter.github.io/bootstrap/components.html
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




form.errors

2013-07-11 Thread Kakar Arunachal Service
Hi,
I am learning Django from an old Django version book, and i am stuck with a
problem regarding forms. When i render forms, i get the registration right,
but if its incorrect, it does not show the error msg in the html. I tried
{{form.errors}}, but couldn't fix he problem. Please guide me.
Thank you.

This is my forms.py:

from django import forms
import re
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist


class RegistrationForm(forms.Form):
username = forms.CharField(label='Username', max_length=30)
email = forms.EmailField(label="Email",)
password1 = forms.CharField(
label='Password',
widget=forms.PasswordInput()
)
password2 = forms.CharField(
label = 'Password (Again)',
widget=forms.PasswordInput()
)

def clean_password2(self):
if 'password1' in self.cleaned_data:
password1 = self.cleaned_data['password1']
password2 = self.cleaned_data['password2']
if password1 == password2:
return password2
raise forms.ValidationError('Password do not match.')

def clean_username(self):
username = self.cleaned_data['username']
if not re.search(r'^\w+$', username):
raise forms.ValidationError('Username can only contain
alphanumeric characters and the underscore.')
try:
User.objects.get(username=username)
except ObjectDoesNotExist:
return username
raise forms.ValidationError('Username is already taken.')

def clean_email(self):
if 'email' in self.cleaned_data:
email = self.cleaned_data['email']
try:
User.objects.get(email=email)
except ObjectDoesNotExist:
return email
raise forms.ValidationError('Email is already taken.')

And this is my views.py:

def register_page(request):
if request.method == 'POST':
form = RegistrationForm(request.POST)
if form.is_valid():
user = User.objects.create_user(
username=form.cleaned_data['username'],
email=form.cleaned_data['email'],
password=form.cleaned_data['password1']
)
return HttpResponseRedirect('/register/success/')
else:
form = RegistrationForm()
variables = RequestContext(request,{
'form':form
})
return
render_to_response('registration/register.html',variables)
else:
form = RegistrationForm()
variables = RequestContext(request,{
'form':form
})
return render_to_response('registration/register.html',variables)

And my register.html:

{% extends "base.html" %}
{% block title %}User Registration{% endblock %}
{% block head %}User Registration{% endblock %}
{% block content %}

{% csrf_token %}
{{form.as_p}}


{% endblock %}

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
I am sorry, but its still not displaying any errors after it renders.


On Fri, Jul 12, 2013 at 3:47 AM, carlos  wrote:

> try this with django 1.5.1
> from django.shortcuts import render
>
> def register_page(request):
> if request.method == 'POST':
> form = RegistrationForm(request.POST)
> if form.is_valid():
> form.save()
>
> return HttpResponseRedirect('/register/success/')
>  else:
> form = RegistrationForm()
>  return render(request, 'registration/register.html', {'form':form})
>
> Cheers
>
>
> On Thu, Jul 11, 2013 at 4:08 PM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> Hi,
>> I am learning Django from an old Django version book, and i am stuck with
>> a problem regarding forms. When i render forms, i get the registration
>> right, but if its incorrect, it does not show the error msg in the html. I
>> tried {{form.errors}}, but couldn't fix he problem. Please guide me.
>> Thank you.
>>
>> This is my forms.py:
>>
>> from django import forms
>> import re
>> from django.contrib.auth.models import User
>> from django.core.exceptions import ObjectDoesNotExist
>>
>>
>> class RegistrationForm(forms.Form):
>> username = forms.CharField(label='Username', max_length=30)
>> email = forms.EmailField(label="Email",)
>> password1 = forms.CharField(
>> label='Password',
>> widget=forms.PasswordInput()
>> )
>> password2 = forms.CharField(
>> label = 'Password (Again)',
>> widget=forms.PasswordInput()
>> )
>>
>> def clean_password2(self):
>> if 'password1' in self.cleaned_data:
>> password1 = self.cleaned_data['password1']
>> password2 = self.cleaned_data['password2']
>> if password1 == password2:
>> return password2
>> raise forms.ValidationError('Password do not match.')
>>
>> def clean_username(self):
>> username = self.cleaned_data['username']
>> if not re.search(r'^\w+$', username):
>> raise forms.ValidationError('Username can only contain
>> alphanumeric characters and the underscore.')
>> try:
>> User.objects.get(username=username)
>> except ObjectDoesNotExist:
>> return username
>> raise forms.ValidationError('Username is already taken.')
>>
>> def clean_email(self):
>> if 'email' in self.cleaned_data:
>> email = self.cleaned_data['email']
>> try:
>> User.objects.get(email=email)
>> except ObjectDoesNotExist:
>> return email
>> raise forms.ValidationError('Email is already taken.')
>>
>> And this is my views.py:
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegistrationForm(request.POST)
>> if form.is_valid():
>> user = User.objects.create_user(
>> username=form.cleaned_data['username'],
>> email=form.cleaned_data['email'],
>> password=form.cleaned_data['password1']
>> )
>> return HttpResponseRedirect('/register/success/')
>> else:
>> form = RegistrationForm()
>> variables = RequestContext(request,{
>> 'form':form
>> })
>> return
>> render_to_response('registration/register.html',variables)
>> else:
>> form = RegistrationForm()
>> variables = RequestContext(request,{
>> 'form':form
>> })
>> return render_to_response('registration/register.html',variables)
>>
>> And my register.html:
>>
>> {% extends "base.html" %}
>> {% block title %}User Registration{% endblock %}
>> {% block head %}User Registration{% endblock %}
>> {% block content %}
>> 
>> {% csrf_token %}
>> {{form.as_p}}
>> 
>> 
>> {% endblock %}
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users

Re: form.errors

2013-07-11 Thread Kakar Arunachal Service
Its just displaying form again, but without any errors. Please guide me to
where am missing something.


On Fri, Jul 12, 2013 at 4:34 AM, Kakar Arunachal Service <
kakararunachalserv...@gmail.com> wrote:

> I am sorry, but its still not displaying any errors after it renders.
>
>
> On Fri, Jul 12, 2013 at 3:47 AM, carlos  wrote:
>
>> try this with django 1.5.1
>> from django.shortcuts import render
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegistrationForm(request.POST)
>> if form.is_valid():
>> form.save()
>>
>> return HttpResponseRedirect('/register/success/')
>>  else:
>> form = RegistrationForm()
>>  return render(request, 'registration/register.html', {'form':form})
>>
>> Cheers
>>
>>
>>  On Thu, Jul 11, 2013 at 4:08 PM, Kakar Arunachal Service <
>> kakararunachalserv...@gmail.com> wrote:
>>
>>>  Hi,
>>> I am learning Django from an old Django version book, and i am stuck
>>> with a problem regarding forms. When i render forms, i get the registration
>>> right, but if its incorrect, it does not show the error msg in the html. I
>>> tried {{form.errors}}, but couldn't fix he problem. Please guide me.
>>> Thank you.
>>>
>>> This is my forms.py:
>>>
>>> from django import forms
>>> import re
>>> from django.contrib.auth.models import User
>>> from django.core.exceptions import ObjectDoesNotExist
>>>
>>>
>>> class RegistrationForm(forms.Form):
>>> username = forms.CharField(label='Username', max_length=30)
>>> email = forms.EmailField(label="Email",)
>>> password1 = forms.CharField(
>>> label='Password',
>>> widget=forms.PasswordInput()
>>> )
>>> password2 = forms.CharField(
>>> label = 'Password (Again)',
>>> widget=forms.PasswordInput()
>>> )
>>>
>>> def clean_password2(self):
>>> if 'password1' in self.cleaned_data:
>>> password1 = self.cleaned_data['password1']
>>> password2 = self.cleaned_data['password2']
>>> if password1 == password2:
>>> return password2
>>> raise forms.ValidationError('Password do not match.')
>>>
>>> def clean_username(self):
>>> username = self.cleaned_data['username']
>>> if not re.search(r'^\w+$', username):
>>> raise forms.ValidationError('Username can only contain
>>> alphanumeric characters and the underscore.')
>>> try:
>>> User.objects.get(username=username)
>>> except ObjectDoesNotExist:
>>> return username
>>> raise forms.ValidationError('Username is already taken.')
>>>
>>> def clean_email(self):
>>> if 'email' in self.cleaned_data:
>>> email = self.cleaned_data['email']
>>> try:
>>> User.objects.get(email=email)
>>> except ObjectDoesNotExist:
>>> return email
>>> raise forms.ValidationError('Email is already taken.')
>>>
>>> And this is my views.py:
>>>
>>> def register_page(request):
>>> if request.method == 'POST':
>>> form = RegistrationForm(request.POST)
>>> if form.is_valid():
>>> user = User.objects.create_user(
>>> username=form.cleaned_data['username'],
>>> email=form.cleaned_data['email'],
>>> password=form.cleaned_data['password1']
>>> )
>>> return HttpResponseRedirect('/register/success/')
>>> else:
>>> form = RegistrationForm()
>>> variables = RequestContext(request,{
>>> 'form':form
>>> })
>>> return
>>> render_to_response('registration/register.html',variables)
>>> else:
>>> form = RegistrationForm()
>>> variables = RequestContext(request,{
>>> 'form'

Re: form.errors

2013-07-12 Thread Kakar Arunachal Service
Okay! That did solved the problem. Thank you! Here's my new view.py:

def register_page(request):
if request.method == 'POST':
form = RegistrationForm(request.POST)
if form.is_valid():
user = User.objects.create_user(
username=form.cleaned_data['username'],
email=form.cleaned_data['email'],
password=form.cleaned_data['password1']
)
return HttpResponseRedirect('/register/success/')

else:
form = RegistrationForm()
variables = RequestContext(request,{
'form':form
})
return render_to_response('registration/register.html',variables)

I am just a noob with these things. I understood why the first instance
didn't worked, but can u please explain to me about the indentation part
(variables and return)? I am little bit puzzled in here. And don't the
second 'if' require an else?
Thanks again!


On Fri, Jul 12, 2013 at 2:13 PM, Daniel Roseman wrote:

> On Thursday, 11 July 2013 23:08:25 UTC+1, Kakar wrote:
>
>> Hi,
>> I am learning Django from an old Django version book, and i am stuck with
>> a problem regarding forms. When i render forms, i get the registration
>> right, but if its incorrect, it does not show the error msg in the html. I
>> tried {{form.errors}}, but couldn't fix he problem. Please guide me.
>> Thank you.
>>
>
>
>> 
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegistrationForm(request.POST)
>> if form.is_valid():
>> user = User.objects.create_user(
>> username=form.cleaned_data['**username'],
>> email=form.cleaned_data['**email'],
>> password=form.cleaned_data['**password1']
>> )
>> return HttpResponseRedirect('/**register/success/')
>> else:
>> form = RegistrationForm()
>> variables = RequestContext(request,{
>> 'form':form
>> })
>> return render_to_response('**registration/register.html',**
>> variables)
>> else:
>> form = RegistrationForm()
>> variables = RequestContext(request,{
>> 'form':form
>> })
>> return render_to_response('**registration/register.html',**
>> variables)
>>
>> 
>>
>
> You are re-instantiating the form in the first else clause, if it is not
> valid. That new form instance is empty and therefore doesn't have any
> errors.
>
> You don't actually need that else clause at all: Just move the last two
> lines of the function ('variables' and 'return') back one indent level, and
> execution will fall through to that point if the form is invalid, complete
> with errors.
> --
> DR.
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: form.errors

2013-07-12 Thread Kakar Arunachal Service
Okay. Thank you so very much! Just one last question, just to know that i
got it right. So, variables and return are not part of the else clause, and
that they return the errors of the last form post. Did i got it right?


On Fri, Jul 12, 2013 at 8:41 PM, Daniel Roseman wrote:

> On Friday, 12 July 2013 14:27:31 UTC+1, Kakar wrote:
>
>> Okay! That did solved the problem. Thank you! Here's my new view.py:
>>
>> def register_page(request):
>> if request.method == 'POST':
>> form = RegistrationForm(request.POST)
>> if form.is_valid():
>> user = User.objects.create_user(
>> username=form.cleaned_data['**username'],
>> email=form.cleaned_data['**email'],
>> password=form.cleaned_data['**password1']
>> )
>> return HttpResponseRedirect('/**register/success/')
>>
>> else:
>> form = RegistrationForm()
>> variables = RequestContext(request,{
>> 'form':form
>> })
>> return render_to_response('**registration/register.html',**variables)
>>
>> I am just a noob with these things. I understood why the first instance
>> didn't worked, but can u please explain to me about the indentation part
>> (variables and return)? I am little bit puzzled in here. And don't the
>> second 'if' require an else?
>> Thanks again!
>>
>
> Well, presumably you understand that in Python, indentation defines blocks
> for things like if and for. If there's no else clause for an if, Python
> will resume execution at the next line that is indented at the same level
> as the beginning of the if statement. In this case, there isn't one,
> because the surrounding block - ie the first if statement - is complete.
> So, it's going to skip over the else clause belonging to the outer if, and
> carry on at the first line at that level - which now is the one starting
> with `variables`.
>
> The upshot of all this is that if the form is not valid, it will skip
> right down to the bottom and execute those last two lines, which render the
> template with the invalid form, and return it.
> --
> DR.
>
> --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




'SimpleLazyObject'

2013-07-12 Thread Kakar Arunachal Service
I've got a TypeError:

int() argument must be a string or a number, not 'SimpleLazyObject'


Here's my view:

def bookmark_save_page(request):
if request.method == 'POST':
form = BookmarkSaveForm(request.POST)
if form.is_valid():
# Create or get link.
link, dummy = Link.objects.get_or_create(
url=form.cleaned_data['url']
)
# Create or get bookmarks.
bookmark, created = Bookmark.objects.get_or_create(
user = request.user,
link = link
)
# Update bookmark title.
bookmark.title = form.cleaned_data['title']
# If the bookmark is being updated, clear old tag list.
if not created:
bookmark.tag_set.clear()
# Create new tag list.
tag_names = form.cleaned_data['tags'].split()
for tag_name in tag_names:
tag, dummy = Tag.objects.get_or_create(name=tag_name)
bookmark.tag_set.add(tag)
# Save bookmark to database.
bookmark.save()
return HttpResponseRedirect(
'/user/%s/' %request.user.username
)
else:
form = BookmarkSaveForm()

variables = RequestContext(request, {'form': form})
return render_to_response('bookmark_save.html',variables)

I really don't know what's going on here. Please guide me.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: 'SimpleLazyObject'

2013-07-12 Thread Kakar Arunachal Service
Here's the traceback info:

Environment:


Request Method: POST
Request URL: http://localhost:8000/save/

Django Version: 1.5.1
Python Version: 2.7.5
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'bookmarks')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
get_response
  115. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Users\Kakar\web\django_bookmarks\bookmarks\views.py" in
bookmark_save_page
  63. link = link
File "C:\Python27\lib\site-packages\django\db\models\manager.py" in
get_or_create
  146. return self.get_query_set().get_or_create(**kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in
get_or_create
  470. return self.get(**lookup), False
File "C:\Python27\lib\site-packages\django\db\models\query.py" in get
  379. clone = self.filter(*args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in filter
  655. return self._filter_or_exclude(False, *args, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\query.py" in
_filter_or_exclude
  673. clone.query.add_q(Q(*args, **kwargs))
File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in add_q
  1266. can_reuse=used_aliases,
force_having=force_having)
File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in
add_filter
  1197. connector)
File "C:\Python27\lib\site-packages\django\db\models\sql\where.py" in add
  71. value = obj.prepare(lookup_type, value)
File "C:\Python27\lib\site-packages\django\db\models\sql\where.py" in
prepare
  339. return self.field.get_prep_lookup(lookup_type, value)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py" in
get_prep_lookup
  143. return self._pk_trace(value, 'get_prep_lookup',
lookup_type)
File "C:\Python27\lib\site-packages\django\db\models\fields\related.py" in
_pk_trace
  216. v = getattr(field, prep_func)(lookup_type, v, **kwargs)
File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py" in
get_prep_lookup
  322. return self.get_prep_value(value)
File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py" in
get_prep_value
  555. return int(value)

Exception Type: TypeError at /save/
Exception Value: int() argument must be a string or a number, not
'SimpleLazyObject'

Please help.


On Sat, Jul 13, 2013 at 12:30 AM, Sithembewena Lloyd Dube  wrote:

> What does the trace information say in your browser (or shell)? The trace
> should be giving more information - such as, in which line number of which
> file is the error showing up?.
>
>
> On Fri, Jul 12, 2013 at 8:45 PM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> I've got a TypeError:
>>
>> int() argument must be a string or a number, not 'SimpleLazyObject'
>>
>>
>> Here's my view:
>>
>> def bookmark_save_page(request):
>> if request.method == 'POST':
>> form = BookmarkSaveForm(request.POST)
>> if form.is_valid():
>> # Create or get link.
>> link, dummy = Link.objects.get_or_create(
>> url=form.cleaned_data['url']
>> )
>> # Create or get bookmarks.
>> bookmark, created = Bookmark.objects.get_or_create(
>> user = request.user,
>> link = link
>> )
>> # Update bookmark title.
>> bookmark.title = form.cleaned_data['title']
>> # If the bookmark is being updated, clear old tag list.
>> if not created:
>> bookmark.tag_set.clear()
>> # Create new tag list.
>> tag_names = form.cleaned_data['tags'].split()
>> for tag_name in tag_names:
>> tag, dummy = Tag.objects.get_or_create(name=tag_name)
>> bookmark.tag_

Re: 'SimpleLazyObject'

2013-07-13 Thread Kakar Arunachal Service
No, it wont do, it loads another error. But my problem is solved. I just
needed to log in. Thanks anyway.


On Sat, Jul 13, 2013 at 10:42 AM, Babatunde Akinyanmi
wrote:

> How about changing this:
>
> Bookmark.objects.get_or_create(
> user = request.user,
> link = link
> )
>
> To this:
> Bookmark.objects.get_or_create(
> user = request.user.id,
> link = link
> )
>
> Sent from my Windows Phone
> --
> From: Kakar Arunachal Service
> Sent: 7/12/2013 8:46 PM
> To: django-users@googlegroups.com
> Subject: Re: 'SimpleLazyObject'
>
> Here's the traceback info:
>
> Environment:
>
>
> Request Method: POST
> Request URL: http://localhost:8000/save/
>
> Django Version: 1.5.1
> Python Version: 2.7.5
> Installed Applications:
> ('django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.sessions',
>  'django.contrib.sites',
>  'django.contrib.messages',
>  'django.contrib.staticfiles',
>  'bookmarks')
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.csrf.CsrfViewMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.contrib.messages.middleware.MessageMiddleware')
>
>
> Traceback:
> File "C:\Python27\lib\site-packages\django\core\handlers\base.py" in
> get_response
>   115. response = callback(request,
> *callback_args, **callback_kwargs)
> File "C:\Users\Kakar\web\django_bookmarks\bookmarks\views.py" in
> bookmark_save_page
>   63. link = link
> File "C:\Python27\lib\site-packages\django\db\models\manager.py" in
> get_or_create
>   146. return self.get_query_set().get_or_create(**kwargs)
> File "C:\Python27\lib\site-packages\django\db\models\query.py" in
> get_or_create
>   470. return self.get(**lookup), False
> File "C:\Python27\lib\site-packages\django\db\models\query.py" in get
>   379. clone = self.filter(*args, **kwargs)
> File "C:\Python27\lib\site-packages\django\db\models\query.py" in filter
>   655. return self._filter_or_exclude(False, *args, **kwargs)
> File "C:\Python27\lib\site-packages\django\db\models\query.py" in
> _filter_or_exclude
>   673. clone.query.add_q(Q(*args, **kwargs))
> File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in add_q
>   1266. can_reuse=used_aliases,
> force_having=force_having)
> File "C:\Python27\lib\site-packages\django\db\models\sql\query.py" in
> add_filter
>   1197. connector)
> File "C:\Python27\lib\site-packages\django\db\models\sql\where.py" in add
>   71. value = obj.prepare(lookup_type, value)
> File "C:\Python27\lib\site-packages\django\db\models\sql\where.py" in
> prepare
>   339. return self.field.get_prep_lookup(lookup_type, value)
> File "C:\Python27\lib\site-packages\django\db\models\fields\related.py" in
> get_prep_lookup
>   143. return self._pk_trace(value, 'get_prep_lookup',
> lookup_type)
> File "C:\Python27\lib\site-packages\django\db\models\fields\related.py" in
> _pk_trace
>   216. v = getattr(field, prep_func)(lookup_type, v, **kwargs)
> File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py"
> in get_prep_lookup
>   322. return self.get_prep_value(value)
> File "C:\Python27\lib\site-packages\django\db\models\fields\__init__.py"
> in get_prep_value
>   555. return int(value)
>
> Exception Type: TypeError at /save/
> Exception Value: int() argument must be a string or a number, not
> 'SimpleLazyObject'
>
> Please help.
>
>
> On Sat, Jul 13, 2013 at 12:30 AM, Sithembewena Lloyd Dube <
> zebr...@gmail.com> wrote:
>
>> What does the trace information say in your browser (or shell)? The trace
>> should be giving more information - such as, in which line number of which
>> file is the error showing up?.
>>
>>
>> On Fri, Jul 12, 2013 at 8:45 PM, Kakar Arunachal Service <
>> kakararunachalserv...@gmail.com> wrote:
>>
>>> I've got a TypeError:
>>>
>>> int() argument must be a string or a number, not 'SimpleLazyObject'
>>>
>>>
>>> Here

Re: 'SimpleLazyObject'

2013-07-13 Thread Kakar Arunachal Service
Yes, you are right.


On Sat, Jul 13, 2013 at 7:07 PM, Victor Rocha  wrote:

> This is a wild guess but I do not see the login_required decorator on your
> view. I think you are getting this error because you are trying to save an
> Bookmark object passing an anonymous user as one of your arguments. An
> anonymous user is a SimpleLazyObject; it is a user but there is no
> reference to it on your databases. The Bookmark foreign key expects to
> point to user instance on the users table.
>
> Thank you,
> Victor Rocha
> www.RochApps.com
>
>
>
> On Friday, July 12, 2013 2:45:00 PM UTC-4, Kakar wrote:
>>
>> I've got a TypeError:
>>
>> int() argument must be a string or a number, not 'SimpleLazyObject'
>>
>>
>> Here's my view:
>>
>> def bookmark_save_page(request):
>> if request.method == 'POST':
>> form = BookmarkSaveForm(request.POST)
>> if form.is_valid():
>> # Create or get link.
>> link, dummy = Link.objects.get_or_create(
>> url=form.cleaned_data['url']
>> )
>> # Create or get bookmarks.
>> bookmark, created = Bookmark.objects.get_or_**create(
>> user = request.user,
>> link = link
>> )
>> # Update bookmark title.
>> bookmark.title = form.cleaned_data['title']
>> # If the bookmark is being updated, clear old tag list.
>> if not created:
>> bookmark.tag_set.clear()
>> # Create new tag list.
>> tag_names = form.cleaned_data['tags'].**split()
>> for tag_name in tag_names:
>> tag, dummy = Tag.objects.get_or_create(**name=tag_name)
>> bookmark.tag_set.add(tag)
>> # Save bookmark to database.
>> bookmark.save()
>> return HttpResponseRedirect(
>> '/user/%s/' %request.user.username
>> )
>> else:
>> form = BookmarkSaveForm()
>>
>> variables = RequestContext(request, {'form': form})
>> return render_to_response('bookmark_**save.html',variables)
>>
>> I really don't know what's going on here. Please guide me.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Display error message

2013-07-13 Thread Kakar Arunachal Service
Hi,
I have a site, that has a submit form, but one must be logged in for that.
And if the user is not logged in, it redirects it to the login page. And
this all fine. My question is, what do I do to display the error message,
"You must be logged to submit.", if the user is not logged in and tries to
submit the form, but has to display the normal login page if not.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




django statics

2013-07-14 Thread Kakar Arunachal Service
Hello,
I read the django docs, but my still confused. How do i use the static
files, for css?
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




rich text editor

2013-07-18 Thread Kakar Arunachal Service
Hello,
Just a thought, can a rich text editor be integrated to a social networking
site. Or should every user have a css each? Its just a thought, was just
wondering but would be glad if any of you could advice me how to if its
possible.
Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rich text editor

2013-07-18 Thread Kakar Arunachal Service
Thanks a lot! Was waiting for an answer. Just one more question though, I
didnt understood much in the link you gave me. Its that, suppose I included
it where users can post, will each post require another css, or something
else. Please explain.
 Liked "Impossible is nothing™"


On Thu, Jul 18, 2013 at 10:44 PM, Andre Terra  wrote:

> Impossible is nothing™, but I don't see the benefits of combining rich
> text with social networking. Things like BBCode[0] usually offer a better
> trade-off between flexibility/usability/maintenance. Based on a quick
> google search, it seems there are solutions tailored for use with Django
> [1][2]
>
> [0] http://en.wikipedia.org/wiki/BBCode
> [1] https://github.com/marcinn/django-bbcode full solution
> [2] http://djangosnippets.org/snippets/853/ old (0.96!), but should be a
> place to start in case you want to rollout your own.
>
>
>  Cheers,
> AT
>
> On Thu, Jul 18, 2013 at 7:24 AM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> Hello,
>> Just a thought, can a rich text editor be integrated to a social
>> networking site. Or should every user have a css each? Its just a thought,
>> was just wondering but would be glad if any of you could advice me how to
>> if its possible.
>> Thank you.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> 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 http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rich text editor

2013-07-18 Thread Kakar Arunachal Service
Thank you so much!!! I will try it for sure! Thanks again!


On Fri, Jul 19, 2013 at 12:15 AM, Andre Terra  wrote:

> It seems you are asking two completely unrelated questions:
> 1. to allow users to add some form of tags into their code for richer
> submissions.
> 2. to have a different css for each user
>
> One possible answer to #1 is BBCode, as I described. Question #2 is
> something altogether. Do you want each user message to appear differently?
> Is that supposed to be customizable to the degree of css? Are you just
> switching colors? How much are you going to let the user style their
> messages? BBcode should be anough to allow them to add bold, italics,
> links, pictures, etc. If you just want that, there's no need to have a
> separate css for each user. Instead, just follow my instructions below.
>
> I'm not sure how django-bbcode styles the rendered text, but my
> step-by-step investigation would be:
>
> 1. Install django-bbcode
> 2. Make sure you have a view somewhere with an input and go to that URL.
> This would possibly be a very simple view with a textarea where you'd type
> something in and see the rendered output.
> 3. Send the textarea back to the template in a variable (called, say,
> stuff) and render it with {% bbcode stuff %} in the template.
> 4. Use firebug, google chrome's inspector/developer tools to inspect the
> css that's applied to the rendered text
> 5. Make changes to yourcurrentcssfile.css to include styling for the
> BBCode.
> 6. GOTO 2
> 7. ???
> 8. Profit!!!
>
> I hope I understood your question well enough. Good luck!
>
> Cheers,
> AT
>
> On Thu, Jul 18, 2013 at 2:56 PM, Kakar Arunachal Service <
> kakararunachalserv...@gmail.com> wrote:
>
>> Thanks a lot! Was waiting for an answer. Just one more question though, I
>> didnt understood much in the link you gave me. Its that, suppose I included
>> it where users can post, will each post require another css, or something
>> else. Please explain.
>>  Liked "Impossible is nothing™"
>>
>>
>> On Thu, Jul 18, 2013 at 10:44 PM, Andre Terra wrote:
>>
>>> Impossible is nothing™, but I don't see the benefits of combining rich
>>> text with social networking. Things like BBCode[0] usually offer a better
>>> trade-off between flexibility/usability/maintenance. Based on a quick
>>> google search, it seems there are solutions tailored for use with Django
>>> [1][2]
>>>
>>> [0] http://en.wikipedia.org/wiki/BBCode
>>> [1] https://github.com/marcinn/django-bbcode full solution
>>> [2] http://djangosnippets.org/snippets/853/ old (0.96!), but should be
>>> a place to start in case you want to rollout your own.
>>>
>>>
>>>  Cheers,
>>> AT
>>>
>>> On Thu, Jul 18, 2013 at 7:24 AM, Kakar Arunachal Service <
>>> kakararunachalserv...@gmail.com> wrote:
>>>
>>>> Hello,
>>>> Just a thought, can a rich text editor be integrated to a social
>>>> networking site. Or should every user have a css each? Its just a thought,
>>>> was just wondering but would be glad if any of you could advice me how to
>>>> if its possible.
>>>> Thank you.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Django users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to django-users+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to django-users@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/django-users.
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>>  --
>>> 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 http://groups.google.com/group/django-users.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> 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+un