Re: Preview for the new website..
Hey, Unfortunately, if you are developing alone, then you got to buy the book "Learning CSS in 3 minutes and 42 seconds by Oscar Wilde" ;-) thats what I did, or else as Praveen and br suggested, get a template and hack it. But as my personal experience, templates never fits your need unless your site is a typical CMS (plus to customize a template you again need the knowledge of CSS/JS, and believe me, the template that you'll love the most will always have a pathetic CSS ;-) lolzz). Definitely getting extJS like framework makes your life simple, but again, it doesn't fit in all the cases... What I can recommend you is, start gradually by taking CSS and Javascript (Give a shot to jquery). Once you grasp the basics, the rest is the matter of time and google... Tx On Jun 5, 11:52 am, rajwrote: > I'm a very beginner developer. I'm just wondering how you got the > actual styling together? Did you bang all that out with photoshop/css/ > javascript or something? Cause I want to make a website, but I don't > know if I should go ahead and learn this way, or if there is an easier > way. Thank you. > -Raj > > On Jun 4, 7:58 am, Shamail Tayyab wrote: > > > > > > > > > Hi guys, > > > From some time I've been working on thishttp://tunesdiary.com > > which is now running live on Django. > > > It was a cool learning experience with my first site in Django after I > > came in from rails background and this group had been real supporting > > to me (thanks for the support guys, this is one real active group). > > Few things that I liked about Django are: > > > * ORM/Signals - definitely makes your life so simple.. > > * Inbuilt support for authentication and its applicability.. > > * Middleware approach towards design.. > > * Powerful templating - especially the templatetags thing. > > * And a lot more.. > > > I'ld like you to review my work and do tell me the goods and more > > important, the bads.. > > > With best regards > > > -- > > Shamail Tayyab > > > P.S The site uses Facebook to login (as of now), I definitely has a > > lot of plans to fix that, but being alone on this work is not > > permitting time to get around to add standard login and some other > > contexts like twitter/openID. -- 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: Writing my first view
i used "debug = False" in setting.py, that's why i couldn't see what the real error is because of the page appearance! thank you for your attention, On Jun 6, 5:31 am, Dave Sayerwrote: > Have you followed the whole of the tutorial? > On 6 Jun 2011 07:41, "bahare hoseini" wrote: > > > hi there, > > i use django vs1.3 > > i started editing urls.py to look loke this: > > > from django.conf.urls.defaults import * > > > from django.contrib import admin > > > admin.autodiscover() > > > urlpatterns = patterns('', > > > (r'^polls/$', 'polls.views.index'), > > > (r'^polls/(?P\d+)/$', 'polls.views.detail'), > > > (r'^polls/(?P\d+)/results/$', 'polls.views.results'), > > > (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'), > > > (r'^admin/', include(admin.site.urls)), > > > ) > > > but when i save it and run http//127.0.0.1:8000/admin/polls , the page can > > not be loaded and the errors are irrelevant such as: > > > File "F:\Program Files\python > > 2.7.1\lib\site-packages\django\views\defaults.py", line 30, in > server_error > > > t = loader.get_template(template_name) # You need to create a 500.html > > template. > > > File "F:\Program Files\python > > 2.7.1\lib\site-packages\django\template\loader.py", line 157, in > > get_template > > > template, origin = find_template(template_name) > > > File "F:\Program Files\python > > 2.7.1\lib\site-packages\django\template\loader.py", line 138, in > > find_template > > > raise TemplateDoesNotExist(name) > > > , i should mention that i don't forget "python manage.py runserver". > > can someone help me please? > > > -- > > 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.
Re: Need some help with MySQL and on OSX
Thanks for the feedback guys. Been using mamp for awhile for other frameworks (cake), but I still prefer python for scripting at the end of the day. Had a few issues with MySQLdb installation. 1st time using django and it doesn't seem so str8 forward to deploy? Will work on the recommendations and keep some documentation throughout the process. Cheers! On Jun 6, 1:33 pm, Andy Dustmanwrote: > Everyone complains, but no one submits patches. > > On Mon, Jun 6, 2011 at 12:54 PM, scot.hac...@gmail.com > > > > > > wrote: > >> On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: > > >> > Anyone have any good documentation on getting django with MySQL on OSX > >> > out there? > > > It really is amazing how difficult this still is. I've written two > > guides on this - one for pre-Leopard, one for post-Leopard: > > >http://birdhouse.org/blog/2009/02/21/python-mysql-connections-on-mac-os/ > >http://birdhouse.org/blog/2009/09/27/python-mysql-connections-and-sno... > > > HTH, > > ./s > > > -- > > 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 > > athttp://groups.google.com/group/django-users?hl=en. > > -- > Question the answers -- 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.
files managing
hello everyone, i need some help; i want the users to download some files.. {say photos} and what setting do i have to take care using FileField. where all these photos will be stored and how can user download the photos -- 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: Parsing feeds that are imported
Also, using the update_feeds that's part of the Django Community Aggregator worked initially, but I started over adding a m2m field on the Feed model for Sites. I'll have several "sites" as part of the Django app, like team1.mysite.com, team2.mysite.com, etc. When I added that field to the models and tried to run the update_feeds script it did nothing. It didn't import the feeds, didn't throw an error, etc. update_feeds: https://github.com/django/djangoproject.com/blob/master/django_website/aggregator/management/commands/update_feeds.py my models: http://dpaste.com/551322/ Thanks, On Jun 6, 4:55 pm, Chris McComaswrote: > This could be the wrong place to ask (maybe a BeautifulSoup) > question... > > I have a Django app that is based around the Django Community > Aggregator, it gets feeds from various sites and displays them on my > site. What I am wanting to do, if possible, is when it gets a feed if > a certain zip code is the feed Title or Summary then I want to create > a entry for that zipcode with that feed? > > I have a model for the zip codes, so the list to compare should be > pulled from that. There'd be a cron that'd run to do this, so for > example if one of the zip codes is 12345 and one of the feeds it gets > on the hourly cron has 12345 in the summary, then it'd go to the model > linking the two and create/save an entry. > > Here are the pertinent models:http://dpaste.com/551223/ > > 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: Django Development Environments
On Sun, Jun 5, 2011 at 10:11 AM, Developrwrote: > Hi! > > I'm currently developing for Django using the following the setup: > > Ubuntu 10.10 > PyCharm > VirtualEnv > Yolk > Pip > > For testing I generally just use the inbuilt dev server that Django > provides. > > For production I'm currently using nginx and FapWS3 - whilst it works > great, with FapWS3 not running threaded I'm looking into other > alternatives. > > I'm curious to see what other developers are using for their > projects! > One rule in groups is before to ask search it. regards, > > 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. > > -- Cristian Salamea @ovnicraft -- 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: Django Development Environments
Dev: OS X 10.6 MacVim virtualenv/pip TDD (unit test), bundled Django dev server Production: RHEL 5.5, 6.0 Apache for static files mod_wsgi Xavier, could you point to any resources about using buildout with Django, virtualenv and pip? I'm assuming you're using it to deploy things into production, right? Nolan On Jun 5, 2011, at 12:38 PM, Xavier Ordoquy wrote: > > virtualenv + pip and/or buildout > > > buildout > nginx + gunicorn stack > > Regards, > Xavier. -- 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: When next part of Django Tutorial?
What is listed under Coming Soon makes sense. In that order. Best regards, Martin On Tue, Jun 7, 2011 at 8:01 AM, Davidwrote: > Let's start with a more concrete question: what do users think should > be in tutorial 5 and beyond? > > On Jun 6, 1:20 pm, Paweł wrote: > > When next part of Django Tutorial? > https://docs.djangoproject.com/en/1.3/intro/tutorial04/ > > -- > 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.
Re: When next part of Django Tutorial?
Let's start with a more concrete question: what do users think should be in tutorial 5 and beyond? On Jun 6, 1:20 pm, Pawełwrote: > When next part of Django > Tutorial?https://docs.djangoproject.com/en/1.3/intro/tutorial04/ -- 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.
Parsing feeds that are imported
This could be the wrong place to ask (maybe a BeautifulSoup) question... I have a Django app that is based around the Django Community Aggregator, it gets feeds from various sites and displays them on my site. What I am wanting to do, if possible, is when it gets a feed if a certain zip code is the feed Title or Summary then I want to create a entry for that zipcode with that feed? I have a model for the zip codes, so the list to compare should be pulled from that. There'd be a cron that'd run to do this, so for example if one of the zip codes is 12345 and one of the feeds it gets on the hourly cron has 12345 in the summary, then it'd go to the model linking the two and create/save an entry. Here are the pertinent models: http://dpaste.com/551223/ 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.
When next part of Django Tutorial?
When next part of Django Tutorial? https://docs.djangoproject.com/en/1.3/intro/tutorial04/ -- 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.
Accessing template name inside a template?
For diagnostic purposes, I want every one of my templates to emit an HTML comment showing the template name. I was doing fine just dropping "", etc, in each template, until the first time I renamed a template and forgot to update the comment :-) Any way to automate this process so I can do ""? -- 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: what is the recommended way to display currency?
Check out BabelDjango: http://babel.edgewall.org/wiki/BabelDjango We've been using it to display currencies and it works pretty well for our needs (which includes two currency formats, Canadian English ($1,123.45) and Canadian French (1 123,45$).) Cheers, Jody On Sun, Jun 5, 2011 at 4:39 PM, snfctechwrote: > I thought this should be obvious but am having a hard time finding it > in the docs. There are a couple snippets that suggest using a custom > currency filter: > > http://www.djangosnippets.org/snippets/552/ > http://djangosnippets.org/snippets/1825/ > > But both use locale.setlocale, which is apparently not thread safe. > > So am I stuck with decimal formatting and hard-coding a currency > symbol somewhere? > > 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. > > -- 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: Need some help with MySQL and on OSX
Everyone complains, but no one submits patches. On Mon, Jun 6, 2011 at 12:54 PM, scot.hac...@gmail.comwrote: >> On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: >> >> > Anyone have any good documentation on getting django with MySQL on OSX >> > out there? > > It really is amazing how difficult this still is. I've written two > guides on this - one for pre-Leopard, one for post-Leopard: > > http://birdhouse.org/blog/2009/02/21/python-mysql-connections-on-mac-os/ > http://birdhouse.org/blog/2009/09/27/python-mysql-connections-and-snow-leopard/ > > HTH, > ./s > > -- > 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. > > -- Question the answers -- 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.
ManyToManyField limit_choices_to that instance via Django admin.
Hello, Here's some example code: [code] class Creative(...): file2 = models.ManyToManyField('Asset', ...) class Asset(...): file = models.FileField(...) [/code] Can I use limit_choices_to to limit "Asset" to only the files that were uploaded by the currently viewed "Creative" instance? In other words, if an uploaded file was not uploaded by the current instance, then I do not want to show it in the admin M2M choice filed. Does that make sense? I have googled around, but I have not had any luck implementing a solid solution. Any tips? Thanks so much! Cheers, Micky -- 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/-/MlhzZ1lkS0N5WElK. 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: Making a login/create user interface
you may also wish to look into django-registration. On Mon, Jun 6, 2011 at 1:03 PM, Shawn Milochikwrote: > Most of the info you need is here: > > > https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-web-requests > > If you get stuck understanding any specific points in the docs then let us > know (be as descriptive as possible) and you'll probably get help. > > > -- > 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.
Re: Making a login/create user interface
Most of the info you need is here: https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-in-web-requests If you get stuck understanding any specific points in the docs then let us know (be as descriptive as possible) and you'll probably get help. -- 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: Need some help with MySQL and on OSX
> On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: > > > Anyone have any good documentation on getting django with MySQL on OSX > > out there? It really is amazing how difficult this still is. I've written two guides on this - one for pre-Leopard, one for post-Leopard: http://birdhouse.org/blog/2009/02/21/python-mysql-connections-on-mac-os/ http://birdhouse.org/blog/2009/09/27/python-mysql-connections-and-snow-leopard/ HTH, ./s -- 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.
Making a login/create user interface
Hey guys, I'm sort of new to this, can someone talk me through on how to make a simple login/create user interface? How exactly do I use the auth_user stuff? Should I even use these given tables? What should the mysql tables look like anyway? What about password encryption? If I don't use the auth_user table, should I create a "login" app? Thank you. -Raj -- 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.
Custom Model Field in Django
I have a model lets say, MyModel which has a foreign key to another model say Tag. class MyModel(models.Model): id=models.AutoField(primary_key=True) name=models.CharField(max_length=200) tag = models.ManyToMany(Tag) I have approximately 50,000 instances of MyModel and each MyModel can have 100 Tags. If I use the above model I will get 5Million entries in a table, mymodel_tag but I can use all the features of ORM. However If I write custom methods and treat above field as an array of integers and write custom code to retrieve/save ids of tags associated with MyModel, I will have just 50K entries but I will have to write custom code for retrieval etc. My Question is : a) Which one should be used in this case? b) If I want to write above only using an extra column in mymodel table which will be the array of ids of all the tags associated with each MyModel, how do i do that? -- 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: Django Admin Login - Redirecting back to login page
Have commented out the 'SESSION_COOKIE_SECURE' and 'SESSION_EXPIRE_AT_BROWSER_CLOSE' from the settings.py file. This has fixed the problem and I can now log in to admin. On Jun 6, 1:33 pm, Aidanwrote: > Thanks for the input. > > I've tried deleting all .pyc files and still get the same issue. > > Also checked the cookies - I've got one sessionid and one csrftoken, > so that doesn't look like the issue. > > I've tried using the chrome javascript debugger to look for 404's and > haven't found any. > > I haven't deleted the database yet as there's data used (by South), to > do migrations on the tables underneath my models. I don't want to have > to recreate it all. > > On Jun 6, 12:19 pm, Karen Tracey wrote: > > > > > > > > > On Mon, Jun 6, 2011 at 6:57 AM, Aidan wrote: > > > I'm having trouble with the Django Admin. My login page appears ok at > > >http://127.0.0.1:8000/adminbutwhen I try to login with a valid > > > username or password the page seems to refresh - it reappears with > > > text boxes empty. It doesn't display any errors on the page (logging > > > in with invalid username / password brings up all the red errors you'd > > > expect). > > > I have seen this (though not with admin -- with a custom site login form) > > when somehow two sessionid cookies have been set. Using the browser tools to > > delete the sessionid cookies and try again allows login. I don't believe > > we've tracked down yet how the multiple sessionid cookies are getting set. > > > Karen > > --http://tracey.org/kmt/ -- 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.
Workaround for #13167?
Hi folks -- I'm having a problem with TemplateSyntaxErrors in Django 1.2 because a third-party app's views aren't setting a variable that gets used in filters (see [1]). I can't set the variable in a context processor because I don't want to override it in places where I'm setting it explicitly. Are there any workarounds for this bug? Thanks! [1] https://code.djangoproject.com/ticket/13167 -- 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: Excel dumps to Office 10
Hello Bobby, No answer just some thoughts. Did the MIME type change for Excel between 2003 and 2010? If your file dump is in a text format and is delimited with tabs or commas, can you change your MIME type to a plain text one? Although the apps may ask to convert when opening files that are in a text format, you'd need to test. Toodle-loo... creecode -- 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/-/Y0ZUcERGMUpGbUVK. 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: How to implement multi-tenant, single DB, single site?
Hello Ben, Take a look at < https://docs.djangoproject.com/en/1.3/topics/auth/#storing-additional-information-about-users >. Toodle-l... creecode -- 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/-/bDMtM2ZwUzNOcUVK. 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: bounces
Hello Paul, On Monday, June 6, 2011 5:12:28 AM UTC-7, Paul Schewietzek wrote: > But I'm getting too far off topic with this I guess. > Personally I don't mind a little drift off topic on this one. KG (original poster) was having a problem with using a communication channel about Django. If this thread helps someone in the future and saves them posting an email about the problem then a few extra posts now seem OK. Toodle-lo creecode -- 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/-/Z05TQml6ZFBLendK. 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.
Excel dumps to Office 10
hey - we are dumping results to excel as such: response = render_to_response('templatename_excel.html', {'trs':trs,}) filename='myfilename.xls' response['Content-Disposition'] = 'attachment; filename=' + filename response['Content-Type'] = 'application/vnd.ms-excel; charset=utf-8' return response where trs is our record set. This works fine for office 2003 and open office but we get an invalid format error when trying to open the item in office 2010... we can click OK on the alert box and the file opens but it is still annoying. Do you have to do anything specifically for Excel 2010 to get that message to go away? -- 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: Need some help with MySQL and on OSX
MacPorts will install it too, but you might find there are a lot of dependencies. On Jun 6, 2011 9:56 AM, "Ivo Brodien"wrote: > > >> MAMP. about as easy as it can get. >> http://www.mamp.info/de/index.html > > But you will still need to install somehow MySQLdb and that is the main problem. > > I don’t know about homebrew, but I remember that I had troubles getting MySQLdb to work but I eventually did with the help of various blogs and Stack Overflow posts, unfortunatelly I did not write down the steps, so good luck. I hope homebrew is a one click solution. > > -- > 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.
Re: How to disable security hash in django comments
Thank you for your response, I didn't want to disable crsf token. I wanted to disable django comment's security_hash I managed to do that overriding comment's forms.py :) On Jun 6, 4:38 pm, Ivo Brodienwrote: > search for csfr excempt decorator. > > On Jun 6, 2011, at 4:35 PM, Ján Vorčák wrote: > > > Hi, > > > I'd like to ask you about one problem. > > I need to remove security hash django comments module. I need to allow > > posting to my app from external application just by posting the post > > request. > > How can I do that? Is there any way to disable this "security hash" > > protection? > > > Thank you > > > -- > > 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 > > athttp://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.
Re: How to implement multi-tenant, single DB, single site?
Thanks, this is very helpful and gives me some good ideas to start implementing. One question I have is: If i'm using Django's built-in User class (and corresponding authentication) and I want to be able to associate each user with an organization and be able to access a user's organization from the view via the request, what is the best/easiest way to do that? Ben On Jun 4, 11:42 pm, Doug Ballancewrote: > For our setup we created a separate user,site framework since we do a > form of vhosting that serves multiple sites from one instance. We have > a Site model that serves as the root tying all of our other models > together. No abstract models or anything fancy, just a FK in each > model class pointing back to the Site model. You only have one site, > but the concept could be the same.. instead of setting the site > instance for a request in middleware from ip/header info like we do, > you'd infer and organization instance from the logged on user. > > For the view management I'd suggest looking at the class based views, > and creating a 'tenant aware' base class view that you can sublcass > for your individual views. I used the generic class based views as a > guide for making my own. I'd suggest starting by looking at the > source in django.views.generic.list and django.views.generic.detail. > The get_queryset()/get_object methods are the main points of > interest. If you have a middlware set the user (or use django's user > model) object on the request, you can alter your get_queryset() method > to restrict the query to only objects the user (or that users > organization) is allowed since the request will be available on the > class as self.request. > > For my use, I have a similar base class with an altered dispatch() > method that wraps the base dispatch method in a try/except looking for > an AuthError exception. In my view subclasses I override > get_queryset() to limit queryset per request (to the site/user), and > do additional permissions checking in get_context_data() raising an > AuthError exception if there is a permission error. The altered > dispatch is responsible for returning an error page or redirecting to > a login if AuthError is raised at any point in the view process. -- 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: How to disable security hash in django comments
search for csfr excempt decorator. On Jun 6, 2011, at 4:35 PM, Ján Vorčák wrote: > Hi, > > I'd like to ask you about one problem. > I need to remove security hash django comments module. I need to allow > posting to my app from external application just by posting the post > request. > How can I do that? Is there any way to disable this "security hash" > protection? > > > > Thank you > > -- > 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.
Re: I could not save my data from the admin page
On Mon, Jun 6, 2011 at 10:29 AM, Temesgen Gebeyehuwrote: > Exception Type: DatabaseError at /admin/books/author/add/ > Exception Value: no such table: django_admin_log > > A table used by the admin doesn't exist; you don't seem to have run syncdb after adding admin to INSTALLED_APPS. Karen -- http://tracey.org/kmt/ -- 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.
How to disable security hash in django comments
Hi, I'd like to ask you about one problem. I need to remove security hash django comments module. I need to allow posting to my app from external application just by posting the post request. How can I do that? Is there any way to disable this "security hash" protection? Thank you -- 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.
I could not save my data from the admin page
Environment: Request Method: POST Request URL: http://127.0.0.1:8000/admin/books/author/add/ Django Version: 1.4 pre-alpha SVN-16262 Python Version: 2.7.1 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'django.contrib.admindocs', 'mysite.books'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', '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 111. response = callback(request, *callback_args, **callback_kwargs) File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in wrapper 316. return self.admin_site.admin_view(view)(*args, **kwargs) File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapped_view 91. response = view_func(request, *args, **kwargs) File "C:\Python27\lib\site-packages\django\views\decorators\cache.py" in _wrapped_view_func 77. response = view_func(request, *args, **kwargs) File "C:\Python27\lib\site-packages\django\contrib\admin\sites.py" in inner 196. return view(request, *args, **kwargs) File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapper 25. return bound_func(*args, **kwargs) File "C:\Python27\lib\site-packages\django\utils\decorators.py" in _wrapped_view 91. response = view_func(request, *args, **kwargs) File "C:\Python27\lib\site-packages\django\utils\decorators.py" in bound_func 21. return func(self, *args2, **kwargs2) File "C:\Python27\lib\site-packages\django\db\transaction.py" in inner 211. return func(*args, **kwargs) File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in add_view 894. self.log_addition(request, new_object) File "C:\Python27\lib\site-packages\django\contrib\admin\options.py" in log_addition 506. action_flag = ADDITION File "C:\Python27\lib\site-packages\django\contrib\admin\models.py" in log_action 16. e.save() File "C:\Python27\lib\site-packages\django\db\models\base.py" in save 463. self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "C:\Python27\lib\site-packages\django\db\models\base.py" in save_base 556. result = manager._insert(values, return_id=update_pk, using=using) File "C:\Python27\lib\site-packages\django\db\models\manager.py" in _insert 198. return insert_query(self.model, values, **kwargs) File "C:\Python27\lib\site-packages\django\db\models\query.py" in insert_query 1456. return query.get_compiler(using=using).execute_sql(return_id) File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 810. cursor = super(SQLInsertCompiler, self).execute_sql(None) File "C:\Python27\lib\site-packages\django\db\models\sql\compiler.py" in execute_sql 754. cursor.execute(sql, params) File "C:\Python27\lib\site-packages\django\db\backends\util.py" in execute 34. return self.cursor.execute(sql, params) File "C:\Python27\lib\site-packages\django\db\backends \sqlite3\base.py" in execute 226. return Database.Cursor.execute(self, query, params) Exception Type: DatabaseError at /admin/books/author/add/ Exception Value: no such table: django_admin_log . . . . . WHat is the problem with this -- 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: Preview for the new website..
My team has a designer (designs stuff in Photoshop), a front-end developer who is comfortable taking designer's photoshop and converting it to HTML/CSS/Javascript (and does a bit with django templates), and then the back-end team (myself and co.) who put the django behind it. We are a very design-driven company, and that complicates my life a bit to put the django behind it (particularly working with forms, where the front end guys have a lot of fancy controls and ajaxy page flows, etc., which are not uncomplicated to implement on the backend), but the sites end up looking cool and (eventually) working nicely and in a very user-friendly way. But I would guess not all startup companies, and particularly web developers who aren't working for a company, have these competencies, in which case you may look to buy or find public domain html templates and tweak them and put the code behind them as the previous poster suggests. Also, Sencha (Ext JS) is a framework that seems to be geared toward companies/people where web developers and computer scientists who are more comfortable with object oriented programming than html and css have to carry the burden of making a nice front-end for their site, since the framework manages and dynamically creates a lot of the HTML and CSS for you and allows you to write stuff in an object-oriented framework built on javascript. We looked at sencha but our front-end/ HTML guy hated it so we are sticking with Jquery even though I would probably go with sencha if i wanted a very ajaxy site but didn't have him around to tweak all the html/css stuff. Not sure if/how sencha plays nicely with Django forms -- in my mind there may be some challenges there, given the two design philosophies, where sencha renders your forms automatically for you based on your object definitions. Ben n Jun 5, 12:52 am, rajwrote: > I'm a very beginner developer. I'm just wondering how you got the > actual styling together? Did you bang all that out with photoshop/css/ > javascript or something? Cause I want to make a website, but I don't > know if I should go ahead and learn this way, or if there is an easier > way. Thank you. > -Raj > -- 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: Need some help with MySQL and on OSX
> MAMP. about as easy as it can get. > http://www.mamp.info/de/index.html But you will still need to install somehow MySQLdb and that is the main problem. I don’t know about homebrew, but I remember that I had troubles getting MySQLdb to work but I eventually did with the help of various blogs and Stack Overflow posts, unfortunatelly I did not write down the steps, so good luck. I hope homebrew is a one click solution. -- 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: Confused about uploading files (Cannot force both insert and updating in model saving)
> > if form.is_valid(): > > f = request.FILES['file'] > > data_set = DataSet() > > data_set.save('foo', f) > > I suspect this is the problem: you create an empty instnce of DataSet > and then call its save method. model.save has three optional arguments > [1], in this case you call it with force_insert='foo', force_update=f. > > Both f and 'foo' evaluate to True, which is an obvious conflict. Ah, yes, of course. I was mixing up model.save() and model.FileField.save(). Thanks for setting me straight. What I wanted was this: if form.is_valid(): f = request.FILES['file'] data_set = DataSet(file=f) data_set.save() -- 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: Need some help with MySQL and on OSX
MAMP. about as easy as it can get. http://www.mamp.info/de/index.html On Jun 6, 8:51 am, Daniel Rosemanwrote: > On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: > > > Anyone have any good documentation on getting django with MySQL on OSX > > out there? > > > Cheers! > > Kolbe > > Just use Homebrew[1]. There's no reason to do it any other way. > > [1]:https://github.com/mxcl/homebrew > > -- > DR. -- 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: Django Admin Login - Redirecting back to login page
Thanks for the input. I've tried deleting all .pyc files and still get the same issue. Also checked the cookies - I've got one sessionid and one csrftoken, so that doesn't look like the issue. I've tried using the chrome javascript debugger to look for 404's and haven't found any. I haven't deleted the database yet as there's data used (by South), to do migrations on the tables underneath my models. I don't want to have to recreate it all. On Jun 6, 12:19 pm, Karen Traceywrote: > On Mon, Jun 6, 2011 at 6:57 AM, Aidan wrote: > > I'm having trouble with the Django Admin. My login page appears ok at > >http://127.0.0.1:8000/adminbut when I try to login with a valid > > username or password the page seems to refresh - it reappears with > > text boxes empty. It doesn't display any errors on the page (logging > > in with invalid username / password brings up all the red errors you'd > > expect). > > I have seen this (though not with admin -- with a custom site login form) > when somehow two sessionid cookies have been set. Using the browser tools to > delete the sessionid cookies and try again allows login. I don't believe > we've tracked down yet how the multiple sessionid cookies are getting set. > > Karen > --http://tracey.org/kmt/ -- 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: bounces
On Mon, Jun 6, 2011 at 12:12 PM, Paul Schewietzekwrote: > If at all, shouldn't they block domains instead of IP's?? Dunno. > > But I'm getting too far off topic with this I guess. > > Have a nice day =) > I worked as a spam fighter for a while, can share my insight: The general rationale for blocking dynamic and dial-ip IP blocks, is that those IP blocks contain a very high ratio of botnet-infected machines (a major source of spam), and a low ratio of legitimate e-mail sources. Generally, the standard way to avoid these problems is to relay your outgoing e-mail through the SMTP server of your ISP. -- Bjarni R. Einarsson Founder, lead developer of PageKite. Make localhost servers visible to the world: http://pagekite.net/ -- 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: bounces
If at all, shouldn't they block domains instead of IP's?? Dunno. But I'm getting too far off topic with this I guess. Have a nice day =) Paul 2011/6/6 Kenneth Gonsalves> On Mon, 2011-06-06 at 13:57 +0200, Paul Schewietzek wrote: > > Maybe your email address or the whole domain was being blacklisted for > > some > > reason I don't really know about SMTP and stuff, but aren't there > > grey-/blacklisting services out there that any mailserver can access? > > I get a dynamic IP - now and then I get a blacklisted one. That must be > it. It has stopped now. > -- > regards > KG > http://lawgon.livejournal.com > Coimbatore LUG rox > http://ilugcbe.techstud.org/ > > -- > 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.
Re: bounces
On Mon, 2011-06-06 at 13:57 +0200, Paul Schewietzek wrote: > Maybe your email address or the whole domain was being blacklisted for > some > reason I don't really know about SMTP and stuff, but aren't there > grey-/blacklisting services out there that any mailserver can access? I get a dynamic IP - now and then I get a blacklisted one. That must be it. It has stopped now. -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- 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: bounces
Maybe your email address or the whole domain was being blacklisted for some reason I don't really know about SMTP and stuff, but aren't there grey-/blacklisting services out there that any mailserver can access? Paul 2011/6/6 Kenneth Gonsalves> On Mon, 2011-06-06 at 13:24 +0200, Paul Schewietzek wrote: > > When you reply to a mail that pers...@example.com posted via the > > mailing > > list, do you send your reply to personX@example or to > > django-users@googlegroups.com? > > the latter > -- > regards > KG > http://lawgon.livejournal.com > Coimbatore LUG rox > http://ilugcbe.techstud.org/ > > -- > 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.
Re: bounces
On Mon, 2011-06-06 at 13:24 +0200, Paul Schewietzek wrote: > When you reply to a mail that pers...@example.com posted via the > mailing > list, do you send your reply to personX@example or to > django-users@googlegroups.com? the latter -- regards KG http://lawgon.livejournal.com Coimbatore LUG rox http://ilugcbe.techstud.org/ -- 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: bounces
When you reply to a mail that pers...@example.com posted via the mailing list, do you send your reply to personX@example or to django-users@googlegroups.com? Paul 2011/6/6 Kenneth Gonsalves> On Sun, 2011-06-05 at 08:26 -0700, creecode wrote: > > I'm assuming you mean the bounces are coming from emails you send in > > response to emails from this Google group? I can't answer that one as > > I use > > the web interface exclusively. > > > > If the above isn't correct could you give us more detail? > > correct > -- > regards > KG > http://lawgon.livejournal.com > Coimbatore LUG rox > http://ilugcbe.techstud.org/ > > -- > 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.
Re: Django Admin Login - Redirecting back to login page
On Mon, Jun 6, 2011 at 6:57 AM, Aidanwrote: > I'm having trouble with the Django Admin. My login page appears ok at > http://127.0.0.1:8000/admin but when I try to login with a valid > username or password the page seems to refresh - it reappears with > text boxes empty. It doesn't display any errors on the page (logging > in with invalid username / password brings up all the red errors you'd > expect). > I have seen this (though not with admin -- with a custom site login form) when somehow two sessionid cookies have been set. Using the browser tools to delete the sessionid cookies and try again allows login. I don't believe we've tracked down yet how the multiple sessionid cookies are getting set. Karen -- http://tracey.org/kmt/ -- 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: Django Admin Login - Redirecting back to login page
Oh and: - delete all *.pyc files from your project and restart the development server <-- this is a nice one that often solves mysterious problems that seem to be impossible and drive you insane Best regards, Martin On Mon, Jun 6, 2011 at 7:13 PM, Martinwrote: > I faced this a long time ago and it nearly drove me insane. Eventually I > just started a new project from scratch and the problem disappeared. > > Wild guesses: > > >- Open the JavaScript debug toolbar of Google Chrome (CTRL+SHIFT+J), >then reload the site and see if there are any 404 errors (that means your >static / media files are not served correctly) >- Refresh your browers cache, restart the browser and try again >- delete your database and run a fresh syncdb --all > > Best regards, > Martin > > On Mon, Jun 6, 2011 at 6:57 PM, Aidan wrote: > >> I'm having trouble with the Django Admin. My login page appears ok at >> http://127.0.0.1:8000/admin but when I try to login with a valid >> username or password the page seems to refresh - it reappears with >> text boxes empty. It doesn't display any errors on the page (logging >> in with invalid username / password brings up all the red errors you'd >> expect). >> >> I'm not sure what's going on here. The console gives me the following: >> >> (cache) C:\PythonProjects\CacheProject\cache>python manage.py >> runserver >> Validating models... >> >> 0 errors found >> Django version 1.3, using settings 'cache.settings' >> Development server is running at http://127.0.0.1:8000/ >> Quit the server with CTRL-BREAK. >> [06/Jun/2011 11:52:09] "GET /admin/ HTTP/1.1" 200 2053 >> [06/Jun/2011 11:52:17] "POST /admin/ HTTP/1.1" 302 0 >> [06/Jun/2011 11:52:21] "GET /admin/ HTTP/1.1" 200 2053 >> >> settings.py - >> # >> INSTALLED_APPS = ( >>'django.contrib.auth', >>'django.contrib.contenttypes', >>'django.contrib.sessions', >>'django.contrib.sites', >>'django.contrib.messages', >>'django.contrib.admin', >> ) >> # >> >> urls.py - >> >> from django.conf.urls.defaults import patterns, include, url >> >> from django.contrib import admin >> admin.autodiscover() >> >> urlpatterns = patterns('', >>(r'^admin/', include(admin.site.urls)), >> ) >> >> Any ideas? >> >> -- >> 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.
Re: Django Admin Login - Redirecting back to login page
I faced this a long time ago and it nearly drove me insane. Eventually I just started a new project from scratch and the problem disappeared. Wild guesses: - Open the JavaScript debug toolbar of Google Chrome (CTRL+SHIFT+J), then reload the site and see if there are any 404 errors (that means your static / media files are not served correctly) - Refresh your browers cache, restart the browser and try again - delete your database and run a fresh syncdb --all Best regards, Martin On Mon, Jun 6, 2011 at 6:57 PM, Aidanwrote: > I'm having trouble with the Django Admin. My login page appears ok at > http://127.0.0.1:8000/admin but when I try to login with a valid > username or password the page seems to refresh - it reappears with > text boxes empty. It doesn't display any errors on the page (logging > in with invalid username / password brings up all the red errors you'd > expect). > > I'm not sure what's going on here. The console gives me the following: > > (cache) C:\PythonProjects\CacheProject\cache>python manage.py > runserver > Validating models... > > 0 errors found > Django version 1.3, using settings 'cache.settings' > Development server is running at http://127.0.0.1:8000/ > Quit the server with CTRL-BREAK. > [06/Jun/2011 11:52:09] "GET /admin/ HTTP/1.1" 200 2053 > [06/Jun/2011 11:52:17] "POST /admin/ HTTP/1.1" 302 0 > [06/Jun/2011 11:52:21] "GET /admin/ HTTP/1.1" 200 2053 > > settings.py - > # > INSTALLED_APPS = ( >'django.contrib.auth', >'django.contrib.contenttypes', >'django.contrib.sessions', >'django.contrib.sites', >'django.contrib.messages', >'django.contrib.admin', > ) > # > > urls.py - > > from django.conf.urls.defaults import patterns, include, url > > from django.contrib import admin > admin.autodiscover() > > urlpatterns = patterns('', >(r'^admin/', include(admin.site.urls)), > ) > > Any ideas? > > -- > 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.
Django Admin Login - Redirecting back to login page
I'm having trouble with the Django Admin. My login page appears ok at http://127.0.0.1:8000/admin but when I try to login with a valid username or password the page seems to refresh - it reappears with text boxes empty. It doesn't display any errors on the page (logging in with invalid username / password brings up all the red errors you'd expect). I'm not sure what's going on here. The console gives me the following: (cache) C:\PythonProjects\CacheProject\cache>python manage.py runserver Validating models... 0 errors found Django version 1.3, using settings 'cache.settings' Development server is running at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK. [06/Jun/2011 11:52:09] "GET /admin/ HTTP/1.1" 200 2053 [06/Jun/2011 11:52:17] "POST /admin/ HTTP/1.1" 302 0 [06/Jun/2011 11:52:21] "GET /admin/ HTTP/1.1" 200 2053 settings.py - # INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.admin', ) # urls.py - from django.conf.urls.defaults import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^admin/', include(admin.site.urls)), ) Any ideas? -- 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: Why self-defined session_key got changed when save in DB?
On Sat, Jun 4, 2011 at 3:27 AM, Jimmywrote: > I'm new to Django and not quite understand your explanation. > > How can I create a specific session_key, and access to the session by > that key? Any risk that I have if I expose the session_key to the > outside? > > Thank you. > > Best regards, > Li Jiaming You cannot, because doing so is dangerous and counter intuitive. Read up on 'session fixation attacks', or my previous reply. Cheers Tom -- 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: Writing my first view
Have you followed the whole of the tutorial? On 6 Jun 2011 07:41, "bahare hoseini"wrote: > hi there, > i use django vs1.3 > i started editing urls.py to look loke this: > > from django.conf.urls.defaults import * > > > > from django.contrib import admin > > admin.autodiscover() > > > > urlpatterns = patterns('', > > (r'^polls/$', 'polls.views.index'), > > (r'^polls/(?P\d+)/$', 'polls.views.detail'), > > (r'^polls/(?P\d+)/results/$', 'polls.views.results'), > > (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'), > > (r'^admin/', include(admin.site.urls)), > > ) > > > but when i save it and run http//127.0.0.1:8000/admin/polls , the page can > not be loaded and the errors are irrelevant such as: > > > > File "F:\Program Files\python > 2.7.1\lib\site-packages\django\views\defaults.py", line 30, in server_error > > t = loader.get_template(template_name) # You need to create a 500.html > template. > > > > File "F:\Program Files\python > 2.7.1\lib\site-packages\django\template\loader.py", line 157, in > get_template > > template, origin = find_template(template_name) > > > > File "F:\Program Files\python > 2.7.1\lib\site-packages\django\template\loader.py", line 138, in > find_template > > raise TemplateDoesNotExist(name) > > > , i should mention that i don't forget "python manage.py runserver". > can someone help me please? > > -- > 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.
Re: Preview for the new website..
*If you are a developer (with much less designing skills) and want to get up and running with your site, **then I would suggest you to go and buy an html template and integrate it with **django. I recommend themeforest.com (I'm not affiliated with them anyways!). **Playing with html templates will make you comfortable with html/css eventually.* On Sun, Jun 5, 2011 at 9:52 AM, rajwrote: > I'm a very beginner developer. I'm just wondering how you got the > actual styling together? Did you bang all that out with photoshop/css/ > javascript or something? Cause I want to make a website, but I don't > know if I should go ahead and learn this way, or if there is an easier > way. Thank you. > -Raj > > On Jun 4, 7:58 am, Shamail Tayyab wrote: > > Hi guys, > > > >From some time I've been working on thishttp://tunesdiary.com > > which is now running live on Django. > > > > It was a cool learning experience with my first site in Django after I > > came in from rails background and this group had been real supporting > > to me (thanks for the support guys, this is one real active group). > > Few things that I liked about Django are: > > > > * ORM/Signals - definitely makes your life so simple.. > > * Inbuilt support for authentication and its applicability.. > > * Middleware approach towards design.. > > * Powerful templating - especially the templatetags thing. > > * And a lot more.. > > > > I'ld like you to review my work and do tell me the goods and more > > important, the bads.. > > > > With best regards > > > > -- > > Shamail Tayyab > > > > P.S The site uses Facebook to login (as of now), I definitely has a > > lot of plans to fix that, but being alone on this work is not > > permitting time to get around to add standard login and some other > > contexts like twitter/openID. > > -- > 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 and Regards, *Praveen Krishna R* -- 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: Request and null value
On 2011-06-06, at 07:36 , Constantine wrote: > Hi, a have a problem, but may be this is expected behaviour: > > on client side i'm post: > $.post("my url",{myvar:null}...) > > but on server side: > request.POST becomes {myvar:u'null'} > > null deserialized to string. So, do i need to report a bug in tracker? Nope, this is normal behavior: the javascript value `null`, when converted to a string, becomes the string `"null"`. String conversion is exactly that $.post does with its POSTdata in the normal case of application/x-www-form-urlencoded. So Django gets a string in its POST value. Nothing to see here. The alternative is to avoid using `application/x-www-form-urlencoded`, and instead use a JSON-encoded POST body. That's significantly more work on both sides, but it will allow you to send complete (typed) JSON data to your server. On the JS side, you'll have to call $.ajax directly (rather than just $.post) using the following options: $.ajax({ type: 'POST', url: your-endpoint, // This sets the POST body directly, to a JSON-encoded data structure data: JSON.stringify(your_javascript_payload), // jquery tries to convert your POST body through post-processing, tell it to leave your POST data as-is processData: false, // your callbacks }); On the Django side, you will not be able to use request.POST. Instead, you'll have to go through `HttpRequest.raw_post_data` or to use HttpRequest as a file: data = json.loads(request) or data = json.loads(request.raw_post_data) -- 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: Request and null value
Thanks, i've workaround this with empty string. I was surprised when saw raw_post_data which looks very similar to GET string. I confused this behaviour with JSON parser. On 6 июн, 12:50, Jani Tiainenwrote: > On Sun, 2011-06-05 at 22:36 -0700, Constantine wrote: > > Hi, a have a problem, but may be this is expected behaviour: > > > on client side i'm post: > > $.post("my url",{myvar:null}...) > > > but on server side: > > request.POST becomes {myvar:u'null'} > > > null deserialized to string. So, do i need to report a bug in tracker? > > It's not "deserialized" thus not a but but works as designed. HTTP > POST/GET parameters are only strings. Nothing more, nothing less. Django > doesn't do any magic by default. > > You can use some known notation to handle your data, like JSON which can > serialize and deserialize data correctly. > > -- > > Jani Tiainen -- 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: Need some help with MySQL and on OSX
On Monday, June 6, 2011 2:30:25 AM UTC+1, Kolbe wrote: > > Anyone have any good documentation on getting django with MySQL on OSX > out there? > > Cheers! > Kolbe Just use Homebrew[1]. There's no reason to do it any other way. [1]: https://github.com/mxcl/homebrew -- DR. -- 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/-/Uld6OE5JdlpGa1lK. 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: Confused about uploading files (Cannot force both insert and updating in model saving)
On Sun, Jun 05, 2011 at 07:18:24PM -0700, Roy Smith wrote: > I'm trying to figure out how to upload a file. I've got a model that > looks like: > > class DataSet(models.Model): > file = models.FileField(upload_to='data/%Y/%m/%d') > > and my view method is: > > def create_data_set(request): > if request.method == 'POST': > form = DataSetForm(request.POST, >request.FILES) > if form.is_valid(): > f = request.FILES['file'] > data_set = DataSet() > data_set.save('foo', f) I suspect this is the problem: you create an empty instnce of DataSet and then call its save method. model.save has three optional arguments [1], in this case you call it with force_insert='foo', force_update=f. Both f and 'foo' evaluate to True, which is an obvious conflict. Michal [1] https://docs.djangoproject.com/en/1.3/ref/models/instances/#django.db.models.Model.save signature.asc Description: Digital signature
Writing my first view
hi there, i use django vs1.3 i started editing urls.py to look loke this: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^polls/$', 'polls.views.index'), (r'^polls/(?P\d+)/$', 'polls.views.detail'), (r'^polls/(?P\d+)/results/$', 'polls.views.results'), (r'^polls/(?P\d+)/vote/$', 'polls.views.vote'), (r'^admin/', include(admin.site.urls)), ) but when i save it and run http//127.0.0.1:8000/admin/polls , the page can not be loaded and the errors are irrelevant such as: File "F:\Program Files\python 2.7.1\lib\site-packages\django\views\defaults.py", line 30, in server_error t = loader.get_template(template_name) # You need to create a 500.html template. File "F:\Program Files\python 2.7.1\lib\site-packages\django\template\loader.py", line 157, in get_template template, origin = find_template(template_name) File "F:\Program Files\python 2.7.1\lib\site-packages\django\template\loader.py", line 138, in find_template raise TemplateDoesNotExist(name) , i should mention that i don't forget "python manage.py runserver". can someone help me please? -- 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.