Re: Introducing myself and my first question

2014-07-20 Thread Ariel E. Isidro
Hi Martin,

I myself am new in Django, here's one tutorial I believe is worth visiting
when setting up your environment:

http://www.jeffknupp.com/blog/2013/12/18/starting-a-django-16-project-the-right-way/

Good luck


On Sun, Jul 20, 2014 at 6:09 AM, Martin Torre Castro <mad...@gmail.com>
wrote:

> Hello,
>
> my name is Martin and I'm a computer engineer from Spain. I'm going to
> start a new project with a colleague and I decided to use Django because we
> searched for free opensource tools and I'm in love with Python.
>
> We have made a couple of tutorials (the official one and "Tango with
> django"). I've also bought the book "Two scoops of Django" for the 1.6
> Django edition. We're starting the project soon as well as we finish the
> design, but I'm concerned about setting up the new environment. We're
> thinking of using:
>
>
>- postgresql
>- Python/Django [ of course ;-) ]
>- Eclipse/Pydev
>- Git
>- jQuery
>
> I've been reading the Greenfield/Roy book and some web sites and I want to
> set up the environment with good practices by using virtualenvwrapper,
> virtualenv, pip, the requirements.txt files and so on.
> I have made some mix for all this, but I would be grateful if someone
> could confirm us if we are on the right way, give us some advice or maybe
> tell us where on the internet we can find a good way of doing all this.
>
> My preview for the whole setting up is next:
>
>
>1. We should start the installations by installing "sudo apt-get
>install virtualenvwrapper" . If I understand correctly, this installs
>virtualenv as well as an embedded pip.
>2. The virtualenv must be created ("virtualenv env") in the parent
>directory of the Eclipse workspace, I suppose. This is one point of
>confusion to me. I don't know either if I have to activate this every time
>I come back for developing resuming the work from days before. I completely
>understand that later from Eclipse I will give the python path inside the
>virtualenv, but don't know if must activate the virtualenv every time.
>3. Next step would be to install all the things we need (django,
>pillow, psycopg2) using a requirements.txt file. "pip install -r
>requirements.txt"
>4. We should create the new django project with a python
>django-admin.py startproject 
>5. Now I don't know if we should link the project to an already
>installed version of Eclipse or run the "git init" first. I understand
>that Eclipse and Git don't need to be installed inside the virtualenv. In
>fact, I've been reading and it seems that Eclipse can work OK just by being
>given the path inside the virtualenv where the python executable is
>located. I've also read that some people used to make different workspaces,
>but configuring the paths should be enough
>http://stackoverflow.com/questions/1145374/virtualenv-with-eclipse-galileo
>
> From here I would just upload to github or bitbucket, maybe doing the
> whole thing from Eclipse would be easier. But the integration with Eclipse
> when we made tangowithdjango tutorial was the difficult point, because
> there is no option for importing a django project from Eclipse (Kepler
> version last time). We found easier to create the project from Eclipse, but
> we were not using a virtualenv for the tutorial.
>
> I haven't used virtualenv before, so it's our second main obstacle, but I
> expect it will be easy when we get used to it (^_^) .
>
> Please could someone help with some piece of advice, pros and cons of
> every option. Just don't want to do something now I will regret in future.
>
> Thank you veeery much in advance.
>
> PS: Some links visited:
> http://www.dabapps.com/blog/introduction-to-pip-and-virtualenv-python/
> http://www.tangowithdjango.com/book/chapters/setup.html
> https://virtualenv.pypa.io/en/latest/virtualenv.html
>
> --
> 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/f7332cab-26a7-45fe-a9f5-26831da6bdf4%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/f7332cab-26a7-45fe-a9f5-26831da6bdf4%40googlegroups.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Ariel E. Isidro*
Backup your imp

Re: Deployment in Django

2014-03-22 Thread Ariel E. Isidro
After git, pythonanywhere is a simple way to deploy and publish.
On Mar 22, 2014 9:02 PM, "Kamal Kaur"  wrote:

> On Sat, Mar 22, 2014 at 2:50 PM, Aryak Sengupta 
> wrote:
> > But what is the simplest and the easiest way to go about deployment?
> >
> > P.S. I am new to Django.
>
> Starting with a small app, following a good tutorial is not a bad
> idea! And the simplest, it lets you start from basics. Make sure you
> use git right from the first step. Will be beneficial. First try
> exploring about it.
>
> Something I just found:
>
> http://stackoverflow.com/questions/5467916/what-is-a-good-tutorial-for-django-other-than-the-django-documentation
>
> --
> Kamaljeet Kaur
>
> kamalkaur188.wordpress.com
> facebook.com/kaur.188
>
> --
> 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/CAP8Q%2BxgcW0x%2BkfTdhN67cJuD5Fw12W5ACieY2ZMpPRuLO8md-w%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: two apps against one table (admin)

2014-02-06 Thread Ariel E. Isidro
What if you define your views to use only the fields that you need?
On Feb 7, 2014 2:24 AM, "fborell"  wrote:

> All,
>
> I need to create a second application in the admin section that ports to
> the first applications model. The second application's admin.py would
> contain only 5 of the 15 fields and be set for read-only.
> My goal was to allow certain users the ability to do a simple search and
> not see some of the other data that they weren't authorized for.
>
> Any thoughts on how to proceed?
>
> Thank,
>
> -f
>
> --
> 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/d1ed61d4-16d9-4a51-a537-d46a1f334d3a%40googlegroups.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/CAECOjia6C34LOi28TBK%2Bs_Fqpy_c0nXkpq8FOmpk71_-Hwaqdw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-02-05 Thread Ariel E. Isidro
1. before exiting mysql, you should grant permission to a user,i.e.
grant all privileges on django_1.* to username@'localhost' identified by
'userpassword'
replace username, userpassword with your own
2. exit mysql console
3. modify settings.py to add your username, password, host (localhost), and
port (3306)
4. run python manage.py syncdb


On Thu, Feb 6, 2014 at 7:52 AM, Drew Ferguson <d...@afccommercial.co.uk>wrote:

> Hi
>
> Just like SQLlite, you tell Django where the MySQL database is in
> settings.py
>
> At the top you should have something like
>
> DATABASES = {
>  'default': {
>   'ENGINE': 'django.db.backends.mysql',
>   'NAME': 'django_1', # Or path to database file if using sqlite3.
> #  'USER': '',
> #  'PASSWORD': '',
> #  'HOST': '', # Empty for localhost
> #  'PORT': '', # Set to empty string for default.
>  }
> }
>
>
> On Wed, 5 Feb 2014 16:38:59 -0600
> Malik Rumi <malik.a.r...@gmail.com> wrote:
>
> > mysql>  CREATE DATABASE django_1;
> >
> > Query OK, 1 row affected (0.24 sec)
> >
> > mysql> SHOW DATABASES;
> >
> > ++
> >
> > | Database   |
> >
> > ++
> >
> > | information_schema |
> >
> > | django_1   |
> >
> > | mysql  |
> >
> > | performance_schema |
> >
> > | test   |
> >
> > ++
> >
> > 5 rows in set (0.31 sec)
> --
> Drew Ferguson
> AFC Commercial
> http://www.afccommercial.co.uk
>
> --
> 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/20140205235235.53a238b1%40blacktav.fergiesontour.org
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Ariel E. Isidro*
Backup your important files, click here  <http://db.tt/7cLLR7V/>

DISCLAIMER: This message is for the designated recipient only and may
contain confidential and/or privileged information. If you have received it
in error, please delete it and advise the sender immediately. You should
not copy or use it for any other purpose, nor disclose its contents to any
other person.

-- 
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/CAECOjiaW4jswaift33tcdTJc5DBwFYJhRKyZPmhn7FToC8QUvw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: moving from sqlite3 to mysql

2014-01-28 Thread Ariel E. Isidro
"Or can I create the database, (presumably directly in the shell), and then
empty it, as these instructions say, and that will take care of it? I
frankly didn't understand why I would need to 'empty' a new and empty
database, but that's what it says. "

With sql lite, everything will be created for you.
While with MySQL,  you should create the database directly in the shell,
and this should give you an empty database.  The Django tables will be
created after configuring your settings, and running  syncdb.




On Wed, Jan 29, 2014 at 1:17 AM, Malik Rumi <malik.a.r...@gmail.com> wrote:

> This is somewhat like the question in "need help moving to production
> server" but I think the right procedure is to start a new thread. So I
> think I have done well for just starting out. With your help I've gotten
> Django running on Windows, and I completed a tutorial and got my site
> working locally with the admin. thank you.
>
> So I thought I was ready to move up to MySQL for some heavy lifting. I
> followed the instructions I got here
> http://matthewwittering.com/blog/how-to-migrating-the-database-engine-for-django.html.
> I did not know what to do with the NAME part, so I put in 'django-1', and
> promptly got the error message 'unknown database 'django-1'. I thought that
> made sense because I hadn't created this database in mysql already, but I
> was just blindly following along. Having to CREATE DATABASE doesn't make
> sense, I thought, because it defeats the purpose of Django abstraction in
> the first place. Besides, when I syncdb, it should take whatever name I
> gave it when I was using sqlite3, right?
>
> Wrong. When I ran syncdb, this time with NAME: ' ', I got :   File
> "C:\Python27\lib\site-packages\MySQLdb\connections.py", line 36, in default
> terror handlerraise errorclass, errorvalue
> django.db.utils.OperationalError: (1046, 'No database selected').
>
> So, what am I missing here? There almost certainly is an easy solution I'm
> not seeing. Do I need to create a database in mysql? If so, must it have
> the same name as it had in sqlite3? I know that name was made from putting
> the model name together with something else, but I don't actually remember
> what it was, and it seems like a lot of extra work to install an sqlite
> browser just to get that name right. If that's what I need to do, maybe I
> can just open that file with notepad?
>
> Or can I create the database, (presumably directly in the shell), and then
> empty it, as these instructions say, and that will take care of it? I
> frankly didn't understand why I would need to 'empty' a new and empty
> database, but that's what it says.
>
> Any and all helpful advise welcome and appreciated.
>
>   --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f4a6d446-7cf8-498a-8ba5-04e339dd80b9%40googlegroups.com
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
*Ariel E. Isidro*
Backup your important files, click here  <http://db.tt/7cLLR7V/>

DISCLAIMER: This message is for the designated recipient only and may
contain confidential and/or privileged information. If you have received it
in error, please delete it and advise the sender immediately. You should
not copy or use it for any other purpose, nor disclose its contents to any
other person.

-- 
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/CAECOjiZL2Jx0M%2BYVdpX45TQDfQBGNgzMGGmOo6XiGb6JtwVkgQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.