Installing Django from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Mateusz Marzantowicz
Hello,

I'm having a problem with managing Django installation which was done from
git repository
(might be svn as well) in clean virtual environment. The problem is that
when I install some
other package via pip which has a Django as a dependency, it doesn't find
my django installation
and then downloads official release. I really need only one Django
installation in my virtualenv,
the one from git :) It is more related to how pip works but does anyone has
any idea how to do it the right way?


Thanks,
Mateusz Marzantowicz

-- 
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 from GIT/Subversion - package dependency in virtual environment

2012-02-20 Thread Mateusz Marzantowicz
Yes, it works!

Although I was previously installing Django according to docs at
https://docs.djangoproject.com/en/1.3/topics/install/#installing-development-version,
your method works perfectly so far.

I understand that keep in sync with trunk/master is as easy as invoking git
pull (svn up) and then setup.py install in src/django directory in
virtualenv root?


Mateusz Marzantowicz

On Mon, Feb 20, 2012 at 1:53 PM, Denis Darii  wrote:

> Do you mean django-trunk installation?
>
> If so, I use this in my requirements.txt:
>
> -e svn+http://code.djangoproject.com/svn/django/trunk/#egg=django-trunk
>
> or directly with pip:
>
> $ pip install -e svn+
> http://code.djangoproject.com/svn/django/trunk/#egg=django-trunk
>
> Hope it helps.
>
> On Mon, Feb 20, 2012 at 1:36 PM, Mateusz Marzantowicz <
> mmarzantow...@gmail.com> wrote:
>
>> Hello,
>>
>> I'm having a problem with managing Django installation which was done
>> from git repository
>> (might be svn as well) in clean virtual environment. The problem is that
>> when I install some
>> other package via pip which has a Django as a dependency, it doesn't find
>> my django installation
>> and then downloads official release. I really need only one Django
>> installation in my virtualenv,
>> the one from git :) It is more related to how pip works but does anyone
>> has any idea how to do it the right way?
>>
>>
>> Thanks,
>> Mateusz Marzantowicz
>>
>>  --
>> 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.
>>
>
>
>
> --
> This e-mail and any file transmitted with it is intended only for the
> person or entity to which is addressed and may contain information that is
> privileged, confidential or otherwise protected from disclosure. Copying,
> dissemination or use of this e-mail or the information herein by anyone
> other than the intended recipient is prohibited. If you are not the
> intended recipient, please notify the sender immediately by return e-mail,
> delete this communication and destroy all copies.
>
> --
> 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: Template inheritance, how to render dynamic content in base templates

2011-05-13 Thread Mateusz Marzantowicz
On Fri, May 13, 2011 at 5:15 AM, robinne wrote:

How can I render dynamic content in a base template if I only call a
> view on my child template?
>
> What I am trying to do is setup a base template that will include
> "Profile" information for the user who is logged in, for example:
> "Welcome John", instead of "login here", on every page. But if I call
> my child page "/Home" (for example) and it extends "base.html", how do
> I render the dynamic content within base.html? Thanks.
>
>
I think you should consider using template tags mechanism. Either it is
already built into your auth/login application (there are some tags
included) or you might write your own custom tags. Please refer to
documentation at:
http://docs.djangoproject.com/en/1.3/howto/custom-template-tags/ .

-- 
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: File Field

2011-05-16 Thread Mateusz Marzantowicz
On Fri, May 13, 2011 at 1:44 AM, pankaj sharma
wrote:

> Hello friends,.
> i want to upload some files to my database and show it to user ..
> how to add an filefield option to models.py and how to show them in
> admin.py.
> and how to let the users download the files...
>
>
Do you really want to store files directly in database? I think it is a
waste of valuable database storage which is more expensive than file system
storage and also obtaining large amount of file data from database is
inefficient. The better way is to store only references to files placed
somewhere under your MEDIA_ROOT tree.

-- 
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: Basic Django Support

2011-05-17 Thread Mateusz Marzantowicz
On Sun, May 15, 2011 at 6:07 PM, David Biglin  wrote:

> Hi,
> I have been playing with Python for the past year now and enjoying it.
> I am trying Django to make a web site for a friend. I am Following the
> Django Tutorial on there web site to get the basic concepts here;
> http://docs.djangoproject.com/en/dev/intro/tutorial01/
>
> During the set up i am using SQLite3 which comes with python, how ever
> when i try and create the DB tables i get the following errors
>
> Command to create DBTables :
>
>python manage.py syncdb
>
>
>
> The Traceback :
>
>Traceback (most recent call last):
>  File "manage.py", line 11, in 
>execute_manager(settings)
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> __init__.py", line 438, in execute_manager
>utility.execute()
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> __init__.py", line 379, in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 191, in run_from_argv
>self.execute(*args, **options.__dict__)
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 220, in execute
>output = self.handle(*args, **options)
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> base.py", line 351, in handle
>return self.handle_noargs(**options)
>  File "/usr/lib/pymodules/python2.7/django/core/management/
> commands/syncdb.py", line 56, in handle_noargs
>cursor = connection.cursor()
>  File "/usr/lib/pymodules/python2.7/django/db/backends/
> __init__.py", line 75, in cursor
>cursor = self._cursor()
>  File "/usr/lib/pymodules/python2.7/django/db/backends/sqlite3/
> base.py", line 174, in _cursor
>self.connection = Database.connect(**kwargs)
>sqlite3.OperationalError: unable to open database file
>
>
>
>
> Any help would be amazing also any other tutorials anyone could
> recommend for starting python web development would be much
> appreciated!
> Thanks again
>
>
Someone already mentioned that your problem might be related to
file/directory permissions. I spent a lot of time to figure that out in my
case.

Depending on your deployment method you might need to adjust your user/group
settings.
If you're using mod_wsgi with Apache http server set user and/or group
parameter in WSGIDaemonProcess directive in your apache config file to the
same user and group as your Djnago project files. In practice I create
separate system user accounts for my django projects, than create apache
virtual hosts and I also use python virtual environment. I can than easily
and quickly deploy everything and file permissions are fine.

Of course you can always play with chmod/chown to allow web server to access
your SQLite database.

-- 
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 save image in postgreSQL database

2011-05-20 Thread Mateusz Marzantowicz
On Fri, May 20, 2011 at 3:00 AM, ramnivas indani  wrote:

> ok but how can i achieve it in Django means how can i store images in
> Django python using URI


Read Django documentation (it is part of studying in college):

* http://docs.djangoproject.com/en/1.3/topics/http/file-uploads/
* http://docs.djangoproject.com/en/1.3/ref/models/fields/#filefield
* http://docs.djangoproject.com/en/1.3/ref/models/fields/#imagefield

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

2011-05-21 Thread Mateusz Marzantowicz
On Sat, May 21, 2011 at 4:50 AM, Dagon  wrote:

> I am a newbie to both Python and Django.
> Why does urlpatterns = patterns('', (r'^People/$',
> 'iFriends.People.views.index') get me the following error message:
>
>  Using the URLconf defined in iFriends.urls, Django tried these URL
> patterns, in this order:
>  ^People/$
>
> The current URL, , didn't match any of these.
>
> If I use the pattern (r'^$', 'iFriends.People.views.index') I get the
> desired results.
>
> Charles
>
>
Please provide some more information about the layout of your
project/application.
As far as I can see from your mail you have project named iFriends and
People application inside.
For that assumption

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

2011-05-21 Thread Mateusz Marzantowicz
On Sat, May 21, 2011 at 2:14 PM, Mateusz Marzantowicz <
mmarzantow...@gmail.com> wrote:

> On Sat, May 21, 2011 at 4:50 AM, Dagon  wrote:
>
>> I am a newbie to both Python and Django.
>> Why does urlpatterns = patterns('', (r'^People/$',
>> 'iFriends.People.views.index') get me the following error message:
>>
>>  Using the URLconf defined in iFriends.urls, Django tried these URL
>> patterns, in this order:
>>  ^People/$
>>
>> The current URL, , didn't match any of these.
>>
>> If I use the pattern (r'^$', 'iFriends.People.views.index') I get the
>> desired results.
>>
>> Charles
>>
>>
> Please provide some more information about the layout of your
> project/application.
> As far as I can see from your mail you have project named iFriends and
> People application inside.
> For that assumption
>

Sorry for that incomplete mail. Below goes the rest of it:

In your project settings.py file inside urlpatterns() place the line that
looks similar to this one below:

(r'^People/', include('iFriends.People.urls')),

Than create file urls.py inside your People application that do the magic.
It might look something like:

(r'^$', 'some.view.function'),

Of course that are only snippets of code and you must place them in the
right place.

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



Re: Why errors when restart but goes away after reload again! How fix?

2011-05-21 Thread Mateusz Marzantowicz
On Sat, May 21, 2011 at 7:49 PM, Chris Seberino  wrote:

> When I restart my server, I get an error on the first page reload and
> then all is fine on the second page reload!
>
> The error is this...
>
> --
> ViewDoesNotExist at /blog
>
> Tried blog in module mvc.controllers.controllers. Error was: 'module'
> object has no attribute 'models'
> 
>
> I get a similar error not matter what page I try to view first after a
> restart.
> It goes away on the second reload always.
>
> chris


What server are you using? What is your configuration? Do you have mod_wsgi,
mod_python or something else? What is your browser, OS, etc. Please do not
let us guess.

Mateusz

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



Re: Why errors when restart but goes away after reload again! How fix?

2011-05-22 Thread Mateusz Marzantowicz
On Sun, May 22, 2011 at 8:41 AM, Chris Seberino  wrote:

> On May 21, 6:35 pm, Mateusz Marzantowicz 
> wrote:
> > What server are you using? What is your configuration? Do you have
> mod_wsgi,
> > mod_python or something else? What is your browser, OS, etc. Please do
> not
> > let us guess.
>
> I am using mod_wsgi which uses Apache 2.2.16
> I use Firefox on Ubuntu Linux 10.10 (server and client both user this
> Ubuntu version)
>
> In my settings.py file I am loading sessions, CSRF and auth
> middleware,
>
> Tell me if there is any other info that would be relevant.
>
> Maybe this is a mod_wsgi quirk?
>
> Sincerely,
>
> Chris
>
>
Don't know if this can help you, but similar error message is presented in
Django documentation:
http://docs.djangoproject.com/en/dev/intro/tutorial03/?from=olddocs#write-your-first-view
 .

<http://docs.djangoproject.com/en/dev/intro/tutorial03/?from=olddocs#write-your-first-view>I'm
not sure about "reload problem" but please check if it's really the page
you're expecting. It might not be working at all (I think I had the similar
problem but I can't remember details).

Mateusz

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



Re: How do you organize your deployment enviroment

2011-05-23 Thread Mateusz Marzantowicz
On Mon, May 23, 2011 at 9:00 AM, DK  wrote:

> Hi,
>
> I am having a django project that  is being frequently deployed on clean
> linux installation. After a few deployments I have noticed that this process
> is very time consuming for me (every time I am preparing run scripts for
> everything, configuring cronjobs, paths to log files, etc) but this could
> be easily automated.
>
> What are a ready solutions to manage such deployments?
>
> My typical workflow is:
> 1) install packages on debian/ubuntu via aptitude (like database, etc)
> 2) creating new virtualenv + getting pip
> 3) pip install -r requirements (to setup enviroment)
> 4) fetch django project from code repository
> 5) setup runtime dir (I keep there: run - for pid files, logs, conf - for
> some config variables or scritps, scripts - some starting srcipts)
> 6) setup crontab jobs
> 7) setup webserver + django wsgi to be started
>
>
> Sure - I can write some custom made installer for that, but wondering if
> there is some generic tool for such things.
>
>
I really think that writing custom bash script is the easiest way. I'm doing
it right now because I need quick and idiot proof way of deploying Django
based project. Be sure to do some preliminary tests of your environment.

I also recommend you deploying a virtual machine for Ubuntu/Debian (if it's
what you want or can do).

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



Re: files managing

2011-06-07 Thread Mateusz Marzantowicz
On Tue, Jun 7, 2011 at 5:15 AM, pankaj sharma wrote:

> hello everyone, i need some help;
> i want the users to download some files.. {say photos}
> and what setting do i have to take care using FileField. where all
> these photos will be stored and how can user download the photos
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
Please read Django documentation first and then describe your problem.

* https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
* https://docs.djangoproject.com/en/dev/ref/models/fields/#filefield


Regards,
Mateusz

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