Re: Admin site doesn't work

2014-06-10 Thread Rini Michael
while launching through the browser do u give something like http://127.0.0.1:8000/admin/ On Wed, Jun 11, 2014 at 7:40 AM, Glen J wrote: > I read another post on here about how their Django site admin site would > not come up. In their case, they had failed to edit the

Admin site doesn't work

2014-06-10 Thread Glen J
I read another post on here about how their Django site admin site would not come up. In their case, they had failed to edit the urls.py and settings.py to enable the site. I have done that and also done a syncdb after making those changes and the admin sited does not come up. All that

Re: Re: Django python fuction

2014-06-10 Thread moqianc...@gmail.com
Yeah, I think hito koto need a function like copy.deepcopy.. I think he known copy.deepcopy before(as his example said), just not known how to write a funtion work as copy.deecopy does for list. moqianc...@gmail.com From: François Schiettecatte Date: 2014-06-11 00:21 To: django-users

Any interest in update_fields=dict(...)?

2014-06-10 Thread Rich Rauenzahn
I have a use case where I am retroactively adding save(update_fields=...) to an existing code base. Sometimes the code is structured such that 'self' of the model is modified in other helper methods of the model, but not saved immediately. It seems like it would be useful to restructure the

Re: Cant get to admin login page

2014-06-10 Thread Glen J
I have this exact same problem. I'be checked both settings.py and urls.py and done a syncdb and still get nothing but the welcome page. Any other ideas on what to check? On Thursday, June 6, 2013 5:53:12 PM UTC-4, Rebecca wrote: > > I'm on part 2 of the django book tutorial ( >

Re: distinct().filter() applies filter before distinct

2014-06-10 Thread John Rambo
This better illustrates what I mean: Example.objects.order_by('a','foreignkey__b').distinct('a').filter(foreignkey__b='something') On Tuesday, June 10, 2014 4:06:50 PM UTC-5, John Rambo wrote: > > If we chain a call to filter() after a call to distinct(), the filter is > applied to the query

distinct().filter() applies filter before distinct

2014-06-10 Thread John Rambo
If we chain a call to filter() after a call to distinct(), the filter is applied to the query before the distinct. How do I filter the results of a query *after* applying distinct? Example.objects.order_by('a','b').distinct('a').filter(b='something) The where clause in the SQL resulting

South to Migrations detail

2014-06-10 Thread Craig Labenz
In South, automatically generated migrations that add models fire the function send_create_signal(), which among other things, results in a ContentType record being written for the new model. Except that it doesn't, because it actually just queues up that signal to be fired at the end of the

Re: Anyone interested in reviewing code for a hobby project - BookMarker

2014-06-10 Thread Aseem Bansal
I did not understand what you said regarding having a standard layout. I mean I am already using the layout that was explained in the Django tutorials. Keeping all my HTML in the template directory and all static files in the static directory with namespacing with the app name which is

Re: Anyone interested in reviewing code for a hobby project - BookMarker

2014-06-10 Thread Aseem Bansal
Rendering the Javascript through Django template engine. Noted. I am trying to keep it simple but I am not an expert. Asked for a review. Chip in if you are interested. http://codereview.stackexchange.com/questions/53896/personal-project-for-managing-my-bookmarks On Monday, June 9, 2014

Re: Modifying the request.POST data that is received from a form; form is not getting validated then

2014-06-10 Thread Anurag Baidyanath
sorry for the unreadable code! I have cleaned it up as suggested and posted it below. the user is displayed only email,subject,help_topic and message fields. rest all the fields are hidden. when the form is submitted; in the submit_ticket() in views.py i have copied the request.POST into a

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
Wouldn't the deep copy module handle this for you: https://docs.python.org/2/library/copy.html François On Jun 10, 2014, at 12:17 PM, hito koto wrote: > Hi, Qiancong : > > I was looking for exactly this、 > Thank you ver much! > > > 2014年6月10日火曜日 23時35分52秒

runserver error

2014-06-10 Thread kim jinhoo
I installed both python and django. After I create a project, I try to run a server error occurred. So had to reinstall django. But I still see the same error. Let them know what is causing me. File "C:\Python27\lib\functools.py", line 56, in '__lt__': [('__gt__', lambda self, other:

Re: Re: Django python fuction

2014-06-10 Thread hito koto
Hi, Qiancong : I was looking for exactly this、 Thank you ver much! 2014年6月10日火曜日 23時35分52秒 UTC+9 Qiancong: > >  > Hi, hito koto: > I think you want to deep copy the list. The following code maybe helpful: > def dcopy(obj): > if not isinstance(obj, list): > return obj >

error

2014-06-10 Thread kim jinhoo
I installed both python and django. After I create a project, I try to run a server error occurred. Re-install django hayeotneunde still see the same error occurs. Let them know what is causing me. File "C:\Python27\lib\functools.py", line 56, in '__lt__': [('__gt__', lambda self,

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Tom Evans
On Tue, Jun 10, 2014 at 12:25 PM, Malcolm Box wrote: > On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: >> >> >> On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box wrote: >>> >>> I'm confused by Django's behaviour when saving related models.

Re: Re: Django python fuction

2014-06-10 Thread moqianc...@gmail.com
Hi, hito koto: I think you want to deep copy the list. The following code maybe helpful: def dcopy(obj): if not isinstance(obj, list): return obj return [dcopy(x) for x in obj] But this function only deep copy for list. You can change code as what I did for dic, set, tuple ,

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
You need to use .append() to add elements to a list, I suggest you take a look at the python tutorial: https://docs.python.org/2/tutorial/ Not quite sure what you are doing with i or elem either. François On Jun 10, 2014, at 10:01 AM, hito koto wrote: > So, I

Re: Django python fuction

2014-06-10 Thread hito koto
So, I also have errors: >>> def foo(x): ... myList = [] ... if isinstance(x, list): ... for i in x: ... elem = i ... return myList + foo(elem) ... else: ... return 1 ... >>> >>> foo(a) Traceback (most

Re: Django python fuction

2014-06-10 Thread François Schiettecatte
You are redefining 'list' on line 2, rename list to myList as follows: def foo(x): myList = [] if isinstance(x, list): for i in x: elem = i return myList + foo(i) else: return 1 And take this to a

Re: Django python fuction

2014-06-10 Thread hito koto
hi, I have this erroes: >>> def foo(x): ... list = [] ... if isinstance(x, list): ... for i in x: ... elem = i ... return list + foo(i) ... else: ... return 1 ... >>> foo(a) Traceback (most recent call last): File "", line 1, in File "",

Re: Django python fuction

2014-06-10 Thread Andrew Farrell
In general, I recommend adding the line "import pdb;pdb.set_trace()" to the top of your function and walking through it to see why it doesn't work. def foo(x): import pdb;pdb.set_trace() list = [] if isinstance(x, list): for i in x: elem = i return

Re: Anyone interested in reviewing code for a hobby project - BookMarker

2014-06-10 Thread trojactory
Aseem, I had a quick look at your Django app and here are some of my observations: 1. Most Django apps have a standard layout with the app in a directory named after itself. See django-taggit for instance. 2. You have made some

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Javier Guerra Giraldez
On Tue, Jun 10, 2014 at 6:43 AM, Rini Michael wrote: > Thanks for your reply,i have been looking into celery as well,but i found > that celery is used for periodic task and i am looking to execute aperiodic > task.please correct me if i am wrong check the

Re: How to have two separate models authentication system in the same django project?

2014-06-10 Thread graeme
Have you tried copying the content of contrib/auth and placing it in a directory in your app? It should work (perhaps with a bit of tweaking) BUT you will have to be careful where they both use the same data (for example the setting for the login url) and may have other problems. I cannot see

Re: Modifying the request.POST data that is received from a form; form is not getting validated then

2014-06-10 Thread Daniel Roseman
On Tuesday, 10 June 2014 12:25:10 UTC+1, Anurag Baidyanath wrote: > > i am having difficulty in saving the form data to the database. > And we are having difficulty reading your code. If you can't be bothered to clean it up enough (eg removing all the commented-out lines) to make it easy to

Django python function

2014-06-10 Thread hito koto
Hello, I don't know how can i do to change to write python function I want to following code change to write python function or change to write recursive definition >>> y = [10, 12, [13, [14, 9], 16], 7] >>> z = copy.deepcopy(y) >>> y [10, 12, [13, [14, 9], 16], 7] >>> z [10, 12, [13, [14, 9],

How to have two separate models authentication system in the same django project?

2014-06-10 Thread Carlos Perche
Hi, Is there a way to have multiple implementations of django's authentication/authorization system? In my practice blog-type site, I've implemented django's auth/auth system as is. I'd like to use the default implementation solely for administrators of the site. For users of the site, on

Django python fuction

2014-06-10 Thread hito koto
Hello, I don't know how can i do to change to write python function I want to following code change to write python function or change to write recursive definition >>> y = [10, 12, [13, [14, 9], 16], 7] >>> z = copy.deepcopy(y) >>> y [10, 12, [13, [14, 9], 16], 7] >>> z [10, 12, [13, [14, 9],

Re: How to receive json data using HTTP POST request in Django 1.6?

2014-06-10 Thread Alok Singh Mahor
thank you Malcolm, I will try that too On Tue, Jun 10, 2014 at 4:47 PM, Malcolm Box wrote: > Simplest answer is to use Django Rest Framework, which makes this > extremely easy. > > Malcolm > > > On Monday, 9 June 2014 11:20:05 UTC+1, Alok Singh Mahor wrote: >> >> Hi all,

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Rini Michael
Hi Malcolm Thanks for your reply,i have been looking into celery as well,but i found that celery is used for periodic task and i am looking to execute aperiodic task.please correct me if i am wrong Thanks in advance -- You received this message because you are subscribed to the Google Groups

Modifying the request.POST data that is received from a form; form is not getting validated then

2014-06-10 Thread Anurag Baidyanath
i am having difficulty in saving the form data to the database. After the user submits the form; fields such as ticket_id , created_date, etc have to be added to the POST request which is generated as a result of the form submission. I have copied the POST data to another dictionary and

Re: Why doesn't saving a related model update the _id field?

2014-06-10 Thread Malcolm Box
On Monday, 9 June 2014 03:08:21 UTC+1, Russell Keith-Magee wrote: > > On Sun, Jun 8, 2014 at 10:34 PM, Malcolm Box > wrote: > >> I'm confused by Django's behaviour when saving related models. Take for >> example: >> >> I kind of understand this, but it's not obvious to

Re: How to receive json data using HTTP POST request in Django 1.6?

2014-06-10 Thread Malcolm Box
Simplest answer is to use Django Rest Framework, which makes this extremely easy. Malcolm On Monday, 9 June 2014 11:20:05 UTC+1, Alok Singh Mahor wrote: > > Hi all, > > I am trying to receive JSON data using HTTP POST in django 1.6. > I tried using request.POST['data'], request.raw_post_data,

Re: execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Malcolm Box
The canonical answer to this is to use Celery, which provides a task queue for any background/scheduled tasks you want to use. It's pretty easy to get set up, and works well. Malcolm On Tuesday, 10 June 2014 06:37:46 UTC+1, Rini Michael wrote: > > Hi, > i am looking for a way where i can

Re: UserProfile.user" must be a "User" instance. django-registration

2014-06-10 Thread Jimish Parekh
Hey Nikhil, I might be wrong but please check your UserProfile model - In your __Unicode(something) function check for syntax error. i think it should be __Unicode__ - And why are you trying to return full name of User. I think you should return self.user there so that when you are

Re: Can't get MySQLdb

2014-06-10 Thread Alan Sawyer
> > I believe I got it to work. I had to change the Engine per this article. > http://dev.mysql.com/doc/connector-python/en/connector-python-django-backend.html -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Re: Question about moving code to product from local or development server.

2014-06-10 Thread Tomas Ehrlich
Hi there, since all have already mentioned Fabric, take a look at Ansible which is a bit more sophisticated tool, but can be used efficiently even for small setups. Depends on your requirements, you can create simple "deployment" playbook, which just takes your code, push it to the server, update

Re: Question about moving code to product from local or development server.

2014-06-10 Thread Phang Mulianto
Hi there, The easy way just copy /transfer your code to your production server manually. To more automate the process, you can use some script . To more advanced and not repeating your self, you can use fabric and create a deployment script for your project. After finish this effort , your

Re: Django Login/Session Not Sticking

2014-06-10 Thread Erik Cederstrand
Den 10/06/2014 kl. 09.08 skrev Juergen Schackmann : > I do have the same issue with django admin, and definitely no custom js > there. any other ideas??? You need to reduce the problem. Scale down to only one app server and re-run your tests. If the problem

Re: Question about moving code to product from local or development server.

2014-06-10 Thread Johannes Schneider
you can use 'Fabric' to deploy your code. But In this case you still have to write some parts on your own. https://pypi.python.org/pypi/Fabric/ bg, Johannes On 07.06.2014 22:50, Chen Xu wrote: I am building a django website, and wondering what is an easy way to move all of my code to

Re: Django Login/Session Not Sticking

2014-06-10 Thread Juergen Schackmann
I do have the same issue with django admin, and definitely no custom js there. any other ideas??? Am Freitag, 6. Juni 2014 13:50:31 UTC+2 schrieb Juergen Schackmann: > > none of my js is fiddling with sessions/cookies. but there are numerous > third party js packages included (for ads etc). so

execute a code at a particular date and time (aperidic task) in django

2014-06-10 Thread Rini Michael
Hi, i am looking for a way where i can execute a task at a particular date and time, i tried apscheduler for this purpose but i am finding some difficulty while integerating with django. can anyone help me with this the flow is user will specify a particular date and time through GUI --> submit