Re: new Django-Python can't get to sqlite

2010-08-13 Thread Piotr Zalewa

Google "install sqlite/mysql $your_operating_system"
If you provide more info (result of running yolk and your operating 
system) we will be able to help you a bit more.


zalun

On 10-08-13 03:15, Tom wrote:

It's my first time using Django&  I'm unable to get the demo going. I
would like to use sqlite (ultimately mysql).
Python 2.7 installed ok.  Then I installed (I think) Django 1.2.1.
The "manage.py runserver" works, but the "syncdb" fails.  How do I
"install" sqlite or pysqlite2 (or even mysql)?  I thought Python 2.5+
came with sqlite installed.

[myserver]$ tar xf Python-2.7.tgz
[myserver]$ cd Python-2.7
[myserver]$ mkdir   /opt/Python-2.7
[myserver]$ chown simonst   /opt/Python-2.7
[myserver]$ ./configure --prefix=/opt/Python-2.7
[myserver]$ make
[myserver]$ sudo make install
[myserver]$ export PATH=/opt/Python-2.7/bin:$PATH
[myserver]$ python -V
Python 2.7

[myserver]$ sudo tar xzf Django-1.2.1.tar.gz -C /opt
[myserver]$ cd /opt/Django-1.2.1
[myserver]$ sudo ln -s /opt/Django-1.2.1/django /opt/Python-2.7/lib/
python2.7/site-packages
[myserver]$ export PATH=/opt/Django-1.2.1/django/bin:$PATH
[myserver]$ django-admin.py --version
1.2.1

[myserver]$ django-admin.py startproject mysite
[myserver]$ cd mysite
[myserver]$ ./manage.py runserver
Validating models...
0 errors found
Django version 1.2.1, using settings 'mysite.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
[12/Aug/2010 20:38:04] "GET / HTTP/1.1" 200 2051
[myserver]$ cp -p settings.py settings.py_ORIG
[myserver]$ vi settings.py
[myserver]$ diff settings.py settings.py_ORIG
<   'ENGINE': 'django.db.backends.sqlite3', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
<   'NAME': 'django_db', # Or path to database file if
using sqlite3.
---
   

  'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 
'mysql', 'sqlite3' or 'oracle'.
  'NAME': '',  # Or path to database file if using sqlite3.
 

[myserver]$ ./manage.py syncdb
   <-- snip traceback lines -->
 return import_module('.base', backend_name)
   File "/opt/Python-2.7/lib/python2.7/site-packages/django/utils/
importlib.py", line 35, in import_module
 __import__(name)
   File "/opt/Python-2.7/lib/python2.7/site-packages/django/db/backends/
sqlite3/base.py", line 34, in
 raise ImproperlyConfigured("Error loading %s: %s" % (module, exc))
django.core.exceptions.ImproperlyConfigured: Error loading either
pysqlite2 or sqlite3 modules (tried in that order): No module named
_sqlite3

   



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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 Django-Python can't get to sqlite

2010-08-13 Thread Piotr Zalewa

there us many ways to do so

I'd install pip from the package (rpm, right?)
and then run "pip install pysqlite3"
but the best would be o read about virtualenv and prepare djsngo 
environment for the project (not globally)


zalun

On 10-08-14 00:11, Tom wrote:

The opsys is rhel AS5.2.  I couldn't find "yolk" on it (that's a
program, right?).
The machine has rpms for Python 2.4&  sqlite, but I was unable to get
Django working with them.  I thought Python 2.5&  later versions
included sqlite, so I started installing all the software (Python,
Django) in new locations under /opt.

I don't have a good grasp on installing stuff for Python. Is the link
of the django dir in Pythons's site-packages all I need to install
Django?  How do I install sqlite and/or pysqlite2, so that Django's
"syncdb" will work?  The "syncdb" error appears to say that
django/db/backends/sqlite3/base.py can't find pysqlite2 or sqlite3.
Where/how do I install them so DJango can find them?
  . . . . . . .
   File "/opt/Python-2.7/lib/python2.7/site-packages/django/db/backends/
sqlite3/base.py", line 34, in
 raise ImproperlyConfigured("Error loading %s: %s" % (module, exc))
django.core.exceptions.ImproperlyConfigured: Error loading either
pysqlite2 or sqlite3 modules (tried in that order): No module named
_sqlite3


[myserver]$ ll /opt
drwxr-xr-x 8 502  502 4096 Aug 11 20:44 Django-1.2.1
drwxr-xr-x 6 501   20 4096 Aug 11 22:00 pysqlite-2.6.0
drwxr-xr-x 6 simonst root 4096 Aug 11 20:10 Python-2.7
[caadmin]$ ll /opt/Python-2.7/lib/python2.7/site-packages
lrwxrwxrwx 1 root root  25 Aug 11 21:09 django ->  /opt/Django-1.2.1/
django
-rw-r--r-- 1 root root 119 Aug 11 20:09 README
[caadmin]$ ll /opt/Django-1.2.1/django
drwxr-xr-x  3  502  502 4096 Aug 11 20:44 bin
drwxr-xr-x  6  502  502 4096 Aug 11 20:44 conf
drwxr-xr-x 22  502  502 4096 Aug 11 20:44 contrib
drwxr-xr-x  9  502  502 4096 Aug 11 20:44 core
drwxr-xr-x  4  502  502 4096 Aug 11 20:44 db
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 dispatch
drwxr-xr-x  3  502  502 4096 Aug 11 20:44 forms
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 http
-rw-r--r--  1  502  502  549 May 24 12:10 __init__.py
-rw-r--r--  1 root root  757 Aug 11 20:44 __init__.pyc
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 middleware
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 shortcuts
drwxr-xr-x  3  502  502 4096 Aug 11 20:44 template
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 templatetags
drwxr-xr-x  2  502  502 4096 Aug 11 20:44 test
drwxr-xr-x  4  502  502 4096 Aug 11 20:44 utils
drwxr-xr-x  4  502  502 4096 Aug 11 20:44 views

On Aug 13, 1:08 am, Piotr Zalewa  wrote:
   

Google "install sqlite/mysql $your_operating_system"
If you provide more info (result of running yolk and your operating
system) we will be able to help you a bit more.

zalun

On 10-08-13 03:15, Tom wrote:

 

It's my first time using Django&I'm unable to get the demo going. I
would like to use sqlite (ultimately mysql).
Python 2.7 installed ok.  Then I installed (I think) Django 1.2.1.
The "manage.py runserver" works, but the "syncdb" fails.  How do I
"install" sqlite or pysqlite2 (or even mysql)?  I thought Python 2.5+
came with sqlite installed.
   
 
   



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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 JSON in Django

2010-08-25 Thread Piotr Zalewa
 In such case it would better to not cache entire method, but simply 
the data - build the unique key per GET requests, check if the data is 
already stored in cache, if so - use it, else - retrieve it from 
database and store it in cache.


from django.core.cache import cache

def someview(req):

par = req.GET.get('somepar')
key = "someview:%s" % par
data = cache.get(key, None)

if not data:
# get data from database
# ...
cache.set(key, data)

# here normal usage of data

On 10-08-25 13:12, buddhasystem wrote:

Hello --

I think that might be the case... I do extract parameters from GET.

Am I out of luck?




Jirka Vejrazka wrote:

Is your AJAX query POST or GET query? Because as you may know, POST
queries
are not cached, GET queries are.


Also, GET requests are not cached in some cases (e.g. when GET
parameters are used) - it's really difficult to figure out what's
wrong without knowing specific details.

   Cheers

 Jirka

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@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.






--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: Multiple django projects

2010-09-02 Thread Piotr Zalewa
 On 09/02/10 17:12, commonzenpython wrote:
> hey, guys
> is it possible to have multiple django projects in one server ?
>
You can also make them using different django versions
check django + virtualenv  on google

zalun

-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Please wait page trouble

2010-09-08 Thread Piotr Zalewa
 Do you have it in the urls.py file?
Would be best to paste it into pastebin or here if it's few lines only

zalun
On 09/08/10 23:56, Bradley Hintze wrote:
> This is what I have in my please_wait.html
>
>  src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";>
> $.getJSON('{% url run_DHM %}')
> });
> 
>
> This is the django error
>
> Caught NoReverseMatch while rendering: Reverse for 'run_DHM' with
> arguments '()' and keyword arguments '{}' not found.
>
> run_DHM takes 'request' as an argument. How do I pass it the argument??
>
> On Tue, Sep 7, 2010 at 1:36 PM, Alec Shaner  wrote:
>> You need to include the jquery library script in your html page if you're
>> calling getJSON as in the previous emails (and note that getJSON isn't
>> necessarily the function you want - jquery provides many options for doing
>> AJAX). Either download it, or use one of the public repositories:
>>
>> http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery
>>
>> In fact, just view the html source code for the link just referenced -
>> you'll see how jquery is included:
>>
>> > src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js";>
>>
>> Then I'd recommend one of the tutorials, e.g.,:
>>
>> http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
>>
>> The tutorials should serve as live examples.
>>
>> On Tue, Sep 7, 2010 at 10:31 AM, Bradley Hintze
>>  wrote:
>>> It seems as if this is the only solution but after a week of trying to
>>> implement it in a variety of ways it won't work. is there something I
>>> need to download (jquery)? More helpful would be a real HTML page as
>>> an example or a live example on the web. I am sorry for the trouble
>>> but I'd like to understand this and get it working.
>>>
>>> On Tue, Aug 31, 2010 at 7:37 PM, Alec Shaner 
>>> wrote:
 $.getJSON should be embedded in your initial Page Wait response page.
 The
 first argument isn't a view, rather a URL. So you might want to use the
 django url template tag, e.g.,
 $.getJSON('{% url whatever.run_DHM %}', ...)
 The second argument is a callback function. The browser stores the
 callback
 and subsequently calls it when the url requested returns a response. It
 also
 might be confusing because the function is defined inline (anonymous),
 which
 is a frequent shortcut used in javascript. But anyway, when the callback
 function executes he just put console.log(result.data) as way to see
 what
 gets returned.
  You say you want to send the user to another page with the results, but
 you
 could return a rendered chunk of html code and replace the Please Wait
 message using jquery to mainupulate the DOM (jquery documentation has
 tutorials). Or if you want to redirect to a new page you could store the
 calculation results in the session and redirect to a view that pulls
 from
 that same session data (or use memcached). So maybe instead of
 console.log(result.data), you could
 use window.location="/some/url/to/show/calculations/";
 His example returns a HttpResponse just to illustrate the concept of how
 to
 return JSON data. You don't have to return JSON, but it's a good method
 if
 you want to return structured data. In the above example of a redirect
 you
 could just return anything I suppose, i.e., just an 'OK'.

 On Tue, Aug 31, 2010 at 5:11 PM, Bradley Hintze
  wrote:
> Ok, I'll try to elaborate. again java is foreign to me although I've
> spent all day trying to learn some.
>  Here's the code:
>
> def please_wait(request):
>   # ... setup context or something
>   return render_to_response("please_wait.html")
>
> def run_DHM(request)
>   # ... perform calculations and collect the result in a dict
>   data = {"result": something}
>   return HttpResponse(json.dumps(data), mimetype="application/json")
>
>
> # using jquery in your html
> 
> $.getJSON("/run_DHM/", function(data) {
>   // do something with result
>   console.log(data.result);
> });
> 
>
> def run_DHM(request) is straight forward then it falls apart.
>
> $.getJSON("/run_DHM/", function(data) {
>   // do something with result
>   console.log(data.result);
> });
>
> I presume that '$.getJSON("/run_DHM/", function(data)' somehow runs
> the run_DHM function? How can it even find the function since it lives
> in view.py? '// do something with result' I want to send another
> page to the client with the results but do I do this here? If not,
> what do I do here? What does 'console.log(data.result);' do? Why does
> def run_DHM(request) return a HttpResponse? I have a template I want
> it to retur

Re: Django v1.1

2010-09-17 Thread Piotr Zalewa
 Hi Robbington.

I'd suggest to use virtualenv and keep to use *only* pip
that way only you have the power to change anything
to update Django to a version above 1.2 simply
pip -E your_virtual_environment install Django>=1.2

zalun

On 09/17/10 13:02, Robbington wrote:
> Hey,
>
> I keep getting this annoying problem that when I download and install
> a new django package, say django-registration it reverts django from
> version 1.2 to 1.1... Is there anyway to avoid this as it messes up my
> databases each time for each django project I am running.
>
> I've used a variety of methods for getting these packages,
> easy_install, aptitude install, pip install all of the seem to do it..
>
> And does any one know the best way to upgrade django back to version
> 1.2, do I have to delete it and start again?
>
> Thanks
>
> Rob
>


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: [Announcement] Vim for Python and Django

2010-09-26 Thread Piotr Zalewa
 Hi Antoni,

Thanks for that!

zalun

On 09/26/10 10:36, Antoni Aloy wrote:
> Hello all!
>
> In this list we have a recurrent thread: "What'ts the best IDE for
> Django and Python development?" trespams-vim is my try to answer this
> question for people who likes to have a very powerful editor and needs
> to have an editor which is able to run in the desktop as well as in a
> remote session. I have updated the previous version with delimMate and
> easytags, so actually you'll find:
>
> * Syntax highlight
> * Python autocompletion
> * Smart tabbing
> * Templates for Python, Django, js, html, ... (just try to edit a
> python file and press sbu + tab as an example)
> * Add/remove comments on multiple lines
> * Tabs
> * Surround
> * marks
>
> etc. etc. :
>
> This is a list of my favorite shortcuts
>
> http://code.google.com/p/trespams-vim/wiki/readme
>
> So, you'll find a collection of plugins and .vimrc settings that I
> have found very useful in my day-by-day work in Python and Django.
>
> http://code.google.com/p/trespams-vim/
>
> Happy coding!
>


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Piotr Zalewa
 On 09/27/10 09:57, Thomas Weholt wrote:
> On Mon, Sep 27, 2010 at 10:38 AM, bruno desthuilliers
>  wrote:
>> Using the package's __init__.py as a facade is certainly not "hackish"
>> - it's one of - if not the main - the raison d'être of this file.
>>
>> Now if your app is really growing that big, it's probably time to
>> refactor it into a set of related, more specialized apps. It's not as
>> easy as just splitting the models / views / whatever as sub-packages
>> of a same app, and doing so afterward will probably be more painful
>> than designing it right from the start, but in both cases it has the
>> benefit that it forces you to think about dependancies management,
>> which can greatly helps when it comes to maintainance.
> Ok, I see your point, but still -  there`s nothing about this in the
> main django documentation as far as I know. The docs should have a
> section about organizing projects where the standard models.py and
> views.py doesn`t fit anymore.
>

It's not there as it's a plain Python feature. Please read about it on
Python site here - http://docs.python.org/tutorial/modules.html#packages.

I've no idea if there are links to Python docs in the first djangobook
chapter or on the Django's Introduction page.
If such feature should be explained on Django docs, every other Python
feature should be there as well.

We come to this pretty often in MooTools community - it has to clearly
be said that framework is just extending the language.

Regards
Piotr Zalewa

-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: [Announcement] Vim for Python and Django

2010-10-01 Thread Piotr Zalewa
 It is great and I'm using it - I was using minibuf before, but somehow
your config convinced me to use NerdTree.
One question thought - I'd like to have the 80+ characters highlighted
somehow.
I found this:
http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns
but I guess it's not working in multicolumn or is overwritten  by
highlighting.
Do you have any solution to that?

Thanks
zalun
On 09/26/10 10:36, Antoni Aloy wrote:
> Hello all!
>
> In this list we have a recurrent thread: "What'ts the best IDE for
> Django and Python development?" trespams-vim is my try to answer this
> question for people who likes to have a very powerful editor and needs
> to have an editor which is able to run in the desktop as well as in a
> remote session. I have updated the previous version with delimMate and
> easytags, so actually you'll find:
>
> * Syntax highlight
> * Python autocompletion
> * Smart tabbing
> * Templates for Python, Django, js, html, ... (just try to edit a
> python file and press sbu + tab as an example)
> * Add/remove comments on multiple lines
> * Tabs
> * Surround
> * marks
>
> etc. etc. :
>
> This is a list of my favorite shortcuts
>
> http://code.google.com/p/trespams-vim/wiki/readme
>
> So, you'll find a collection of plugins and .vimrc settings that I
> have found very useful in my day-by-day work in Python and Django.
>
> http://code.google.com/p/trespams-vim/
>
> Happy coding!
>


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: [Announcement] Vim for Python and Django

2010-10-01 Thread Piotr Zalewa
 Answering to ,yself...

Just installed vim 7.3 colorcolumn=80 is perfect for that

zalun
On 10/01/10 17:40, Piotr Zalewa wrote:
>  It is great and I'm using it - I was using minibuf before, but somehow
> your config convinced me to use NerdTree.
> One question thought - I'd like to have the 80+ characters highlighted
> somehow.
> I found this:
> http://stackoverflow.com/questions/235439/vim-80-column-layout-concerns
> but I guess it's not working in multicolumn or is overwritten  by
> highlighting.
> Do you have any solution to that?
>
> Thanks
> zalun
> On 09/26/10 10:36, Antoni Aloy wrote:
>> Hello all!
>>
>> In this list we have a recurrent thread: "What'ts the best IDE for
>> Django and Python development?" trespams-vim is my try to answer this
>> question for people who likes to have a very powerful editor and needs
>> to have an editor which is able to run in the desktop as well as in a
>> remote session. I have updated the previous version with delimMate and
>> easytags, so actually you'll find:
>>
>> * Syntax highlight
>> * Python autocompletion
>> * Smart tabbing
>> * Templates for Python, Django, js, html, ... (just try to edit a
>> python file and press sbu + tab as an example)
>> * Add/remove comments on multiple lines
>> * Tabs
>> * Surround
>> * marks
>>
>> etc. etc. :
>>
>> This is a list of my favorite shortcuts
>>
>> http://code.google.com/p/trespams-vim/wiki/readme
>>
>> So, you'll find a collection of plugins and .vimrc settings that I
>> have found very useful in my day-by-day work in Python and Django.
>>
>> http://code.google.com/p/trespams-vim/
>>
>> Happy coding!
>>
>


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 structure and git as VCS

2010-10-07 Thread Piotr Zalewa
 Hi,

I'm working on defining the structure of an application
It will have quite a few apps, with few of them opensourced.

I was thinking how to make it easier for people involved into the project.
In essence front-end developer should work on one repository only -
that's also goes quite nicely with app portability and would also help
if an idea about whitelabelling the project could come to someone's mind.
Other apps will be installed via pip under the virtual environment and
will be a separate repositories in git.
Back-end devs then will work each one on the application back-end and on
the front-end application, to provide some changes to the functionality.

Basically:
project - one repository
front-end app - one repository
apps - a repository for each one.

I'd like to implement a slightly modified V.Dressen's model of the
workflow - in draft explained here:
https://wiki.mozilla.org/Labs/Jetpack/FlightDeck/Code_Workflow on each
of the repositories

Do you think it's best structure?
And, quite important, will it not look like a mess for an "average"
developer?

Piotr

-- 
blog  http://piotr.zalewa.info
jobs  http://builder.mozillalabs.com, http://jsfiddle.net
twit  http://twitter.com/zalun


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 structure and git as VCS

2010-10-07 Thread Piotr Zalewa
Thanks Brian,

It looks like it will manage the git repositories for me. It might be a
good idea, but I think I'll keep it it "custom" build. I (wishful
thinking) don't use Apache, etc.

On 10/07/10 13:56, Brian Bouterse wrote:
> Maybe not an exact answer to your question, but we do something kind of
> similar to what you are describing.  Basically, we have app authors
> (both frontend and backend) work with their app in their own repo and
> publish them into this repository <https://apps.opus.ncsu.edu/>.  Then
> we use Opus <http://github.com/bmbouter/opus> to deploy them onto our
> servers since it is connected to the app repository where their apps are
> published Opus provides a self service deployment interface.  You can
> even test your deployments on our sandbox servers
> <https://sandbox.opus.ncsu.edu/>.
> 
> Brian
> 
> On Thu, Oct 7, 2010 at 8:25 AM, Piotr Zalewa  <mailto:zal...@gmail.com>> wrote:
> 
>  Hi,
> 
> I'm working on defining the structure of an application
> It will have quite a few apps, with few of them opensourced.
> 
> I was thinking how to make it easier for people involved into the
> project.
> In essence front-end developer should work on one repository only -
> that's also goes quite nicely with app portability and would also help
> if an idea about whitelabelling the project could come to someone's
> mind.
> Other apps will be installed via pip under the virtual environment and
> will be a separate repositories in git.
> Back-end devs then will work each one on the application back-end and on
> the front-end application, to provide some changes to the functionality.
> 
> Basically:
> project - one repository
> front-end app - one repository
> apps - a repository for each one.
> 
> I'd like to implement a slightly modified V.Dressen's model of the
> workflow - in draft explained here:
> https://wiki.mozilla.org/Labs/Jetpack/FlightDeck/Code_Workflow on each
> of the repositories
> 
> Do you think it's best structure?
> And, quite important, will it not look like a mess for an "average"
> developer?
> 
> Piotr
> 
> --
> blog  http://piotr.zalewa.info
> jobs  http://builder.mozillalabs.com, http://jsfiddle.net
> twit  http://twitter.com/zalun
> 
> 
> --
> 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
> <mailto:django-users@googlegroups.com>.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> <mailto:django-users%2bunsubscr...@googlegroups.com>.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> -- 
> Brian Bouterse
> ITng Services
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-us...@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.


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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 with http basic authentication

2010-10-13 Thread Piotr Zalewa

 Althought it is true, there are ways to get this data to Django.
Check this (after a simple google search):
http://stackoverflow.com/questions/152248/can-i-use-http-basic-authentication-with-django

zalun

http://jsfiddle.net/user/zalun/

On 10-10-13 01:38, Sam Lai wrote:

On 12 October 2010 22:29, Morten Pedersen  wrote:

Hi everyone
I would be very very gratefull for any help getting access to the basic http 
user and password through Django.

As far as I know, HTTP Basic Authentication occurs at the HTTP
connection level, i.e. it is between the web server and browser. There
is no way for Django to access that.

What usually happens is people use 'forms authentication' instead.
Django has a built-in authentication app - see
http://docs.djangoproject.com/en/dev/topics/auth/


A simple app that print out the password an user to the browser would really 
help me very very much.

Cheers
Morten Pedersen
Denmark

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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.





--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: problems using apps in main project (NameErrors)

2010-10-27 Thread Piotr Zalewa
Hi

If you want to have the apps in apps folder you need to put them on the
python path, so eithor modify the python path environment variable or
(prefered) modify manage.py and add
site.addsitedir(path('apps'))

zalun

On 10/27/10 14:50, wawa wawawa wrote:
> Hi All,
> 
> I've spent the last hour or so looking for a clear and simple
> explanation to this but I've been unsuccessful. Maybe someone here could
> help me (please!)
> 
> What do I need to do to make sure my created apps are useable?
> 
> This is the structure of my "XMLmunger" project.
> 
> In order to simplify my project I want to use different apps for the
> major functional bits of the project. First stop is the "upload"
> application.
> I cannot figure out why my upload app is not being recognised by django.
> Note, at the moment I'm only using views / urls and templates. No models
> at all.
>  
> 
> ├── apps
> │   ├── __init__.py (empty)
> │   └── upload
> │   ├── __init__.py (empty)
> │   ├── urls.py
> │   └── views.py
> ├── __init__.py (empty)
> ├── manage.py
> ├── public
> │   └── static (css, js and images)
> ├── settings.py
> ├── templates
> │   └── (all of my templates)
> ├── urls.py
> └── views.py
> 
>  - In my /settings.py I added "upload" to "INSTALLED_APPS".
>  - In my apps directory I have __init__.py (empty) to allow all sub dirs
> to be imported as modules.
>  - I would like to pass all urls for an app to the urls.py in that app
> directory:  (r"^/upload$", include('upload.urls'))
> 
> Now the dev server won't start, complaining:
> 
>>python manage.py runserver 
> Error: No module named upload
> 
> OK. Let's change "upload" to "apps.upload" in INSTALLED_APPS.
> 
> Now the dev server starts but any page I try to go to gives: NameError
> at / "name 'apps' is not defined".
> 
> I have a feeling I'm missing something very obvious but everything
> djangoesque is still forming in my mind and I'm really not sure where
> the problem is.
> 
> I've been trying "from XMLMunger.view import *" in my root urls.py
> without success. I am thinking that I do need to import but I'm just not
> sure where and what...
> 
> Thanks in advance...
> 
> W
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-us...@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.


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: problems using apps in main project (NameErrors)

2010-10-27 Thread Piotr Zalewa
just add before code:
import site
:)

On 10/27/10 15:13, wawa wawawa wrote:
> Hi Piotr,
> 
> On 27 October 2010 15:54, Piotr Zalewa  wrote:
>> If you want to have the apps in apps folder you need to put them on the
>> python path, so eithor modify the python path environment variable or
>> (prefered) modify manage.py and add
>> site.addsitedir(path('apps'))
> 
> Many thanks for the response.
> 
> A question: I presume this only matters for the dev server then?
> 
> I added this just before "execute_manager(settings)"
> 
> $ python manage.py runserver
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
> site.addsitedir(path('apps'))
> NameError: name 'site' is not defined
> 
> Apologies if I'm being very stupid!
> 
> Thanks
> 
> W
> 
> 
>> zalun
>>
>> On 10/27/10 14:50, wawa wawawa wrote:
>>> Hi All,
>>>
>>> I've spent the last hour or so looking for a clear and simple
>>> explanation to this but I've been unsuccessful. Maybe someone here could
>>> help me (please!)
>>>
>>> What do I need to do to make sure my created apps are useable?
>>>
>>> This is the structure of my "XMLmunger" project.
>>>
>>> In order to simplify my project I want to use different apps for the
>>> major functional bits of the project. First stop is the "upload"
>>> application.
>>> I cannot figure out why my upload app is not being recognised by django.
>>> Note, at the moment I'm only using views / urls and templates. No models
>>> at all.
>>>
>>> 
>>> ├── apps
>>> │   ├── __init__.py (empty)
>>> │   └── upload
>>> │   ├── __init__.py (empty)
>>> │   ├── urls.py
>>> │   └── views.py
>>> ├── __init__.py (empty)
>>> ├── manage.py
>>> ├── public
>>> │   └── static (css, js and images)
>>> ├── settings.py
>>> ├── templates
>>> │   └── (all of my templates)
>>> ├── urls.py
>>> └── views.py
>>>
>>>  - In my /settings.py I added "upload" to "INSTALLED_APPS".
>>>  - In my apps directory I have __init__.py (empty) to allow all sub dirs
>>> to be imported as modules.
>>>  - I would like to pass all urls for an app to the urls.py in that app
>>> directory:  (r"^/upload$", include('upload.urls'))
>>>
>>> Now the dev server won't start, complaining:
>>>
>>>> python manage.py runserver
>>> Error: No module named upload
>>>
>>> OK. Let's change "upload" to "apps.upload" in INSTALLED_APPS.
>>>
>>> Now the dev server starts but any page I try to go to gives: NameError
>>> at / "name 'apps' is not defined".
>>>
>>> I have a feeling I'm missing something very obvious but everything
>>> djangoesque is still forming in my mind and I'm really not sure where
>>> the problem is.
>>>
>>> I've been trying "from XMLMunger.view import *" in my root urls.py
>>> without success. I am thinking that I do need to import but I'm just not
>>> sure where and what...
>>>
>>> Thanks in advance...
>>>
>>> W
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-us...@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.
>>
>>
>> --
>> blog  http://piotr.zalewa.info
>> jobs  http://webdev.zalewa.info
>> twit  http://twitter.com/zalun
>> face  http://facebook.com/zaloon
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-us...@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.
>>
>>
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Installing Django on Ubuntu

2010-11-15 Thread Piotr Zalewa
On 11/15/10 08:54, kelp wrote:
> Hello,
> So I have downloaded Django and put the folder into my /home/username/
> directory, and I ran setup.py. I played with Django a little bit, but
> it turns out that I haven't actually been using the newest, stable
> version of Django (1.2.3), but I have been using 1.1. The django I
> have been using appears to be located in this directory:
> /usr/lib/pymodules/python2.6/django
> Can i just delete this directory and paste the django directory from
> the 1.2.3 version into the python2.6 directory? Will everything be
> fine and dandy?
> 

try start from using the mkvirtualenv
it will help you now and in the future
there is no need for a machine wide django installation

I'm writing these commands from the memory, please correct if needed

as root do:
$> easy_install pip
$> pip install virtualenv
$> pip install mkvirtualenv

then for general working with django you can
$> mkvirtualenv django --no-site-packages
it will create a clean virtual environment with python installed
it will also switch it on, so your prompt will have it's name
install django with
(django)$> pip install Django
you'd need to install other packages if you need them

if you want to switch to this environment in different terminal simply
$> workon django
(django) $>

to switch off the environment:
(django) $> deactivate
$>

it is good because you may have a lot of these, you may test newer
django versions without installing it for the whole computer. you may
also (and that's the best part) have the separate virtual environment
for every project.

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Installing Django on Ubuntu

2010-11-15 Thread Piotr Zalewa
On 11/15/10 14:41, Flaviu Simihaian wrote:
> zalun,
> 
> I thought to get mkvirtualenv you have to install the
> virtualenvwrapper shell commands:
> 
> $ pip install virtualenvwrapper
> $ export WORKON_HOME=~/VirtualEnvs
> $ mkdir -p $WORKON_HOME
> $ source /usr/local/bin/virtualenvwrapper.sh
> 
> and then you can use it:
> $ mkvirtualenv django --no-site-packages
> 
> I'm just following Doug Hellmann's installation guide:
> http://www.doughellmann.com/docs/virtualenvwrapper/
> 
> 
> Flaviu
> 
Indeed - totally forgotten about the wrapper installataion and
configuration - thanks

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: VIM as Modern Python/Dajngo IDE

2012-02-06 Thread Piotr Zalewa
Good work with adding explanations to what plugins are doing, I'm too 
often just add plugins.


It might be worth to put your setup (basically .vim directory) on 
github. I did so with mine, but it's a bit bloated 
(https://github.com/zalun/vimSetup)


I advice to use pathogen plugin and keep all submodules in "bundle" dir. 
It's de facto standard in vim configs.


zalun

On 02/04/12 20:49, David Markey wrote:

It looks like most of this could be scripted to be made automatic..

On 4 February 2012 19:31, yati sagade mailto:yati.sag...@gmail.com>> wrote:

Seriously dude, I think you should go about making a video of this.


On Sun, Feb 5, 2012 at 12:56 AM, Vikas Ruhil mailto:vikasruhi...@gmail.com>> wrote:


Now working on graphics and how use all this content efficiently
,try to make graphics those can give basic to advance
understanding to the Python/Django users.Really Good response
this post is breaking records for m .Keep Switch there More are
coming

On Sun, Feb 5, 2012 at 12:29 AM, yati sagade
mailto:yati.sag...@gmail.com>> wrote:

Hi Vikash
Appreciate the heads up! Why don't you share this link on G+
and other social media - Even I'll share with my friends - I
haven't tried all of it yet, but it looks good. kudos man,
Good Job! Keep it up :)

Yati Sagade

On Sat, Feb 4, 2012 at 5:33 PM, Vikas Ruhil
mailto:vikasruhi...@gmail.com>> wrote:

I write a Blog about VIM as a Python/Dajngo Modern IDE
.There are about 15 Plugin and config of there is on
post . I am looking for plugin suggestion for more .

Also for newbie and Non-vim user's there is request  to
checkout the post.Those Guys who ask what IDE should
they need use or Which is Best IDE for Python/Django.


http://learnhackstuff.blogspot.in/2012/02/vim-as-universal-idepart-1.html

Regards
Vikash Ruhil

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




--
Yati Sagade

(@yati_itay )


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




Regards
Vikash Ruhil

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




--
Yati Sagade

(@yati_itay )


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

Re: Django REST

2012-03-04 Thread Piotr Zalewa

On 03/04/12 20:06, Daniel Hilton wrote:

On 4 March 2012 18:35, Jani Tiainen  wrote:

I've been very happy with django-rest-framework.

I think there exists at least django-piston to do the same.


The other one to look at is django-tastypie - I've used it twice now
in anger and been really happy with it plus the rate of development /
improvement I've seen.

Cheers,
Dan



I'm writing REST with tastypie right now. I do like the way it is done. 
Community on IRC is very responsive, docs are good, examples and such.




And you can write it also "manually". Since REST is just architectural
specification and doesn't involve any special magic.

On Sun, Mar 4, 2012 at 8:13 PM, Bharath Mundlapudi
wrote:


Dear Django Users and Authors,

I am wondering if there are any best practices or better way to write REST
based apps on top of Django. I was using version 1.1 and not followed recent
advancements. Can you kindly point me to links or references from your
experience.

Preferably out-of-the-box solutions.

-Bharath

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



--

Jani Tiainen

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






--
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: Anyone using a javascript MVC on top of Django?

2012-04-17 Thread Piotr Zalewa
We use a very new framework called Shipyard 
https://github.com/seanmonstar/shipyard at Mozilla to build 
http://builder.addons.mozilla.org/. The goal is to have a nice framework 
working well with Django. MooTools style (classes etc.).


A lot of requests on dev site, one file per project on production

zalun

On 04/18/12 02:13, br wrote:

We have an extremely javascript&  ajax heavy application.  To put it
one way, we have blatently disregarded graceful degradation in order
to build the type of application we want to build.  We're finding that
as the thing grows, the interactions between the front end javascript
and django are becoming more and more painful, mostly due to the
contortion we have to put django through to make it work with our
design philosophy.   (examples: tons of dynamic list filtering,
tagging, object cloning, saving state across multi-page forms, etc.).
This isn't a post to criticize Django, I love it.  Nor am I inviting a
critique of the way we build software.  I'm just looking for a way to
make Django work better for us and am considering switching to a model
where we use a javascript MVC on top of Django, with JSON bridging the
in-between.  We probably should have gone that route to begin with.
Has anyone had good success with any of them?  Backbone.js seems to be
the most popular.  Although, based on this:
http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/
I may check out ember.js.

Thanks,

Ben



--
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: Dynamic parameters in django URLs

2011-09-29 Thread Piotr Zalewa

On 09/29/11 11:36, Dejan Noveski wrote:

Hi,

I want to add dynamic urls to my site for faceting purposes. E.g:
/(type)/(subtype)/(category)/
But I also want something like this to work: /(type)/(subtype)/ or
/(type)/(category)/ or /(subtype)/(category)/ or just /(category)/ |
/(type)/ | /(subtype)/


If category or type would be always different in a special way (in.e. 
category starts is always 5 characters and subtype is never 5 characters 
long) then it is possible.


I'd suggest to use:

/type/(type)/category/(category)/ etc.
certainly it might be
/t/(type)/c/(category)/
but I like the former better



Is there any clean way of doing this without declaring each possible
combination of url params?

Thanks

--
--
Dejan Noveski


--
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 tests. where to create users

2011-11-29 Thread Piotr Zalewa

I use all solutions, depending on the needs.

When I'm testing a usage of many objects I use fixtures (also with users 
as I'm "pretending" that users created them)


When there is a test involving a user I create this object, either in 
test or the setUp.


On 11/28/11 01:58, Gelonida N wrote:

Hi,

I'd like to run some django tests, which use the test client and which
should check, that certain users can only access certain contents.

Where would you create this users / passwords.
- With a fixture
- as part of a test class in the SetUp section and tear
  it down afterwards?


There is no need to remove them
Just create a user in setUp if you need it for all tests, if for a part 
of the tests only - create 2 test classes and create a user in one of 
them only



- create a custom test runner with a setup phase ?


I've got it as well - I don't create users there, but I've got a few 
other methods which are useful for more than one app.



Is there any other recommended code section, which could do the setup
prior to running tests.

Ideally I'd like to avoid fixtures.


Is there a reason?


Of course I could create a script to generate certain fixtures and run
only then the tests, but I'd prefer, the user data is created ad part of
the test procedure.


zalun

--
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 south and new installed app how to?

2011-12-20 Thread Piotr Zalewa

Explained here: http://south.aeracode.org/docs/commands.html#schemamigration


On 12/15/11 15:58, Gijsbert de Haan wrote:

Hi,
I have an existing django project with south enabled using buildout. Now
I want to add a new egg to get and install another django application
for my project, this new application needs models, and thus needs tables
to be created.
My question: is it possible to have these tables created via South? That
way my current deployment system, which uses South migrations to do
database schema changes, could also handle this new application.
I have tried to run manage.py schemamigrate newapp and migrate (newapp)
but that creates files in the eggs directory, which I prefer not to add
to my source control system.
Any advice on how to do this properly?
Thanks,
Gijsbert

--
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/-/ZewQKq1UiE8J.
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: User Profile Creation

2011-12-20 Thread Piotr Zalewa

You can't do it in admin site without tinkering.
If you create users inside a view (i.e. during the registration 
process), there is no need to use signals - you can simply create a 
profile with data from registration form.


If you use django forms, use them with prefix kwarg, this will allow to 
simply divide request to User and Profile fields.


https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms

zalun

On 12/15/11 22:46, bazaarsoft wrote:

In all the examples I've seen of creating the user profile at the time
a User is created, I always see the use of the signal and the profile
table's fields (except for user) have to be nullable. I don't see a
way to break in to the creation process using the signal scheme such
that you can pass in valid data for initial creation. I have all the
form elements for both the User object an my profile object - I just
can't get them to my version of the create_profile method.

Is this correct - a user profile can't have any required fields
(required in the model) except user because the only way to create it
is through the signal?



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

2012-01-05 Thread Piotr Zalewa

Please attach the index.html - there might be an unknown unicode character

zalun

On 01/05/12 12:18, Hassan wrote:

Dear ALL,

i am trying to do render_to_response('index.html') , and i keep geting
this dont know why ? its a normal html page ??!! what to do ?


UnicodeDecodeError at /
'utf8' codec can't decode byte 0x93 in position 3197: invalid start
byte
Request Method: GET
Request URL:http://127.0.0.1:8000/
Django Version: 1.3.1
Exception Type: UnicodeDecodeError
Exception Value:
'utf8' codec can't decode byte 0x93 in position 3197: invalid start
byte
Exception Location: c:\python27\lib\encodings\utf_8.py in decode, line
16
Python Executable:  c:\python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\\global',
  'c:\\python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\django_blog_zinnia-0.8.1-
py2.7.egg',
  'c:\\python27\\lib\\site-packages\\beautifulsoup-3.2.0-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\django_xmlrpc-0.1.3-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\django_tagging-0.3.1-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\django_mptt-0.5.2-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\pyparsing-1.5.6-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\akismet-0.2.0-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\south-0.7.3-py2.7.egg',
  'c:\\python27\\lib\\site-packages\\django_oembed-0.1.1-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',
  'c:\\python27\\lib\\site-packages\\win32',
  'c:\\python27\\lib\\site-packages\\win32\\lib',
  'c:\\python27\\lib\\site-packages\\Pythonwin']
Server time:Thu, 5 Jan 2012 06:11:04 +0200



--
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 register JS event handler

2011-05-18 Thread Piotr Zalewa

Make the JS code a callable function
Include JS in pages you want to use it
Create a small template in which you will call the function with these 
values.

Include it in templates you need such a thing


On 05/18/11 09:44, Thomas Guettler wrote:

On 17.05.2011 13:18, Michal Petrucha wrote:

On Tue, May 17, 2011 at 12:34:05PM +0200, Thomas Guettler wrote:

Hi,

I want to register some jquery event handler for some widgets of a form 
(FooForm). The
form gets used in several views.

It would be a pain to insert $(function(){...}) in every page which uses this 
form.

The Media Form objects only handles links to JS files.

Any hints how to insert the js/jquery lines in every page which uses FooForm?

   Thomas

Why not create a separate js file that you'll include in relevant
pages? Yes, you'll have one small js file but it will probably be less
painful than trying to hack this around in some way.

Unfortunately there is a dynamic value, which I want to pass to a jquery method.

If I only use static js files, I would need to store the value somewhere in
a hidden field.

   Thomas




--
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: installing django

2011-05-24 Thread Piotr Zalewa

On 05/24/11 07:40, bh.hoseini wrote:

hi there,
i installed django on vista, but i don't know how to combine it with
python, i read installation guide but it wasn't ussefull! :

I had some troubles install Django on Win7
In the end I used cygwin - it worked fine, although it's not clean Win.
I removed Windows anyway.

zalun

--
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: Our new startup site build on Django and GAE is now live!

2011-06-03 Thread Piotr Zalewa

+1k - just wanted to write the same message

On 06/03/11 14:39, Rob wrote:

I spent a few seconds looking for the X to close the sign up panel
before
seeing this:

"LOCQL is a social Q&A service, so we need you to sign in instead of
browse anonymously."

But I *always* browse anonymously first to see if a site is something
I want to use and/or trust with any info about me; if I like it I
will sign up.

I'd like to provide feedback but the first thing you want me to do,
before even looking at the site, is give you my facebook info?
Ummm ... no.  So the only feedback I have is get rid of that "*we're*
social so *you* have to share" attitude.

Rob.

On Jun 2, 3:02 am, maverick  wrote:

We build a pretty cool website LOCQL (www.LOCQL.com) purely on Django
and run on GAE has just went live!

I would say development with Django is purely enjoyable experience,
however the Google Apps Engine does bring us some headache esp. we are
a location based service, the geo-location related search is a
challenge for us.

I would like everyone who use Django to give us a try and feedback are
warmly welcome!




--
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: Seeking a Django 1.3 and syslog configuration example

2011-06-03 Thread Piotr Zalewa

In Add-ons Builder I've got something like this in log_settings.py

https://github.com/mozilla/FlightDeck/blob/master/log_settings.py

'handlers': {
'syslog': {
'()': logging.handlers.SysLogHandler,
'facility': logging.handlers.SysLogHandler.LOG_LOCAL7,
'formatter': 'prod',
},
}

It depends on the commonware, but I guess it's nothing there regarding 
logging to the SysLog

https://github.com/jsocol/commonware/

Good luck
zalun

On 06/03/11 16:02, Rob wrote:

Thanks, but this doesn't help at all.  I have no problem getting the
RotatingFileHandler working, it is documented albeit poorly, but the
SysLogHandler isn't documented at all and doesn't work the same way.

The SysLogHandler actually has to connect to syslogd and log to a
syslog facility (eg. LOG_USER or LOG_LOCAL0).  How do I configure
those
options?

Rob.

On Jun 1, 12:41 pm, Shawn Milochik  wrote:

This should help out. It's for a file, not SysLogHandler, but the idea
is the same.

Just take any arguments you would normally pass to the handler if you
were creating it programmatically and add them as keys to the dictionary:

  'log_file': {
  'level': 'DEBUG',
  'class': 'logging.handlers.RotatingFileHandler',
  'filename': '/tmp/myfilename.log',
  'formatter': 'verbose',
  'backupCount': 50,
  'maxBytes': 2 ** 20,
  },

As demonstrated here, filename, backupCount, and maxBytes (used by the
RotatingFileHandler but not in Django's default logging dict) were just
added and given values. Do the same for SysLogHandler parameters and it
should work.

I had the same difficulty you were having in figuring this out; we
should update the documentation to mention this. I'll open a ticket.

Shawn




--
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: Social Networking basics? -Raj

2011-06-21 Thread Piotr Zalewa

Do we have a group FAQ?

On 06/20/11 22:44, Cal Leeming [Simplicity Media Ltd] wrote:

On Mon, Jun 20, 2011 at 10:32 PM, Shawn Milochik mailto:sh...@milochik.com>> wrote:

Is it just me or are we having a sudden spurt of e-mail that goes
like this:

Q: How do I 
A: You do X.

Q: How do I do X?
A: You use Y.

Q: How do I use Y?


Yup, I was just thinking the same thing.


I'm convinced that these people are either trolls or inherently
"un-helpable," unless you want to write their code for them.

In either case I think the only sane response is to completely
ignore these people as soon as this pattern emerges, because it's an
utter waste of the time we could be using to help others -- the
reason we're on this list in the first place.

Also, ignoring them is probably the only way to discourage repeat
offences.


+1, sound like a sane plan.


Shawn

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


--
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-profile with django registration ?

2011-06-21 Thread Piotr Zalewa

On 06/21/11 14:15, Satyajit Sarangi wrote:

https://bitbucket.org/ubernostrum/django-registration This is what I
am using for user registration . Once , I log in the user is not able
to get into the userprofile page .

Thus I installed this https://bitbucket.org/ubernostrum/django-profiles/
for user profile .


Recent commits were done 2 years ago.
Which version of Django do you use?



Now , this produces a conflict in urls.py and also settings.py file .


Would you provide any errors?


How to resolve it . What changes needs to be done with urls.py and
settings.py so that , when a user logs in , he/she is redirected to
the profile page .


How your current urls.py and settings.py do look like?
Please use some dpaste or similar sites.

zalun


--
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-profile with django registration ?

2011-06-21 Thread Piotr Zalewa

In urls.py you've got:
   url(r'^accounts/', include('registration.urls')),

and later:
(r'^accounts/', include('userprofile.urls')),

/me is no expert, but that smells like asking for trouble.

zalun


On 06/21/11 14:48, Satyajit Sarangi wrote:

I am using 1.3
This is my settings.py
http://dpaste.com/556954/

This is my urls.py
http://dpaste.com/556955/

On Tue, Jun 21, 2011 at 7:14 PM, Piotr Zalewa mailto:zal...@gmail.com>> wrote:

On 06/21/11 14:15, Satyajit Sarangi wrote:

https://bitbucket.org/__ubernostrum/django-__registration
<https://bitbucket.org/ubernostrum/django-registration> This is
what I
am using for user registration . Once , I log in the user is not
able
to get into the userprofile page .

Thus I installed this
https://bitbucket.org/__ubernostrum/django-profiles/
<https://bitbucket.org/ubernostrum/django-profiles/>
for user profile .


Recent commits were done 2 years ago.
Which version of Django do you use?



Now , this produces a conflict in urls.py and also settings.py
file .


Would you provide any errors?


How to resolve it . What changes needs to be done with urls.py and
settings.py so that , when a user logs in , he/she is redirected to
the profile page .


How your current urls.py and settings.py do look like?
Please use some dpaste or similar sites.

zalun


--
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
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscribe@__googlegroups.com
<mailto: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>.




--
_Satyajit Sarangi_

--
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-profile with django registration ?

2011-06-21 Thread Piotr Zalewa

On 06/21/11 15:27, Satyajit Sarangi wrote:

Yes I know thats the problem . But , want to know whats the way out .


Theway out is to read documentation:
https://docs.djangoproject.com/en/1.3/
especially
https://docs.djangoproject.com/en/1.3/topics/http/urls/

zalun



On Tue, Jun 21, 2011 at 7:52 PM, Piotr Zalewa mailto:zal...@gmail.com>> wrote:

In urls.py you've got:
   url(r'^accounts/', include('registration.urls')),

and later:
(r'^accounts/', include('userprofile.urls')),

/me is no expert, but that smells like asking for trouble.

zalun



On 06/21/11 14:48, Satyajit Sarangi wrote:

I am using 1.3
This is my settings.py
http://dpaste.com/556954/

This is my urls.py
http://dpaste.com/556955/

    On Tue, Jun 21, 2011 at 7:14 PM, Piotr Zalewa mailto:zal...@gmail.com>
<mailto:zal...@gmail.com <mailto:zal...@gmail.com>>> wrote:

On 06/21/11 14:15, Satyajit Sarangi wrote:

https://bitbucket.org/ubernostrum/django-registration
<https://bitbucket.org/__ubernostrum/django-__registration>
<https://bitbucket.org/__ubernostrum/django-__registration
<https://bitbucket.org/ubernostrum/django-registration>> This is
what I
am using for user registration . Once , I log in the
user is not
able
to get into the userprofile page .

Thus I installed this
https://bitbucket.org/ubernostrum/django-profiles/
<https://bitbucket.org/__ubernostrum/django-profiles/>
<https://bitbucket.org/__ubernostrum/django-profiles/
<https://bitbucket.org/ubernostrum/django-profiles/>>
for user profile .


Recent commits were done 2 years ago.
Which version of Django do you use?



Now , this produces a conflict in urls.py and also
settings.py
file .


Would you provide any errors?


How to resolve it . What changes needs to be done with
urls.py and
settings.py so that , when a user logs in , he/she is
redirected to
the profile page .


How your current urls.py and settings.py do look like?
Please use some dpaste or similar sites.

zalun


--
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 <mailto:django-users@googlegroups.com>
<mailto:django-users@__googlegroups.com
<mailto:django-users@googlegroups.com>>.

To unsubscribe from this group, send email to
django-users+unsubscribe@__goo__glegroups.com
<http://googlegroups.com>
<mailto:django-users%__2bunsubscr...@googlegroups.com
<mailto:django-users%252bunsubscr...@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>
<http://groups.google.com/__group/django-users?hl=en
<http://groups.google.com/group/django-users?hl=en>>.




--
_Satyajit Sarangi_

--

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
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscribe@__googlegroups.com
<mailto: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
<mailto:django-users@googlegroups.com>.
To unsubscribe from this group, send email to
django-users+unsubscribe@__googlegroups.com
<mailto: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>.




--
_Satyajit Sarangi_

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

Re: how to set up user profile in django-registration ?

2011-06-22 Thread Piotr Zalewa

On 06/22/11 16:09, Satyajit Sarangi wrote:

I am using django registration , which is not displaying any profile
when I log in . Thus I am not able to login . What should I do to
overcome this ?



I assume you've been reading docs already. (django-registration and 
django user management ones, possibly also the django first project 
tutorial).

Could you provide which steps you've already taken?

zalun

--
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 the django-users mailing list properly and doing your homework..

2011-07-01 Thread Piotr Zalewa

Everything has its place. For me it looks like that:

direct help - IRC
searching for solutions - tutorials, documentation, django snippets
discovering new stuff - email list, StackOverflow

zalun

On 07/02/11 01:11, Andre Terra wrote:

To be honest, I often think about how an e-mail list is actually one of
the worst media to help with coding.

Here's some food for thought: wouldn't it be better if we had a
django-help project that combined django snippets, a stack overflow-like
ratings system (an incentive to both good questions and speedy answers),
code highlighting, moderation, open/closed questions, etc?



Sincerely,

André Terra


On Fri, Jul 1, 2011 at 6:51 PM, Cal Leeming [Simplicity Media Ltd]
mailto:cal.leem...@simplicitymedialtd.co.uk>> wrote:

Also, I modified the wiki entry to include one good/one bad example
of a thread.

Could others people also contribute some examples of what they
consider good/bad threads too? (maybe could even put some text
underneath to explain why)

On Fri, Jul 1, 2011 at 10:46 PM, Cal Leeming [Simplicity Media Ltd]
mailto:cal.leem...@simplicitymedialtd.co.uk>> wrote:

+1 on gists (i didn't even know this existed).

Because to be honest, if github disappears, then something has
gone terribly wrong with the interwebs :X

But also +1 on django web team deploying their own...


On Fri, Jul 1, 2011 at 5:46 PM, Micky Hulse mailto:rgmi...@gmail.com>> wrote:

Don't forget about GitHub Gists!

https://gist.github.com/

Considering a lot of Django projects are already hosted
there... Seems
like a natural fit to me. :)

Also, Gist has the "fork" feature.

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


--
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: testclient cannot find the template

2010-12-15 Thread Piotr Zalewa

Hi Kenneth,

It looks like the test can't find the /success/ URL
and then tries to display a 404 error, but there is o 404.html template

Do you have 404.html template created?

zalun

On 10-12-15 01:13, Kenneth Gonsalves wrote:

hi,

I am trying to write a test of a view with test client. My test is like
this:

class Testgetnum(unittest.TestCase):
 def setUp(self):
 self.client = Client()
 def testgetnum(self):
 response = self.client.post('/success/',{'id':1})
 self.assertEqual(response.status_code, 200)

but the test crashes since it cannot find the template mentioned in the
view. But the template is there in the correct directory pointed to by
settings. The error traceback is:

Traceback (most recent call
last):
   File "/home/lawgon/addition/../addition/addnums/tests.py", line 38, in
testgetnum
 response =
self.client.post('/success/',{'id':1})
   File "/usr/lib/python2.6/site-packages/django/test/client.py", line
444, in post
 response = super(Client, self).post(path, data=data,
content_type=content_type, **extra)
   File "/usr/lib/python2.6/site-packages/django/test/client.py", line
245, in post
 return
self.request(**r)
   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py",
line 139, in get_response
 response = callback(request,
**param_dict)
   File "/usr/lib/python2.6/site-packages/django/utils/decorators.py",
line 89, in _wrapped_view
 response = view_func(request, *args,
**kwargs)
   File "/usr/lib/python2.6/site-packages/django/views/defaults.py", line
18, in page_not_found
 t = loader.get_template(template_name) # You need to create a
404.html template.
   File "/usr/lib/python2.6/site-packages/django/template/loader.py",
line 157, in get_template
 template, origin =
find_template(template_name)
   File "/usr/lib/python2.6/site-packages/django/template/loader.py",
line 138, in find_template
 raise
TemplateDoesNotExist(name)
TemplateDoesNotExist: 404.html



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: testclient cannot find the template

2010-12-15 Thread Piotr Zalewa

This should work, is /success working in dev server?

zalun

On 10-12-15 03:53, Kenneth Gonsalves wrote:

On Wed, 2010-12-15 at 03:44 -0800, Piotr Zalewa wrote:

It looks like the test can't find the /success/ URL
and then tries to display a 404 error, but there is o 404.html
template

Do you have 404.html template created?

no 404 template - but why can it not find the /success/ url? Do I need
to import urls.py also?



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: virtualenv and deployment

2010-12-15 Thread Piotr Zalewa
Better would be to create the requirements.txt and install directly on 
the server (pip install ir requirements.txt)

I use mod_wsgi

On 10-12-15 08:48, Álex González wrote:

Hi!

I'm using virtualenv with --no-site-packages and now I like to do a 
deployment of my app... I'm using a sharing hosting, can I uypload all 
my enviroment dir (with the packages installed with pip) to the server 
and use them?


What's the better way to the deployment? mod_python, mod_wsgi, perhaps 
fast-cgi?


Thanks!

--
@agonzalezro 
Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx, 
.ppt and/or .pptx

--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-us...@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.



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: Authenticate every def in views.py

2010-12-18 Thread Piotr Zalewa

I remember using a middleware with an exception list. (more than a year ago)

On 10-12-18 05:35, Łukasz Rekucki wrote:

On 18 December 2010 13:48, James Bennett  wrote:

On Fri, Dec 17, 2010 at 8:43 PM, suckerfish  wrote:

I've added a decorator to *each* def in views.py to require
authentication. Is there a simpler way that allows me to apply
authentication automatically to every def in the file?

1. Write a middleware which will force authentication on all your
views (easy), or

You just have to remember to exclude the login view somehow. This is
troublesome if you want to use a 3rd party app for authentication.
Using decorator like @login_not_required will make you fork it. Second
options is to hardcode excluded views in the middleware. I had this
problem too and decided to bite the bullet for the sake of simplicity.


2. If you absolutely must have this happen at the view level, stick
some code in the views file which loops over the views defined in the
file and applies the auth decorator to each one.


Now that's some "automagic" :). IMHO, putting a single line in front
of a view isn't THAT bad and gives important information to the person
reading the code.




--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@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: Syntax Error

2011-01-04 Thread Piotr Zalewa
what happens if you'remove the commented lines?

On 01/04/11 15:22, hank23 wrote:
> Can someone explain to me what the following error is trying to tell
> me:
> 
> SyntaxError at /polls/1
> invalid syntax (urls.py, line 20)Request Method: GET
> Request URL: http://127.0.0.1:8000/polls/1
> Django Version: 1.2.3
> Exception Type: SyntaxError
> Exception Value: invalid syntax (urls.py, line 20)
> Exception Location: C:\Python27\lib\site-packages\django\utils
> \importlib.py in import_module, line 35
> Python Executable: C:\Python27\python.exe
> Python Version: 2.7.1
> Python Path: ['C:\\Documents and Settings\\hversemann\\djangoprojects\
> \mysite', '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: Tue, 4 Jan 2011 09:12:32 -0600
> 
> The urls.py module that it is referring to looks like this:
> 
> from django.conf.urls.defaults import *
> 
> # Uncomment the next two lines to enable the admin:
> from django.contrib import admin
> admin.autodiscover()
> 
> #urlpatterns = patterns('',
> # Example:
> # (r'^mysite/', include('mysite.foo.urls')),
> # Uncomment the admin/doc line below to enable admin
> documentation:
> # (r'^admin/doc/', include('django.contrib.admindocs.urls')),
> # Uncomment the next line to enable the admin:
> # (r'^admin/', include(admin.site.urls)),(r'^polls/$',
> 'polls.views.index'),
> #(r'^polls/(?P\d+)/$', 'polls.views.detail'),
> #(r'^polls/(?P\d+)/results/$', 'polls.views.results'),
> #(r'^polls/(?P\d+)/vote/$', 'polls.views.vote'),
> #(r'^admin/', include(admin.site.urls)),
> #)
> 
> urlpatterns = patterns('',
> (r'^polls/', include('polls.urls')),
> (r'^admin/', include(admin.site.urls)),
> )
> 
> 
> and I thought it had previously worked ok when I last tried to use it
> back on the 23rd. I would appreciate any help or direction in
> debugging this since I'm relatively new to both django and python.
> Thanks.
> 
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Generic views

2011-01-11 Thread Piotr Zalewa
On 01/11/11 14:02, martinez wrote:
> I would like to know if I could work without generic views.
> 
Sure you can - simply define your own in [application]/views.py

Please read the doc
http://docs.djangoproject.com/en/1.2/#the-view-layer

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: TestCase and fixtures

2011-01-11 Thread Piotr Zalewa
Hi Simone

Try fixtures = ['myfix']

On 01/11/11 21:25, Simone Dalla wrote:
> Hi!
> 
> I'm testing my application with a TestCase class, specifing "fixtures"
> attribute in my class like:
> 
> class MyTestCase(TestCase):
> fixtures = ['myfix.json']

> 
> 
> I've created the folder "fixtures" in my directory application like:
> 
> /home/simo/Projects/myproject/myapp/fixtures/myfix.json
> 
> where myfix.json was created by "dumpdata" command, but when I execute
> the command
> 
> manage.py test myapp
> 
> fixtures data don't load, and the command report "...0 fixtures
> loads..." but they are load only when I rename the fixtures file
> "initial_data.json". I've already read the documentation
> to http://docs.djangoproject.com/en/1.2/topics/testing/#fixture-loading.
> I'm making something wrongs??
> 
> Regards,
> Simone
> 
> -- 
> Simo
> 
> - Registered Linux User #395060
> 
> - Software is like sex, it is better when it is free  --> Linus B. Torvalds
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-us...@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.


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

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



Re: Need HELP urgently

2011-01-12 Thread Piotr Zalewa
I'd also take a look at XHR requests (Web Console or Firebug's Net panel)


On 01/12/11 13:53, Matias Aguirre wrote:
> The given answers are correct, that's your issue without doubt, create an 
> admin
> class for your Priority model and setup a raw_id_field[1]:
> 
> class PriorityOptions(admin.ModelAdmin):
> raw_id_fields = ('entry',)
> register(Priority, PriorityOptions)
> 
> Regards,
> Matías
> 
> [1]: 
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields
> 
> Excerpts from gupta-django's message of Wed Jan 12 03:27:17 -0200 2011:
>> I have two application
>>
>> 1. App1 - It has a Model Class "Entry" that has 20 entries
>> 2. App2 - It has a Model Class "Priority"
>>
>> In Priority class I am defining a Foreign Key Relationship as
>>
>> from App1.models import Entry
>>
>> class Priority(models.Model):
>> entry = models.ForeignKey(Entry)
>> priority = models.CharField(max_length=2)
>>
>> And in App2/admin.py I am simply registering Priority
>>
>> admin.site.register(Priority)
>>
>> But on Admin website when I try to add a priority - the control hangs
>> up and only a blank page is returned after a long time gap.
>>
>> Can anyone please look into the issue that why it is not letting me
>> add priorities through Admin? I am able to add from backend,
>>
>> Thanks
>>


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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: Javascript Questions

2011-01-12 Thread Piotr Zalewa
Is it in django-admin or completely irrelevant to this mailing list?

zalun

On 01/12/11 20:32, hank23 wrote:
> I have a text field on a page which I want to disable when the page is
> loaded and enable later when the user selects an entry in a dropdown
> box. First how and where do I code the call to my disablefield
> function when the page loads? Second what event is generated whenever
> I select an entry in a dropdown box(onclick, ondblclick, onchange, or
> some other one)?
> 
> 
> 
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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-users] Custom signals

2011-01-19 Thread Piotr Zalewa
I'm trying to add custom signals to my models.
I'm sure I'm missing some step.

http://paste.pocoo.org/show/323618/

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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-users] Custom signals

2011-01-20 Thread Piotr Zalewa
Yes,
that was it!
pre_copy.send(type(self), instance=self, ...

On 01/20/11 01:37, Łukasz Rekucki wrote:
> On 20 January 2011 02:00, Piotr Zalewa  wrote:
>> I'm trying to add custom signals to my models.
>> I'm sure I'm missing some step.
>>
>> http://paste.pocoo.org/show/323618/
>>
> 
> The "sender" argument in receiver() must match the one in send()
> (using identity). In receive() you're using a class, while in send()
> you're passing an instance of that class, so they have no chance of
> matching.
> 
> Try:
> 
> post_copy.send(sender=type(self), copied_to=new_version)
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: Where Is My Javascript Code's Problem?

2011-01-24 Thread Piotr Zalewa
I think you wanted something like this to happen:
http://jsfiddle.net/zalun/96vsU/

zalun

On 01/21/11 21:41, hank23 wrote:
> I was actually hoping to see the results of the code altering the
> screen fields dynamically when I click the button to call the
> javascript function. So if this won't do it, then how do I through the
> javascript function code cause the screen fields to be refreshed when
> the code changes them?
> 
> On Jan 21, 3:35 pm, "Mo J. Al-Mughrabi"  wrote:
>> Lol
>>
>> Sent from my iPhone
>>
>> On Jan 22, 2011, at 12:34 AM, Sandro Dutra  wrote:
>>
>> LOL! What are you trying to do, guy?
>>
>> It's obvius the alert box will appear, 'cause it's a visual element.
>>
>> But the rest of the code only set a bunch of variables, it's not printing
>> anything, it's not launching any alert, so what are you waiting to happen?
>>
>> 2011/1/21 hank23 
>>
>>
>>
>>
>>
>>> Here's my javascript function code:
>>
>>>  function addRecipient()
>>>  {
>>>  alert("Entering addRecipient function!")
>>>  var list = document.getElementById('recipientlist');
>>>  var rlist = list.value;
>>>  var reciever = document.getElementById('recipient');
>>>  rlist = rlist + receiver.value + ", ";
>>>  reciever.value = "";
>>>  }
>>
>>> I get the alert box just fine, but nothing seems to happen after that.
>>> So what's wrong with the code as is and do I need to call some other
>>> method to refresh the browser window to show the results of my
>>> javascript having run, in order to see my screen change?
>>
>>> --
>>> 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 
>> athttp://groups.google.com/group/django-users?hl=en.- Hide quoted text -
>>
>> - Show quoted text -
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: validate changes in m2m field in admin panel

2011-02-11 Thread Piotr Zalewa

I would use signals for that purpose

On 11-02-11 10:18, bagheera wrote:
Hi, i would like to perform validation on m2m field to control, if 
user made any changes. I'd like to disallow removing relations from 
m2m field, only adding them.


example:

model Product(models.Model):
name = models.TextField()
model Order(models.Model):
products = models.ManyToManyField(Product)


If user creates an order with three products, he can't remove any 
product from order after object has been saved.


Is there any way to do that on model level?

if i put in clean() method:
current_products = self.products.all() i will get list of products 
currently assigned to order. Can i get list of objects that was chosen 
in form, so i could compare them and raise validation error if needed?







--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

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

2011-02-15 Thread Piotr Zalewa

Learn how to serve static files
For the Django 1.3+
http://docs.djangoproject.com/en/dev/howto/static-files/
For Django 1.2
http://docs.djangoproject.com/en/1.2/howto/static-files/

Good luck
zalun
On 02/15/11 10:00, Szabo, Patrick (LNG-VIE) wrote:
> Hi, 
> 
> I just want an image to be shown in my header so i just added it in my
> template like this:
> 
> 
> 
> Unfortunately i only get the "alt text" shown and not the image. 
> The image is in the same directory as the template.
> 
> Why doesn't this work ?!
> 
> Kind regards
> 
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT-Entwickler 
> LexisNexis
> Marxergasse 25, 1030 Wien
> 
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573 
> Fax: +43 (1) 534 52 - 146 
> 
> 
> 
> 
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: chrome extension

2011-02-16 Thread Piotr Zalewa
On 02/16/11 05:34, Tony Lambropoulos wrote:
> Should I assume that this was a silly question?
> 
> On Mon, Feb 14, 2011 at 10:10 PM, Tony  > wrote:
> 
> Hi,
> Is there any way to have a chrome extension with a backend in Django,
> like for storing data server side and using its views?  Or is this not
> possible?
> thanks

I know nothing about Chrome extensions, but someone has written one for
my jsFiddle. You definitely can send a GET request (which this extension
is doing), I assume you will be able to send POST and receive response,
which would answer your question as a yes.

If the question was about installing Django instance inside Chrome
browser, than the answer is a NO. :)

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

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



Re: confused about ModelForm Field validation

2011-02-18 Thread Piotr Zalewa

On 02/18/11 09:44, Roman Klesel wrote:
> [..] in some cases the values
> stored in the tables have to be converted before the can be displayed
> and also have to be converted bevore bein saved to the database.
> [...]

> def clean(self,value):
> "convert the literal value to the db representation"
> [...]

> On top of that, I feel like working against the ideas of whole validation 
> thing.

I think you may consider it a hack

> Can someone suggest a better solution? Maybe an easier one. Or a more
> stable one? There are quite some fields where I have to do such
> conversions. I'm really trying to find a clean solution which is not
> just tricking the framework.

I would use pre_save signal for data modification

http://docs.djangoproject.com/en/dev/topics/signals/
http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save

Piotr
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

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



South - when to start?

2011-02-18 Thread Piotr Zalewa
Where is the best moment to start with south?

1. The very beginning, as the first app added to the project?
2. At the moment when more devs will be involved?
3. When real data will start to show?

I'm building a new system, I think the current model progress is about
20%, where 100% is the moment I will put the site on the server. I'm
very close to point 2.

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: South - when to start?

2011-02-18 Thread Piotr Zalewa
I'm mostly looking for a solution which would work for front-end devs
who start early in the process (some part of app is written and they may
jump on the UI). I guess South before 2 is a must then.

I heard it's dead simple, I guess a little practice in writing
migrations will not kill me.

Thanks
zalun
On 02/18/11 13:11, Grigoriy Petukhov wrote:
> I have found nice way to do quick development on 1st and 2nd steps you
> have mentioned.
> 
> I've put following instructions in reset.sh:
>  * Drop database
>  * Create new database
>  * Run ./manage.py syncdb
>  * Generate sample data
> 
> When I change some model then I just run reset.sh. That works even for
> several developers. If you pull someone changes then you run reset.sh
> and get actual database state. It really saves time because you do not
> need to spend your time writing migrations for schema and data.
> 
> Of course, this method is not good if generating sample data takes a
> lot of time. In such case migrating could be better solution.
> 
> On 18 фев, 16:24, Piotr Zalewa  wrote:
>> Where is the best moment to start with south?
>>
>> 1. The very beginning, as the first app added to the project?
>> 2. At the moment when more devs will be involved?
>> 3. When real data will start to show?
>>
>> I'm building a new system, I think the current model progress is about
>> 20%, where 100% is the moment I will put the site on the server. I'm
>> very close to point 2.
>>
>> zalun
>> --
>> blog  http://piotr.zalewa.info
>> jobs  http://webdev.zalewa.info
>> twit  http://twitter.com/zalun
>> face  http://facebook.com/zaloon
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: Collaborative text editor with Django

2011-02-24 Thread Piotr Zalewa
On 02/23/11 08:32, Anoop Thomas Mathew wrote:
> Is there any collaborative text editing application available for django.
> Has anybody tried with etherpad(www.etherpad.org
> ) along with django?

If you'd start building it - I'd be collaborating.

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: Collaborative text editor with Django

2011-02-26 Thread Piotr Zalewa
On 02/24/11 05:07, Brice Leroy wrote:
> I'm very curious to know the use case for this kind of editor. I'm using
> HG and GIT to manage merging and I'm quite happy with those.
> 

Not all code is a part of bigger infrastructure, but here it is: pair
programming in jsFiddle (which is a django project).

zalun
-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

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



Selunium2 and Django

2011-02-26 Thread Piotr Zalewa

Hi,

I'm trying to use Selenium2 (beta 2) with Django.
I'd like to use it from within unit test.

I installed the django-nose-selenium and I am able to connect to the 
server with

./manage.py test --with-selenium

It doesn't load the page if I'm using the the WebDriver.

Do you have any examples or doc?

zalun
--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
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: autocomplete omg

2011-02-28 Thread Piotr Zalewa

Hi,


Would you give us a little info about your background?
Are you familiar with  JavaScript (jQuery, MooTools, YUI, anything) ?
Can you create a front-end example of autocomplete with a fake data on 
http://jsfiddle.net/ ?

The rest would be a simple search in Django

zalun

On 11-02-28 08:52, Szabo, Patrick (LNG-VIE) wrote:


Hi,

I'm using the latest version of Django with sqlite and want to 
implement autocomplete for one of my fields.


I've tried 4 diffrent tutorials an non oft them works.

Has anyone got a full tutorial for me that definetely  works with the 
current version ?!


Maybe one youre using yourfelf ?!

Kind regards

. . . . . . . . . . . . . . . . . . . . . . . . . .

**

Patrick Szabo
XSLT-Entwickler

LexisNexis
Marxergasse 25, 1030 Wien

patrick.sz...@lexisnexis.at 

Tel.: +43 (1) 534 52 - 1573

Fax: +43 (1) 534 52 - 146



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



--
blog http://piotr.zalewa.info
jobs http://webdev.zalewa.info
twit http://twitter.com/zalun
face http://www.facebook.com/zaloon

--
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: Collaborative text editor with Django

2011-03-01 Thread Piotr Zalewa
On 03/01/11 07:45, Anoop Thomas Mathew wrote:
> @piotr zalewa:
> jsFiddle is of course a nice
> Is jsFiddle open source?? I couldn't find its source anywhere.
> http://www.facebook.com/topic.php?uid=183790024998&topic=14241
> <http://www.facebook.com/topic.php?uid=183790024998&topic=14241>


This is off-topic - http://groups.google.co.uk/group/jsfiddle-users
Current version has a very ugly code - proof of concept style - it is
partially available, however the (in progress) beta is a complete rewrite.

> So, friends,
> This etherpad is in comet (java) and can anyone tell how to integrate
> etherpad, keeping it as it is, with other django apps???
> Some iFrame ideas??? Please file-in your views.
> Is that a really bad idea???

it depends how you would like to have it integrated

zalun
-- 
blog  http://piotr.zalewa.info
fidd  http://jsfiddle.net/user/zalun/
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

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