Re: Question about customizing Django's session backend.

2014-01-20 Thread Начаров Михаил

Hi Chen.

There are several session backends in django: database, cached, 
file-based. You can read about them on this page 
. But I 
didn't see obstacles for using default django configuration. You can use 
django models for django contrib application, while in your own apps 
still using sqlalchemy.


Cheers!


21.01.2014 11:04, Chen Xu пишет:

Hi everyone,
I am wondering if there is a way to customize django's session backend 
like we can do it for user authentication backend, the reason why I 
ask this is that when I call django.contrib.auth.login, it gives me 
the error no django_session table since I am using sqlalchemy, I did 
not do python manage.py syncdb at all.


Thanks in advance.

--
⚡ Chen Xu ⚡
--


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


Re: ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-17 Thread Начаров Михаил

You're welcome!

You can also take a look to another python web-server.
Especially if you want to have for example two sites with different 
version of python on the same server.

When I wrote my first django-app on py3, I faced the same problem.


17.01.2014 15:34, Timothy W. Cook пишет:




On Fri, Jan 17, 2014 at 1:52 AM, Начаров Михаил 
<michael.nacha...@gmail.com <mailto:michael.nacha...@gmail.com>> wrote:


Hi Timothy,

Note that your mod_wsgi module compiled for using python2.7. So
what you need now is install(compile) mod_wsgi for python3
instead of the same module compiled for python2.7.
On Debian you can do it by this command:
$ sudo apt-get install libapache2-mod-wsgi-py3


Thanks,  After some poking around, I did find that this was the 
problem.  Now, recompiling it on CentOS (with Python 3 as an alternate 
install) was quite another trick.  :-)


Thanks.



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


Re: ImproperlyConfigured: Error loading psycopg2 module: No module named _psycopg

2014-01-16 Thread Начаров Михаил

Hi Timothy,

Note that your mod_wsgi module compiled for using python2.7. So what you 
need now is install(compile) mod_wsgi for python3 instead of the 
same module compiled for python2.7.

On Debian you can do it by this command:
$ sudo apt-get install libapache2-mod-wsgi-py3



16.01.2014 16:34, Timothy W. Cook пишет:
This question is also on Stackoverflow http://goo.gl/LinMue  but I 
thought somene here may have an idea.



I have a Django 1.5, Python 2.7 site running under Apache with 
mod_wsgi on a CentOS 6.4 server.


I have rebuilt this site using Django 1.6 and Python 3.3. Deploying it 
to the same server and changing the paths in httpd.conf I get the 
subject error. This new install works as expected using ./manage.py 
runserver.


Here are the two WSGI definitions from httpd.conf:

|WSGIScriptAlias/  /home/ccdgen/CCDGEN2/apache/wsgi.py
WSGIPythonPath/home/ccdgen/CCDGEN2/ccdgen/ccdgen:/home/ccdgen/CCDGEN2/ccdgen:/home/ccdgen/CCDGEN2/lib/python3.3/site-packages


  Order  allow,deny
  Allowfrom  all



#WSGIScriptAlias/ccdgen/home/ccdgen/CCDGEN/apache/wsgi.py
#WSGIPythonPath/home/ccdgen/CCDGEN/mlhim/ccdgen:/home/ccdgen/CCDGEN/mlhim:/home/ccdgen/CCDGEN/lib/python2.7/site-packages
#
#
#  Order  allow,deny
#  Allowfrom  all
#
#|

The wsgi.py file is the same on both installations:

|import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE",  "mlhim.settings")
from  django.core.wsgi import get_wsgi_application
application=  get_wsgi_application()|

--

Thanks in advance for any ideas.

Cheers,
Tim


--
MLHIM VIP Signup: http://goo.gl/22B0U

Timothy Cook, MSc   +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.

To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B%3DOU3XNi7-FGOCPnKS%2Bb6%3D-ueWbPMOWFXfOce663fn0YpjWwQ%40mail.gmail.com.

For more options, visit https://groups.google.com/groups/opt_out.


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


Re: Filtering by month doesn't work

2013-11-25 Thread Начаров Михаил
Hi Tranta.
In my projects this functionality works fine. 
What version of django did you used? 
Do you sure that field end in Event table contains November dates?

Also, you can use *today.month* instead of  *int(today.strftime('%m')*) and* 
today.year *instead of  *int(today.strftime('%Y')).*
And in django docs says that it necessary to validate your form before use 
it:

*if event_form.is_valid():*
*event = event_form.save()*


вторник, 26 ноября 2013 г., 5:24:21 UTC+6 пользователь Vojtěch Tranta 
написал:
>
> Hi,
> do you have any clue why this does not work?
>
> def index(request):
> if request.method == 'POST' and request.POST:
> event_form = EventForm(request.POST)
> event = event_form.save()
>
> today = datetime.date.today();
> year = int(today.strftime('%Y'))
> month = int(today.strftime('%m'))
> events = Event.objects.filter(end__month='11')
> # events = Event.objects.all()
> pdb.set_trace()
> cal = jvccalendar.HTMLCalendar(jvccalendar.MONDAY).formatmonth(year, 
> month, events)
> form = EventForm()
> return render_to_response('jvc/index.html', {'cal': cal, 'side_form': 
> form}, context_instance=RequestContext(request))
>
>
> I am still getting "events" as empty, filtering using 
> filter(end_start='2013') works, but filtering by month does not, I googled 
> as much as I could, but no luck. I copied code from StackOverflow, but no 
> luck 
> Thank you!
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4521ed83-d85b-42a5-a344-27ac273648b9%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Min requirements for running django?

2012-05-06 Thread Начаров Михаил
Hi, Etienne,

I'm using django in my apps about half of a year and deploy some apps
already. It's hard to say how much memory you need, because it's really
depends of what work you want to do on server-side. If it's only creating a
dynamic-pages and filling the database with data coming from users, I think
100MB RAM will be enough. But remember to set DEBUG=False in your
settings.py in the deployed app otherwise, the amount of required memory
can be much larger.
And take a look on deployment section in django
documentation<https://docs.djangoproject.com/en/1.4/#the-development-process>.
It really helps.

With love from Russia,
Mikhail

On Mon, May 7, 2012 at 5:24 AM, Etienne B. Roesch
<etienne.roe...@gmail.com>wrote:

> Hi all,
>
> I am investigating hosting solutions for django apps, and would like to
> query the community on the requirements they have experienced to do so
> properly. On a machine that would only run django-related processes, how
> much RAM? Also, any tips on how to best set it up would be much
> appreciated. :) e.g., separate django, media, database servers, etc, is it
> overkill?
>
> http://jacobian.org/writing/django-performance-tips/
> http://www.djangobook.com/en/1.0/chapter20/
>
> Thanks much in advance!
>
> Etienne
>
> --
> 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.