Re: Full text search available on PostgreSQL?

2014-07-08 Thread Johannes Schneider

you could have a look at djorm-ext-pgfulltex.

bg,
Johannes

On 28.06.2014 18:15, Bastian Kuberek wrote:

Hi,

Just saw that django.contrib.admin.ModelAdmin.search_fields

 full
text search only support MySQL.

Are there plans on any progress towards getting this functionality on
PostgreSQL?

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/f0071b4f-a368-4512-a6f7-79d921e32141%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.



--
Johannes Schneider
Webentwicklung
johannes.schnei...@galileo-press.de
Tel.: +49.228.42150.xxx

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn

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


Re: django beginner

2014-07-08 Thread ngangsia akumbo
yes


 

-- 
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/1616cf49-a3a0-4d3e-98e1-f015f8b35988%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Python 3 Usage

2014-07-08 Thread Andreas Kuhne
The main problem that I have seen is that there are some plugins that don't
support Python 3 (the biggest issue we are having is django-storages and
boto). You can of course patch the plugins yourself and contact the authors
to make a pull request. Often the difference is not that great.

Regards,

Andréas


2014-07-08 6:09 GMT+02:00 Elena Williams :

> Hi Richard,
>
> Django has fully supported Python 3 for a while now, see this talk:
> http://pyvideo.org/video/2242/porting-django-apps-to-python-3-0
>
> Also IMHO it's less a matter of which users use Python 3 (I'd say it's
> likely most serious Python users mix-and-match on a project-to-project
> basis, depending on the age of the original code, but use Python 3 where
> they can).
>
> I'd say it's a case of which hosting servers are running Python 3 at the
> time of deployment.
>
> Often the default version of Python supported by hosts is 2.7 or even 2.6,
> so it's a matter of whether the costs outweigh the benefits of installing
> and maintaining your own versions of Python 3.
>
> ---
> Elena :)
> @elequ
>
>
> On Tue, Jul 8, 2014 at 10:17 AM, Timothy W. Cook  wrote:
>
>> I've been using Python 3 with Django for about 8 months.  No real
>> problems.  Early on I had to patch a couple of add-ons.
>>
>>
>>
>> On Mon, Jul 7, 2014 at 9:10 PM, Richard Eng 
>> wrote:
>>
>>> I was wondering how many Django users have switched to Python 3. Are the
>>> majority of users still on Python 2? I'm looking for rough
>>> proportion/percentage.
>>>
>>> I also read that Django and Python 3 have some problems or issues. Is
>>> there any truth to this?
>>>
>>> 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/d2ac4e23-471a-4c11-a16d-54a11b7bef33%40googlegroups.com
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> 
>> Timothy Cook
>> LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
>> MLHIM http://www.mlhim.org
>>
>>  --
>> 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%3DOU3Xt8gzVQSBUqnyTKm3ij%2BqbV_3YJr5x5XQ8ALrQA4g7cQ%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/CAMRRKVcB%2BNwSUeKQ2C8MTxd16Fh8DXQGXL3fhxNhi0aVtjxbCA%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/CALXYUb%3Dbsu-mWmTzkO41g_kWMBQYHyp2iEJGL3wjFsZsJ6-NRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: DateTimeField always returns None

2014-07-08 Thread William Granli
Changing the name of 'date' did not fix the issue. 

I have ended up changing the database field from DATETIME to TEXTFIELD. Not 
a good fix, but since there seems to be no clear solution to this I went 
ahead. It works at least. 

I have tried the Q-based queries too, by the way. (And other ways of saying 
the same thing. The problem definitely doesn't lie in the queries).

Den måndagen den 7:e juli 2014 kl. 01:14:52 UTC+2 skrev Russell Keith-Magee:
>
> Date isn't *disallowed* as a field name: 
>
>
> http://dev.mysql.com/doc/refman/5.5/en/reserved-words.html#table-reserved-words-new-5.5
>
> As long as it's quoted, it's an allowed name.
>
> However, it's *really* not recommended.
>
> This isn't for database related reasons - it's the Python side that is 
> problematic. The name of the class used to *store* date objects is also 
> named "date". As a result, you're going to get all sorts of unpredictable 
> namespace conflicts, because at various times in the same module, "date" 
> will be either a class or a model field. Unless you're *very* careful about 
> imports and how you use them, you're going to trip over unexpected 
> behaviours.
>
> This is probably something we should add to the model warning suite; if 
> someone is looking for an project to get involved with Django, this would 
> be a relatively easy feature to add.
>
> Yours,
> Russ Magee %-)
>
>
>
>
> On Sun, Jul 6, 2014 at 10:51 AM, Dean > 
> wrote:
>
>> I think there is a restriction in using 'date' in MySQL as a field name 
>> as it's some sort of inbuilt function. 
>>
>> On Friday, July 4, 2014 5:01:15 PM UTC+8, William Granli wrote:
>>>
>>> I am trying to create a queryset for getting the values of a 
>>> DateTimeField which is DATETIME in the DB.
>>>
>>> The class in models.py:
>>>
>>> class ChangeMetrics(models.Model):
>>> id = models.IntegerField(primary_key=True)
>>> file_id = models.ForeignKey(File, db_column = 'file_id')
>>> version_id = models.ForeignKey(Version, db_column = 'version_id')
>>> function_id = models.ForeignKey(Function, blank=True, db_column = 
>>> 'function_id')
>>> date = models.DateTimeField(blank=True, null=True)
>>> user = models.TextField(blank=True)
>>> changed = models.IntegerField(blank=True, null=True)
>>>
>>> The field in the SQL DB:
>>>
>>> date DATETIME
>>>
>>> The tuples are populated in the database and running SQL queries 
>>> directly on the DB is working perfectly.
>>>
>>> This is the queryset I am currently using in Django:
>>>
>>> queryset = ChangeMetrics.objects.filter(~Q(changed=None), ~Q(date=None), 
>>> ~Q(version_id=None))
>>>
>>> I have tried a raw query and also a version of the query that uses 
>>> exclude(), but that still returns None for date.
>>>
>>> I am accessing the entries in the queryset through a for loop and simply 
>>> accessing date through entry.date inside the for loop.
>>>
>>> I am using Django version 1.6.5. I have also tried getting the values 
>>> through the Django shell, to no success.
>>>
>>> Any ideas on what could be wrong? I have tried a multitude of queries, 
>>> none of them change the returned value of date. I have tried resyncing the 
>>> DB. I've looked over the models and everything seems to be correct. 
>>> Everything except the date works fine.
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/20994464-f99b-40bf-a16e-aaff87ff9d5a%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: Serving static files from another directory rather than "statics"

2014-07-08 Thread mulianto
Hi,

Why not generate the new file under static folder.

I use compressor but for big js css need time for generate the compress minify 
file when on production.



Sent from my iPhone

On 8 Jul 2014, at 10:35, carlos  wrote:

> Hi, maybe you need use this third party solution 
> http://django-compressor.readthedocs.org/en/latest/
> 
> and other is 
> https://django-pipeline.readthedocs.org/en/latest/
> 
> Cheers
> 
> 
> On Mon, Jul 7, 2014 at 5:58 PM, Chen Xu  wrote:
>> Hi Everyone,
>> I am working on a site, under my project in my local environment, I have a 
>> directory called "static" (generated by django just like everyone else's) to 
>> server my js and css. I wrote a script which minify all the js and css files 
>> and copy them in a directory called "static_min" which is at the same level 
>> as "static". When I try to include my css and js files from "static_min", it 
>> show url not found. 
>> 
>> And I tried the followeing:
>> in my settings: I changed the STATICFILES_DIRS as the following:
>> 
>> STATIC_ROOT = sys.path[0]
>> 
>> STATICFILES_DIRS = (
>> os.path.join(STATIC_ROOT, 'static'),
>> os.path.join(STATIC_ROOT, 'static_min')
>> )
>> 
>> I thought doing this will make Django to look for file in both static and 
>> static_min, but it did not work.
>> 
>> 
>> Could someone help.
>> 
>> Thanks
>> 
>> 
>> 
>> 
>> 
>> -- 
>> ⚡ Chen Xu ⚡
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users+unsubscr...@googlegroups.com.
>> To post to this group, send email to django-users@googlegroups.com.
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/CACac-qZbMcM6%2Bqs9frw1gToBSvbgD2NSaFtdOFrDfxScX%3DiVmg%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/CAM-7rO28fM3wZmYL85jCXECaiiYnOrHhVv8%3DZSfKVmLV5-ox_Q%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/D80E3ACB-E88B-4467-B2B3-1B711A60B113%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: SWFL Django users

2014-07-08 Thread Larry Martell
On Tue, Jul 8, 2014 at 12:07 AM, Janelle O'Dea  wrote:
> Anybody in Southwest Florida who uses Django?

I am in Venice.

-- 
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/CACwCsY5f5m528ExJbsDBk-0LhJhCgdu7pA0GWv5SVX00LGwvtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Marc Aymerich
Hi,
Wanted to try 1.7 and I'm hit by an exception that don't know how to solve
:)

running current 1.7.x branch, here full runserver output:

orchestra@orchestra:~/panel$ python manage.py runserver 0.0.0.0:
/usr/local/lib/python2.7/dist-packages/djcelery/managers.py:77:
RemovedInDjango18Warning: `ExtendedManager.get_query_set` method should be
renamed `get_queryset`.
  class ExtendedManager(models.Manager):

/usr/local/lib/python2.7/dist-packages/djcelery/managers.py:108:
RemovedInDjango18Warning: commit_manually is deprecated in favor of
set_autocommit.
  @transaction.commit_manually

Traceback (most recent call last):
  File "manage.py", line 10, in 
execute_from_command_line(sys.argv)
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 385, in execute_from_command_line
utility.execute()
  File
"/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py",
line 354, in execute
django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line
21, in setup
apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 106, in populate
app_config.import_models(all_models)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line
190, in import_models
self.models_module = import_module(models_module_name)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
  File
"/home/orchestra/django-orchestra/orchestra/apps/accounts/models.py", line
8, in 
class Account(models.Model):
  File
"/home/orchestra/django-orchestra/orchestra/apps/accounts/models.py", line
9, in Account
user = models.OneToOneField(get_user_model(), related_name='accounts')
  File
"/usr/local/lib/python2.7/dist-packages/django/contrib/auth/__init__.py",
line 136, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 187, in get_model
self.check_ready()
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py",
line 119, in check_ready
raise AppRegistryNotReady()
django.core.exceptions.AppRegistryNotReady


My impression is that breaks when loading a model that has a reference to
custom user model:

user = models.OneToOneField(get_user_model(), related_name='accounts')


Any idea?
-- 
Marc

-- 
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%2BDCN_vWsJ7j1BKGbuNpOPD%3DqHCffD8829Bu8N6zpfPua-k7%2Bg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Tango with Django chapter 7 Exercises

2014-07-08 Thread zuchie
try in step 2:

action = ""

leave it blank, the form will be posted in the same view.

and in step 4:

 Add Page

of course you have to insert url into the context dic this way in 
views/category(): category.url = category_name_url.
I think your way the url will be processed as category//add_page/, the page 
might not be found.

try the changes above and let me know if that works for you.

On Sunday, July 6, 2014 12:02:32 PM UTC-7, Martin Spasov wrote:
>
> I am doing the exercises in chapter 7 
>  and I 
> have to create an add page link on every category page that would take the 
> users to a new page on which they can enter name and url to add to certain 
> category if the category in question is not existing they would be 
> redirected to the add category page.
>
> so the steps are:
>
> 1.Create a new view (the tut gives us this one ready)
>
> def add_page(request, category_name_url):
> context = RequestContext(request)
> category_name = category_name_url.replace('_',' ')
> if request.method == 'POST':
> form = PageForm(request.POST)
>
> if form.is_valid():
> page = form.save(commit = False)
>
> try:
> cat = Category.objects.get(name = category_name)
> page.category = cat
> except Category.DoesNotExist:
> return render_to_response('blog/add_category.html', {} , 
> context)
>
> page.views = 0
> page.save()
>
> return category(request, category_name_url)
> else:
> print form.errors
>
>else:
> form = PageForm()
>
> return render_to_response('blog/add_page.html', {'category_name_url': 
> category_name_url, 'category_name': category_name, 'form': form}, context)
>
> 2.create a new template
>
> 
> 
> 
>  Drib 
> 
>
> 
> Add Page
>
> 
> {% csrf_token %}
> {%for hidden in forms.hidden_fields%}
> {{hidden}}
> {%for field in forms.visible_fields%}
> {{field}}
> {{field.errors}}
> {{field.help_text}}
> 
> 
> 
>
> 
>
> 3.URL Mapping
>
> url(r'^category/(?P\w+)/add_page/$', views.add_page , name 
> = 'add_page')
>
> 4.Create a link from the category page (I am just going to post the link 
> because there is no point to post the whole file...
>
>  Add Page
>
> Hints from the tut are :
>
> -Update the category() view to pass category_name_url by inserting it to 
> the view’s context_dict dictionary - DONE
>
> -Update the category.html with a link to /rango/category//add_page/. 
> Ensure that the link only appears when the requested category exists - with 
> or without pages. - I believe i did that in step 4 (not 100 % sure though)
>
> -Update rango/urls.py with a URL mapping to handle the above link.(Step 3 
> i believe)
>
>
> My question is why when clicking on add page and entering the details 
> needed it doesnt add the page at all its not even doing the is_valid() i 
> believe because the same function works perfectly when creating 
> categories(i get a message if the cat is already created or if i leave it 
> blank) but here it just redirects me and thats all?
>

-- 
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/64541164-831b-4aa4-bdb9-3282f54be6a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django 1.6 + Mysql

2014-07-08 Thread Hataraku Meeru
I'm pretty new at Django but I think I have gotten this when I am using
something that is undefined or doesn't have a value.

Are you sure you want:
self.connection.connection.converter._datetime_to_mysql(value)?

Is there one too many ".connection" s there?



On Tue, Jul 8, 2014 at 1:12 AM, Carlos Arturo Sanchez Rivera <
ing.c...@gmail.com> wrote:

> Check this tw:
>
>  https://twitter.com/iscenigmax/status/485657005567115264
>
> El sábado, 5 de julio de 2014 19:03:56 UTC-5, Henrique Oliveira escribió:
>
>> hi there,
>>
>> I am getting this error when using Mysql connector:
>>
>> File "/opt/b360/lib/python3.4/site-packages/django/core/handlers/base.py",
>> line 114, in get_response
>> response = wrapped_callback(request, *callback_args,
>> **callback_kwargs)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py",
>> line 69, in view
>> return self.dispatch(request, *args, **kwargs)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/views/generic/base.py",
>> line 87, in dispatch
>> return handler(request, *args, **kwargs)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py",
>> line 194, in get
>> self.object = self.get_object()
>>
>>   File "/opt/b360/lib/python3.4/site-packages/allauth/account/views.py",
>> line 258, in get_object
>> return queryset.get(key=self.kwargs["key"].lower())
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py",
>> line 301, in get
>> num = len(clone)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py",
>> line 77, in __len__
>> self._fetch_all()
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py",
>> line 854, in _fetch_all
>> self._result_cache = list(self.iterator())
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/query.py",
>> line 220, in iterator
>> for row in compiler.results_iter():
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py",
>> line 709, in results_iter
>> for rows in self.execute_sql(MULTI):
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py",
>> line 772, in execute_sql
>> sql, params = self.as_sql()
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/compiler.py",
>> line 93, in as_sql
>> where, w_params = self.query.where.as_sql(qn=qn,
>> connection=self.connection)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py",
>> line 103, in as_sql
>> sql, params = child.as_sql(qn=qn, connection=connection)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py",
>> line 106, in as_sql
>> sql, params = self.make_atom(child, qn, connection)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py",
>> line 181, in make_atom
>> lvalue, params = lvalue.process(lookup_type, params_or_value,
>> connection)
>>
>>   File "/opt/b360/lib/python3.4/site-packages/django/db/models/sql/where.py",
>> line 365, in process
>> connection=connection, prepared=True)
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py",
>> line 407, in get_db_prep_lookup
>> prepared=prepared)]
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/django/db/models/fields/__init__.py",
>> line 912, in get_db_prep_value
>> return connection.ops.value_to_db_datetime(value)
>>
>>   File 
>> "/opt/b360/lib/python3.4/site-packages/mysql/connector/django/base.py",
>> line 398, in value_to_db_datetime
>> return self.connection.connection.converter._datetime_to_mysql(value)
>>
>> AttributeError: 'NoneType' object has no attribute 'converter'
>>
>> Any Ideas?
>>
>  --
> 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/6deab4a4-99e0-4c0b-8ab8-6c4b831bf255%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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

Re: django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Frank Bieniek

Hi Marc,

this should fix it:
File 
"/home/orchestra/django-orchestra/orchestra/apps/accounts/models.py", 
line 9, in Account

user = models.OneToOneField(get_user_model(), related_name='accounts')

change it to:

user = models.OneToOneField(settings.AUTH_USER_MODEL, 
related_name='accounts')


Simply do not use get_user_model() in model definitions.

Thanks
Frank

--
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/53BBCDF0.30404%40produktlaunch.de.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Marc Aymerich
On Tue, Jul 8, 2014 at 12:54 PM, Frank Bieniek <
frank.bien...@produktlaunch.de> wrote:

> Hi Marc,
>
> this should fix it:
>
>  File "/home/orchestra/django-orchestra/orchestra/apps/accounts/models.py",
>> line 9, in Account
>> user = models.OneToOneField(get_user_model(),
>> related_name='accounts')
>>
> change it to:
>
> user = models.OneToOneField(settings.AUTH_USER_MODEL,
> related_name='accounts')
>
> Simply do not use get_user_model() in model definitions.
>

Good fix Frank,
thank you very much!!


-- 
Marc

-- 
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%2BDCN_u77dQySyR%3DYU1xzioskPJU6WOSsyukj70eAtWERFL9gg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Tom Evans
On Tue, Jul 8, 2014 at 11:54 AM, Frank Bieniek
 wrote:
> Simply do not use get_user_model() in model definitions.

The 1.7 relnotes should probably be updated with this instruction,
afaict there is nothing about this in the "App-loading refactor" nor
"django.contrib.auth" sections.

https://docs.djangoproject.com/en/1.7/releases/1.7/

Cheers

Tom

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


Re: SWFL Django users

2014-07-08 Thread acheraime
I'm in Bradenton / Sarasota

Sent from my iPhone

> On Jul 8, 2014, at 6:12 AM, Larry Martell  wrote:
> 
>> On Tue, Jul 8, 2014 at 12:07 AM, Janelle O'Dea  wrote:
>> Anybody in Southwest Florida who uses Django?
> 
> I am in Venice.
> 
> -- 
> 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/CACwCsY5f5m528ExJbsDBk-0LhJhCgdu7pA0GWv5SVX00LGwvtw%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/5CC7915E-F5E1-4CB3-8C54-0CE2027F2C58%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


How do I add a Foreign Key Field to a ModelForm in Django?

2014-07-08 Thread Ram Ganesh


it shows a drop down menu which is have mobile objects.
How to get mobile name?
confused about - self.queryset = 
forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")

models.py

class Mobile(models.Model):
name = models.CharField(max_length=50)
price = models.DecimalField(max_digits=7,decimal_places=2)

class Agent(models.Model):
mobile = models.ForeignKey(Mobile)
agent_name = models.CharField(max_length=50)


forms.py

class MobileForm(ModelForm):
class Meta:
model = Mobile

class AgentForm(ModelForm):
class Meta:
model = Agent

def __init__(self,  *args, **kwargs):
super(AgentForm, self).__init__(*args, **kwargs)
self.queryset = 
forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")


views.py

def add_agent(request):
if request.method == 'GET':
agent_form = AgentForm()
return  render(request,'agentForm.html', {'agent_form':agent_form,})
 


in addAgentForm.html

{% if not agents_details %}

{% csrf_token %}
 {{ agent_form }} 


{% endif %}


-- 
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/446e0adf-1766-43db-b5e9-3f68597a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I add a Foreign Key Field to a ModelForm in Django?

2014-07-08 Thread Tom Evans
On Tue, Jul 8, 2014 at 3:16 PM, Ram Ganesh  wrote:
>
>
> it shows a drop down menu which is have mobile objects.
> How to get mobile name?

https://docs.djangoproject.com/en/1.7/ref/forms/fields/#modelchoicefield

"""
The __str__ (__unicode__ on Python 2) method of the model will be
called to generate string representations of the objects for use in
the field’s choices; to provide customized representations, subclass
ModelChoiceField and override label_from_instance.
"""

So you can define a __unicode__ or __str__ method (python 2, python 3)
on your Mobile model, or define a sub-class of ModelChoiceField that
has a label_from_instance() method and use that instead of
ModelChoiceField.

> confused about - self.queryset =
> forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")

Well that line is quite confusing - I guess you are trying to set the
queryset that the ModelChoiceField will use, but that is not how you
do it:

Foo.objects.all() does not take arguments.
Model forms do not use a self.queryset attribute.
For a ModelChoiceField, Foo.objects.all() is the default queryset.

I guess you want a form like this:

class AgentForm(ModelForm):
mobile = forms.ModelChoiceField(label='Select mobile')
class Meta:
model = Agent
def __init__(self, *args, **kwargs):
super(AgentForm, self).__init__(*args, **kwargs)
self.fields['mobile'].queryset = Mobile.objects.all()

As I mentioned, Foo.objects.all() is the default, so if you are happy
with that, omit the entire __init__ method.

Cheers

Tom

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


Re: How do I add a Foreign Key Field to a ModelForm in Django?

2014-07-08 Thread Shubham Pansari
Add the following method in your class Mobile to make it return the name of
mobile object.

def __unicode__(self):
return self.name

This will return the name whenever a mobile object is created.




On Tue, Jul 8, 2014 at 7:46 PM, Ram Ganesh  wrote:

>
>
> it shows a drop down menu which is have mobile objects.
> How to get mobile name?
> confused about - self.queryset =
> forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")
>
> models.py
>
> class Mobile(models.Model):
> name = models.CharField(max_length=50)
> price = models.DecimalField(max_digits=7,decimal_places=2)
>
> class Agent(models.Model):
> mobile = models.ForeignKey(Mobile)
> agent_name = models.CharField(max_length=50)
> 
>
> forms.py
>
> class MobileForm(ModelForm):
> class Meta:
> model = Mobile
>
> class AgentForm(ModelForm):
> class Meta:
> model = Agent
>
> def __init__(self,  *args, **kwargs):
> super(AgentForm, self).__init__(*args, **kwargs)
> self.queryset =
> forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")
> 
>
> views.py
>
> def add_agent(request):
> if request.method == 'GET':
> agent_form = AgentForm()
> return  render(request,'agentForm.html',
> {'agent_form':agent_form,})
>  
>
>
> in addAgentForm.html
>
> {% if not agents_details %}
> 
> {% csrf_token %}
>  {{ agent_form }} 
> 
> 
> {% endif %}
> 
>
>  --
> 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/446e0adf-1766-43db-b5e9-3f68597a%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

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


Re: How do I add a Foreign Key Field to a ModelForm in Django?

2014-07-08 Thread Ram Ganesh
Thanks for your time 

-- 
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/493cb697-2653-4ae0-a9ed-a1c014924fb8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How do I add a Foreign Key Field to a ModelForm in Django?

2014-07-08 Thread Ram Ganesh
Thanks for your time 

On Tuesday, July 8, 2014 8:13:23 PM UTC+5:30, Shubham Pansari wrote:
>
> Add the following method in your class Mobile to make it return the name 
> of mobile object.
>
> def __unicode__(self):
> return self.name
>
> This will return the name whenever a mobile object is created.
>
>
>
>
> On Tue, Jul 8, 2014 at 7:46 PM, Ram Ganesh  > wrote:
>
>>
>>
>> it shows a drop down menu which is have mobile objects.
>> How to get mobile name?
>> confused about - self.queryset = 
>> forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")
>>
>> models.py
>>
>> class Mobile(models.Model):
>> name = models.CharField(max_length=50)
>> price = models.DecimalField(max_digits=7,decimal_places=2)
>>
>> class Agent(models.Model):
>> mobile = models.ForeignKey(Mobile)
>> agent_name = models.CharField(max_length=50)
>> 
>>
>> forms.py
>>
>> class MobileForm(ModelForm):
>> class Meta:
>> model = Mobile
>> 
>> class AgentForm(ModelForm):
>> class Meta:
>> model = Agent
>>
>> def __init__(self,  *args, **kwargs):
>> super(AgentForm, self).__init__(*args, **kwargs)
>> self.queryset = 
>> forms.ModelChoiceField(queryset=Mobile.objects.all(label="select mob")
>> 
>>
>> views.py
>>
>> def add_agent(request):
>> if request.method == 'GET':
>> agent_form = AgentForm()
>> return  render(request,'agentForm.html', 
>> {'agent_form':agent_form,})
>>  
>>
>>
>> in addAgentForm.html
>>
>> {% if not agents_details %}
>> 
>> {% csrf_token %}
>>  {{ agent_form }} 
>> 
>> 
>> {% endif %}
>> 
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/446e0adf-1766-43db-b5e9-3f68597a%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


Re: django beginner

2014-07-08 Thread Mando
Is there anything in your models for the other apps ex: photo, events, 
etc... ? syncdb will not do anything with those until you create your 
models. Besides that you just need to crate your view and a url pointer to 
it and you should get a response.



On Tuesday, July 8, 2014 3:13:14 AM UTC-5, ngangsia akumbo wrote:
>
> yes
>
>
>  

-- 
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/c5f55a23-bb91-44c7-a551-c531b08abb0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django beginner

2014-07-08 Thread Mando
can you post the output when you run syncdb?

On Tuesday, July 8, 2014 10:13:41 AM UTC-5, Mando wrote:
>
> Is there anything in your models for the other apps ex: photo, events, 
> etc... ? syncdb will not do anything with those until you create your 
> models. Besides that you just need to crate your view and a url pointer to 
> it and you should get a response.
>
>
>
> On Tuesday, July 8, 2014 3:13:14 AM UTC-5, ngangsia akumbo wrote:
>>
>> yes
>>
>>
>>  

-- 
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/f5fb97ec-541e-4eec-b373-8dface34cc0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NameError name 'lang' is not defined, corresponds to name 'polls' is not defined,

2014-07-08 Thread Rodrigo Caicedo
In your INSTALLED_APPS part in the configuration file, the registered 
application is called 'langu', and not 'lang'. If you copied your code, 
that's your problem.



On Sunday, July 6, 2014 2:26:15 AM UTC-5, gintare wrote:
>
> I am trying to create a project "lang" according Django documentation part 
> 1-4 tutorial.
>
> Folder structure:
>
> Scripts\lang\lang\_init_.py
> Scripts\lang\lang\settings.py
> Scripts\lang\lang\urls.py
>
> Scripts\lang\langu\_init_.py
> Scripts\lang\langu\admin.py
> Scripts\lang\langu\models.py
> Scripts\lang\langu\urlsu.py
> Scripts\lang\langu\views.py
>
> * Scripts\lang\lang\urls.py
> from django.conf.urls import patterns, include, url
>
> from django.contrib import admin
> admin.autodiscover()
>
> from langu import views
>
> urlpatterns = patterns('',   
> url(r'^langu/', include(langu.urlsu)),
> url(r'^admin/', include(admin.site.urls)),
> )
>
>
> * Scripts\lang\langu\urlsu.py
> from django.conf.urls import patterns, url
>
> from langu import views
>
> urlpatterns = patterns('',
> url(r'^$', views.index, name='index')
> )
>
>
> * Scripts\lang\lang\settings.py
> ... 
> INSTALLED_APPS = (
> 'django.contrib.admin',
> 'langu',
> )
> ROOT_URLCONF = 'lang.urls'
> 
>
>
>
>
> * Scripts\lang\langu\views.py
> from django.shortcuts import render
> from django.http import HttpResponse
>
> def index(request):
> return HttpResponse("Hello, world. You're at the poll index.")
>
>
>

-- 
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/a5d1e185-49e5-44aa-a13b-d496bec66375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: NameError name 'lang' is not defined, corresponds to name 'polls' is not defined,

2014-07-08 Thread Tom Evans
On Tue, Jul 8, 2014 at 6:54 PM, Rodrigo Caicedo
 wrote:
> In your INSTALLED_APPS part in the configuration file, the registered
> application is called 'langu', and not 'lang'. If you copied your code,
> that's your problem.

I don't think so, he has a project named "lang" (with "lang.settings")
that has an app named "langu".

>
>
>
> On Sunday, July 6, 2014 2:26:15 AM UTC-5, gintare wrote:
>>
>> I am trying to create a project "lang" according Django documentation part
>> 1-4 tutorial.
>>
>> Folder structure:
>>
>> Scripts\lang\lang\_init_.py
>> Scripts\lang\lang\settings.py
>> Scripts\lang\lang\urls.py
>>
>> Scripts\lang\langu\_init_.py
>> Scripts\lang\langu\admin.py
>> Scripts\lang\langu\models.py
>> Scripts\lang\langu\urlsu.py
>> Scripts\lang\langu\views.py

Where is manage.py? Should be at Scripts\lang\manage.py and have
appropriate contents.

I think "lang" and "langu" are not being picked up as python modules
because Scripts\lang is not being added to sys.path, which is one half
of manage.py's two jobs.

Cheers

Tom

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


Re: gunicorn myproject.wsgi:application invalid now.

2014-07-08 Thread Yannick Morin
Did you found a solution because I have the same issue.

On Thursday, June 19, 2014 9:27:32 AM UTC-4, Jacky wrote:
>
> I use gunicorn to deploy my project all the time, but today, in my new 
> project, it raise a error.
>
> I check here and there, google around, but it doesn't work.
>
> Maybe there was wrong with me.
>
> So I create a new project to test, here is all my process:
>
> $ virtualen env
> $ source env/bin/active
> $ pip install django
> $ pip install gunicorn
> $ django-admin.py startproject test_project
> $ cd test_project
> $ django-admin startapp myapp
> $ cd ..
> $ gunicorn test_project.wsgi:application
>
> 
> load_entry_point('gunicorn==19.0.0', 'console_scripts', 'gunicorn')()
> 
> raise HaltServer(reason, self.WORKER_BOOT_ERROR)
> gunicorn.errors.HaltServer: 
>
> I'm crazy about this error... oh fk.
>
> Any one can help me ? You r my god.
>
> Thank you very much!
>

-- 
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/a1e82a38-6010-4bc5-b97e-2703e92e866e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django newbie issues

2014-07-08 Thread Janelle
I've never worked in Ubuntu before, but from what I understand, there is no
text editor or Word or anything like that; everything is done through the
command line and there is no "desktop."

So, how would I open settings.py with Ubuntu?


On Tue, Jul 8, 2014 at 12:47 AM, Lachlan Musicman  wrote:

> If they aren't in settings, then the software would never have worked
> (if it needed a DB) :)
>
> You can just open settings.py with a text editor - notepad, wordpad,
> gedit, emacs/vim, even word if you want. It's just a text file.
>
> Cheers
> L.
>
> On 8 July 2014 14:05, Janelle O'Dea  wrote:
> > Again, super helpful. I just have a few more (hopefully not terribly
> > obvious) questions: this mechanism specified in settings.py; will I
> access
> > settings.py the same way as manage.py? python settings.py runserver?
> >
> > If I find the credentials for the database (if they aren't in
> settings.py, I
> > probably don't have them...am I screwed?) how can I get to and dump the
> db?
> >
> > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote:
> >>
> >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote:
> >> > Thank you, Mike. I haven't tried your first option yet, but I will
> >> > either today or tomorrow. What kinds of clues would I look for in
> >> > settings?
> >>
> >> Django needs credentials to access the database and there should be a
> >> mechanism specified in settings to get them. I don't keep such things
> >> directly in my settings because I keep them under version control. But
> >> if you had unfettered acccess to my machine you could discover where
> >> they are. You say you have the Ubuntu machine in question so you might
> >> be able to find them.
> >>
> >> The fingers crossed part is because the developer might have settled for
> >> the Django Admin superuser credentials being the same as for the
> database.
> >>
> >> If not, but you do have the database credentials you can dump the db,
> >> start another Django project with the same source code and load a new
> >> database to gain complete access to everything.
> >>
> >> Also: any ideas about my first question?
> >>
> >> No. I'm not a Mac person. But permissions on Macs are (I believe) the
> >> same as for Linux/Unix.
> >>
> >> Good luck
> >>
> >> Mike
> >>
> >> >
> >> > Everyone: I'm in Naples, Florida. If anyone is in the Southwest
> Florida
> >> > area and wants to try and help, I'll get you a Randy's key lime pie.
> Or
> >> > take you out for seafood. Or something.
> >> >
> >> > On Sunday, July 6, 2014 7:36:46 PM UTC-4, Janelle O'Dea wrote:
> >> >
> >> > Hi all,
> >> >
> >> > I have two separate Django questions.
> >> >
> >> > One: I am trying to learn how to use Django on my computer (Mac
> OS,
> >> > Mavericks) and was first getting the error "unable to open
> database"
> >> > when running "python manage.py syncdb." To fix it, I followed
> >> > instructions from here: https://coderwall.com/p/gl_grw
> >> > 
> >> > Now, I can't save settings.py. I realize this may have to do with
> >> > the advice to change permissions on the page I just linked to; how
> >> > can I change them back?
> >> > When I run the "python manage.py syncdb" command now, it tells me
> >> > there's a syntax error in settings.py. When I try to fix
> settings.py
> >> > and save it, it tells me ERRNO 13 permission denied.
> >> > I'm mainly trying to get a feel for Django because I may want to
> use
> >> > it in the near future.
> >> >
> >> > Two: At my workplace, someone produced a Django app on Ubuntu. The
> >> > app is a source database for reporters to view and add to (I work
> at
> >> > a newspaper). The main question: can I get the source information
> >> > out of this database so that we can recover it and use it, even if
> >> > the original creator of this app/database is not available? He
> isn't
> >> > responding to phone calls or emails, and bosses want me to see if
> I
> >> > can extract the info. I've never worked in Ubuntu before.
> >> >
> >> > Thanks for any help that anyone can provide.
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google
> >> > Groups "Django users" group.
> >> > To unsubscribe from this group and stop receiving emails from it, send
> >> > an email to django-users...@googlegroups.com
> >> > .
> >> > To post to this group, send email to django...@googlegroups.com
> >> > .
> >> > Visit this group at http://groups.google.com/group/django-users.
> >> > To view this discussion on the web visit
> >> >
> >> >
> https://groups.google.com/d/msgid/django-users/38f6d8d0-efe2-4739-9e79-bdcd35f2cc7b%40googlegroups.com
> >> >
> >> > <
> https://groups.google.com/d/msgid/django-users/38f6d8d0-efe2-4739-9e79-bdcd35f2cc7b%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
> >> > For more options, visit 

Re: Full text search available on PostgreSQL?

2014-07-08 Thread Bastian Kuberek
This looks promising. 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/CANRHea%3DMXR_2z4CSq21b1YoMtJad_GzjXG-RN%3DNV9h3eyjtg2A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


RE: Django newbie issues

2014-07-08 Thread Ilya Kazakevich
There are a lot of graphical user interfaces available for Linux, and Ubuntu 
bundles some of them. And there are a lot of text editos (like Sublime)
In command line you could use some command line editor like "vim" or "nano" or 
"emacs" or "F4" in Midnight Commander.

But I believe you need to read some books or tutorials about Ubuntu before. 


Ilya Kazakevich,
JetBrains PyCharm (Best Python/Django IDE)
http://www.jetbrains.com/pycharm/
"Develop with pleasure!"


>-Original Message-
>From: django-users@googlegroups.com
>[mailto:django-users@googlegroups.com] On Behalf Of Janelle
>Sent: Wednesday, July 09, 2014 12:25 AM
>To: django-users@googlegroups.com
>Subject: Re: Django newbie issues
>
>I've never worked in Ubuntu before, but from what I understand, there is no 
>text
>editor or Word or anything like that; everything is done through the command
>line and there is no "desktop."
>
>So, how would I open settings.py with Ubuntu?
>
>
>On Tue, Jul 8, 2014 at 12:47 AM, Lachlan Musicman 
>wrote:
>
>
>   If they aren't in settings, then the software would never have worked
>   (if it needed a DB) :)
>
>   You can just open settings.py with a text editor - notepad, wordpad,
>   gedit, emacs/vim, even word if you want. It's just a text file.
>
>   Cheers
>   L.
>
>
>   On 8 July 2014 14:05, Janelle O'Dea  wrote:
>   > Again, super helpful. I just have a few more (hopefully not terribly
>   > obvious) questions: this mechanism specified in settings.py; will I 
> access
>   > settings.py the same way as manage.py? python settings.py runserver?
>   >
>   > If I find the credentials for the database (if they aren't in 
> settings.py, I
>   > probably don't have them...am I screwed?) how can I get to and dump 
> the
>db?
>   >
>   > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote:
>   >>
>   >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote:
>   >> > Thank you, Mike. I haven't tried your first option yet, but I will
>   >> > either today or tomorrow. What kinds of clues would I look for in
>   >> > settings?
>   >>
>   >> Django needs credentials to access the database and there should be a
>   >> mechanism specified in settings to get them. I don't keep such things
>   >> directly in my settings because I keep them under version control. 
> But
>   >> if you had unfettered acccess to my machine you could discover where
>   >> they are. You say you have the Ubuntu machine in question so you 
> might
>   >> be able to find them.
>   >>
>   >> The fingers crossed part is because the developer might have settled 
> for
>   >> the Django Admin superuser credentials being the same as for the
>database.
>   >>
>   >> If not, but you do have the database credentials you can dump the db,
>   >> start another Django project with the same source code and load a new
>   >> database to gain complete access to everything.
>   >>
>   >> Also: any ideas about my first question?
>   >>
>   >> No. I'm not a Mac person. But permissions on Macs are (I believe) the
>   >> same as for Linux/Unix.
>   >>
>   >> Good luck
>   >>
>   >> Mike
>   >>
>   >> >
>   >> > Everyone: I'm in Naples, Florida. If anyone is in the Southwest 
> Florida
>   >> > area and wants to try and help, I'll get you a Randy's key lime 
> pie. Or
>   >> > take you out for seafood. Or something.
>   >> >
>   >> > On Sunday, July 6, 2014 7:36:46 PM UTC-4, Janelle O'Dea wrote:
>   >> >
>   >> > Hi all,
>   >> >
>   >> > I have two separate Django questions.
>   >> >
>   >> > One: I am trying to learn how to use Django on my computer
>(Mac OS,
>   >> > Mavericks) and was first getting the error "unable to open
>database"
>   >> > when running "python manage.py syncdb." To fix it, I followed
>   >> > instructions from here: https://coderwall.com/p/gl_grw
>   >> > 
>   >> > Now, I can't save settings.py. I realize this may have to do 
> with
>   >> > the advice to change permissions on the page I just linked to; 
> how
>   >> > can I change them back?
>   >> > When I run the "python manage.py syncdb" command now, it
>tells me
>   >> > there's a syntax error in settings.py. When I try to fix 
> settings.py
>   >> > and save it, it tells me ERRNO 13 permission denied.
>   >> > I'm mainly trying to get a feel for Django because I may want 
> to
>use
>   >> > it in the near future.
>   >> >
>   >> > Two: At my workplace, someone produced a Django app on
>Ubuntu. The
>   >> > app is a source database for reporters to view and add to (I 
> work
>at
>   >> > a newspaper). The main question: can I get the source
>information
>   >> > out of this database so that we can

Re: Full text search available on PostgreSQL?

2014-07-08 Thread jirka . vejrazka
Also, not directly tied to ModelAdmin, but you might want to take a look at 
django-watson.

 HTH

   Jirka

-Original Message-
From: Johannes Schneider 
Sender: django-users@googlegroups.com
Date: Tue, 08 Jul 2014 09:26:07 
To: 
Reply-To: django-users@googlegroups.com
Subject: Re: Full text search available on PostgreSQL?

you could have a look at djorm-ext-pgfulltex.

bg,
Johannes

On 28.06.2014 18:15, Bastian Kuberek wrote:
> Hi,
>
> Just saw that django.contrib.admin.ModelAdmin.search_fields
> 
>  full
> text search only support MySQL.
>
> Are there plans on any progress towards getting this functionality on
> PostgreSQL?
>
> 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/f0071b4f-a368-4512-a6f7-79d921e32141%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.


-- 
Johannes Schneider
Webentwicklung
johannes.schnei...@galileo-press.de
Tel.: +49.228.42150.xxx

Galileo Press GmbH
Rheinwerkallee 4 - 53227 Bonn - Germany
Tel.: +49.228.42.150.0 (Zentrale) .77 (Fax)
http://www.galileo-press.de/

Geschäftsführer: Tomas Wehren, Ralf Kaulisch, Rainer Kaltenecker
HRB 8363 Amtsgericht Bonn

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

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1509172023-1404852641-cardhu_decombobulator_blackberry.rim.net-509912240-%40b4.c3.bise7.blackberry.
For more options, visit https://groups.google.com/d/optout.


Re: Django newbie issues

2014-07-08 Thread Mike Dewhirst

On 9/07/2014 6:24 AM, Janelle wrote:

I've never worked in Ubuntu before, but from what I understand, there is
no text editor or Word or anything like that; everything is done through
the command line and there is no "desktop."Â

So, how would I open settings.py with Ubuntu?Â


You could try something like the Filezilla FTP client which will give 
you a pseudo-desktop and let you view files using a familiar editor. You 
would need login credentials of course.


The learning curves are not terribly steep but it seems you are facing a 
number of them.


Ilya is correct but you might make faster progress if you set out the 
problem(s) and ask for a local contractor to get in touch.





On Tue, Jul 8, 2014 at 12:47 AM, Lachlan Musicman mailto:data...@gmail.com>> wrote:

If they aren't in settings, then the software would never have worked
(if it needed a DB) :)

You can just open settings.py with a text editor - notepad, wordpad,
gedit, emacs/vim, even word if you want. It's just a text file.

Cheers
L.

On 8 July 2014 14:05, Janelle O'Dea mailto:jnode...@gmail.com>> wrote:
 > Again, super helpful. I just have a few more (hopefully not terribly
 > obvious) questions: this mechanism specified in settings.py; will
I access
 > settings.py the same way as manage.py? python settings.py runserver?
 >
 > If I find the credentials for the database (if they aren't in
settings.py, I
 > probably don't have them...am I screwed?) how can I get to and
dump the db?
 >
 > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote:
 >>
 >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote:
 >> > Thank you, Mike. I haven't tried your first option yet, but I will
 >> > either today or tomorrow. What kinds of clues would I look for in
 >> > settings?
 >>
 >> Django needs credentials to access the database and there should
be a
 >> mechanism specified in settings to get them. I don't keep such
things
 >> directly in my settings because I keep them under version
control. But
 >> if you had unfettered acccess to my machine you could discover where
 >> they are. You say you have the Ubuntu machine in question so you
might
 >> be able to find them.
 >>
 >> The fingers crossed part is because the developer might have
settled for
 >> the Django Admin superuser credentials being the same as for the
database.
 >>
 >> If not, but you do have the database credentials you can dump
the db,
 >> start another Django project with the same source code and load
a new
 >> database to gain complete access to everything.
 >>
 >> Also: any ideas about my first question?
 >>
 >> No. I'm not a Mac person. But permissions on Macs are (I
believe) the
 >> same as for Linux/Unix.
 >>
 >> Good luck
 >>
 >> Mike
 >>
 >> >
 >> > Everyone: I'm in Naples, Florida. If anyone is in the
Southwest Florida
 >> > area and wants to try and help, I'll get you a Randy's key
lime pie. Or
 >> > take you out for seafood. Or something.
 >> >
 >> > On Sunday, July 6, 2014 7:36:46 PM UTC-4, Janelle O'Dea wrote:
 >> >
 >> > Â  Â  Hi all,
 >> >
 >> > Â  Â  I have two separate Django questions.
 >> >
 >> > Â  Â  One: I am trying to learn how to use Django on my
computer (Mac OS,
 >> > Â  Â  Mavericks) and was first getting the error "unable to
open database"
 >> > Â  Â  when running "python manage.py syncdb." To fix it, I
followed
 >> > Â  Â  instructions from here: https://coderwall.com/p/gl_grw
 >> > Â  Â  
 >> > Â  Â  Now, I can't save settings.py. I realize this may have
to do with
 >> > Â  Â  the advice to change permissions on the page I just
linked to; how
 >> > Â  Â  can I change them back?
 >> > Â  Â  When I run the "python manage.py syncdb" command now, it
tells me
 >> > Â  Â  there's a syntax error in settings.py. When I try to fix
settings.py
 >> > Â  Â  and save it, it tells me ERRNO 13 permission denied.
 >> > Â  Â  I'm mainly trying to get a feel for Django because I may
want to use
 >> > Â  Â  it in the near future.
 >> >
 >> > Â  Â  Two: At my workplace, someone produced a Django app on
Ubuntu. The
 >> > Â  Â  app is a source database for reporters to view and add
to (I work at
 >> > Â  Â  a newspaper). The main question: can I get the source
information
 >> > Â  Â  out of this database so that we can recover it and use
it, even if
 >> > Â  Â  the original creator of this app/database is not
available? He isn't
 >> > Â  Â  responding to phone calls or emails, and bosses want me
to see if I
 >> > Â  Â  can extract the info. I've never worked in Ubuntu before.
 >> >
 >> > Â  Â  Thanks for any help that anyone can provide

Re: Django newbie issues

2014-07-08 Thread Lachlan Musicman
On 9 July 2014 06:24, Janelle  wrote:
> I've never worked in Ubuntu before, but from what I understand, there is no
> text editor or Word or anything like that; everything is done through the
> command line and there is no "desktop."
>
> So, how would I open settings.py with Ubuntu?
>

GEdit is a text editor that comes with Ubuntu by default if it is a
desktop computer. If you only have command line access, use "less" or
"more", which are both pre-installed.

less /path/settings.py

or

more /path/settings.py

Ilya is technically correct ("vim" or "nano" or "emacs"), although
these are explicitly editors. You only need to read the file, so less
or more should be sufficient.

cheers
L.





-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

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


Some creating Forms from models snags.

2014-07-08 Thread Don Fox
In the Creating forms from Models documentation 
*https://docs.djangoproject.com/en/1.6/topics/forms/modelforms/ *I'm having 
some problems.

First I'm placing the code from the first block (green section), where the 
class ArticleForms is defined in the shell in a *forms.py *file in a myapp 
app of a project.

Second, the models in the second and third green blocks are located in the 
myapp/models.py with the class AuthorForm and class BookForm classes in the 
from the first block commented out.  


On arriving at the 4th green block that has

>>> from myapp.models import Article>>> from myapp.forms import ArticleForm

I get this response from a syncdb:



File 
"/Users/donfox1/Projects/DjangoExplorations/PycharmProjects/classBased/myapp/forms.py",
 
line 17, in 

from myapp.models import Article

ImportError: cannot import name Article

DONs-iMac:classBased donfox1$ 


Can anyone tell me why I can't import my Article class from my 
app/models.py.


-- 
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/d0812a2c-ef08-4615-8255-7657ad6c49e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Django newbie issues

2014-07-08 Thread Janelle
Thanks, all, for the advice.
I am facing a number of learning curves, and I appreciate that you all take
time from the more advanced work you do to help me out. I'll seek someone
local.




On Tue, Jul 8, 2014 at 6:09 PM, Mike Dewhirst  wrote:

> On 9/07/2014 6:24 AM, Janelle wrote:
>
>> I've never worked in Ubuntu before, but from what I understand, there is
>> no text editor or Word or anything like that; everything is done through
>> the command line and there is no "desktop."Â
>>
>> So, how would I open settings.py with Ubuntu?Â
>>
>
> You could try something like the Filezilla FTP client which will give you
> a pseudo-desktop and let you view files using a familiar editor. You would
> need login credentials of course.
>
> The learning curves are not terribly steep but it seems you are facing a
> number of them.
>
> Ilya is correct but you might make faster progress if you set out the
> problem(s) and ask for a local contractor to get in touch.
>
>
>>
>> On Tue, Jul 8, 2014 at 12:47 AM, Lachlan Musicman > > wrote:
>>
>> If they aren't in settings, then the software would never have worked
>> (if it needed a DB) :)
>>
>> You can just open settings.py with a text editor - notepad, wordpad,
>> gedit, emacs/vim, even word if you want. It's just a text file.
>>
>> Cheers
>> L.
>>
>> On 8 July 2014 14:05, Janelle O'Dea > > wrote:
>>  > Again, super helpful. I just have a few more (hopefully not
>> terribly
>>  > obvious) questions: this mechanism specified in settings.py; will
>> I access
>>  > settings.py the same way as manage.py? python settings.py
>> runserver?
>>  >
>>  > If I find the credentials for the database (if they aren't in
>> settings.py, I
>>  > probably don't have them...am I screwed?) how can I get to and
>> dump the db?
>>  >
>>  > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote:
>>  >>
>>  >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote:
>>  >> > Thank you, Mike. I haven't tried your first option yet, but I
>> will
>>  >> > either today or tomorrow. What kinds of clues would I look for
>> in
>>  >> > settings?
>>  >>
>>  >> Django needs credentials to access the database and there should
>> be a
>>  >> mechanism specified in settings to get them. I don't keep such
>> things
>>  >> directly in my settings because I keep them under version
>> control. But
>>  >> if you had unfettered acccess to my machine you could discover
>> where
>>  >> they are. You say you have the Ubuntu machine in question so you
>> might
>>  >> be able to find them.
>>  >>
>>  >> The fingers crossed part is because the developer might have
>> settled for
>>  >> the Django Admin superuser credentials being the same as for the
>> database.
>>  >>
>>  >> If not, but you do have the database credentials you can dump
>> the db,
>>  >> start another Django project with the same source code and load
>> a new
>>  >> database to gain complete access to everything.
>>  >>
>>  >> Also: any ideas about my first question?
>>  >>
>>  >> No. I'm not a Mac person. But permissions on Macs are (I
>> believe) the
>>  >> same as for Linux/Unix.
>>  >>
>>  >> Good luck
>>  >>
>>  >> Mike
>>  >>
>>  >> >
>>  >> > Everyone: I'm in Naples, Florida. If anyone is in the
>> Southwest Florida
>>  >> > area and wants to try and help, I'll get you a Randy's key
>> lime pie. Or
>>  >> > take you out for seafood. Or something.
>>  >> >
>>  >> > On Sunday, July 6, 2014 7:36:46 PM UTC-4, Janelle O'Dea wrote:
>>  >> >
>>  >> > Â  Â  Hi all,
>>  >> >
>>  >> > Â  Â  I have two separate Django questions.
>>  >> >
>>  >> > Â  Â  One: I am trying to learn how to use Django on my
>> computer (Mac OS,
>>  >> > Â  Â  Mavericks) and was first getting the error "unable to
>> open database"
>>  >> > Â  Â  when running "python manage.py syncdb." To fix it, I
>> followed
>>  >> > Â  Â  instructions from here: https://coderwall.com/p/gl_grw
>>  >> > Â  Â  
>>  >> > Â  Â  Now, I can't save settings.py. I realize this may have
>> to do with
>>  >> > Â  Â  the advice to change permissions on the page I just
>> linked to; how
>>  >> > Â  Â  can I change them back?
>>  >> > Â  Â  When I run the "python manage.py syncdb" command now, it
>> tells me
>>  >> > Â  Â  there's a syntax error in settings.py. When I try to fix
>> settings.py
>>  >> > Â  Â  and save it, it tells me ERRNO 13 permission denied.
>>  >> > Â  Â  I'm mainly trying to get a feel for Django because I may
>> want to use
>>  >> > Â  Â  it in the near future.
>>  >> >
>>  >> > Â  Â  Two: At my workplace, someone produced a Django app on
>> Ubu

Re: Django newbie issues

2014-07-08 Thread Lachlan Musicman
(GEdit and less/more shouldn't require too much learning - gedit is
literally the equivalent of Notepad, less and more are what the 70s
look like.

L.

On 9 July 2014 12:00, Janelle  wrote:
> Thanks, all, for the advice.
> I am facing a number of learning curves, and I appreciate that you all take
> time from the more advanced work you do to help me out. I'll seek someone
> local.
>
>
>
>
> On Tue, Jul 8, 2014 at 6:09 PM, Mike Dewhirst  wrote:
>>
>> On 9/07/2014 6:24 AM, Janelle wrote:
>>>
>>> I've never worked in Ubuntu before, but from what I understand, there is
>>> no text editor or Word or anything like that; everything is done through
>>> the command line and there is no "desktop."Â
>>>
>>> So, how would I open settings.py with Ubuntu?Â
>>
>>
>> You could try something like the Filezilla FTP client which will give you
>> a pseudo-desktop and let you view files using a familiar editor. You would
>> need login credentials of course.
>>
>> The learning curves are not terribly steep but it seems you are facing a
>> number of them.
>>
>> Ilya is correct but you might make faster progress if you set out the
>> problem(s) and ask for a local contractor to get in touch.
>>
>>>
>>>
>>> On Tue, Jul 8, 2014 at 12:47 AM, Lachlan Musicman >> > wrote:
>>>
>>> If they aren't in settings, then the software would never have worked
>>> (if it needed a DB) :)
>>>
>>> You can just open settings.py with a text editor - notepad, wordpad,
>>> gedit, emacs/vim, even word if you want. It's just a text file.
>>>
>>> Cheers
>>> L.
>>>
>>> On 8 July 2014 14:05, Janelle O'Dea >> > wrote:
>>>  > Again, super helpful. I just have a few more (hopefully not
>>> terribly
>>>  > obvious) questions: this mechanism specified in settings.py; will
>>> I access
>>>  > settings.py the same way as manage.py? python settings.py
>>> runserver?
>>>  >
>>>  > If I find the credentials for the database (if they aren't in
>>> settings.py, I
>>>  > probably don't have them...am I screwed?) how can I get to and
>>> dump the db?
>>>  >
>>>  > On Monday, July 7, 2014 7:30:44 PM UTC-4, Mike Dewhirst wrote:
>>>  >>
>>>  >> On 8/07/2014 2:22 AM, Janelle O'Dea wrote:
>>>  >> > Thank you, Mike. I haven't tried your first option yet, but I
>>> will
>>>  >> > either today or tomorrow. What kinds of clues would I look for
>>> in
>>>  >> > settings?
>>>  >>
>>>  >> Django needs credentials to access the database and there should
>>> be a
>>>  >> mechanism specified in settings to get them. I don't keep such
>>> things
>>>  >> directly in my settings because I keep them under version
>>> control. But
>>>  >> if you had unfettered acccess to my machine you could discover
>>> where
>>>  >> they are. You say you have the Ubuntu machine in question so you
>>> might
>>>  >> be able to find them.
>>>  >>
>>>  >> The fingers crossed part is because the developer might have
>>> settled for
>>>  >> the Django Admin superuser credentials being the same as for the
>>> database.
>>>  >>
>>>  >> If not, but you do have the database credentials you can dump
>>> the db,
>>>  >> start another Django project with the same source code and load
>>> a new
>>>  >> database to gain complete access to everything.
>>>  >>
>>>  >> Also: any ideas about my first question?
>>>  >>
>>>  >> No. I'm not a Mac person. But permissions on Macs are (I
>>> believe) the
>>>  >> same as for Linux/Unix.
>>>  >>
>>>  >> Good luck
>>>  >>
>>>  >> Mike
>>>  >>
>>>  >> >
>>>  >> > Everyone: I'm in Naples, Florida. If anyone is in the
>>> Southwest Florida
>>>  >> > area and wants to try and help, I'll get you a Randy's key
>>> lime pie. Or
>>>  >> > take you out for seafood. Or something.
>>>  >> >
>>>  >> > On Sunday, July 6, 2014 7:36:46 PM UTC-4, Janelle O'Dea wrote:
>>>  >> >
>>>  >> > Â  Â  Hi all,
>>>  >> >
>>>  >> > Â  Â  I have two separate Django questions.
>>>  >> >
>>>  >> > Â  Â  One: I am trying to learn how to use Django on my
>>> computer (Mac OS,
>>>  >> > Â  Â  Mavericks) and was first getting the error "unable to
>>> open database"
>>>  >> > Â  Â  when running "python manage.py syncdb." To fix it, I
>>> followed
>>>  >> > Â  Â  instructions from here: https://coderwall.com/p/gl_grw
>>>  >> > Â  Â  
>>>  >> > Â  Â  Now, I can't save settings.py. I realize this may have
>>> to do with
>>>  >> > Â  Â  the advice to change permissions on the page I just
>>> linked to; how
>>>  >> > Â  Â  can I change them back?
>>>  >> > Â  Â  When I run the "python manage.py syncdb" command now, it
>>> tells me
>>>  >> > Â  Â  there's a syntax error in settings.py. When I try to fix

Re: Some creating Forms from models snags.

2014-07-08 Thread Lachlan Musicman
There is no class Article in any of those blocks. That's why.

Try adding this to models.py this:

class Article(models.Model):
  name = models.CharField(max_length=25)
  body = models.TextField()
  author = models.ForeignKey(Author)

That should help.

cheers
L.

On 9 July 2014 11:31, Don Fox  wrote:
> In the Creating forms from Models documentation
> https://docs.djangoproject.com/en/1.6/topics/forms/modelforms/ I'm having
> some problems.
>
> First I'm placing the code from the first block (green section), where the
> class ArticleForms is defined in the shell in a forms.py file in a myapp app
> of a project.
>
> Second, the models in the second and third green blocks are located in the
> myapp/models.py with the class AuthorForm and class BookForm classes in the
> from the first block commented out.
>
>
> On arriving at the 4th green block that has
>
 from myapp.models import Article
 from myapp.forms import ArticleForm
>
> I get this response from a syncdb:
>
>
>
> File
> "/Users/donfox1/Projects/DjangoExplorations/PycharmProjects/classBased/myapp/forms.py",
> line 17, in 
>
> from myapp.models import Article
>
> ImportError: cannot import name Article
>
> DONs-iMac:classBased donfox1$
>
>
>
> Can anyone tell me why I can't import my Article class from my
> app/models.py.
>
>
> --
> 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/d0812a2c-ef08-4615-8255-7657ad6c49e5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

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


Re: Some creating Forms from models snags.

2014-07-08 Thread Lachlan Musicman
Or something like this:

https://docs.djangoproject.com/en/1.6/intro/overview/

L.

On 9 July 2014 12:29, Lachlan Musicman  wrote:
> There is no class Article in any of those blocks. That's why.
>
> Try adding this to models.py this:
>
> class Article(models.Model):
>   name = models.CharField(max_length=25)
>   body = models.TextField()
>   author = models.ForeignKey(Author)
>
> That should help.
>
> cheers
> L.
>
> On 9 July 2014 11:31, Don Fox  wrote:
>> In the Creating forms from Models documentation
>> https://docs.djangoproject.com/en/1.6/topics/forms/modelforms/ I'm having
>> some problems.
>>
>> First I'm placing the code from the first block (green section), where the
>> class ArticleForms is defined in the shell in a forms.py file in a myapp app
>> of a project.
>>
>> Second, the models in the second and third green blocks are located in the
>> myapp/models.py with the class AuthorForm and class BookForm classes in the
>> from the first block commented out.
>>
>>
>> On arriving at the 4th green block that has
>>
> from myapp.models import Article
> from myapp.forms import ArticleForm
>>
>> I get this response from a syncdb:
>>
>>
>>
>> File
>> "/Users/donfox1/Projects/DjangoExplorations/PycharmProjects/classBased/myapp/forms.py",
>> line 17, in 
>>
>> from myapp.models import Article
>>
>> ImportError: cannot import name Article
>>
>> DONs-iMac:classBased donfox1$
>>
>>
>>
>> Can anyone tell me why I can't import my Article class from my
>> app/models.py.
>>
>>
>> --
>> 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/d0812a2c-ef08-4615-8255-7657ad6c49e5%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> The idea is that a beautiful image is frameable. Everything you need
> to see is there: It’s everything you want, and it’s very pleasing
> because there’s no extra information that you don’t get to see.
> Everything’s in a nice package for you. But sublime art is
> unframeable: It’s an image or idea that implies that there’s a bigger
> image or idea that you can’t see: You’re only getting to look at a
> fraction of it, and in that way it’s both beautiful and scary, because
> it’s reminding you that there’s more that you don’t have access to.
> It’s now sort of left the piece itself and it’s become your own
> invention, so it’s personal as well as being scary as well as being
> beautiful, which is what I really like about art like that.
> ---
> Adventure Time http://theholenearthecenteroftheworld.com/



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

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


Re: Some creating Forms from models snags.

2014-07-08 Thread Don Fox


On Tuesday, July 8, 2014 10:30:23 PM UTC-4, Lachlan Musicman wrote:
>
> There is no class Article in any of those blocks. That's why. 
>
> Try adding this to models.py this: 
>
> class Article(models.Model): 
>   name = models.CharField(max_length=25) 
>   body = models.TextField() 
>   author = models.ForeignKey(Author) 
>
> That should help. 
>
> cheers 
> L. 
>
> On 9 July 2014 11:31, Don Fox > wrote: 
> > In the Creating forms from Models documentation 
> > https://docs.djangoproject.com/en/1.6/topics/forms/modelforms/ I'm 
> having 
> > some problems. 
> > 
> > First I'm placing the code from the first block (green section), where 
> the 
> > class ArticleForms is defined in the shell in a forms.py file in a myapp 
> app 
> > of a project. 
> > 
> > Second, the models in the second and third green blocks are located in 
> the 
> > myapp/models.py with the class AuthorForm and class BookForm classes in 
> the 
> > from the first block commented out. 
> > 
> > 
> > On arriving at the 4th green block that has 
> > 
>  from myapp.models import Article 
>  from myapp.forms import ArticleForm 
> > 
> > I get this response from a syncdb: 
> > 
> > 
> > 
> > File 
> > 
> "/Users/donfox1/Projects/DjangoExplorations/PycharmProjects/classBased/myapp/forms.py",
>  
>
> > line 17, in  
> > 
> > from myapp.models import Article 
> > 
> > ImportError: cannot import name Article 
> > 
> > DONs-iMac:classBased donfox1$ 
> > 
> > 
> > 
> > Can anyone tell me why I can't import my Article class from my 
> > app/models.py. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "Django users" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to django-users...@googlegroups.com . 
> > To post to this group, send email to django...@googlegroups.com 
> . 
> > Visit this group at http://groups.google.com/group/django-users. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/django-users/d0812a2c-ef08-4615-8255-7657ad6c49e5%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>
>
> -- 
> The idea is that a beautiful image is frameable. Everything you need 
> to see is there: It’s everything you want, and it’s very pleasing 
> because there’s no extra information that you don’t get to see. 
> Everything’s in a nice package for you. But sublime art is 
> unframeable: It’s an image or idea that implies that there’s a bigger 
> image or idea that you can’t see: You’re only getting to look at a 
> fraction of it, and in that way it’s both beautiful and scary, because 
> it’s reminding you that there’s more that you don’t have access to. 
> It’s now sort of left the piece itself and it’s become your own 
> invention, so it’s personal as well as being scary as well as being 
> beautiful, which is what I really like about art like that. 
> ---
>  
>
> Adventure Time http://theholenearthecenteroftheworld.com/ 
>


I should have mentioned that I already had this method in the models.py:

class Article (models.Model):
pub_date = models.DateField()
headline = models.CharField(max_length = 30)
content  = models.CharField(max_length=500)
reporter = models.CharField(max_length=20)

This was assumed to be needed after the definition of the article form in 
the shell. 
As I said I have that same class ArticleForm in the forms.py

Thanks for the reply.
 

-- 
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/02faafc6-0427-4b81-8fbd-a53109150896%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Some creating Forms from models snags.

2014-07-08 Thread Lachlan Musicman
On 9 July 2014 13:19, Don Fox  wrote:
>
>
> I should have mentioned that I already had this method in the models.py:
>
> class Article (models.Model):
> pub_date = models.DateField()
> headline = models.CharField(max_length = 30)
> content  = models.CharField(max_length=500)
> reporter = models.CharField(max_length=20)
>
> This was assumed to be needed after the definition of the article form in
> the shell.
> As I said I have that same class ArticleForm in the forms.py
>
> Thanks for the reply.

Do you still have the same issue?

If so I would suggest it's a PATH problem.

In classBased (which is the folder that has manage.py?), run

python manage.py

and then do

from myapp.models import Article

if that fails, it is a PATH problem.

Googling Django PATH has heaps on it, but something like this shows the way:

https://community.webfaction.com/questions/16064/django-module-import-problem


cheers
L.



-- 
The idea is that a beautiful image is frameable. Everything you need
to see is there: It’s everything you want, and it’s very pleasing
because there’s no extra information that you don’t get to see.
Everything’s in a nice package for you. But sublime art is
unframeable: It’s an image or idea that implies that there’s a bigger
image or idea that you can’t see: You’re only getting to look at a
fraction of it, and in that way it’s both beautiful and scary, because
it’s reminding you that there’s more that you don’t have access to.
It’s now sort of left the piece itself and it’s become your own
invention, so it’s personal as well as being scary as well as being
beautiful, which is what I really like about art like that.
---
Adventure Time http://theholenearthecenteroftheworld.com/

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