Re: I can't load fixtures

2014-08-17 Thread Davide Scatto
when you run a test the django fixture discoverer search in all fixture 
subfolder in apps registered in settings.INSTALLED_APPS.
you don't need __init__.py file nor FIXTURE_DIRS (fixture folder is a 
subfolder of app folder, isn't it?).

did you add fixture param in yr test class?

what version of django are you using?

Davide

Il giorno giovedì 14 agosto 2014 19:05:30 UTC+2, Daniel Grace ha scritto:
>
> I created a fixtures file called testdata.xml in a fixtures folder, but I 
> can't load the fixtures file into the database.
>
> I placed an __init__.py file in the fixtures folder (not sure about this 
> step, is it needed?)
>
> I put the fixtures directory in settings.py:
> FIXTURE_DIRS = (
>'/myapp/fixtures/',
> )
>
> I tried two ways to load the fixture, but neither worked:
> >python manage.py syncdb
> Creating tables ...
> Installing custom SQL ...
> Installing indexes ...
> Installed 0 object(s) from 0 fixture(s)
> >python manage.py loaddata "myapp/fixtures/testdata.xml"
> C:\myenv\lib\site-packages\django\core\management\commands\loaddata.py:216: 
> User
> Warning: No fixture named 'myapp/fixtures/testdata' found.
>   warnings.warn("No fixture named '%s' found." % fixture_name)
> Installed 0 object(s) from 0 fixture(s)
>
> Any ideas?
> 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/58cab9f2-8c75-47c8-bcd6-0d257c683154%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: I can't load fixtures

2014-08-14 Thread eprikazc
'/myapps/fixtures' is treated as absolute path. Try removing leading slash 
to make it relative. Either you can write full absolute path to the 
directory.

thanks,
Eugene


On Thursday, August 14, 2014 9:05:30 PM UTC+4, Daniel Grace wrote:
>
> I created a fixtures file called testdata.xml in a fixtures folder, but I 
> can't load the fixtures file into the database.
>
> I placed an __init__.py file in the fixtures folder (not sure about this 
> step, is it needed?)
>
> I put the fixtures directory in settings.py:
> FIXTURE_DIRS = (
>'/myapp/fixtures/',
> )
>
> I tried two ways to load the fixture, but neither worked:
> >python manage.py syncdb
> Creating tables ...
> Installing custom SQL ...
> Installing indexes ...
> Installed 0 object(s) from 0 fixture(s)
> >python manage.py loaddata "myapp/fixtures/testdata.xml"
> C:\myenv\lib\site-packages\django\core\management\commands\loaddata.py:216: 
> User
> Warning: No fixture named 'myapp/fixtures/testdata' found.
>   warnings.warn("No fixture named '%s' found." % fixture_name)
> Installed 0 object(s) from 0 fixture(s)
>
> Any ideas?
> 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/22a1ef6b-131e-43b1-9261-a0f1cdce27c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


I can't load fixtures

2014-08-14 Thread Daniel Grace
I created a fixtures file called testdata.xml in a fixtures folder, but I 
can't load the fixtures file into the database.

I placed an __init__.py file in the fixtures folder (not sure about this 
step, is it needed?)

I put the fixtures directory in settings.py:
FIXTURE_DIRS = (
   '/myapp/fixtures/',
)

I tried two ways to load the fixture, but neither worked:
>python manage.py syncdb
Creating tables ...
Installing custom SQL ...
Installing indexes ...
Installed 0 object(s) from 0 fixture(s)
>python manage.py loaddata "myapp/fixtures/testdata.xml"
C:\myenv\lib\site-packages\django\core\management\commands\loaddata.py:216: 
User
Warning: No fixture named 'myapp/fixtures/testdata' found.
  warnings.warn("No fixture named '%s' found." % fixture_name)
Installed 0 object(s) from 0 fixture(s)

Any ideas?
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/92c480fa-66ba-4554-888d-27bbd6fb958d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.