Re: Decoupling Postgres database credentials in django for deployment.

2018-03-30 Thread Phang Mulianto
I agree to set debug to false in your production configuration file. Never
debug on production setup.

If need enable debug on, use in staging environment or with different
django configuration files.



On Fri, 30 Mar 2018 23:52 PASCUAL Eric,  wrote:

> You're perfectly right about the "500 Error + DEBUG" case.
>
>
> One solution is to set DEBUG to off by default, and turn it on by code in
> the setting module if detecting  that the app is executing in a dev or Q
> environment. Depending on your context, this can be done with rules based
> on the host name or some other properties of the target systems.
>
>
> Best
>
>
> Eric
>
> --
> *From:* django-users@googlegroups.com  on
> behalf of Bill Torcaso 
> *Sent:* Friday, March 30, 2018 4:50:02 PM
> *To:* Django users
> *Subject:* Re: Decoupling Postgres database credentials in django for
> deployment.
>
>
> I have a concern about using environment variables to hold secret
> information, and an opinion about it.
>
> IF
>
> DEBUG is enabled, and there is a 500 server internal error, and the
> default 500 template is used to render the response,
>
>
> THEN
>
> *all of your secret information is shown in the browser output*
>
>
> Of course, DEBUG should never be enabled in production.  But a single
> human error might make it happen.
>
> I would prefer to trust Github security and long passwords than to think I
> am infallible about setting DEBUG.
>
> Note that this is certainly what happens when I run on a Vagrant VM, and I
> think it would be the same in a Docker-like container.
>
>
>
>
> On Thursday, March 29, 2018 at 4:24:40 PM UTC-4, prince gosavi wrote:
>
> Hi,
> I have made a django project and want to deploy it on cloud.
> Before that i want to decouple all the private information.
> I want to decouple the database info too, like the username password etc.
> Any help is appreciated.
>
> --
> 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/f5a1498a-3383-4219-b10e-e3e64f164658%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/DB7P193MB03311541D366207EF76069C28CA10%40DB7P193MB0331.EURP193.PROD.OUTLOOK.COM
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Zoomslider in Django

2018-03-13 Thread Phang Mulianto
Hi

This related to static path.can you access the image manually in the
browser?

The javascript part is run in client browser already, which django finished
processing when page sent to client.

Hope helps.

Regards

On 13 Mar 2018 5:17 pm, "deviya sweety"  wrote:

> Hi,
>I'm new to django and jquery, how can I use Zoomslider in Django??
> When i try to use data-zs-src='["images/2.jpg", "images/1.jpg",
> "images/3.jpg"]' it shows an error that those images are not found.
> could anyone help me out with this please.
> Thankyou in advance :)
>
> --
> 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/745abc51-2e60-4dec-9da9-606a18165c39%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Deploying SSL for my Django 2.0.1 server with Apache on Ubuntu 16.04 (droplet)

2018-01-21 Thread Phang Mulianto
Hi

If you use ssl on apache, the ssl terminate only on apache request from
client, then the wsgi from apache is no https.

So ssl handled by your webserver service, whether the webserver you use is
apache or nginx.

Try access the static file with https is it working?



On 21 Jan 2018 4:26 pm, "Antonis Christofides" 
wrote:

> Hello,
>
> I'm not certain I understand what you are describing. Is Apache listening
> on port 8000? How is it possible that you are using "runserver" when you
> are running Django through mod_wsgi? Something is wrong there.
>
> Also, don't put your Django app's files in public_html or any other
> directory that is publicly served by Apache. You don't want visitors from
> the web reading your source code (or, much worse, your settings file with
> its secrets). If you haven't done this before you may be confused by static
> files, in which case this article (of mine)
> 
> may help.
>
> Regards,
>
> Antonis
>
> Antonis Christofideshttp://djangodeployment.com
>
>
> On 2018-01-21 05:00, drone4four wrote:
>
> I’ve played with a little Django (v2.0.1) locally. Now I am trying to
> implement a test case on my production Apache web server. I’m running an
> Ubuntu 14.04 DigitalOcean droplet (will upgrade to 18.04 later this year).
>
> I got Django running.
>
> Here it is: http://www.angeles4four.info:8000/
>
> Before I log into my admin panel, I figure it’s best practices to set up
> HTTPS first. But when I visit that URL, Chrome throws this message:
>
>
> This site can’t provide a secure connection http://www.angeles4four.info
>> sent an invalid response. ERR_SSL_PROTOCOL_ERROR
>
>
> And my shell on my server shows this message:
>
> [20/Jan/2018 23:54:39] "GET / HTTP/1.1" 200 16559 [21/Jan/2018 00:01:23]
>> code 400, message Bad request syntax ('\x16\x03\x01\x00Ì\x01\x00\
>> x00È\x03\x03&6U\x10µ\x82\x97\x7f´8\x1e«\x0e¿ÿ§\x89æ\x82\r¢G§\x01ç°P%\x80)ÕÃ\x00\x00\x1c
>> * À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x00') [21/Jan/2018
>> 00:01:23] *You're accessing the development server over HTTPS, but it
>> only supports HTTP.*
>
>
> That’s because SSL isn’t set up. My current SSL Certificate Authority is
> Let’s Encrypt. SSL is running properly for my public_html content but not
> for my recent deployment of Django.
>
> I found some resources elsewhere on SO for setting up SSL with Django.
>
> In an SO post titled, “Configure SSL Certificate on Apache for Django
> Application (mod_wsgi)”, a highly upvoted answer by Alexey Kuleshevich
> suggests a template for 000-default.conf and default-ssl.conf for Apache
> vhosts. See here: Configure SSL Certificate on Apache for Django
> Application (mod_wsgi)
> 
>
> I did my best to change up the suggested values and entries so that they
> refer to my specific configuration. Here are what these two vhost
> configuration files of mine look like now.
>
> /etc/apache2/sites-available/angeles4four.info-le-ssl.conf:
>
> 
> 
> #ServerName http://www.example.com
> ServerAdmin coffee.drinker.dan...@gmail.com
> ServerName angeles4four.info
> ServerAlias http://www.angeles4four.info
> DocumentRoot /var/www/html/angeles4four.info/public_html
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>
> # Django Application
> Alias /static /var/www/html/angeles4four.info/public_html/
> Cel2FahConversion
> 
> Require all granted
> 
> 
> 
> Require all granted
> 
> 
> WGIDaemonProcess cel python-path=/var/www/html/ange
> les4four.info/public_html/Cel2FahConversion/venv/bin/python3
> WSGIProcessGroup cel
> WSGIScriptAlias / /var/www/html/angeles4four.info/public_html/
> Cel2FahConversion/Cel2FahConversion/Cel2FahConversion/wsgi.py
>
>
> SSLCertificateFile /etc/letsencrypt/live/angeles4four.info/cert.pem
> SSLCertificateKeyFile /etc/letsencrypt/live/angeles4four.info/privkey.pem
> Include /etc/letsencrypt/options-ssl-apache.conf
> SSLCertificateChainFile /etc/letsencrypt/live/angeles4four.info/chain.pem
> 
> 
>
>
> angeles4four.info.conf:
>
> Quote:
> 
>
>
> #ServerName http://www.example.com
> ServerAdmin coffee.drinker.dan...@gmail.com
> ServerName angeles4four.info
> ServerAlias http://www.angeles4four.info
> DocumentRoot /var/www/html/angeles4four.info/public_html
> 
> Options Indexes FollowSymlinks
> AllowOverride All
> Require all granted
> 
>
>
> ErrorLog ${APACHE_LOG_DIR}/error.log
> CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>
> RewriteEngine on
> RewriteCond %{SERVER_NAME} =angeles4four.info [OR]
> RewriteCond %{SERVER_NAME} =www.angeles4four.info
> RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
> 
>
> No dice. I still get the same traceback as I initially shared.
>
> The next SO post I came across suggests modifying settings.py. Here it is: 
> Error
> "You're 

Re: Vim plugin that does Django code completion?

2017-07-07 Thread Phang Mulianto
Hi

You can use plugin on vim using snipmate. You can create your own
autocomplete or using others created snip available for vim.

Hope helps.



On 7 Jul 2017 11:27 pm, "Robert F."  wrote:

> Is there a Vim plugin that does code completion for Django?  I'd like to
> be able to type something like "foobar = models." and hit Tab and see a
> list of classes like CharField or Foreign key.  Alternately, I'd be OK with
> entering an abbreviation that would bring up the proper code snippet.  The
> Django documentation suggests YouCompleteMe but it appears to only handle
> Python code, not Django specifically.  Also, I haven't been able to get it
> to work on my Mac laptop.
>
> I almost exclusively do editing of Django files on a remote Debian server
> from my Mac laptop.  I know PyCharm provides the ability to edit remote
> files and it has Vim emulation but it's pretty expensive and I'm not sure
> how closely the emulator emulates Vim.  SublimeText appears to have a
> "Djaneiro" package that does what I need but it looks like editing remote
> files is rather difficult with Sublime.  Doesn't Vim have better support
> for Django code completion that's comparable to these two applications?
>
> --
> 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/166226ca-2fc6-4454-9baf-0d871c552a8f%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: A public cloud with django backend

2016-09-20 Thread Phang Mulianto
hi,
this one :

{{i.file_name}}

should be

{{i.file_name}}

it will point to your local webserver if in local dev (
http://127.0.0.1/media/filename) , and in prod will be from your domain (
http://yourdomain.com/media/filename)

Cheers,

Mulianto

On Mon, Sep 19, 2016 at 10:59 PM, 'Tom Evans' via Django users <
django-users@googlegroups.com> wrote:

> On Thu, Sep 15, 2016 at 8:21 AM, Rahul Doshi 
> wrote:
> > Hi ,I want to setup  a dropbox like server with django. So far i have
> > achieved uploading files onto a location .I want these files to show up
> on
> > browser which they do(while saving file to the location I indexed an
> entry
> > in the Db so i just print the file names from the DB(POSTGRESQL).Now i
> want
> > to provide users options to view or download the files.I put a link on it
> > and tried ,it did not work since it shows an javascript error "NOT
> ALLOWED
> > TO LOAD LOCAL RECOURCE" . All uploaded files are loaded in C drive of my
> > laptop. Where else do i load so that javascript can load it? Attaching my
> > code ..thanks in advance.
>
>
> For security reasons, browser do not allow internet zone sites to
> access local content from javascript (otherwise, any site could read
> any accessible file from your computer and submit it, well, anywhere).
>
> Serve the files from the webserver instead.
>
> Cheers
>
> Tom
>
> --
> 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/CAFHbX1LaHEEpfm_9xVx2xeVq-eJQSoevSi2eKuK2wLtj%3DwXvcA%
> 40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: Django App DB replicas - call for suggestions

2015-02-21 Thread Phang Mulianto
Hi,

There is database do the offline and sync to main db server when connection
available. See couchdb.

or maybe for manual sync, in local db use sqlite, and your client app will
sync when online to main db.

Regards,

mulianto

On Sat, Feb 21, 2015 at 10:45 PM, Blazor  wrote:

> Hi all,
>
> I was asked to design a new django app by a client whose needs are a
> little bit context-specific.
>
> The purpose of this app is to introduce computer-assisted technologies in
> a paper-based environment, in the e-Health domain. This client would like
> to access a central server with a few mobile clients with the constraint of
> a non-permanent internet connection, because the location of the mobile
> clients is continuously changing and an internet connection might not
> always be available.
>
> My current idea is based on a portable small server (a nettop, or even a
> raspberry pi, as the computing power is not a problem for this app) with a
> django app on it and a wireless access point for providing mobile clients
> with an always-on portable server reachability. At the same time, I'd like
> other clients around the world (a very little number, though) to still be
> able to access a central remote version of the same service, so I'd still
> deploy the same app (with its own DB replica) within a remote server.
>
> I hope I made my client's requirements clear: how would you manage the
> synchronization between the two DBs, given that both DBs need a write
> access and that the only relaxation of this constraint is that when the
> portable server is on, the remote DB might work in a read-only mode (but
> this is not required).
>
> Thanks in advance for any suggestions you'll provide me with.
> B.
>
> --
> 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/bb65e66c-4788-4010-9bfe-b8f20e41e5d1%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%2BSr5mSJ90adkhZQKRAL81899fZGLOg2Z9tAXLu3wJk5MEs1sQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Deploying Django project

2014-11-21 Thread Phang Mulianto
Hi Fred,

Sory for the missunderstanding ...

i just remember my first time deploying manually with all the typing and
typo and the step.. :)

Cheers

Mulianto

On Fri, Nov 21, 2014 at 11:42 PM, Fred Stluka <f...@bristle.com> wrote:

>  Mulianto,
>
> You said:
>
> Fred way is good, but need time to type and remember all the steps. WIth
> fabric you will not miss a step and it can be automated.
>
>  I think you misunderstood my post.  The commands I showed
> are excerpts from my automated script.  I provided them so
> termopro could write such a script of his own.  I don't type all
> of those commands each time.  I just type:  *pub*
>
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com <f...@bristle.com> --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>  On 11/20/14 7:50 PM, Phang Mulianto wrote:
>
> Hi termopro,
>
>  TO automate the deployment, look for fabric + cuisie (CHef like fabric) .
>
>  You will bored with the command line in each deployment, and you will
> need fast and standard way of deploying to each new machine.
>
>  Fred way is good, but need time to type and remember all the steps. WIth
> fabric you will not miss a step and it can be automated.
>
>  Git is you friend here. You can create a private repo in your prod
> machine, and make the code pull from the repo for production deployment
> when you push from dev to prod with hook script (Automate again)
>
>  BUt make sure the code tested before go production with this way.
>
>  Regards,
>
> Mulianto
>
>  Blog: http://muliantophang.blogspot.com
>
> On Fri, Nov 21, 2014 at 7:37 AM, Fred Stluka <f...@bristle.com> wrote:
>
>>  termopro,
>>
>> I have automated my deployments mostly separate from my
>> version control.
>>
>> The other team members and I write, test, commit, and push our
>> code changes to our Git repo.  I then pull, review, test, update
>> the version number, commit, tag, and push to Git.
>>
>> Then I use a shell script (on Mac, but would work on Unix/Linux
>> also) to push the tagged commit to TEST and later to PROD.
>>
>> My script does things like:
>>
>> - Get the latest files from Git before, and back to master after:
>>% git checkout mytag
>>...
>>% git checkout master
>>
>> - Create folder of collected static files before, and delete after:
>>% mkdir -pv collected_static/mytag
>>% python manage.py collectstatic --clear --noinput
>>...
>>% rm -rfv collected_static
>>
>> - Delete all local *.pyc files:
>>% find . -name \*.pyc -exec rm -v "{}" ";"
>>
>> - Insert PROD password into local settings file (PROD pushes
>>only) before, and remove after:
>>% sed -i .old -e "s/PUT_PROD_PASSWORD_HERE/`cat prod_pw`/g" settings.py
>>...
>>% mv -v settings.py.old settings.py
>>
>> - Show a warning banner at the Web site to say it is going down
>>briefly, and clear the banner after:
>>% ssh -t myserver.mydomain.com cp -v
>> /var/www/django/myapp/templates/myapp/site_alert_maintenance.html
>> site_alert.html
>>% sleep 60
>>...
>>% ssh -t myserver.mydomain.com cp -v
>> /var/www/django/myapp/templates/myapp/site_alert_none.html site_alert.html
>>
>> - Push the local files to the TEST or PROD server:
>>%  rsync -v --progress -i -l --rsh=ssh -r --del myapp
>> myserver.mydomain.com:/var/www/django
>>
>> - Run all migrations on the server
>>% ssh -t myserver.mydomain.com python manage.py migrate --all
>>
>> - Stop the Apache server, delete all remote *.pyc files, and
>>restart the server:
>>% ssh -t myserver.mydomain.com sudo /etc/init.d/httpd stop
>>% ssh -t myserver.mydomain.com sudo find /var/www/django/myapp -name
>> \*.pyc -exec rm -v "{}" ";"
>>% ssh -t myserver.mydomain.com sudo /etc/init.d/httpd start
>>
>> Plus a few other actions that are specific to our app, and lots
>> or informational messages, prompts, confirmations, etc.  Also,
>> some of these steps are combined into a remote script that
>> runs on the server to reduce the number of "ssh -t sudo"
>> commands I would otherwise have to do.  But, that's the gist
>> of it.
>>
>> Hope this helps!
>> --Fred
>> --
>> Fred Stluka -- mailto:f...@bristle.com <f.

Re: Deploying Django project

2014-11-20 Thread Phang Mulianto
Hi termopro,

TO automate the deployment, look for fabric + cuisie (CHef like fabric) .

You will bored with the command line in each deployment, and you will need
fast and standard way of deploying to each new machine.

Fred way is good, but need time to type and remember all the steps. WIth
fabric you will not miss a step and it can be automated.

Git is you friend here. You can create a private repo in your prod machine,
and make the code pull from the repo for production deployment when you
push from dev to prod with hook script (Automate again)

BUt make sure the code tested before go production with this way.

Regards,

Mulianto

Blog: http://muliantophang.blogspot.com

On Fri, Nov 21, 2014 at 7:37 AM, Fred Stluka  wrote:

>  termopro,
>
> I have automated my deployments mostly separate from my
> version control.
>
> The other team members and I write, test, commit, and push our
> code changes to our Git repo.  I then pull, review, test, update
> the version number, commit, tag, and push to Git.
>
> Then I use a shell script (on Mac, but would work on Unix/Linux
> also) to push the tagged commit to TEST and later to PROD.
>
> My script does things like:
>
> - Get the latest files from Git before, and back to master after:
>% git checkout mytag
>...
>% git checkout master
>
> - Create folder of collected static files before, and delete after:
>% mkdir -pv collected_static/mytag
>% python manage.py collectstatic --clear --noinput
>...
>% rm -rfv collected_static
>
> - Delete all local *.pyc files:
>% find . -name \*.pyc -exec rm -v "{}" ";"
>
> - Insert PROD password into local settings file (PROD pushes
>only) before, and remove after:
>% sed -i .old -e "s/PUT_PROD_PASSWORD_HERE/`cat prod_pw`/g" settings.py
>...
>% mv -v settings.py.old settings.py
>
> - Show a warning banner at the Web site to say it is going down
>briefly, and clear the banner after:
>% ssh -t myserver.mydomain.com cp -v
> /var/www/django/myapp/templates/myapp/site_alert_maintenance.html
> site_alert.html
>% sleep 60
>...
>% ssh -t myserver.mydomain.com cp -v
> /var/www/django/myapp/templates/myapp/site_alert_none.html site_alert.html
>
> - Push the local files to the TEST or PROD server:
>%  rsync -v --progress -i -l --rsh=ssh -r --del myapp
> myserver.mydomain.com:/var/www/django
>
> - Run all migrations on the server
>% ssh -t myserver.mydomain.com python manage.py migrate --all
>
> - Stop the Apache server, delete all remote *.pyc files, and
>restart the server:
>% ssh -t myserver.mydomain.com sudo /etc/init.d/httpd stop
>% ssh -t myserver.mydomain.com sudo find /var/www/django/myapp -name
> \*.pyc -exec rm -v "{}" ";"
>% ssh -t myserver.mydomain.com sudo /etc/init.d/httpd start
>
> Plus a few other actions that are specific to our app, and lots
> or informational messages, prompts, confirmations, etc.  Also,
> some of these steps are combined into a remote script that
> runs on the server to reduce the number of "ssh -t sudo"
> commands I would otherwise have to do.  But, that's the gist
> of it.
>
> Hope this helps!
> --Fred
> --
> Fred Stluka -- mailto:f...@bristle.com  --
> http://bristle.com/~fred/
> Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
> Open Source: Without walls and fences, we need no Windows or Gates.
> --
>  On 11/19/14 5:22 AM, termopro wrote:
>
>  I have created a Django 1.7 project and would like to deploy it. I am
> reading about how to do it right and i have some questions.
>
> If i understand correctly deployment should contain the following steps:
>
> 1) Initial remote machine set up:
>
>- a) install os / server / database / cache ...
>- b) install Django and required modules
>- c) update database with real data
>
> 2) Upload code/ database changes to remote machine:
>
>- a) upload changed Django project
>- b) upload changes in Database tables (model migrations)
>
> Most tutorials/articles about deployment do not cover 1.c and 2.b. Also
> the tasks 1.b. and 2.a. are solved using revision control tools
> (Git/Mercurial)
>
> So i'd like to know:
>
>-
>
>1) How do i install Django project or it's updates without revision
>control tools ? Should i simply upload my project using FTP/SSH ? Is there
>a good way to automate it ?
> -
>
>2) How do i automate the task of uploading required database changes
>(like model migrations) ?
>
>  --
> 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
> 

Re: Newbie: Complete environment setup(virtualenv, pip, eclipse, git...)

2014-07-21 Thread Phang Mulianto
Hi Martin,

Virtualenv is use for using different version of python or python library
so it wont use the default python in system.  So when open eclipse for
editing, no need to activate virtualenv, but when you need to run the code
in specific python install, you need to activate virtualenv.

VIrtualenv will be usefull in production , where several different python
version needed or several python libarary with different version used.

Regards,

Mulianto
http://muliantophang.blogspot.com




On Mon, Jul 21, 2014 at 2:40 PM, Martin Torre Castro 
wrote:

> Firstly, I want to say "thank you" to you, Thomas.
>
> Secondly, could you or someone how does the development cycles work with
> virtualenv? Is this way of working just as I wrote?
>
> I think it works by activating the virtualenv every time with a "source
> activate" command and after that starting to program from the terminal. I
> need to know this for adapting Eclipse to activating the virtualenv every
> times it opens if virtualenv works as expected.
>
> Thanks
>
>
>
> On Sunday, 20 July 2014 04:29:53 UTC+2, Thomas wrote:
>>
>>  On 7/19/14 6:41 PM, Martin Torre Castro wrote:
>>
>>  Hello,
>>
>>  my name is Martin and I'm a computer engineer from Spain. I'm going to
>> start a new project with a colleague and I decided to use Django because we
>> searched for free opensource tools and I'm in love with Python.
>>
>>  We have made a couple of tutorials (the official one and "Tango with
>> django"). I've also bought the book "Two scoops of Django" for the 1.6
>> Django edition. We're starting the project soon as well as we finish the
>> design, but I'm concerned about setting up the new environment. We're
>> thinking of using:
>>
>>
>>- postgresql
>>- Python/Django [ of course ;-) ]
>>- Eclipse/Pydev
>> - Git
>>- jQuery
>>
>>
>>  All good choices. pip and virtualenv provide for a reproducible and
>> robust installation. PostgreSQL is imho far superior to other options for
>> db. I don't have experience with using Eclipse in this environment so can't
>> comment there.
>>
>> hth
>>
>>- Tom
>>
>  --
> 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/f99612a0-0d8f-44ee-93ee-2ed3e01055f3%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%2BSr5mS_Kk_i0%3DFgO-pfw2e4N_11VXQ6yp%3D0T82X2Qp0zy3dLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: advice from experts

2014-07-20 Thread Phang Mulianto
try using Git / any other SCM


On Sun, Jul 20, 2014 at 2:37 PM, Eddilbert Macharia 
wrote:

> hi guys i have created a web application and its my first one,so i luck
> the experience in the finer details requirement.
>
> what are some of the considerations i shld keep in mind before i move the
> application from development to production.
>
> here is one i realised recently, locking out a resource if someone else is
> altering it at the same time.
>
> 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/93261ac0-8407-472a-bdf6-86222ca87c0d%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%2BSr5mT20v-baMNHbfaUDBngP2s8RXrnU9qmukkkczKxPQ-1EA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: crm app

2014-06-28 Thread Phang Mulianto
have a look of openerp which have crm on the package..

it has cloud offer also, and is still free for a few user.


On Sat, Jun 28, 2014 at 1:42 PM, Mike Dewhirst 
wrote:

> Thanks Kelvin. It looks good at first glance.
>
> Do you know if Django-CRM is suitable for an end user?
>
> Mike
>
>
> On 28/06/2014 2:05 PM, Kelvin Wong wrote:
>
>> If you don't want to help the fellow when he runs into issues, give him
>> a supported product like Zoho CRM. It is free for 3 users.
>>
>> I'm currently reviewing Tree.io for a client and while it looks nice, it
>> uses Piston (abandonware), Jinja (unnecessary), Dajaxice (a bad idea
>> generally). I wouldn't recommend it at this point.
>>
>> K
>>
>>
>> On Friday, June 27, 2014 8:01:43 PM UTC-7, Mike Dewhirst wrote:
>>
>> I have a non-technical colleague who needs a fairly simple CRM system.
>> SugarCRM Community Edition is overkill.
>>
>> --
>> 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/247fd82c-
>> 0b64-4731-a409-37b8f3a22870%40googlegroups.com
>> > 0b64-4731-a409-37b8f3a22870%40googlegroups.com?utm_medium=
>> email_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/53AE55BA.4010804%40dewhirst.com.au.
>
> 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%2BSr5mTi7z1SVBKJoWrTQTU8p%2BDwn2iW%2B-jMJwZRqWQRhpmm7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to display image in template

2014-06-27 Thread Phang Mulianto
Hi,

The image i assume you upload to media folder .
Make sure your media folder accessible by webserver which serving static
files.

To use in template just use the html img src='urltoimage'  , and use
media_url context variable to not hardening the url.

Mulianto

http://muliantophang.blogspot.com




On Fri, Jun 27, 2014 at 4:33 PM, Ram Ganesh  wrote:

> I started learning Django and I'm trying to build a photo app.
> this app merging uploaded images and rendering.
> I have merged Images with PIL and save the image in accessible file system.
>
> Now I'm stuck with this,
>  -How do I displaying merged new Image,
>  -How to serve merged new Image files in my Templates?
> Can some one show a step by step instruction
>
> Application running on django development server.
>
> --
> 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/912a0115-080f-4e01-9c2e-c7253a940fd0%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%2BSr5mRRBxLhj1zaWSuTcfuUxrdFs7QTM-mM4EFauWrD_XJuWA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Angular and Django

2014-06-22 Thread Phang Mulianto
Angularjs great for a front end, and it just plain html + javascript. we
won't need django templating, just put the angular app in a webserver like
nginx to server static files, then use django for the API part with REST
service.

The angular html generation should not in django templating, because it
will loose the benefit of REST + API application. and you will still need
to process the HTML before output to the client / nginx server.

Just let django process the core CRUD function and
authentication/authorization, and the presentation give it to Angularjs.

I am use angular if want better user experience with web app, especially
with single page app.

Regards,

Mulianto


On Sun, Jun 22, 2014 at 11:51 PM, Scot Hacker  wrote:

> Angular is really wonderful, and I use it with several Django projects.
> But the two are agnostic about each other. All Angular needs from the
> back-end is a solid JSON API to work with and a few core back-end features
> like handling authentication. Modern JS frameworks like Angular, sadly,
> make the back-end almost (but not quite) irrelevant. The reason I use
> Django as the back-end is because Django REST Framework is so freaking
> fantastic as an API generator. I'm really hoping that once Django 1.7 lands
> and migrations are in, the dev team will turn its attention to native
> RESTfulness.
>
> You do lose a lot of Django goodness when adopting a client-side framework
> though. For example, you can't traverse model relationships however and
> whenever you want - any data you need in the view needs to be added to the
> API first.
>
> This isn't *quite* ready for public consumption yet, but here's something
> I've been working on - a kit for building hybrid Django + Angular sites:
>
> https://github.com/shacker/tristano
>
>
> On Saturday, June 21, 2014 4:03:17 PM UTC-7, zweb wrote:
>>
>>
>> I was looking at Angular and looks like it does many of the thing Django
>> Templates does but on the client side.
>>
>> Are you using Angular with Django? How is the experience? What are the
>> /pros/cons? What are using django for and what are you using angular for?
>> Is django pretty much a rest framework  with business logic and DB
>> access? (when used with Angular)
>>
>>  --
> 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/a1c94581-afe2-4a39-844e-72abc7973fa2%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%2BSr5mT3b9Gqgk%3DK9Q%3DakTSNXdf-xjj1kmDwP8uNhNG%2Bp9OWTA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 fabric will be reusable in other project.
You would like to automate and simplfy the workflow to upload your
production and can be repeated easily.

Fabric is more python for deployment.

Regards,

Mulianto
http://muliantophang.blogspot.com


On Tue, Jun 10, 2014 at 3:11 PM, Johannes Schneider <
johannes.schnei...@galileo-press.de> wrote:

> 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 production, is there a tool for doing that, or
>> maybe write my own script?
>>
>>
>> Thanks
>>
>> --
>> ⚡ Chen Xu ⚡
>>
>> --
>> 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/CACac-
>> qY8nbj6uiPyvkorvARAqZ%2Bej7rAty_CtdkHnz5bXBKBKQ%40mail.gmail.com
>> > qY8nbj6uiPyvkorvARAqZ%2Bej7rAty_CtdkHnz5bXBKBKQ%
>> 40mail.gmail.com?utm_medium=email_source=footer>.
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> --
> Johannes Schneider
> Webentwicklung
> johannes.schnei...@galileo-press.de
> Tel.: +49.228.42150.xxx
>
> Galileo Press GmbH
> Rheinwerkallee 4 - 53227 Bonn - Germany
> Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax)
> http://www.galileo-press.de/
>
> Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
> HRB 8363 Amtsgericht Bonn
>
>
> --
> 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/5396AF94.5040509%40galileo-press.de.
>
> 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%2BSr5mS6WSRMsxLdqk6aOAXUpLMPurco-pDE%2BRA3Ev5CQ7P%2BKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Upgrading from 1.4.3 to 1.4.10

2014-04-18 Thread Phang Mulianto
Hi,

i have documenting my journey uprading from django-1.4 to django-1.5 ,
which i only found some change in the url usage.

here are the link of my blog. http://bit.ly/RuPMbr

Thanks,

Mulianto


On Thu, Apr 17, 2014 at 11:46 AM,  wrote:

> Thanks those release notes were very helpful.
>
>
>
> On Wednesday, April 16, 2014 7:08:22 AM UTC-7, nu.ev...@gmail.com wrote:
>>
>> How do I discover what changed between Django 1.4.3 and 1.4.10?
>>
>> Will require changes to my code, or will it just work?
>>
>  --
> 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/d0386985-dba7-4a51-b32e-9e8604fa6764%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%2BSr5mTyuLNcMGiysfTRQnP3XUBNvpW%2BpW6FrSnsQiJC2QAiZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django statics

2013-07-15 Thread Phang Mulianto
Hi,

Better not use hard coded url path for static, use {{ STATIC_URL }} in your
link ;
eg : 




On Mon, Jul 15, 2013 at 7:28 AM, Sébastien Billion <
sebastien.bill...@gmail.com> wrote:

> Hi,
>
> In your project folder, you can create a folder media zith a subfolder
> css, an other img, js, whatever.
> In your settings.py, you can use this line to get the absolute path
> dynamically:
>
> from os import path
> PROJECT_ROOT = path.dirname(path.abspath(__file__))
>
> After, you need to specify your MEDIA_ROOT and MEDIA_URL
>
>
> MEDIA_ROOT = path.join(PROJECT_ROOT,'media')
>
> MEDIA_URL = '/media/'
>
> In your template, if you want to get your css or your js, img, etc... you
> just need to do
> 
>
> Regards,
> Seb
>
>
> 2013/7/15 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.
>>
>>
>>
>
>  --
> 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: Choosing a JS framework to go together with Django

2013-07-14 Thread Phang Mulianto
Hi ,

Why not using REST for serving your data to the Front End app, it can be
from mobile app or just web app with HTML + javascript.

With that you don't need to worry about redo the template side in django
and in your front end js app.
With REST serving JSON, no template / html needed for the response.

You can use Tastypie or Django rest
frameworkwhich still using Django
engine . This way also your application server no
need to rendering the HTML view in every request from the first time.

Any front end will be able to process the JSON with javascript.

Regards,

Mulianto


On Sun, Jul 14, 2013 at 8:18 PM, dotnetCarpenter
wrote:

> In the end, my project stalled due to lack of resources. We might pick it
> up but it's been abandoned for quite some time. I haven't had any django
> projects since. Hence, I can't make any recommendations.
>
> DjangoAjax looks promising but might lack the community support you
> expect. It is however based on jQuery and ASP.NET MVC, so if you can see
> past the M$ cruft, some guides etc are available.
>
> --
> 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: NoReverseMatch at /my_account/

2013-02-05 Thread Phang Mulianto
Oh great.. I have this problem too and cant figure it out.

Now i know the problem.

I hit this twice already...

I am from php too...but build with django is wonderfull and got speed in
production :)
On Feb 5, 2013 11:04 PM, "frocco"  wrote:

> Coming from PHP, I love django.
>
> On Tuesday, February 5, 2013 3:25:28 AM UTC-5, Serkan Sökmen wrote:
>>
>> Yeah, i did the same once -)
>>
>> On Tue, Feb 5, 2013 at 1:07 AM, frocco  wrote:
>>
>>> Thank you, I can't tell you how long I struggled with this.
>>>
>>> On Monday, February 4, 2013 1:48:37 PM UTC-5, frocco wrote:

 I am getting NoReverseMatch at /my_account/
 what is wrong with my urls?
 Thanks

 Reverse for 'order_info' with arguments '()' and keyword arguments '{}' 
 not found.

 main urls.py

 (r'^my_account/$', include('accounts.urls')),


 accounts/urls.py

 urlpatterns = patterns('accounts.views',
 (r'^$', 'my_account',
  {'template_name': 'registration/my_account.html'}, 'my_account'),
 (r'^order_info/$', 'order_info',
  {'template_name': 'registration/order_info.html'}, 'order_info'),
(r'^register/$', 'register',
{'template_name': 'registration/register.html', 'SSL': 
 settings.ENABLE_SSL }, 'register'),
 (r'^order_info/$', 'order_info',
  {'template_name': 'registration/order_info.html'}, 'order_info'),
(r'^order_details/(?P[-\w]+)/$', 'order_details',
{'template_name': 'registration/order_details.**ht**ml'}, 
 'order_details'),
 )

  --
>>> 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?hl=en
>>> .
>>> For more options, visit 
>>> https://groups.google.com/**groups/opt_out
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> *E. Serkan Sökmen*
>> Django / Front-end Developer @Teknolab 
>> Personal works: serkansokmen.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?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: Django apache mod_wsgi permission denied

2012-12-16 Thread Phang Mulianto
THank for the config , i do able to run the apache22 with mod_wsgi + python
2.7 in windows server.



On Sun, Dec 2, 2012 at 3:03 PM, Loai Ghoraba  wrote:

> Thanks a million for the tip :)
>
>
> On Sun, Dec 2, 2012 at 5:08 AM, Chris Cogdon  wrote:
>
>>
>>
>> On Saturday, December 1, 2012 3:47:39 AM UTC-8, Loai Ghoraba wrote:
>>>
>>> no I mean the root of my project guys :) thanks a lot :D which lives in
>>> path/to/my/project :)
>>>
>>
>> Oh thank god for that!
>>
>> I'd actually done something similiar once... I'd removed a bunch of
>> permissions using chmod -R /   rather than chmod -R . ... This was on an
>> oldold NCR Tower 32 running SVR3. I ended up writing a program to go
>> through the archives on tape (yes, tape) and copy only the permission bits
>> from all the tape files.
>>
>> Anyway, a better form of that command is chmod -R a+rX
>>
>> The capital X means "only set the execute bit if any execute bits are
>> set". If you use lower-case x, then you'll send up setting the execute bit
>> for normal files, too, which is another potential security risk. If you
>> want to fix this up, do:
>>
>> find . -type f -print0 | xargs -0 chmod a-x
>> chmod a+x manage.py # Restore x for the Django management command
>>
>> Protip: always use the -print0 | xargs -0  form of the "find/xargs"
>> pattern, as this will prevent spaces in your paths from causing havoc.
>>
>> I wish I knew of a better way to set the x bits all the way up the tree,
>> without giving someone a program to run, the best I can come up with is:
>>
>> cd static
>> chmod a+x . .. ../.. ../../.. ../../../.. ../../../../..
>> ../../../../../.. ../../../../../../..
>>
>> and hope that's enough :)
>>
>>
>>  --
>> 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/-/_8jpEFytyesJ.
>>
>> 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.
>

-- 
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: Can I simply disable the CSRF? crazy

2012-09-24 Thread Phang Mulianto
hi, better use csrf for your application security.

it is easier to disable it, but security for your app what you will think
after it running later.

do it correctly now or later .

Rgds,

Mulianto

On Mon, Sep 24, 2012 at 2:56 PM, yati sagade  wrote:

> Remove {% csrf_token %} from the form AND leave the csrf_exempt decorator
> as it is in the view. Everyone faces challenges while learning a new thing.
> The key is to face it head on and not to move to somewhere you think there
> will be no challenges :)
>
>
> On Mon, Sep 24, 2012 at 1:14 AM, puneet loya  wrote:
>
>> Hi
>>
>> I was trying to disable csrf . I am calling post using ajax.
>>
>> I have used the csrf token placed it below the form.
>>
>> In my views file i m using the csrf exempt.
>>
>> I am still getting the network forbidden error. :(
>>
>> If you require more information i will share it :)
>>
>> On Thursday, 19 August 2010 06:49:02 UTC+5:30, chenge wrote:
>>>
>>>
>>>
>>> On 8月18日, 上午4时29分, Rolando Espinoza La Fuente 
>>> wrote:
>>> > On Tue, Aug 17, 2010 at 8:01 AM, chenge  wrote:
>>> > > I'm new to django. CSRF let me crazy!
>>> >
>>> > Can't use {% csrf_token %} tag inside your 's?
>>> >
>>> > See csrf_exempt decorator:http://docs.**djangoproject.com/en/dev/ref/*
>>> *contrib/csrf/#exceptions
>>> >
>>> > Regards,
>>> >
>>> > Rolando Espinoza La fuentewww.insophia.com
>>>
>>> Thanks, I decide try flask first, that seems simple. Maybe I'll try
>>> the exempt.
>>
>>  --
>> 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/-/BQ5RpafQK3EJ.
>> 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.
>>
>
>
>
> --
> Yati Sagade
>
> Software Engineer at mquotient 
> 
>
> Twitter: @yati_itay  | Github: 
> yati-sagade
>
> Organizing member of TEDx EasternMetropolitanBypass
> http://www.ted.com/tedx/events/4933
>
> https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869
>
>
>
>  --
> 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: Understanding the use of Apache and nginix with Django

2012-09-08 Thread Phang Mulianto
Hi,

The apache or whatever the webserver you choose, should only serving static
files, not .py files .

the / request to your webserver will be redirect to django process, whether
it is uwsgi, or wsgi , or whatever service you choose to deploy.

Django runs as application server actually.

user -- web server   application server --- db server

hope helps

rgds,
Mulianto

On Sat, Sep 8, 2012 at 10:49 PM, Reginald Choudari <
adnanchowdhur...@gmail.com> wrote:

> Hello,
>
> I've just started working on deploying a Django hosted website on my VPS.
> Last night I finished configuring mod_wsgi with apache2.2 and had got the
> 'It works!' page running from my Django project. I read here (
> https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/) the
> following:
>
> Django doesn't serve files itself; it leaves that job to whichever Web
> server you choose.
> We recommend using a separate Web server -- i.e., one that's not also
> running Django -- for serving media. Here are some good choices:
>
>- lighttpd 
>
>
>- Nginx 
>
> I don't really understand this. This morning I configured my urls.py and
> views.py to direct the '/' site url to an index.html template I created on
> the fly (just for sanity check). Although it wasn't working at first, I
> restarted apache2.2 service and the web page shows fine now. I don't
> understand the idea of hosting two web servers and how Django is involved
> with this if at all.
>
> To me, it seems like apache routes clients to the wsgi, and the wsgi
> returns with whatever http response it conjures up? Can someone shed some
> light on this?
>
> Thanks,
> RC
>
> --
> 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/-/9KrPNlJvEbwJ.
> 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 deployment questions

2012-09-02 Thread Phang Mulianto
Hi,

i just use git only, create Gits bare repo in the server , upload via git
push [ssh of course] , then use the hook/post-update script to pull the git
in the production code.

so only change/ updated part in the code got uploaded. save Bandwidth, and
also reduce error, also faster deploy.

for the user part, i still have no idea, coz i use gunicorn , i think it
automaticly reload the new py file.



On Sun, Sep 2, 2012 at 1:07 PM, Mike  wrote:

> I just started to use Fabric to automate my deployments to my staging
> server. (and when I'm ready, to the production server as well).  I have
> just a few questions for more experienced folks:
>
> Do you clone your whole git repository onto your server, or upload a new
> archive each time you release?  Seems like it would be easier to switch
> versions of the running code, by switching tags, but it would use up a lot
> more disk space. I'd also have to have an ssh key to the central git
> repository on the web server.  Sounds like that could be a security issue.
> At the moment I'm programming Fabric to upload an archive, untar it, and
> symlink it to a fixed directory where the web server expects it to be.
>
> Do you log out all users or just reset the sessions (manage.py reset
> sessions)?
>
> thanks!
>
> --
> 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/-/jIsZUTiptKQJ.
> 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: Caching Options

2012-08-22 Thread Phang Mulianto
Hi i also use johhny cache, why it not hit your cache? Johny cache will
cache your queryset and update it when the database table for the queryset
updated.

I only cache the queryset without add code in the views,  johny cache
handle the rest
Pada 23 Agu 2012 06.46, "James"  menulis:

> Right now, I'm loading up some data VIA the orm. The nature of the data is
> fairly complex, somewhere around 10-12 tables are touched per insert and
> about twice that number referencing static helper tables.
>
> For production and day to day use, I've been using django-cache-machine,
> but I've also been considering Johnny-caching.
>
> For this problem though, johnny won't work because the cache would
> effectively never get hit.
>
> As far as Django-Cache-Machine, I don't think it's caching .get type
> queries. I believe it only caches querysets, and then only when you
> actually iterate over them.
>
> Considering most of my references are .get type queries for this
> operation, I would think that caching those type of queries would be useful
> for me during this process.
>
> Now, I won't have to go through this that often, maybe once ever four
> months, but still I think caching some of the queries up front could speed
> this up.
>
> What are peoples thoughts on this?
>
> --
> 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/-/pvdY4dz4LdgJ.
> 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: Regarding Template langauge

2012-07-10 Thread Phang Mulianto
Hi ,

if you ask about template use in django ...
there are some alternative besides default django template, which like
mako, jinja, cheetah...

regards,

Mulianto

On Tue, Jul 10, 2012 at 7:41 PM, kenneth gonsalves
wrote:

> On Tue, 2012-07-10 at 00:42 -0700, web_premi wrote:
> > I want to know that whether django support jsp or not? as well as what
> > kind of other langauges does django support like
> > dhtml,php,jsp,asp? which best suite for it?
>
> none of the above
> --
> regards
> Kenneth Gonsalves
>
> --
> 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: Finding a developer

2012-06-26 Thread Phang Mulianto
Hi ,

i think depend on where you search it.

if you  search djangoers in here..you find plenty of it.

if you search ROR in their mailing list, there are plenty of it too..

i think the important think is you know about the engine you want to use..

in today world, developer works from remote is not a rare thing...

Regards,

Mulianto

On Mon, Jun 25, 2012 at 5:16 AM, Mengu  wrote:

> well, it may be hard to find if you require their presence otherwise
> you will find many great developers who are looking for remote full/
> part time work.
>
> On Jun 24, 11:35 pm, "Bob Carlson"  wrote:
> > I have been planning to implement my backend server in Django/Python but
> I am
> > still in the early phases. I thought I ought to look into Ruby on Rails
> as well.
> > The technical articles comparing them come out pretty even. It appears
> that
> > there is perhaps three times as much RR activity out there as
> Django/Python. I
> > am doing prototype work myself right now, but I will need professional
> help
> > eventually. That led me to my question.
> >
> > Is it easier to find a Django developer or a Rails developer? Despite
> there
> > being more activity around Rails, the availability of developers may not
> follow.
> > Also, is there any difference in cost?
> >
> > Cheers, Bob
> >
> > Bob Carlson | +1 719 571 9228 (office)  | +1 541 521 9525 (mobile)
> >
> > b...@rjcarlson.com  | rjcarlson49 (aim or skype)
>
> --
> 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: Affordable Django hosting solution in India/around?

2012-06-25 Thread Phang Mulianto
Hi,

some thing people search... reliable and cheap / affordable.

Afforadble / cheap is relative variable there in my opinion. you mention 8$
/ month stil expensive and unaffordable for you.
in other country it is cheap (us).

even the cheap one in amazon aws around 8 -10 $ / month with standart
package.

but you know amazon have free account for 1 years you can try. but if you
need permanent you need to pay.

better way you lease a vps and join with other fellow there to share the
resource and split the payment.

Regards,

Mulianto

On Mon, Jun 25, 2012 at 8:52 PM, Kartik Singhal wrote:

> Hi
>
> We are a small non-profit all-students organization conducting a 
> TEDxevent in our college soon. We have built a basic 
> django-based web app for
> speaker nomination, participant registration, blog, etc. and other mostly
> static content.
>
> Regarding this I am looking for a reliable and affordable web hosting
> solution (preferably in India). Since our requirement is pretty small,
> hosting on a VPS on upwards of 8$/month or more seems expensive and
> unaffordable for us. Are there any web hosts catering to requirements of
> small organizations like us?
>
> I should also add - our previous website was based off Drupal (PHP based
> CMS) and we would like to maintain an archive of that too, if possible, on
> this new hosting solution, but this is not a primary requirement.
>
> --
> Kartik
> http://k4rtik.wordpress.com/
>
>
>  --
> 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 do I get django working without having to manually run the server?

2012-06-17 Thread Phang Mulianto
The python manage.py runserveris intended for fast development time to
kick start the apps.

you don't need to prepare the apache wsgi stack first, especialy if you
want to try something new like django newcomer. it's took time and
knowledge to prepare the apache wsgi.

but it still an option if you don't want use the runserver command.
if you don't want to type it everytime you start the development, make it
run as service in your devel machine.

it's bundled in django as a development web server, not for production web
server.

so make it what you like ... it's in the documentation..



On Sun, Jun 17, 2012 at 12:20 PM, Kurtis Mullins
wrote:

> But you still need manage.py runserver for development because it is
>> specially designed to prioritise debugging over security and performance.
>
>
> Really? I could see the use for it when running an actual debugger but
> otherwise, I'm not so sure there's any benefit to using it. Do you have any
> sources or more information on this? This is new information to me. 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: Django in mobile devices

2012-05-19 Thread Phang Mulianto
Hi Mario,

thanks for your response.

i already know about sl4a .

what i mean is, are there any known project that use django / mini django
framework parts to build apps in mobile device, in this case android only
or even multi device.

this will be nice ... do mvc in mobile use python...   i mean ruby people
already done it.



On Sat, May 19, 2012 at 4:20 PM, Mario Gudelj <mario.gud...@gmail.com>wrote:

> Have a look at http://www.linuxjournal.com/article/10940
>
> Also
> http://thedjangoforum.com/board/thread/879/django-python-on-a-standalone-android/
>
> On 19 May 2012 00:54, Phang Mulianto <braveh...@gmail.com> wrote:
>
>> HI all,
>>
>> i recently see rhomobile.com , which running ruby in mobile devices, and
>> phonegap which use javascript.
>>
>> do anyone aware of the equivalent python / django can be used for mobile
>> devices..
>>
>> i am thinking about create app for the mobile client using web technology
>> without go deeper in java.
>>
>> any comment appreciated.
>>
>>
>> Thanks,
>>
>> Mulianto
>>
>>  --
>> 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.
>

-- 
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 in mobile devices

2012-05-18 Thread Phang Mulianto
HI all,

i recently see rhomobile.com , which running ruby in mobile devices, and
phonegap which use javascript.

do anyone aware of the equivalent python / django can be used for mobile
devices..

i am thinking about create app for the mobile client using web technology
without go deeper in java.

any comment appreciated.


Thanks,

Mulianto

-- 
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: Image Update with Django - Admin site

2012-05-18 Thread Phang Mulianto
hi,

thats default behaviour of the image fields.

The old image not removed, but still keep intact, and the new image user
uploaded will be named with a _1.ext , _2.ext

you must handle the saving yourselft to make it rewrite the old images.

Check the snippet i use :
http://djangosnippets.org/snippets/2754/

hope helps

On Fri, May 18, 2012 at 5:42 PM, nishad  wrote:

> Hi...
> Am new to the Django community...
>
> Topic:- I have noticed an issue related to the image uploading and it
> saving with Django admin interface.
>
> Steps to trace the issue :-
>
> 1. When i was uploaded/(browse) and saved an Article with an image
> (.jpg) , for the first time it saves perfectly
>as follows (smedia/images/misc/sample.jpg)
> 2. For the second time i have tried to update some textual contents in
> the article and saves once again through the same admin interface ,
> but this time image get saved as follows (smedia/images/misc/
> sample_1.jpg)
>
> Issue :-
> It cause an image duplication in respective folder and also an error
> when page/template is rendered through browser.
>
> Can any one please suggest a method to avoid the duplication of image
> on updating the existing one.
>
> Thanks in advance.
>
> --
> 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: Problem with Jquery over Django

2012-05-16 Thread Phang Mulianto
Hi

You need understand the different between open the html directly in you
browser with open it from a web server.

Check your static file setting and load it, is it returning the js or not
On May 17, 2012 12:18 AM, "Marcin Tustin"  wrote:

> Host your JS on your server, and use an absolute URL. This is what the
> STATIC_URL setting is for.
>
> On Wed, May 16, 2012 at 5:15 PM, Amr Abdel-wahab <
> amr.mohamed.abdelwa...@gmail.com> wrote:
>
>> Oh ok, then can you give me a 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.
>>
>
>
>
> --
> Marcin Tustin
> Tel: 07773 787 105
>
>  --
> 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: New Release of IBM_DB_DJANGO (1.0.4)

2012-05-16 Thread Phang Mulianto
Is the IBM db express free?

I don't even know ubtil now...

As django user,  this is great news
On May 16, 2012 9:42 PM, "Andre Terra"  wrote:

> I don't even use IBM databases, but I just wanted to say thank you and
> great job!
>
> I'm always happy to see Django being embraced all across the IT industry
> and to see IBM developing and maintaining an part of this great framework
> is always heart warming.
>
> Keep up the good work!
>
>
> Cheers,
> AT
>
>
> On Wed, May 16, 2012 at 7:20 AM, Rahul wrote:
>
>> IBM_DB_DJANGO-1.0.4
>> ---
>> IBM_DB_DJANGO adaptor enables access to IBM databases from Django
>> applications http://www.djangoproject.com/. The adaptor is developed
>> and maintained by IBM.
>>
>> What's New?
>> 
>>  - Added support for Django-1.4
>>
>>  - Backward compatibilty - Same codebase works with older supported
>> version of Django
>>
>>  - Added support to enable Django's USE_TZ feature
>>
>>  - Added support for Django's bulk_create
>>
>>  - Added support for 'SELECT FOR UPDATE'
>>
>>  - Added module version string __version__
>>
>>
>> SVN access to the source
>> ---
>> http://code.google.com/p/ibm-db/source/browse/trunk/IBM_DB/ibm_db_django/
>>
>> Installation
>> 
>> $ easy_install ibm_db_django
>>
>> Feedback/Suggestions/Issues
>> 
>> You can provide us feedback/suggestions, or report a bug/defect, or
>> ask for help by using any of the following channels:
>> 1. Mailing us at open...@us.ibm.com
>> 2. Opening a new issue at http://code.google.com/p/ibm-db/issues/list.
>> 3. By opening new discussion at http://groups.google.co.in/group/ibm_db.
>> For prerequisites, installation steps and help details, visit -
>> http://code.google.com/p/ibm-db/wiki/ibm_db_django_README
>> Try this out and let us know you valuable feedback. Have fun.
>>
>> Cheers,
>> Rahul Priyadarshi
>>
>> Download Express-C for free, go to:
>>
>> ---
>> -
>>
>> http://www.ibm.com/software/data/db2/express/download.html?S_CMP=ECDDWW01_TACT=ACDB2011
>>
>> --
>> 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.
>

-- 
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 layout a "big" project in django 1.4 - best practices ?

2012-05-15 Thread Phang Mulianto
Hi..

For the app, i like to use loose couple method from project dir so i can
reuse and plug my app in other project easily.

I learn it from a book call practical django apps.

And i want ask about settings.py,  if we make the settings become a folder
and put dev.py, prod.py,  any step to make manage.py know which one to
load. Seems there is no info about it in the blog.

Btw i stil using django 1.3

Thanks for the share
On May 16, 2012 6:13 AM, "Michael Palumbo" 
wrote:

> Hi,
>
> I have found lots of posts on how organizing a kinda big project with
> Django =<1.3 but I was wondering what could be the best option with Django
> 1.4 since the default layout has changed.
>
> I have found just this post on the internet talking about structuring a
> django 1.4 project:
> http://www.deploydjango.com/django_project_structure/index.html
> What do you think?
>
> Please feel free to share your points of views and/or explain how you
> handle it.
>
> Thanks
>
>  --
> 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/-/7G089jM6W6gJ.
> 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: Help - Which IDE is best to use.

2012-05-15 Thread Phang Mulianto
Again?

Well i just use a simple text editor
On May 15, 2012 2:53 PM, "Harold.Miao"  wrote:

> it is not a free sw
>
> 2012/5/15 Ezequiel Bertti 
>
>> 10x pycharm...
>>
>> the best one...
>>
>> the only one made to work with python and django...
>>
>>
>> On Tue, May 15, 2012 at 12:28 AM, Rivsen  wrote:
>>
>>> Maybe you can try Sublime Text 2. It's a good IDE or Editor.
>>>
>>> 2012/5/15 Harold.Miao 
>>>
>>> maybe  eclipse+pydev  is good  IDE


 2012/5/15 doniyor 

> @Aaron: you are more than right,
>
>
>
> Am Montag, 14. Mai 2012 19:44:35 UTC+2 schrieb Aaron C. de Bruyn:
>
>> Try here:
>>
>> https://code.djangoproject.**com/wiki/DjangoResources#**
>> IntegratedDevelopmentEnvironme**nts
>>
>> But keep in mind, a good carpenter can work with a $5 hammer or a $50
>> hammer.  The tools don't make the developer.  (Although they can make
>> the job of a good developer easier.)
>>
>> -A
>>
>> On Mon, May 14, 2012 at 10:39 AM, Sandro Dutra 
>> wrote:
>> > Again... Please search before create one more of this messages
>> about "What's
>> > IDE is best?". The best IDE is the IDE you fell confortable using.
>> There 666
>> > topics about this here, search...
>> >
>> >
>> > 2012/5/14 Eneldo Serrata 
>> >>
>> >> Aptana or Eclipse with PyDev Plugin
>> >> http://pydev.org/
>> >>
>> >> El 14/05/2012, a las 11:56, Sanjay M escribió:
>> >>
>> >> I am new to Django, and I was confused in choosing a IDE between
>> Eclipse
>> >> and aptana studio 3 to edit source code. Kindly suggest me a good
>> one.
>> >>
>> >> Thank you in advance,
>> >> Regards,
>> >> Sanjay M
>> >>
>> >>
>> >>
>> >> --
>> >> 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/-/**2LIdVrSuFpQJ.
>>
>> >> To post to this group, send email to django-users@googlegroups.com.
>>
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscribe@**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+unsubscribe@**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+unsubscribe@**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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/IBuwOYUQasQJ.
>
> 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.
>



 --

 Best Regards,
 Harold Miao


  --
 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 

Template Tags adding unwanted line feed

2012-05-13 Thread Phang Mulianto
Hi all,

i have a template tags for menu...

it's display as i wanted in the template.
Then i refactor it, change the calling method of the template tags, then
the menu shifted down, like given an enter / line feed. and to fix it i use
css with adding top:-20px  to shifted it up as would normally showed.

The css is still the same, no update. so does this is an expected result
using template tags ?


Before i called using this line in the normal template called from other
template tags   :


{% load pmmenu_tags %}
{% pmmenu_main_menu %}




then i change it to this one, which is in the template tags :


{% for menu in menu_list %}
  {{ menu.title }}
  {% if menu.pmmenuitem_set.all %}

  {% for submenu in menu.pmmenuitem_set.all %}
  {{ submenu.title }}
  {% endfor %}

  {% endif %}
  
{% endfor %}




Best Regards,

Mulianto

-- 
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 use ImageField??

2012-05-08 Thread Phang Mulianto
you would use MEDIA_URL for calling the image path to be view in  your
template.

and the image will be upload to the media root folder..

On Mon, May 7, 2012 at 8:35 PM, Boris Shemigon  wrote:

> MEDIA_ROOT
>  denotes
> an absolut path where your files are going to be stored.
> MEDIA_URL
>  is
> a relative url to the website's / that handles the media.
>
> For more details please you read the official 
> documentation
> .
>
>
> On Mon, May 7, 2012 at 7:33 PM, Boris Shemigon  wrote:
>
>> MEDIA_ROOTdenotes
>>  an absolut path where your files are going to be stored.
>> MEDIA_URLis
>>  a relative url to the website's / that handles the media.
>>
>> For more details please you read the official 
>> documentation
>> .
>>
>>
>>
>> On Mon, May 7, 2012 at 7:17 PM, atul khairnar wrote:
>>
>>> Hi,
>>> I am writing this ImageViewer app, just to get involved with Django. I
>>> have used *ImageField* to store images in database. I want to load the
>>> images on the clients browser from Django server. But, I think, i can't
>>> distinguish between *media root* and *media url*. I have attached the
>>> project with the mail. Please check the code and help me out. sorry for my
>>> English.
>>>
>>> --
>>> Atul Khairnar
>>> College of Engineering , Pune
>>> Cell - (+91)9579289613
>>>
>>>
>>>  --
>>> 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.
>

-- 
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: Paramiko EOFErrors start to occur after a while

2012-05-08 Thread Phang Mulianto
Hi,

i also have the script to sftp using python...run with cron every 30 mins,
and suddently since last week, the eol errors come out..

i think this problem bcoz the sftp server..

are you trying rsync to transfer between host ?

On Tue, May 8, 2012 at 6:31 AM, Tino de Bruijn  wrote:

> Hi,
>
> Unfortunatly we can't move to Amazon S3. So what other file system or
> transfer method would you recommend? We had an NFS in place, but getting it
> to play nice with permissions was quite a hassle.
>
> How do other people do this?
>
> Tino
>
>
> On Wednesday, May 2, 2012 1:25:52 AM UTC+2, Kurtis wrote:
>
>> I messed with the SFTP implementatoin a while back. I noticed it was
>> pretty tough and, if I'm not mistaken, a bit out-dated. We ended up moving
>> to Amazon S3 so it wasn't a big deal.
>>
>> Anyways, maybe you could try using another file system? SSH isn't really
>> an ideal solution for this sort of a problem -- even though it works as a
>> great starting point.
>>
>> I'm not sure if that helps much but good luck to you!
>>
>> On Tue, May 1, 2012 at 11:49 AM, Tino de Bruijn  wrote:
>>
>>> Hi,
>>>
>>> My setup is the following: I have two webservers that serve all dynamic
>>> request. I have a seperate static file server (that also has some celery
>>> queue workers running). When images are uploaded by users, those images are
>>> uploaded to the webservers, and processed async by a queue. In the job they
>>> are transfered to the static file server and resized. For the admin
>>> however, I want the transfering and resizing done right then, so that when
>>> admins post content, it is immediatly visible. Admins post different
>>> content than users, so this is implemented by using a different field on
>>> the models. The admin images are transfered to the static file server
>>> directly by using sftpstorage from django-storages.
>>>
>>> The problem is that paramiko (used by django-storages for the sftp
>>> implementation) starts to throw EOFErrors. This doesn't always happen. When
>>> the mod_wsgi instance is fresh, everything works, but after a while these
>>> errors start occurring. Touching the wsgi.py file makes everything work
>>> again.
>>>
>>> I have build a retry loop (5 times) to try to circumvent network
>>> glitches, but it consistently fails. If it needs to retry it'll keep
>>> failing.
>>>
>>> I have two questions:
>>>
>>> 1) Does anybody have an idea why this could be happening?
>>> 2) Is this the best way to implement this strategy, or would you suggest
>>> a different technique?
>>>
>>> Thanks,
>>>
>>>
>>> Tino
>>>
>>> --
>>> 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/-/UXX_**dJrQJOwJ
>>> .
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users+unsubscribe@*
>>> *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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/20YX_C3Oo3AJ.
>
> 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: EmailMessage hangs in Windows

2012-04-23 Thread Phang Mulianto
Hi,

What s the error msg.. It should smtp error message.

Maybe your smtp mail server setting.what mta you use?

How many often you sent the email?

Maybe your smtp still busy processing other mail.
On Apr 24, 2012 7:42 AM, "CrabbyPete"  wrote:

> I am using
> from django.core.mail   import  EmailMessage
>
> and I have the following code
> msg = EmailMessage ( subject   =  subject,
>   body  =  body,
>   from_email = sender,
>   to  = receivers,
>  bcc = bcc
>)
>try:
>print "Mailing"
>err = msg.send( fail_silently = False )
>except Exception, e:
>err = "Email Send Error " + str(e)
>print err
>else:
>print "Mailed"
>
> I am mailing a bunch of messages and every once in a while it hangs on
> the send. I never know when, and it only happens with windows.
>
> Any one else have this problem?
>
> --
> 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.



saving a foreign key data table

2012-04-19 Thread Phang Mulianto
HI ,

I have a template which consist of fields in a master table and a foreign
key table. i want user fill the foreign key field data inline in 1 template.

and when use submit it, new data of course, i need the data to saved in the
master table, then save the foreign table with the foreignkey of the master
table id just inserted.

after some search and test i finaly get it, but need opinion is this the
best way to do this ?

here are the view code ;:

def myadmin_new_flat_page(request,
template_name="myadmin/change_data.html"):
if request.method == 'POST': # If the form has been submitted...
form = AdminFlatPageModelForm(request.POST) # A form bound to the
POST data
inlineform = AdminFlatPageMetaModelForm(request.POST) # A form
inline
postdata = request.POST.copy()
if form.is_valid(): # All validation rules pass
fp = form.save(commit=True)
fp.save()
key= request.POST.get('flatpage','nothing')
postdata['flatpage']=int(fp.pk)
key = str(request.POST)
a=str(postdata)
data={'flatpage_id':int(fp.pk),'keyword':'finest
code','description':'interested ? ' }
w='not'
inlineform=AdminFlatPageMetaModelForm(initial=data)  # this not
work ?
if not inlineform.is_valid():
   ifp = inlineform.save(commit=False)
   w='work'
   ifp.flatpage_id=fp.pk
   ifp.keyword = request.POST.get('keyword')
   ifp.description = request.POST.get('description')

   ifp.save()
messages.success(request, 'New '+ me +' Added' + str(fp.pk) +
key + a+w)
redirect=False
return
render_to_response('myadmin/please_wait.html',locals(),context_instance =
RequestContext(request) )
else:
form = AdminFlatPageModelForm()
inlineform = AdminFlatPageMetaModelForm()
button = _generate_button('new')
return render_to_response(template_name,locals(),context_instance =
RequestContext(request) )

i get manage to save the foreign table with manual assigning the fields.
then save it.

thanks before.

Mulianto

-- 
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: Returning template data from a ManyToMany model

2012-04-17 Thread Phang Mulianto
On Tue, Apr 17, 2012 at 2:10 PM, LJ  wrote:

> I am having trouble figuring out how to query the database and return
> the results in a format that my template can render appropriately.
> I have a model that has a ManyToMany field:
>
> class Student()
> ...
> parents = models.ManyToManyField('parents.Parent', blank=True,
> null=True)
> ...
> The Parent model looks like:
>
> class Parent()
>...
>first_name  models.CharField(max_length=30)
>last_name  models.CharField(max_length=30)
>gender  models.CharField(max_length=1)
>...
>def __unicode__(self):
>  return u'Parent : %s %s' % (self.first_name, self.last_name)
>
> The method in my view currently looks something like this:
>
> def get_parents( request, template )
>   id=request.GET['id']
>   template_data["parents"] = Parent.objects.filter(student=id)
>   return render_to_response( template, template_data,
> context_instance=RequestContext(request))
>
> The template data is returning the data in the format:
>  [ , ]
>
> I think this because you return your result in template_data["parents"] ,
so in your tempalte it will be parent:parent:bob thomas.

usualy i use locals() to pass all the var to template.

return render_to_repsonse(template,
locals(),context_instance=RequestContext(request))

don't know if this is best practice in django, but make me easier to work
with variables need to pass to template without have to include it in an
array.

with the locals() you will have the data in your template like you mention
below.


> Instead, I need the template data formatted with the other fields in
> my Parent model, like:
>  [ ,
> ]
>
> The format doesn't have to be exactly like the above, but I need to
> include the index, and to return some of the other fields defined in
> my Parent model.
> My template will look something like:
> {% for parent in parents.object_list %}
> 
> {{parent.id}}
> {{parent.first_name}}
> {{parent.last_name}}
> {% endfor %}
>
> Can someone give me some ideas about how I can change my view to
> return my template data in a more useable format?
>
> --
> 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: High Traffic

2012-04-17 Thread Phang Mulianto
I think this is just a bad practice in the app logic, or bad logic.

you have only 9000records, what other languange out there will be process
it faster anyway .

if you have 1Mill records, do you will retreive all that object first and
do the processing, and no caching at all .

this will make even fastest monster machine seems slow down.

optimization of web app is have many path... database loading, caching,
compressing content, static file caching serving, keep alive, and many
more..

just my 2 cents..

Regards,

Mulianto

On Tue, Apr 17, 2012 at 1:02 PM, Andy McKay  wrote:

> Run django debug toolbar, see what queries you are running and how
> long they take and that you've got database indexes set up.
>
> Failing that, run a middleware or other logging tool to tell you slow
> pages. Then test with django debug toolbar. Rinse and repeat.
>
> --
> 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: cache decorators in urls.py error

2012-04-13 Thread Phang Mulianto
Hi Tom,

i already fix it, it is because

"then probably the error is that you have not imported your view
function. It's hard to tell, as you just say 'different errors come
out'."

i just realize i not import my view in the url.py , as in documentation is
not said i have to import it first before use it in url.py.

somebody gonna fix the documentation ?

it only remind you "If you take this approach, don't forget to import
cache_page within your URLconf."
please add "and import your view function to be called also"

anyway.. thank Tom for the light..

Regards,
Mulianto

On Fri, Apr 13, 2012 at 9:27 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Fri, Apr 13, 2012 at 1:51 PM, Phang Mulianto <braveh...@gmail.com>
> wrote:
> > Hi ,
> >
> > i already try
>
> Randomly trying things is unlikely to fix anything.
>
> cache_page decorates a function. Therefore, if this doesn't work:
>
> > (r'^$',cache_page(index), { 'template_name':
> > 'blog/public_list.html'},
> >> 'index'),
> >
>
> then probably the error is that you have not imported your view
> function. It's hard to tell, as you just say 'different errors come
> out'.
>
> > and even :
> >
> > (r'^$',cache_page(index()), { 'template_name': 'blog/public_list.html'},
> >> 'index'),
> >
>
> This one is nonsense. Your function 'index' is to be called when it is
> to be run. Here you are trying to decorate the return value of the
> function, without passing it any arguments - which is probably one of
> the 'different errors'.
>
> > but different error comes out...
> > i don't know whats wrong.. anyone can help point it out..
> >
>
> If you want to decorate a view in your urls.py, you must import the
> view function, and then refer to the view function by name. Like in
> the example I linked you to previously…
>
>
> https://docs.djangoproject.com/en/1.3/topics/cache/#specifying-per-view-cache-in-the-urlconf
>
> So if your urlconf looked like this:
>
> urlpatterns = ('',
>(r'^foo/(\d{1,2})/$', my_view),
> )
>
> then to add the cache_page decorator to that view, you make it like this:
>
> urlpatterns = ('',
>(r'^foo/(\d{1,2})/$', cache_page(my_view, 60 * 15)),
> )
>
> If you continue to have problems, then you will have to tell us what
> those problems are. "It doesn't work", or "different errors" is not
> good enough, you must tell us word-for-word what those errors are.
>
> 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.
>
>

-- 
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: cache decorators in urls.py error

2012-04-13 Thread Phang Mulianto
Hi ,

i already try (r'^$',cache_page(index), { 'template_name':
'blog/public_list.html'},
> 'index'),

and even :

(r'^$',cache_page(index()), { 'template_name': 'blog/public_list.html'},
> 'index'),

but different error comes out...
i don't know whats wrong.. anyone can help point it out..





On Tue, Apr 10, 2012 at 9:42 PM, Tom Evans <tevans...@googlemail.com> wrote:

> On Sat, Apr 7, 2012 at 3:53 PM, Phang Mulianto <braveh...@gmail.com>
> wrote:
> > Hi,
> >
> > i have my apps and try to use cache decorator in url.py but got error.
> >
> > Here are the urls.py
> >
> > from django.views.decorators.cache import cache_page
> >
> > urlpatterns = patterns('article.views',
> > #(r'^$','index', { 'template_name': 'blog/public_list.html'},
> 'index'),
> > (r'^$',cache_page('index'), { 'template_name':
> 'blog/public_list.html'},
> > 'index'),
> > )
> >
> > the error is :
> >
> > cache_page must be passed a view function if called with two arguments
> >
> > what is wrong in the url.. note i also use the DDT (django debug
> toolbar) .
> >
> > THanks for pointing me out..
>
>
> https://docs.djangoproject.com/en/1.3/topics/cache/#specifying-per-view-cache-in-the-urlconf
>
> cache_page wraps a function, not a string.
>
> 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.
>
>

-- 
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: Audio Streaming Using Django

2012-04-13 Thread Phang Mulianto
hi,

for stream over the web, you can us shoutcast or other torrent stream
technology to save your server bandwidth

maybe with django you can built your own backend..

Mulianto


On Fri, Apr 13, 2012 at 12:21 PM, atul khairnar wrote:

> Hi,
> I am developing Internet Radio App using Django. But i don't know how to
> stream the audio over web using django. which modules and technology to
> use. Please Help.
>
>
> Atul Khairnar
> B.Tech
> Department of Computer Engineering and Information Technology
> College of Engineering , Pune
> Cell - (+91)9579289613
>
>
>
>  --
> 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.



cache decorators in urls.py error

2012-04-07 Thread Phang Mulianto
Hi,

i have my apps and try to use cache decorator in url.py but got error.

Here are the urls.py

from django.views.decorators.cache import cache_page

urlpatterns = patterns('article.views',
#(r'^$','index', { 'template_name': 'blog/public_list.html'}, 'index'),
(r'^$',cache_page('index'), { 'template_name':
'blog/public_list.html'}, 'index'),
)

the error is :

cache_page must be passed a view function if called with two arguments

what is wrong in the url.. note i also use the DDT (django debug toolbar) .

THanks for pointing me 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.



Re: Why using Generic Views?

2012-04-07 Thread Phang Mulianto
HI,

i understand why need to use generic views after i code some of my function
like showing list of data, and the view is the same and i end up copy paste
it , not type it (smarter huh?) , just change my db object and pass to my
template.

well , generic view is come in the rescue and we can produce faster result
with less code, just call the generic function  in the url.py files and
point to your template to render.

hope help..

Mulianto

On Wed, Apr 4, 2012 at 10:36 PM, Dan Gentry  wrote:

> I use generic views - either function or class based - for the common
> functionality in my apps.  As Serge mentioned, a list works pretty
> much the same in every application, so I just provide a few parameters
> to a generic view.  More complicated forms still require custom code.
>
> On Apr 3, 1:07 am, abisson  wrote:
> > Good evening,
> >
> > I just finished the Django 1.4 Tutorial, and I really don't understand
> > the point of Generic Views in Django? As far as I can see, we wrote
> > more code than before, and what other example would make the Generic
> > Views better than normal views?
> >
> > Thanks for the clarifications!
>
> --
> 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: Improving Site Performance

2012-04-07 Thread Phang Mulianto
Well.. i think the lazy query is on action.

The query executed to get the data from database to be use in your view, if
you said requestContext(..)

if you remove it, of course the data will not available in your
view/template.

To reduce the query executed everytime you call the page, try use query
caching..
one quick way without change code is use some cache like johnny-cache..it
will automaticly cache your query and unvalidate it if your data changes.

i used it to.. and try load your page more than once, you will see in the
debug toolbar, the query is reduced in the second and next load...that is
the cache in action..

hope help..

On Thu, Apr 5, 2012 at 3:41 PM, Swaroop Shankar V wrote:

> Hi All,
> Am developing a site using django and it is almost ready to be launched.
> Right now am trying to optimize the performance of the site. I have
> installed the django debug toolbar and when i checked the number of queries
> being exicuted on the homepage i could see there are 74 queries
> being executed. On debugging I could see that most of the queries  are
> through the context_instance=RequestContext(request) that am passing to a
> view. When I removed it I could see the queries where reduced to 24, which
> improved the performance, but I end up in an error
>
> Caught KeyError while rendering: 'request'
>
> this is happening because the homepage is rendering a custom template tag 
> which requires the request object available (to access the currently logged 
> in user details). So is there any way to avoid using 
> context_instance=RequestContext(request) and still make the request object 
> accessible in the custom template tag?
>
> Thanks and Regards,
> Swaroop Shankar V
>
>  --
> 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: Which Linux distro to use on EC2?

2011-11-14 Thread Phang Mulianto
for me i would like to have an optimized kernel binary and build the kernel
in my running machine, and disable all driver not used by system os.

it will slim your kernel and faster booting and loading.

all precompiled binnary have bloated driver in kernel so it will match any
hardware and load the driver...

i use FreeBSD coz already familiar with it..
On Nov 14, 2011 7:54 PM, "Charles Cossé"  wrote:

> On Mon, Nov 14, 2011 at 2:55 AM, Thomas Guettler  wrote:
>
>>
>>
>> Am 13.11.2011 21:58, schrieb Charles Cossé:
>> > The main difference with Ubuntu is that it's a binary distribution
>> > (pre-compiled binaries for a standardized platform).  I use Gentoo,
>> > personally, which is a variant of Debian with "portage" rather than
>> > "apt".   LAMP server stuff is readily available on all distros of Linux.
>> >  If you're hardcore then use Gentoo.  If you're medium-core then use
>> > Debian.  If you're softcore then use Ubuntu.  If you like RedHat style
>> > more than Debian, then go CentOS.
>>
>> If you are a hardcore, you write your own kernel and libc.
>>
>> On Ubuntu you'll never  compile your own kernel.  It won't be optimized
> for your system.  It (Ubuntu) will also probably find 99% of your hardware
> and make it work off-the-bat.  Gentoo was created by the developer of the
> apt system, Daniel Robbins ... not really a variant of Debian, but more of
> a rethink of Debian's package management system, "apt", called "portage" in
> Gentoo.
>
>
>
>> I would use ubuntu.
>>
>>  thomas
>>
>>
>> --
>> Thomas Guettler, http://www.thomas-guettler.de/
>> E-Mail: guettli (*) thomas-guettler + de
>>
>> --
>> 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.
>>
>>
>
>
> --
> AsymptopiaSoftware|Software@theLimit
>   http://www.asymptopia.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: synchronize django admin interface password with other application passwords

2011-11-06 Thread Phang Mulianto
maybe you can just modify the create_user function in django , matching the
hash algorithm of the other backend, or the other backend matching to the
django backend.

you choose which one would be the single auth method.

and of course the admin interface is just as it, except you need custom
method. you need little effort still..

On Mon, Nov 7, 2011 at 10:13 AM, Gelonida N  wrote:

> Hi Mike,
>
> On 11/07/2011 12:15 AM, Mike Dewhirst wrote:
> > On 7/11/2011 7:43am, Gelonida N wrote:
> >>
> >> What would be the easiest way to hook into the password modification
> >> form, such, that I can calculate two password hashes with different
> >> salts / alorithms?
> >>
> > You need your own auth backend which inherits the existing django model
> > backend. Then borrow the offered password and create the other app's
> hash.
> >
> > https://docs.djangoproject.com/en/dev/ref/authbackends/
> >
>
> I'll look into it.
>
> At the moment I started creating my own 'create_user_form',
> which gets all info, and creates then the default user with
>
> django.contrib.auth.models.User.objects.create_user()
>
> and the other user with the other API
>
> But this is of course not that flexible as it does not allow
> to create users (or modify passwords) with the default admin interface.
>
>
> --
> 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: syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Phang Mulianto
Hi Florian,

Thanks for the pointer.. nice and works like a charm..

i will prefer add the options in the settings.py as the table will growing
and work for all application table including admin table.

and the next target is figure out about the database router for load
balancing the sql query..

is it better to load balance by within the django or handle it using other
Layer 4 load balancer ?

thanks

On Mon, Oct 17, 2011 at 12:24 AM, Florian Apolloner
wrote:

> Oh and if you don't want to create all tables in the cluster, just create
> with the default engine and then switch as needed.
>
>  --
> 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/-/YqWTj0_-_tYJ.
>
> 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.



syncdb for mysql using engine=NDBCLUSTER

2011-10-16 Thread Phang Mulianto
Hi,

i try to run syncdb to create table in mysql cluster db, and need have
engine=NDBCLUSTER in each table which want to create in the cluster.
How to add the engine=NDBCLUSTER from the syncdb command line ?

Thanks for the help.

Mulianto

-- 
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: Ajax replacement in django

2011-10-14 Thread Phang Mulianto
ajax use usualy load a div part of html with new content fetch from the
server when user do something,like click a submit button. and django process
the request as a simple usual request.

i have using prototype+scriptocolous for the simple syntax to make an ajax
form.
i see the jquery version also but a bit trouble coz need to add the event
manually.

and remember the crsf token when using ajax request..will need it generated
properly..

anyone using prototype to?

or anyone have better way with ajax
On Oct 14, 2011 7:47 PM, "Babatunde Akinyanmi"  wrote:

> From what Iankesh said initially, I think he is having problems using
> ajax to load part of a page not ajax as a whole.
> Iankesh, it is possible to load only a portion of a page with ajax.
>
> On 10/13/11, Sells, Fred  wrote:
> >> On Wed, Oct 12, 2011 at 9:17 AM, lankesh87 
> wrote:
> >> >  I am developing a web application where i need ajax like features.
> >> > But I don't want to use ajax, so my question is- "is there any way to
> >> > perform ajax like functions in django?"
> >>
> > Use Flex, it's easier.
> >
> > --
> > 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.
> >
> >
>
> --
> Sent from my mobile device
>
> --
> 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: a django question about "python manage.py syncdb"

2011-10-14 Thread Phang Mulianto
maybe you can try remove the models.py coz by default syncdb look for
models.py or anything beneath models folder...but cannot do both of them...
On Oct 14, 2011 5:49 PM, "Chen Xu"  wrote:

> and when i tried "python manage.py sqlall  "  it gives empty.
> I think is it because I am not importing  properly or something else is
> going wrong.
>
>
> Thanks
>
>
>
>
>
> On Fri, Oct 14, 2011 at 2:46 AM, Chen Xu  wrote:
>
>> I know that will work, but what I can do to just make "python manage.py
>> syncdb" work?
>>
>> Thanks very much
>>
>>
>> On Fri, Oct 14, 2011 at 2:37 AM, nicolas HERSOG wrote:
>>
>>> You can also type python manage.py sqlall  and copy paste sql
>>> instructions in your bd
>>>
>>> On Fri, Oct 14, 2011 at 11:23 AM, Chen Xu  wrote:
>>>
 Hi,
 I am new to Django.
 I have installed Django and go t everything set up correctly, just
 started some easy tutorials.

 So when I do
 Django-admin.py startapp  blog


 it creates a /blog directory that looks like thsi
 /blog
 - __init__.py
 - tests.py
 - models.py
 - views.py

 I know in Django, when you run "python manage.py syncdb", it will look
 through models.py, and create all the table it finds.
 However, I dont want to create all my tables in models.py, becaue when
 my proj get bigger, it is hard to maintain.
 Therefore, I create a subdirectory "/Models" to store all my model

 /blog
 - __init__.py
 - tests.py
 - models.py
 - views.py
 /Models
 - __init__.py
 post.py

  so in my
 models.py: (only 2 lines)
 from django.db import models
 from blog.Models import post

 in my post.py: (only 3 lines)
 from django.db import models
 class post(models.Model):
   body = models.TextField()


 and then when I run "python manage.py syncdb" , it doesn't create the
 table "post" for me.

 Could anyone please help?




 Thanks very much
 Best regards


 --
 ⚡ Chen Xu ⚡

 --
 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.
>>>
>>
>>
>>
>> --
>> ⚡ Chen Xu ⚡
>>
>
>
>
> --
> ⚡ Chen Xu ⚡
>
> --
> 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: Ajax replacement in django

2011-10-12 Thread Phang Mulianto
but for the web html standart you need ajax.

maybe you can use some javascript framework like prototype+scripatoulus or
jquery to simply work with ajax and browser compatibility issue.
On Oct 12, 2011 10:55 PM, "Donald Stufft"  wrote:

>  I don't think there's any reason to insult anyone, let's be civil.
>
> On Wednesday, October 12, 2011 at 10:50 AM, Chandrakant Kumar wrote:
>
>
> You are another 'garbage' product of our country's shitty education system.
>
> On 10/12/2011 08:09 PM, lankesh87 wrote:
>
> Actually my project guide is asking me to search for ajax replacement
> in django. So that way we dont have to use ajax.
>
> I mean if we could only refrsh particular part in our web page without
> refreshing the whole page "using django".
>
> Thanx in advance and pardone me for my foolish questions as i am new
> to django and web but i do have some basic knowledge on
> how html functions.
>
> On Oct 12, 7:24 pm, Javier Guerra Giraldez wrote:
>
> On Wed, Oct 12, 2011 at 9:17 AM, lankesh87 wrote:
>
> I am developing a web application where i need ajax like features.
> But I don't want to use ajax, so my question is- "is there any way to
> perform ajax like functions in django?"
>
> that kind of specifications (ajax-like but no ajax) sound very weird
> to me. I find only two explanations:
>
> A) you don't know how HTTP works
>
> or
>
> B) when you say 'ajax' you're in fact talking about a specific library
> that you don't want to use and not the generic javascript-driven
> requests.
>
> if A, then please do learn about HTTP first. then you'll not only
> realize what you really need, but will also be in position to make
> your applications like you want.
>
> if B, then please tell us what is it that you don't want.
>
> --
> Javier
>
>
> --
> 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.
>

-- 
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 use DJANGO as reverse proxy over HTTPS?

2011-10-10 Thread Phang Mulianto
dj@ngo is a web development framework to create web application.

to serve as proxy better use real web server like apache, nginx, lighttpd or
squid.

django buildin web server for development use only.

if you want to build a proxy,  from ground up you can use python which
django base on.
On Oct 10, 2011 9:31 PM, "deepak gupta"  wrote:

> Hi All,
>
> Do any one knows How to use DJANGO as reverse proxy over HTTPS?
> Do DJANGO webserver support HTTPS?
>
> Thanks.
> Deepak G.
>
>
> --
> 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: Report tool is supported for django .

2011-10-04 Thread Phang Mulianto
i remember there is how to output to pdf in the documentation..  should
there any ready to use tool out there..will be nice..
 On Oct 4, 2011 5:03 PM, "Le Huu Nghia"  wrote:
> Dear all,
>
> I need to make a report with django .
> This report supports (chart , export PDF, Excell ...,)
> please give me some recommendations with tool i must use for this case.
>
> Thanks in advance.
>
> --
> 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: loaddata and auto_now_add=True

2011-10-03 Thread Phang Mulianto
i think bcoz load data does not use the orm api..while your test use orm to
insert data..
On Oct 3, 2011 3:43 PM, "Reikje"  wrote:
> Hi, I have a test fixture file which I use in unit tests. In some
> Models I have date fields defined like this:
> models.DateTimeField(auto_now_add=True) for which I don't specify
> values in the fixture file (users.json). This works well as part of
> testing but when I want to load the fixture into the real database
> using the loaddata command, it will complain about these fields being
> null, i.e. Warning: Column 'last_seen_at' cannot be null
>
> Whats the difference between running the fixture file as part of the
> test suite and loading it using loaddata. I guess I can work around
> this by adding values for these fields but I am lazy :)
>
> --
> 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 do some additional process while saving a django flatpage

2011-10-03 Thread Phang Mulianto
why not query your flatpage db and use the field for the menu in ur table..
flatpage have url and title.. get url n title and put in your menu
template..no need signaling
can add cache to as the flatpage not modified to often..
 On Oct 2, 2011 10:03 PM, "Swaroop Shankar V"  wrote:
> Hi,
> I am trying to build a menu system which can be controlled at the admin
> area. For the content management purpose i am using django flatpage. So
when
> a page is getting saved i need to insert the page title and url in the
menu
> table i have created. So i guess a flatpage signal is the best way to go,
> but after searching a lot i could not find any such signals available for
> flatpage. So which is the best approach to implement whatever i had
> described above. Thanks
> Regards,
>
> Swaroop Shankar V
>
> --
> 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: Platform system with Django?

2011-09-26 Thread Phang Mulianto
of cource it can be done.
it will be your application logic jobs and the database layout...
On Sep 26, 2011 12:57 PM, "Ian"  wrote:
> I'm new to django, and at this point all I've done is the tutorial.
>
> But my end goal is to create a website that serves as a platform
> system.
>
> I want users to go to my site, create an account, edit some settings/
> preferences, and a subdomain (can you do this with django?).
>
> Then within each subdomain, other people can register as users to this
> particular subdomain, post things, etc.
>
> Is it possible to do this? I can imagine the structure and how to get
> the second part working (having users register on a particular
> subdomain site, post things, etc), but I'm having trouble figuring out
> where to get started with the first part (creating the subdomain site)
>
> Is there a tutorial or guide to get me started with this platform
> concept? Thanks so much!
>
> --
> 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: access fields value in template

2011-09-18 Thread Phang Mulianto
Thanks for the respons.

i use the items function using

{% for key, value in object.items %}
   {{ value }} 
{% endfor %}

the problem now.. the field is not arranged like what i want.

let say i want to display name, email, password, join in the table.

how to achive this field arrangement in the ORM query.

thanks


On Sat, Sep 17, 2011 at 9:43 PM, dm03514 <dm03...@gmail.com> wrote:

> You can access just the values by the values property,
> {% for value in object.values %}
> {{ value }}
> {% endfor %}
>
>
>
> On Sep 17, 4:33 am, Phang Mulianto <braveh...@gmail.com> wrote:
> > hi ..
> >
> > i have a pagination objects :
> >
> > in my view i got query and paginate it using this :
> >
> >   objects = paginator.page(page)
> >
> > then the objects goes into the view template.
> > i can populate the field value using this template :
> >
> > {% for object in objects.object_list %}
> > 
> > {{ object.title }}
> > {{ object.content }}
> > {{ object.slug }} 
> > {{ object.is_publish }} 
> > {{ object.created_at }} 
> > {{ object.updated_at }} 
> > {% endfor %}
> >
> > This solution give the field values of know field name, like title,
> content,
> > slug, etc...
> >
> > what i want to aim is to access the field value which is unknow, like say
> it
> > is different model .
> > i want to use this template in any model i give the to the object_list
> > variable.
> >
> > how to achieve this.
> > i try this one :
> > {% for x in object.items %}
> > {{ x }}
> > {% endfor %}
> >
> > The html result are in table like this :
> > ('is_publish', True)('title', u'first day with django')('created_at',
> > datetime.datetime(2011, 7, 10, 18, 6, 18))('updated_at',
> > datetime.datetime(2011, 8, 23, 0, 26, 42))('content', u'Great
> > start...progressing now...')('pk', 1L)('slug', u'first-day-django')
> >
> > but it show the field name and the field value. how i access the value of
> > the field.
> >
> > i want to create a record list, but not a view template for each model,
> but
> > 1 template for every model.
> >
> > i hear the django table, but i want to do it my own way..
> >
> > anyone have suggestion.
> >
> > Thanks.
> > Mulianto
>
> --
> 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.



access fields value in template

2011-09-17 Thread Phang Mulianto
hi ..

i have a pagination objects :

in my view i got query and paginate it using this :

  objects = paginator.page(page)

then the objects goes into the view template.
i can populate the field value using this template :

{% for object in objects.object_list %}

{{ object.title }}
{{ object.content }}
{{ object.slug }} 
{{ object.is_publish }} 
{{ object.created_at }} 
{{ object.updated_at }} 
{% endfor %}

This solution give the field values of know field name, like title, content,
slug, etc...

what i want to aim is to access the field value which is unknow, like say it
is different model .
i want to use this template in any model i give the to the object_list
variable.

how to achieve this.
i try this one :
{% for x in object.items %}
{{ x }}
{% endfor %}

The html result are in table like this :
('is_publish', True)('title', u'first day with django')('created_at',
datetime.datetime(2011, 7, 10, 18, 6, 18))('updated_at',
datetime.datetime(2011, 8, 23, 0, 26, 42))('content', u'Great
start...progressing now...')('pk', 1L)('slug', u'first-day-django')

but it show the field name and the field value. how i access the value of
the field.

i want to create a record list, but not a view template for each model, but
1 template for every model.

i hear the django table, but i want to do it my own way..

anyone have suggestion.

Thanks.
Mulianto

-- 
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: login auth issue - beginner

2011-08-20 Thread Phang Mulianto
hi.. your request is  GET, and you try get the query data with POST .

this the errror cause
16. username = request.POST['username']

Exception Value: "Key 'username' not found in "

check your login form to use POST..

HTH,

Mulianto


On Sat, Aug 20, 2011 at 9:59 PM, Phil  wrote:

> Hi,
>
> I am new to Django and am trying to use the built in auth features for the
> first time. I have been following the steps on the djangobook website
> here...
>
> http://www.djangobook.com/en/1.0/chapter12/
>
> However I am getting the following error on my login page. Anyone know
> where I am going wrong?...
>
>
> Environment:
>
>
> Request Method: GET
> Request URL: http://127.0.0.1:8080/login/
>
> Django Version: 1.3
> 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',
> 'healthapp',
> 'healthapp.myhealth']
> 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 "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py"
> in get_response
> 111. response = callback(request, *callback_args, **callback_kwargs)
> File "/home/phil/mydev/projects/healthapp/../healthapp/views.py" in login
> 16. username = request.POST['username']
> File
> "/usr/local/lib/python2.7/dist-packages/django/utils/datastructures.py" in
> __getitem__
> 256. raise MultiValueDictKeyError("Key %r not found in %r" % (key, self))
>
> Exception Type: MultiValueDictKeyError at /login/
> Exception Value: "Key 'username' not found in "
>
> --
> 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/-/9zw1FCvQ33kJ.
> 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: help error in form usage

2011-08-16 Thread Phang Mulianto
Oh i see..

i read the manual, the django book, no such information about that..
oh my..better update the manual there..

thanks for your quick explanation then, i think not a good way to manualy
assign a dictionarry to the form, not like in the documentation / book of
django. now i get it.

Thanks

Mulianto

On Tue, Aug 16, 2011 at 11:58 PM, Tom Evans <tevans...@googlemail.com>wrote:

> Your form is not a model form, and so you cannot pass instance=post.
> Since it is just a regular form, you should pass a dictionary of
> values, with the keys of the dictionary being the names of the fields.
>
> If the form is representing a model, you should be using a model form.
>
> https://docs.djangoproject.com/en/1.3/topics/forms/modelforms/
>
> Cheers
>
> Tom
>
> On Tue, Aug 16, 2011 at 4:47 PM, Phang Mulianto <braveh...@gmail.com>
> wrote:
> >
> > hi anyone can help me...
> >
> > On Mon, Aug 15, 2011 at 12:39 PM, Phang Mulianto <braveh...@gmail.com>
> wrote:
> >>
> >> Hi Daniel,
> >>
> >> i change it to instance, but still got other errors :
> >>
> >> def myadmin_change_post(request,
> template_name='blog/admin/change_post.html'):
> >> try:
> >> id= request.GET.get('id','4')
> >> except ValueError:
> >> id=1
> >> #post = get_object_or_404(Post,pk=id)
> >> post = Post.objects.get(pk=id)
> >> form = AdminPostForm(instance=post)
> >> return render_to_response(template_name,locals(),context_instance =
> RequestContext(request) )
> >>
> >> the form :
> >>
> >> class AdminPostForm(forms.Form):
> >>
> >>
> >> cat_choices = [('private','private')]
> >>
> >> title =
> forms.CharField(widget=forms.TextInput(attrs={'size':'20','value':'','class':''}),label='Title')
> >> content=
> forms.CharField(widget=forms.Textarea(attrs={'cols':'40','rows':'5'}),label='Content')
> >> slug =
> forms.CharField(widget=forms.TextInput(attrs={'size':'20','class':''}),label='Slug')
> >> is_publish = forms.BooleanField(label='Publish')
> >> categories = forms.ChoiceField(choices=cat_choices)
> >> created_at =
> forms.DateTimeField(widget=forms.DateTimeInput(),label='Created at')
> >> modified_at =
> forms.DateTimeField(widget=forms.DateTimeInput(),label='Modified at')
> >>
> >> any clue where the error migh be..
> >>
> >> TypeError at /article/change/
> >>
> >> __init__() got an unexpected keyword argument 'instance'
> >>
> >> Request Method: GET
> >> Request URL: http://127.0.0.1:8000/article/change/?id=2
> >> Django Version: 1.3
> >> Exception Type: TypeError
> >> Exception Value:
> >>
> >> __init__() got an unexpected keyword argument 'instance'
> >>
> >> Exception Location:
> C:\Users\mulianto\workspace\myblog\src\myblog\..\myblog\article\views.py in
> myadmin_change_post, line 132
> >> Python Executable: c:\python27\python.exe
> >> Python Version: 2.7.2
> >> Python Path:
> >>
> >> ['C:\\Users\\mulianto\\workspace\\myblog\\src\\myblog',
> >>  'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
> >>  'c:\\python27\\lib\\site-packages\\simplejson-2.1.6-py2.7.egg',
> >>
> >>
> >>  'c:\\python27\\lib\\site-packages\\pyasn1-0.0.13-py2.7.egg',
> >>  'c:\\python27\\lib\\site-packages\\pymongo-1.11-py2.7-win32.egg',
> >>  'c:\\python27\\lib\\site-packages\\mongoengine-0.4-py2.7.egg',
> >>
> >>
> >>  'C:\\Windows\\system32\\python27.zip',
> >>  'c:\\python27\\DLLs',
> >>  'c:\\python27\\lib',
> >>  'c:\\python27\\lib\\plat-win',
> >>  'c:\\python27\\lib\\lib-tk',
> >>  'c:\\python27',
> >>
> >>
> >>  'c:\\python27\\lib\\site-packages',
> >>
> >>
> >>  'c:\\python27\\lib\\site-packages\\PIL']
> >>
> >> Server time: Mon, 15 Aug 2011 12:32:23 +0800
> >>
> >> Traceback Switch to copy-and-paste view
> >>
> >> c:\python27\lib\site-packages\django\core\handlers\base.py in
> get_response
> >>
> >> for middleware_method in self._view_middleware:
> >>
> >> response = middleware_method(request, callback,
> callback_args, callback_kwargs)
> >>
> >> if response:
> >>
> >> break
> >>
> >> 

Re: help error in form usage

2011-08-16 Thread Phang Mulianto
hi anyone can help me...

On Mon, Aug 15, 2011 at 12:39 PM, Phang Mulianto <braveh...@gmail.com>wrote:

> Hi Daniel,
>
> i change it to instance, but still got other errors :
>
>
> def myadmin_change_post(request,
> template_name='blog/admin/change_post.html'):
> try:
> id= request.GET.get('id','4')
> except ValueError:
> id=1
> #post = get_object_or_404(Post,pk=id)
> post = Post.objects.get(pk=id)
> form = AdminPostForm(instance=post)
>
> return render_to_response(template_name,locals(),context_instance =
> RequestContext(request) )
>
> the form :
>
> class AdminPostForm(forms.Form):
>
>
> cat_choices = [('private','private')]
>
> title =
> forms.CharField(widget=forms.TextInput(attrs={'size':'20','value':'','class':''}),label='Title')
> content=
> forms.CharField(widget=forms.Textarea(attrs={'cols':'40','rows':'5'}),label='Content')
> slug =
> forms.CharField(widget=forms.TextInput(attrs={'size':'20','class':''}),label='Slug')
> is_publish = forms.BooleanField(label='Publish')
> categories = forms.ChoiceField(choices=cat_choices)
> created_at =
> forms.DateTimeField(widget=forms.DateTimeInput(),label='Created at')
> modified_at =
> forms.DateTimeField(widget=forms.DateTimeInput(),label='Modified at')
>
> any clue where the error migh be..
> TypeError at /article/change/
>
> __init__() got an unexpected keyword argument 'instance'
>
>  Request Method: GET  Request URL:
> http://127.0.0.1:8000/article/change/?id=2  Django Version: 1.3  Exception
> Type: TypeError  Exception Value:
>
> __init__() got an unexpected keyword argument 'instance'
>
>  Exception Location: 
> C:\Users\mulianto\workspace\myblog\src\myblog\..\myblog\article\views.py
> in myadmin_change_post, line 132  Python Executable:
> c:\python27\python.exe  Python Version: 2.7.2  Python Path:
>
> ['C:\\Users\\mulianto\\workspace\\myblog\\src\\myblog',
>  'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
>  'c:\\python27\\lib\\site-packages\\simplejson-2.1.6-py2.7.egg',
>
>  'c:\\python27\\lib\\site-packages\\pyasn1-0.0.13-py2.7.egg',
>  'c:\\python27\\lib\\site-packages\\pymongo-1.11-py2.7-win32.egg',
>  'c:\\python27\\lib\\site-packages\\mongoengine-0.4-py2.7.egg',
>
>  'C:\\Windows\\system32\\python27.zip',
>  'c:\\python27\\DLLs',
>  'c:\\python27\\lib',
>  'c:\\python27\\lib\\plat-win',
>  'c:\\python27\\lib\\lib-tk',
>  'c:\\python27',
>
>  'c:\\python27\\lib\\site-packages',
>
>
>  'c:\\python27\\lib\\site-packages\\PIL']
>
>  Server time: Mon, 15 Aug 2011 12:32:23 +0800
>
> Traceback Switch to copy-and-paste 
> view<http://127.0.0.1:8000/article/change/?id=2#>
>
>- c:\python27\lib\site-packages\django\core\handlers\base.py in
>get_response
>1.
>
>   for middleware_method in self._view_middleware:
>
>   2.
>
>   response = middleware_method(request, callback, 
> callback_args, callback_kwargs)
>
>   3.
>
>   if response:
>
>   4.
>
>   break
>
>   5.
>   6.
>
>   if response is None:
>
>   7.
>
>   try:
>
>1.
>
>   response = callback(request, *callback_args, 
> **callback_kwargs)
>
>   ...
>1.
>
>   except Exception, e:
>
>   2.
>
>   # If the view raised an exception, run it 
> through exception
>
>   3.
>
>   # middleware, and if the exception middleware 
> returns a
>
>   4.
>
>   # response, use that. Otherwise, reraise the 
> exception.
>
>   5.
>
>   for middleware_method in 
> self._exception_middleware:
>
>   6.
>
>   response = middleware_method(request, e)
>
>▶ Local vars <http://127.0.0.1:8000/article/change/?id=2#>
>  Variable Value   exceptions
>
> 'c:\python27\lib\site-packages\django\core\exceptions.pyc'>
>
> e
>
>TypeError("__init__() got an unexpected keyword argument 'instance'",)
>
> callback_args
>
>()
>
> receivers
>
>[(, None)]
>
> middleware_method
>
> >
>
> self
>
>
>
> settings
>
>
>
> request
>
>GET:,
>POST:,
>COOKIES:{'csrftoken': '5fbc1b8cf0e31318c4f7a1904df1b5c

Re: help error in form usage

2011-08-14 Thread Phang Mulianto
Hi Daniel,

i change it to instance, but still got other errors :

def myadmin_change_post(request,
template_name='blog/admin/change_post.html'):
try:
id= request.GET.get('id','4')
except ValueError:
id=1
#post = get_object_or_404(Post,pk=id)
post = Post.objects.get(pk=id)
form = AdminPostForm(instance=post)
return render_to_response(template_name,locals(),context_instance =
RequestContext(request) )

the form :

class AdminPostForm(forms.Form):


cat_choices = [('private','private')]

title =
forms.CharField(widget=forms.TextInput(attrs={'size':'20','value':'','class':''}),label='Title')
content=
forms.CharField(widget=forms.Textarea(attrs={'cols':'40','rows':'5'}),label='Content')
slug =
forms.CharField(widget=forms.TextInput(attrs={'size':'20','class':''}),label='Slug')
is_publish = forms.BooleanField(label='Publish')
categories = forms.ChoiceField(choices=cat_choices)
created_at =
forms.DateTimeField(widget=forms.DateTimeInput(),label='Created at')
modified_at =
forms.DateTimeField(widget=forms.DateTimeInput(),label='Modified at')

any clue where the error migh be..
TypeError at /article/change/

__init__() got an unexpected keyword argument 'instance'

 Request Method: GET  Request URL:
http://127.0.0.1:8000/article/change/?id=2  Django Version: 1.3  Exception
Type: TypeError  Exception Value:

__init__() got an unexpected keyword argument 'instance'

 Exception Location:
C:\Users\mulianto\workspace\myblog\src\myblog\..\myblog\article\views.py
in myadmin_change_post, line 132  Python Executable:
c:\python27\python.exe  Python
Version: 2.7.2  Python Path:

['C:\\Users\\mulianto\\workspace\\myblog\\src\\myblog',
 'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\simplejson-2.1.6-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\pyasn1-0.0.13-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\pymongo-1.11-py2.7-win32.egg',
 'c:\\python27\\lib\\site-packages\\mongoengine-0.4-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
 'c:\\python27\\DLLs',
 'c:\\python27\\lib',
 'c:\\python27\\lib\\plat-win',
 'c:\\python27\\lib\\lib-tk',
 'c:\\python27',
 'c:\\python27\\lib\\site-packages',


 'c:\\python27\\lib\\site-packages\\PIL']

 Server time: Mon, 15 Aug 2011 12:32:23 +0800

Traceback Switch to copy-and-paste
view

   - c:\python27\lib\site-packages\django\core\handlers\base.py in
   get_response
   1.

  for middleware_method in self._view_middleware:

  2.

  response = middleware_method(request,
callback, callback_args, callback_kwargs)

  3.

  if response:

  4.

  break

  5.
  6.

  if response is None:

  7.

  try:

  1.

  response = callback(request,
*callback_args, **callback_kwargs)

  ...
   1.

  except Exception, e:

  2.

  # If the view raised an exception, run
it through exception

  3.

  # middleware, and if the exception
middleware returns a

  4.

  # response, use that. Otherwise, reraise
the exception.

  5.

  for middleware_method in
self._exception_middleware:

  6.

  response = middleware_method(request, e)

   ▶ Local vars 
 Variable Value   exceptions

   

e

   TypeError("__init__() got an unexpected keyword argument 'instance'",)

callback_args

   ()

receivers

   [(, None)]

middleware_method

   >

self

   

settings

   

request

   ,
   POST:,
   COOKIES:{'csrftoken': '5fbc1b8cf0e31318c4f7a1904df1b5c2',
'sessionid': 'ee90c4ad05c1512cc424c7117f1320c9'},
   META:{'ALLUSERSPROFILE': 'C:\\ProgramData',
'APACHE2TRIAD_DIR': 'd:\\apache2triad',
'APPDATA': 'C:\\Users\\mulianto\\AppData\\Roaming',
'COMMONPROGRAMFILES': 'C:\\Program Files\\Common Files',
'COMPUTERNAME': 'MULIANTO-PC',
'COMSPEC': 'C:\\Windows\\system32\\cmd.exe',
'CONTENT_LENGTH': '',
'CONTENT_TYPE': 'text/plain',
'CSRF_COOKIE': '5fbc1b8cf0e31318c4f7a1904df1b5c2',
'DJANGO_SETTINGS_MODULE': 'myblog.settings',
'FP_NO_HOST_CHECK': 'NO',
'GATEWAY_INTERFACE': 'CGI/1.1',
'HOMEDRIVE': 'C:',
'HOMEPATH': '\\Users\\mulianto',
'HTTP_ACCEPT':
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
'HTTP_ACCEPT_LANGUAGE': 'en-us,en;q=0.5',
'HTTP_CONNECTION': 'keep-alive',
'HTTP_COOKIE': 'sessionid=ee90c4ad05c1512cc424c7117f1320c9;
csrftoken=5fbc1b8cf0e31318c4f7a1904df1b5c2',
'HTTP_HOST': 

Re: question about template engine jinja

2011-08-14 Thread Phang Mulianto
well this sounds good..

thanks for the information russell .

Mulianto

On Sun, Aug 14, 2011 at 3:31 PM, Russell Keith-Magee <
russ...@keith-magee.com> wrote:

>
> On Sunday, August 14, 2011, Phang Mulianto <braveh...@gmail.com> wrote:
> > Thanks Reinout for the response,
> >
> > i read the doc , just in time compilation to Python bytecode is used in
> jinja..
> >
> > is django default template also do this ?
> >
> > which i see the reason why jinja faster.
>
> Django's template engine doesn't currently bytecode compilation; however,
> Armin Ronacher, the author of Jinja, is doing a Google Summer of Code
> project that will hopefully result in Jinja and Django using a common
> bytecode engine.
>
> Yours,
> Russ Magee %-)
>
> --
> 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.



help error in form usage

2011-08-14 Thread Phang Mulianto
hi..need help..

Here are the model :


class Post(models.Model):
title = models.CharField(max_length=200)
content = models.TextField()
slug = models.SlugField(max_length=50, unique=True, help_text='Unique
Value for Article page URL, created from title.')
is_publish = models.BooleanField(default=False)
categories = models.ManyToManyField(Category)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

class Meta:
db_table = 'post'
ordering = ['-created_at']
verbose_name_plural = 'Posts'

def __unicode__(self):
return self.title

@models.permalink
def get_absolute_url(self):
return ('article_post', ())


here are my view :

def myadmin_change_post(request,
template_name='blog/admin/change_post.html'):
try:
id= request.GET.get('id','4')
except ValueError:
id=1
#post = get_object_or_404(Post,pk=id)
post = Post.objects.get(pk=id)
*form = AdminPostForm(initial=post)*
return render_to_response(template_name,locals(),context_instance =
RequestContext(request) )

here are the template :
{% extends "myadmin/index.html" %}

{%block content %}



{% csrf_token %}

{% for field in form.visible_fields %}
{% if forloop.first %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{% endif %}

{{ field.label_tag }}
{{ field }}
{{ field.errors }}


{% endfor %}






{% endblock %}

The problem is, when in the view, the form is unbound the page display .
when i bound the form like this :

form = AdminPostForm(initial=post)  => generate error in template
but when
form = AdminPostForm() => No error but the field all empty

What i intend to do is, edit the data in the form, which like change
form/edit form.
any clue for this error..
the error are :
TemplateSyntaxError at /article/change/

Caught AttributeError while rendering: 'Post' object has no attribute 'get'

 Request Method: GET  Request URL:
http://127.0.0.1:8000/article/change/?id=4  Django Version: 1.3  Exception
Type: TemplateSyntaxError  Exception Value:

Caught AttributeError while rendering: 'Post' object has no attribute 'get'

 Exception Location: c:\python27\lib\site-packages\django\forms\forms.py in
value, line 470  Python Executable: c:\python27\python.exe  Python Version:
2.7.2  Python Path:

['C:\\Users\\mulianto\\workspace\\myblog\\src\\myblog',
 'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\simplejson-2.1.6-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\pyasn1-0.0.13-py2.7.egg',
 'c:\\python27\\lib\\site-packages\\pymongo-1.11-py2.7-win32.egg',
 'c:\\python27\\lib\\site-packages\\mongoengine-0.4-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
 'c:\\python27\\DLLs',
 'c:\\python27\\lib',
 'c:\\python27\\lib\\plat-win',
 'c:\\python27\\lib\\lib-tk',
 'c:\\python27',
 'c:\\python27\\lib\\site-packages',
 'c:\\python27\\lib\\site-packages\\PIL']

 Server time: Sun, 14 Aug 2011 21:14:41 +0800
*
*Template error

In template
c:\users\mulianto\workspace\myblog\src\myblog\templates\blog\admin\change_post.html,
error at line *9*
Caught AttributeError while rendering: 'Post' object has no attribute 'get'
1 {% extends "myadmin/index.html" %} 2
3 {%block content %} 4  5  6  7 {% csrf_token %} 8  9 {% for field in
form.visible_fields %} 10 {% if forloop.first %} 11 {% for hidden in
form.hidden_fields %} 12 {{ hidden }} 13 {% endfor %} 14 {% endif %} 15  16 {{ field.label_tag
}} 17 {{
field }} 18 {{ field.errors }} 19 
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/article/change/?id=4

Django Version: 1.3
Python Version: 2.7.2
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.flatpages',
 'myblog.utils',
 'myblog.article',
 'myblog.polling']
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',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


Template error:
In template
c:\users\mulianto\workspace\myblog\src\myblog\templates\blog\admin\change_post.html,
error at line 9
   Caught AttributeError while rendering: 'Post' object has no attribute
'get'
   1 : {% extends "myadmin/index.html" %}


   2 :


   3 : {%block content %}


   4 : 


   5 : 


   6 : 


   7 : {% csrf_token %}


   8 : 


   9 :  {% for field in form.visible_fields %}


   10 : {% if forloop.first 

Re: Template tag: how to output success message above input field

2011-08-14 Thread Phang Mulianto
you can use javascript function...

On Sun, Aug 14, 2011 at 4:53 PM, Subhranath Chunder wrote:

> Setting a simple context variable in your view would solve your purpose.
>
> Thanks,
> Subhranath Chunder.
> www.subhranath.com
>
>
> On Sun, Aug 14, 2011 at 1:22 PM, doniyor wrote:
>
>> Hey Guys,
>>
>> i need a litle help in working with forms. i have a button and i want
>> to output a success text above the button if the user presses the
>> button. how to do this ? is there any template tag like  {% if
>> form.is_submitted %} or so?
>>
>> main point is that i dont want to write another html file only to show
>> the success message.
>>
>> thanks in advance..
>>
>> Doni
>>
>> --
>> 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,
> Subhranath Chunder.
> www.subhranath.com
>
>  --
> 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: question about template engine jinja

2011-08-14 Thread Phang Mulianto
Thanks Reinout for the response,

i read the doc , just in time compilation to Python bytecode is used in
jinja..

is django default template also do this ?

which i see the reason why jinja faster.

mulianto

On Sun, Aug 14, 2011 at 6:19 AM, Reinout van Rees <rein...@vanrees.org>wrote:

> On 13-08-11 14:41, Phang Mulianto wrote:
>
>> and i read about jinja template, why it can be faster than django
>> template engine ?
>>
>
> Jinja basically uses django's syntax, but (if my memory is correct) it
> allows you to do more things than django's templates allows you to.
>
> Is it faster? I thought there were people trying to bring jinja into django
> as it is good and fast. If it is faster, it would probably be because people
> are making a dedicated effort at making it fast. Multiple projects are using
> jinja, so there's a good chance that the combined effort *could* make it
> faster.
>
> I don't know from experience, though, *if* it is faster.
>
>
> Reinout
>
> --
> Reinout van Reeshttp://reinout.vanrees.org/
> rein...@vanrees.org 
> http://www.nelen-schuurmans.**nl/<http://www.nelen-schuurmans.nl/>
> "If you're not sure what to do, make something. -- Paul Graham"
>
>
> --
> 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+unsubscribe@**
> googlegroups.com <django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<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.



question about template engine jinja

2011-08-13 Thread Phang Mulianto
Hi all,

i need sugestion about templating.

if i use many include in django template, is it a good practice and effect
the load performance of the application ?

and i read about jinja template, why it can be faster than django template
engine ?

how many of you prefer jinja, and why ?

thanks all.

-- 
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-registration - stuck at Required templates topic

2011-08-04 Thread Phang Mulianto
well..like the error said..you need to put {% csrf_token %} inside your
form.. do you read the tutorial? you should read it if you serious getting
in django. . it helps you alot as it help me too..
On Aug 5, 2011 12:12 PM, "bob gailer"  wrote:
>
>
> On Aug 4, 11:47 pm, Mario Gudelj  wrote:
>> Hey Bob,
>>
>> You can download some basic templates for this pagehttp://
devdoodles.wordpress.com/2009/02/16/user-authentication-with-d...
>
> OK - did that - now what? I can get the login form displayed - when I
> click get:
>
> Forbidden (403)
>
> CSRF verification failed. Request aborted.
> Help
>
> Reason given for failure:
>
> CSRF token missing or incorrect.
>
>
> In general, this can occur when there is a genuine Cross Site Request
> Forgery, or when Django's CSRF mechanism has not been used correctly.
> For POST forms, you need to ensure:
>
> The view function uses RequestContext for the template, instead of
> Context.
> In the template, there is a {% csrf_token %} template tag inside
> each POST form that targets an internal URL.
> If you are not using CsrfViewMiddleware, then you must use
> csrf_protect on any views that use the csrf_token template tag, as
> well as those that accept the POST data.
>
> I have no idea what to do with that message.
>
> I need a lot more hand-holding, since I am VERY new to django.
>
> --
> 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: Most stable Linux distribution for Django - Python development

2011-08-01 Thread Phang Mulianto
i will go for freebsd which is unix.
but all depends on the admin abd hardware..
On Aug 1, 2011 5:17 PM, "Cal Leeming [Simplicity Media Ltd]" <
cal.leem...@simplicitymedialtd.co.uk> wrote:

-- 
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: tar xzvf Django-1.3.tar.gz

2011-07-30 Thread Phang Mulianto
you should extract all the content to a folder. in windows you will need to
extract it twice until u see some django folder files which you see ass
setup.py
then from msdos prompt go to the folder..then run this command :
python setup.py install

assume your python path is set in windows machine.

you just need dig into the doc man..
On Jul 30, 2011 9:45 PM, "patt numero1"  wrote:
> in your terminal>tar xzvf Django-1.3.tar.gz (to unzip your tar)
> in your terminal>cd Django-1.3 (to move in the new directory created
> by the tar)
> in your terminal>sudo python setup.py install (to install django)
>
> hope this helpful!!! ;-)
>
> On Jul 30, 2:41 am, Technical Writer  wrote:
>> Hello,all:
>> I am a technical writer here in China and right now I run into
>> troube installing Django onto my Windows operation system. I have
>> followed the steps in the instruction page at (
https://www.djangoproject.com/download/) with Python 2.7 installed. Then I
>> downloaded Django-1.3.tar.gz. and the instruction page tells me:
>> --
>> tar xzvf Django-1.3.tar.gz
>> cd Django-1.3
>> sudo python setup.py install
>> ---
>>
>> How do I suppose to continue? Type in these words into Python shell?
>> But there is indication that the syntax is wrong . I am totally
>> confused here. Can anyone 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: about django

2011-07-28 Thread Phang Mulianto
welcome to the club. ...
start with the documentation like others said, then more deep buy a book for
reference, then create a pilot project...
On Jul 29, 2011 10:08 AM, "Harjot Gill"  wrote:
> Refer the following site.It will really help you.This site will help
> you to learn django from starting and this are some tutorials that
> will help you to learn django.
>
> www.djangoproject.com
>
> Best of luck !
>
> --
> 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: Real Example

2011-07-22 Thread Phang Mulianto
you better find books in amazon. .. many ready to learn for you..
On Jul 22, 2011 10:41 PM, "Shawn Milochik"  wrote:
> On 07/22/2011 10:31 AM, Eyad Al-Sibai wrote:
>> Hi!
>>
>> I want a real example of complete django application with source code
>> to understand django better
>>
>
> 1. Search Google, github, and bitbucket.
>
> 2. Read this: https://code.djangoproject.com/wiki/UsingTheMailingList
>
>
> --
> 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: Setting LOGIN_URL dynamically, for different users, based on app?

2011-07-22 Thread Phang Mulianto
with user profile, i translate it this way :
after user login,app check the profile of user then decide based on the
profile which page sould user be redirected after login,say a to dashboard
landing page, b user redirect to console page...

why would create 2 login page for 1 project anyway..
On Jul 22, 2011 9:54 PM, "Andre Terra"  wrote:
> No, there is no way to do that. I'm sorry, but your approach is convoluted
> and inherently wrong.
>
> Instead of asking "how can I make this solution work?" you should be
asking
> "what's the best way to solve my needs?" and the answer to the latter will
> be very different from what you currently have in mind.
>
> IDEAS:
>
> * There is no reason you will need two login pages. Ideally, users should
> authenticate against the system as a whole, or you will rewrite the same
> logic in many places and the code will be huge and hard to maintain.
> * Navigating through the site (and therefore accessing objects) is the
part
> that needs the permission checks.
> * Working with different models doesn't mean users have to live in two
> separate system. Again, think about permissions. Don't worry about the
> models until you get the profile permissions figured out.
> * What if an admin needs to work on both the dashboard and the console?
> Where would he login?
> * Apps should be as pluggable as possible. In that sense, have each app
> define its own urls and let the project-wide urls handle login.
> * If you really need to (and I don't see why you would), write custom auth
> backends if you want, and restrict a user's login based on his profile's
> access level.
>
>
> Regards,
> AT
>
>
> On Fri, Jul 22, 2011 at 10:35 AM, dpapathanasiou <
> denis.papathanas...@gmail.com> wrote:
>
>> Thanks for your reply, but now that I've read up on custom profile and
>> permissions, it doesn't seem like a solution.
>>
>> Here's another way of explaining it: in my urls.py file, I have two
>> entries inside the urlpatterns definition, like this:
>>
>> (r'^dashboard/', include('mysite.console.urls')),
>> (r'^console/', include('mysite.console.urls')),
>>
>> And then inside the /dashboard/urls.py file I have this:
>>
>> urlpatterns = patterns('',
>> (r'^login/$',
>> 'django.contrib.auth.views.login',
>> {'template_name': 'dashboard/login.html'}),
>>
>> [etc]
>> )
>>
>> And inside /console/urls.py is this:
>>
>> urlpatterns = patterns('',
>> (r'^login/$',
>> 'django.contrib.auth.views.login',
>> {'template_name': 'console/login.html'}),
>>
>> [etc]
>> )
>>
>> Basically, since /console and /dashboard provide different
>> functionality to different types of users, they have different
>> templates (and their db model definitions are quite different; /
>> dashboard users are not a type of /console user, nor can they really
>> be both inherited from the same user profile class).
>>
>> So, ideally, what I'd like to be able to do is something like this, to
>> force the built-in authentication to use a different url than the
>> single LOGIN_URL specified in settings.py:
>>
>> urlpatterns = patterns('',
>> (r'^login/$',
>> 'django.contrib.auth.views.login',
>> {'template_name': 'dashboard/login.html', LOGIN_URL='/dashboard/
>> accounts/'}),
>>
>> [etc]
>> }
>>
>> and:
>>
>> urlpatterns = patterns('',
>> (r'^login/$',
>> 'django.contrib.auth.views.login',
>> {'template_name': 'console/login.html', LOGIN_URL='/console/
>> profile/'}),
>>
>> [etc]
>> }
>>
>> Is there a way to do that?
>>
>> On Jul 21, 9:23 pm, Andre Terra  wrote:
>> > Why not make custom user profiles and write permission checks on your
>> views?
>> >
>> > Cheers,
>> > AT
>>
>> --
>> 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.
>

-- 
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: block bots and spiders

2011-07-12 Thread Phang Mulianto
yes Bruno, that's what i mean, so this is doable.. and also can prevent DDOS
attack to your core web server...

On Tue, Jul 12, 2011 at 6:28 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On Jul 12, 11:57 am, Phang Mulianto <braveh...@gmail.com> wrote:
> > hi..
> >
> > why not block the spiders in the web server environtment .
> > i think it is better than has to put the code in the apps.
> >
> > is it possible ? because i had read that some web server can block
> > unnecesary request before reach the real web server..like nginx,
> lighttpd,
> > etc..
>
>
> On Apache I'm using mod_rewrite to block bad-behaving bots.
>
> --
> 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: block bots and spiders

2011-07-12 Thread Phang Mulianto
hi..

why not block the spiders in the web server environtment .
i think it is better than has to put the code in the apps.

is it possible ? because i had read that some web server can block
unnecesary request before reach the real web server..like nginx, lighttpd,
etc..



On Tue, Jul 12, 2011 at 5:38 PM, Jonas Geiregat  wrote:

>
>
> > Hi all,
> >
> > has someone an effective way to block away bots and spiders?
> > There are so many ignoring robots.txt - besides facebook and tons of
> > Java/xyz clients there are many more illegal spiders around.
> >
> > So does anyone have a performance effective way to block them out?
> > Or do you think - if performance matters, leave them crawling...
> >
> > regards
> >
> > Henrik
>
> The only thing I can think of is checking the request.META dictionary. It
> contains the HTTP_HOST and HTTP_USER_AGENT settings by the client. You could
> check if those are valid but of course a spider could fake those values. But
> I'm guessing not all spiders fake them.
> You could at least filter out those that don't set these values.
>
> It would probably require lot's of heavy regular expression code (since
> there are so many valid client headers) which would be best implemented as a
> decorator on each view method.  Or you could probably put the code in a
> middleware.
> Eventually taking out those spiders would slow down your request.
>
> Again I have no experience on this field, it's just an idea that might be
> possible.
>
> Regards,
>
> Jonas.
>
> --
> 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: 'WSGIRequest' object has no attribute 'update'

2011-07-11 Thread Phang Mulianto
>
>
> The bug is in this line. render_to_response() takes a dictionary as the
> context_instance, but this code just passes the request instance.
>
> You probably meant either:
>
> return render_to_response(template_name, locals(),
> context_instance=(request, ))  # Note comma
>
> or
>
> return render_to_response(template_name, locals(),
> context_instance={'request':request}))
>
> HTH,
>
> Malcolm
>
>
> Hi Malcolm,

already try your reccomendation, but still got error.

and i check with other view in the apps, i found out you are right, the bug
is in the render_to_response.

i fix it with this one :
  return render_to_response(template_name,
locals(),context_instance=RequestContext(request))

i miss the RequestContext(request))

This one think which pass all the context processed variable to the
template.

Thanks, and i learn now how to read error message and track it down now..

It solved now..

continue to learning...

-- 
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: 'WSGIRequest' object has no attribute 'update'

2011-07-11 Thread Phang Mulianto
Hi Shawn,

Here are the view called :

# Create your views here.
from django.shortcuts import render_to_response
from django.template import RequestContext
from ecomstore.cart import cart

def show_cart(request, template_name="cart/cart.html"):
if request.method == 'POST':
postdata = request.POST.copy()
if postdata['submit'] == 'Remove':
cart.remove_from_cart(request)
if postdata['submit'] == 'Update':
cart.update_cart(request)

cart_item_count = cart.cart_item_count(request)
page_title = "Shopping Cart"
cart_subtotal = cart.cart_subtotal(request)
return render_to_response(template_name, locals(),
context_instance=(request))

Thanks for your help..

On Sun, Jul 10, 2011 at 11:57 PM, Shawn Milochik  wrote:

> May we see the rest of your view? If not, you'll have to figure it out by
> examining exactly what your 'request' variable contains. The error is
> clearly from calling update() on it, and it not being allowed.
>
> --
> 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+unsubscribe@**
> 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.



'WSGIRequest' object has no attribute 'update'

2011-07-10 Thread Phang Mulianto
Hi all..i am learning django no, using django 1.3 + python 2.7 . i came from
php world...

i am using a book , and follow the code in there, but got error and cannot
find whats the cause. here are the errors.

anyone can give some clue? Thanks
AttributeError at /cart/

'WSGIRequest' object has no attribute 'update'

 Request Method: GET  Request URL: http://127.0.0.1:8000/cart/  Django
Version: 1.3  Exception Type: AttributeError  Exception Value:

'WSGIRequest' object has no attribute 'update'

 Exception Location: c:\python27\lib\site-packages\django\template\loader.py
in render_to_string, line 186  Python Executable:
c:\python27\python.exe  Python
Version: 2.7.2  Python Path:

['C:\\Users\\mulianto\\workspace\\ecomstore\\src\\ecomstore',
 'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
 'C:\\Windows\\system32\\python27.zip',
 'c:\\python27\\DLLs',
 'c:\\python27\\lib',
 'c:\\python27\\lib\\plat-win',
 'c:\\python27\\lib\\lib-tk',
 'c:\\python27',
 'c:\\python27\\lib\\site-packages']

 Server time: Sun, 10 Jul 2011 13:23:33 +0800
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/cart/

Django Version: 1.3
Python Version: 2.7.2
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.flatpages',
 'ecomstore.catalog',
 'ecomstore.utils',
 'ecomstore.cart']
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',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware')


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:\Users\mulianto\workspace\ecomstore\src\ecomstore\..\ecomstore\cart\views.py"
in show_cart
  17. return render_to_response(template_name, locals(),
context_instance=(request))
File "c:\python27\lib\site-packages\django\shortcuts\__init__.py" in
render_to_response
  20. return HttpResponse(loader.render_to_string(*args, **kwargs),
**httpresponse_kwargs)
File "c:\python27\lib\site-packages\django\template\loader.py" in
render_to_string
  186. context_instance.update(dictionary)

Exception Type: AttributeError at /cart/
Exception Value: 'WSGIRequest' object has no attribute 'update'

-- 
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.