Re: Missing manage.py & settings.py

2019-03-08 Thread Sithembewena L. Dube
Understand the difference between a project and an app. See "Projects vs.
apps" at the following link (correct for current version).

https://docs.djangoproject.com/en/2.1/intro/tutorial01/

Kind regards,
Sithembewena


*Sent with Shift
*

On Sat, Mar 9, 2019 at 7:07 AM  wrote:

> after installing django inside virtual environment write following
> commands:
> django-admin startproject "you_project_name"
> go inside this folder and then type
> python manage.py startapp "your app name"
> this command will create apps
> and after this include your app inside installed apps
>
> On Saturday, March 2, 2019 at 6:44:05 AM UTC+5:30, jtaylor___ wrote:
>>
>> I pip installed a Django project, but it doesn’t have a manage.py or
>> settings.py.  I checked the repo on GitHub, and those files don’t exist
>> there either.  Is this an alternate way of doing a Django project that I’m
>> not aware of?
>>
>> FWIW, the project is django-wiki.
>>
>> TIA
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/42aed5a2-018d-4f3b-b4b4-0e6430f03be8%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAH-SnCATnr-oydCmM5KgGLc9xuQG31zjtV4_savd35TNAB3MWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Missing manage.py & settings.py

2019-03-08 Thread gauravsrivastava2k17
after installing django inside virtual environment write following commands:
django-admin startproject "you_project_name"
go inside this folder and then type
python manage.py startapp "your app name"
this command will create apps
and after this include your app inside installed apps

On Saturday, March 2, 2019 at 6:44:05 AM UTC+5:30, jtaylor___ wrote:
>
> I pip installed a Django project, but it doesn’t have a manage.py or 
> settings.py.  I checked the repo on GitHub, and those files don’t exist 
> there either.  Is this an alternate way of doing a Django project that I’m 
> not aware of? 
>
> FWIW, the project is django-wiki. 
>
> TIA

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/42aed5a2-018d-4f3b-b4b4-0e6430f03be8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Missing manage.py & settings.py

2019-03-08 Thread lujate
I know what startapp is for. I'm just wondering why it's applicable here.

To recap, I have a 3rd party Django app that I need to pip install. I
created a project to contain the app. When I add the app to installed apps
in my settings,  Django errors on start up.

If startapp is still required for a pip installed app, I can do that easily
enough. Does it matter the name of the app I create? I'm afraid I'll have a
conflict if I use the same name as the pip installed app.

Thanks

On Fri, Mar 8, 2019, 2:46 AM Andréas Kühne 
wrote:

> The reason you have startapp in django-admin is because you might want to
> start a new part of your project from scratch. For example if you are
> selling ice-cream online and have models for ice-creams in the ice_cream
> app and you want to start selling cupcakes as well, you can then start a
> new app called cupcakes that has the templates, models and views for
> cupcakes.
>
> Regards,
>
> Andréas
>
>
> Den fre 8 mars 2019 kl 03:13 skrev lujate :
>
>> I'm sorry,  I don't understand what you're trying to say.
>>
>> On Thu, Mar 7, 2019, 12:23 AM Gil Obradors >
>>> For create it  yourself from 0
>>>
>>> El dj., 7 de març 2019, 01:05, lujate  va
>>> escriure:
>>>
 What purpose does startapp serve when you're only using a pip installed
 app?



 On Wed, Mar 6, 2019, 11:12 AM ambesh chand shahi >>> wrote:

> You should first type django-admin startproject "your project name".
>
> Then if you are using python3 then type python3 manage.py startapp
> "appname".
>
> After that include that app in settings.py in Installed apps.
>
>
> On Tue, 5 Mar 2019, 07:29 lujate,  wrote:
>
>> I created a scratch project for R
>> I did a runserver and confirmed the default landing page.
>> I added the apps to the settings file per the docs.
>> I ran a migrate per the docs and got an error on one of the apps.
>> I tried a runserver and got the same error.
>> I dug into site-packages and confirmed the app was there.
>>
>> I added multiple apps, and there's only an error on one. I don't know
>> if that's because the others are fine,  or it just stopped at the first
>> error.
>>
>> Thanks
>>
>> On Mon, Mar 4, 2019, 6:59 PM Mario Martinez > wrote:
>>
>>> Did you run the django-admin startproject your_project_name command?
>>>
>>> On Fri, Mar 1, 2019, 6:13 PM lujate  wrote:
>>>
 I pip installed a Django project, but it doesn’t have a manage.py
 or settings.py.  I checked the repo on GitHub, and those files don’t 
 exist
 there either.  Is this an alternate way of doing a Django project that 
 I’m
 not aware of?

 FWIW, the project is django-wiki.

 TIA

 --
 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 https://groups.google.com/group/django-users.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/django-users/30fc5fdc-6bd6-4807-99ff-c41e6e109642%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.

>>> --
>>> You received this message because you are subscribed to a topic in
>>> the Google Groups "Django users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/django-users/UNcOwcHuox8/unsubscribe
>>> .
>>> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CAOXNLNvP-vePzZj1zEeN-kVRiBPwEk_A6x64aJ0Y312uaegE3w%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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> 

Re: Static files in production [Was: How does WSGI work?]

2019-03-08 Thread Tal
Ok - maybe I'll try to get a hold of Grahame Dumpleton when I have some 
time.

Thanks guys

PS.

Python frameworks like Flask or Django are good at making decisions about 
what response to return for a given request, and returning it.
In most cases, that response is an HTML page, or json, or something similar.
If a request comes that requires you to return a file however, this is best 
done by your web server software (nginx, apache, etc).
It can do it way more efficiently.
In production, if you set everything up as recommended, the request 
initially hits your web server, which decides if the request should be sent 
to Django, or if a file should be returned directly.
That decision is usually easy to make for the web server because all static 
files (files that never change, like images) are all in the same directory.
When you are writing your django project, you'll probably have individual 
static directories for every app.
As Mike pointed out, the "./manage.py collectstatic" command will gather 
all these static files from all your apps into a single folder, so that
your web server can easily determine if it should return a static file from 
that folder, or send the request to django.


On Thursday, March 7, 2019 at 6:41:39 PM UTC-7, Mike Dewhirst wrote:
>
> On 8/03/2019 11:54 am, Joel Mathew wrote: 
> > There's a mod_wsgi_express thread that Graham monitors, so he's sure 
> > to get feedback from there 
> > 
> > Understanding this better could help me solve static file blues. Most 
> > of the time I don't understand why my static files fine aren't served 
> > when I move to production. 
>
> Usually it is because they are in the wrong place. 
>
> Your production webserver (in my case Apache) probably wants to serve 
> the static files directly without Django getting involved at all. There 
> should be an alias directive in your webserver conf which specifies the 
> actual location of your static files base directory and equates that 
> with the STATIC_URL value in your settings. Similarly for the MEDIA_URL 
> value. 
>
> All you really need to do is write a script to copy your static files 
> from where they live in your dev environment to the location specified 
> by STATIC_URL in your production environment. 
>
> Alternatively, manage.py collectstatic will do that for you. 
>
> > 
> > On Fri, 8 Mar, 2019, 5:29 AM Mike Dewhirst,   
> > > wrote: 
> > 
> > On 8/03/2019 10:11 am, Tal wrote: 
> > > The word "simple" appears 13 times in PEP, but no one knows 
> how 
> > > this magical specification works? 
> > > Can anyone confirm I'm not crazy please? 
> > 
> > You could try writing to Grahame Dumpleton for confirmation. I'm 
> > reasonably sure he wrote mod_wsgi and ought to be able to correct 
> > you if 
> > you've misunderstood anything.He used to give presentations on 
> > wsgi at 
> > PyCons so you might be able to find something on YouTube from a few 
> > years ago. 
> > 
> > Last I heard of him he is fairly focused on Kubernetes so he 
> probably 
> > doesn't monitor the Django list any more. 
> > 
> > > 
> > > On Tuesday, February 26, 2019 at 3:13:00 PM UTC-7, Tal wrote: 
> > > 
> > > Is it right though? 
> > > 
> > > On Tuesday, February 26, 2019 at 2:49:03 PM UTC-7, mike wrote: 
> > > 
> > > Great write up! 
> > > 
> > > On Tue, Feb 26, 2019 at 2:39 PM Tal  > > wrote: 
> > > 
> > > Did I get something wrong? 
> > > Do you mean the devs working on the Django project 
> know 
> > > nothing about this, or the devs using Django to 
> > build web 
> > > apps? 
> > > From what I've read, devs using Django don't need to 
> be 
> > > too familiar with WSGI, but it seems like it helps at 
> > > least having a conceptual understanding of what it is. 
> > > 
> > > On Tuesday, February 26, 2019 at 12:28:26 PM UTC-7, 
> > Motaz 
> > > Hejaze wrote: 
> > > 
> > > You are very close to what realy happens , most of 
> > > devs know nothing aboutbthis stuff 
> > > 
> > > On Tue, 26 Feb 2019, 20:26 Tal, 
> > mailto:tal@gmail.com>> wrote: 
> > > 
> > > I've been developing web applications using 
> > Flask 
> > > and Django for about a year now, and 
> > although I've 
> > > come across the term WSGI a bunch of times 
> > in both 
> > > frameworks, I never really understood what 
> > it did. 
> > > I'm sure I'm not the only one. The quick 
> > > explanations I read never made sense to me. 
> Even 
> > > PEP didn't 

Re: How to remove a model definition completely in Django when it previously had foreign keys

2019-03-08 Thread James Bennett
When you need to remove any piece of code that's been referenced in
migrations, generally there's a multi-step process.

For sake of a simple example, let's assume you have Model A in App A, and
Model B in App B. And at some point you added a foreign key from Model A to
Model B, but now you want to completely remove Model B. The process is:

1. Remove the foreign key from Model A and generate a migration for that.
Apply the migration. DO NOT DELETE MODEL B'S CODE YET.
2. Generate a migration with a RemoveModel operation for Model B. DO NOT
DELETE MODEL B'S CODE YET.
3. Squash migrations for App A, starting at the point the foreign key to
Model B was added, and ending at the point the foreign key to Model B was
removed. DO NOT DELETE MODEL B'S CODE YET.
4. Now that only a single migration file references Model B, either remove
the AddField/RemoveField operations from it entirely, or replace them with
migrations.RunPython.noop operations. DO NOT DELETE MODEL B'S CODE YET.
5. Verify that you can bring up a fresh database correctly with the
migrations you now have. DO NOT DELETE MODEL B'S CODE YET.
6. Finally: delete Model B's code from your codebase.

if you referred to this model from multiple apps/models, you will need to
do steps 1-5 once for each app/model that had a reference.

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAL13Cg9mhnsefdwwKnAbkBYxjN%3DsMZbhRq%2BwmLw6TUXspR0KSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModuleNotFoundError: No module named 'sample,'

2019-03-08 Thread Ezequiel Bertti
Check your INSTALED_APPS on settings.py

I think you have a simple typo with: "sample,",

On Fri, Mar 8, 2019 at 7:14 AM abel otugeme  wrote:

> You must have written code that doesn't work.  Check if you imported any
> function e.g models that you didn't use.
> On Mar 7, 2019 10:44 AM,  wrote:
>
>> Hi Team
>>
>> My project name is Sample
>> While I am trying to connect database with models.py
>> I am finding these type of errors
>> ModuleNotFoundError: No module named 'sample,'
>> Can anybody help me.
>>
>> --
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/94eba992-1553-40a5-8a58-4f9ad85bbd5c%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAMrS0S9QNYG-86u-hFwpzLBp_mXZx0pbguj9DTHVOJL-jnAnrQ%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Ezequiel Bertti

https://telegram.me/ebertti
https://twitter.com/ebertti
https://github.com/ebertti

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACrQMYrwpo5YgXqfmb-nvP0ZHhwW110BLZji%3DFNf93e3camFFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove a model definition completely in Django when it previously had foreign keys

2019-03-08 Thread Henrik Ossipoff Hansen
Yes, when running tests (which happen on a clean database), the migration 
history is run all from the initial migrations (by Django itself). At this 
point, app b's initial migration (which have a reference to a.A) will fail 
because it cannot find such model:

ValueError: Related model 'a.A' cannot be resolved

fredag den 8. marts 2019 kl. 15.23.51 UTC+1 skrev Clara Daia:
>
> Are you getting an error? I think migration dependencies should solve that 
> by themselves, running "step 2" before "step 3". Doesn't Django complain if 
> you try to migrate "step 3" before "step 2"?
>
> Em sex, 8 de mar de 2019 às 11:07, Henrik Ossipoff Hansen <
> henrik@gmail.com > escreveu:
>
>> We're trying to remove a model completely from one of our apps - an 
>> operation I think we've done many times without issues, but this time it's 
>> causing us some headache. Consider we have two apps:
>>
>> An app called a with a model A
>> An app called b with a model B, and this model B has a foreign key to A.
>>
>> This means the initial Django migration file for app b contains an entry 
>> for a foreign key to the string 'a.A'. Let's call this step 1.
>>
>> Now later, we remove the foreign key on model B. This of course creates a 
>> new migration, but the initial migration still has the 'a.A' foreign key 
>> definition in it (obviously). Let's call this step 2.
>>
>> Now the tricky part: we want to remove the whole model A. This in itself 
>> creates a migration for app a to that deletes the model, but poses a new 
>> problem; when running the full migration history (for example during 
>> tests), the initial migration of app b will fail, because it can no longer 
>> resolve 'a.A'. Let's call this step 3.
>>
>> How are people coping with the issue the best? One solution I can think 
>> of involves doing a migration squash (and would be sort of easy in our 
>> case, since we're actually going to remove the whole app a as well), but it 
>> seems a bit extreme. Is there anyone out there with a better and less 
>> intrusive solution?
>>
>> Regards,
>> Henrik Ossipoff Hansen
>>
>> -- 
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/162da80d-ca64-48d1-b555-4ce44d6040aa%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/236407fc-b903-4504-b31b-952fb9f0c47b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to remove a model definition completely in Django when it previously had foreign keys

2019-03-08 Thread Clara Daia
Are you getting an error? I think migration dependencies should solve that
by themselves, running "step 2" before "step 3". Doesn't Django complain if
you try to migrate "step 3" before "step 2"?

Em sex, 8 de mar de 2019 às 11:07, Henrik Ossipoff Hansen <
henrik.ossip...@gmail.com> escreveu:

> We're trying to remove a model completely from one of our apps - an
> operation I think we've done many times without issues, but this time it's
> causing us some headache. Consider we have two apps:
>
> An app called a with a model A
> An app called b with a model B, and this model B has a foreign key to A.
>
> This means the initial Django migration file for app b contains an entry
> for a foreign key to the string 'a.A'. Let's call this step 1.
>
> Now later, we remove the foreign key on model B. This of course creates a
> new migration, but the initial migration still has the 'a.A' foreign key
> definition in it (obviously). Let's call this step 2.
>
> Now the tricky part: we want to remove the whole model A. This in itself
> creates a migration for app a to that deletes the model, but poses a new
> problem; when running the full migration history (for example during
> tests), the initial migration of app b will fail, because it can no longer
> resolve 'a.A'. Let's call this step 3.
>
> How are people coping with the issue the best? One solution I can think of
> involves doing a migration squash (and would be sort of easy in our case,
> since we're actually going to remove the whole app a as well), but it seems
> a bit extreme. Is there anyone out there with a better and less intrusive
> solution?
>
> Regards,
> Henrik Ossipoff Hansen
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/162da80d-ca64-48d1-b555-4ce44d6040aa%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMpbhxyQ-QVdcvwR_D79pihEkw0hoY-6j1wzGeDcoLaMm2%3DN%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


How to remove a model definition completely in Django when it previously had foreign keys

2019-03-08 Thread Henrik Ossipoff Hansen
We're trying to remove a model completely from one of our apps - an 
operation I think we've done many times without issues, but this time it's 
causing us some headache. Consider we have two apps:

An app called a with a model A
An app called b with a model B, and this model B has a foreign key to A.

This means the initial Django migration file for app b contains an entry 
for a foreign key to the string 'a.A'. Let's call this step 1.

Now later, we remove the foreign key on model B. This of course creates a 
new migration, but the initial migration still has the 'a.A' foreign key 
definition in it (obviously). Let's call this step 2.

Now the tricky part: we want to remove the whole model A. This in itself 
creates a migration for app a to that deletes the model, but poses a new 
problem; when running the full migration history (for example during 
tests), the initial migration of app b will fail, because it can no longer 
resolve 'a.A'. Let's call this step 3.

How are people coping with the issue the best? One solution I can think of 
involves doing a migration squash (and would be sort of easy in our case, 
since we're actually going to remove the whole app a as well), but it seems 
a bit extreme. Is there anyone out there with a better and less intrusive 
solution?

Regards,
Henrik Ossipoff Hansen

-- 
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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/162da80d-ca64-48d1-b555-4ce44d6040aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: linking django app to slurm db

2019-03-08 Thread Derek
I have not worked with SLURM in any way at all ... but it seems to me that 
if its a third-party app, you'd be better off working with an API that will 
shield you from the messy details of the internal database e.g.

https://github.com/PySlurm/pyslurm


On Thursday, 7 March 2019 15:39:24 UTC+2, Bissane Belhadji wrote:
>
> Hi everyone!
> I've been working on this project with SLURM for quite a while now and 
> I've been experiencing a massive writer's block, I'm working on a portal 
> that will allow employees register to slurm's database and run their jobs 
> on accounts along with several other things.  I have built this django 
> application with an LDAP and Kerberos backend to authenticate against the 
> corporate internal authentication system and I'm sorte of familiar with how 
> slurm works now, however, I can't for the life of me figure out how to link 
> my django app to the slurm db 
> I have a few ideas in mind that I'm currently testing out, but any new 
> approach to this or even the slightest suggestion is greatly appreciated 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7fa720b1-eea8-41a7-9c39-33b0e46c32b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.db.utils.OperationalError: no such table: user_user

2019-03-08 Thread cyril moreau
It does not work for me and i dont know why.

if i want to have the table created I have to first make :
python manage.py  makemigrations my_app

and then 
python manage.py  migrate


python manage.py  makemigrations (without the name of my app) does not take 
into account my apps that i have define in the settings.py file :
INSTALLED_APP=[
django.contrib.admin,

user,
event,
picture,

]
I can not explain this issue.


Le vendredi 8 mars 2019 13:42:44 UTC+1, Nasir Ahmad a écrit :
>
> Hi,
> Migration for each app use cmd > python manage.py migrate, it migrate all 
> inbuilt app.
>
> On Fri, Mar 8, 2019 at 2:27 AM cyril moreau  > wrote:
>
>> To fix my issue I had to makemigrations for each one of my app :
>>
>> by doing the following it will create my user table :
>>
>> python manage.py  makemigrations user
>>
>> does not work if i just do :
>> python manage.py  makemigrations
>>
>>
>> Best regards
>>
>> Le jeudi 7 mars 2019 19:01:10 UTC+1, cyril moreau a écrit :
>>>
>>> Hi,
>>>
>>> I have the following model that i use as AUTH_USER_MODEL :
>>>
>>> model.py
>>>
>>>
>>> class User(AbstractBaseUser, PermissionsMixin):
>>>email = models.EmailField(_('email address'), unique=True)
>>>password = models.CharField(_('password'), max_length=255, blank=
>>> False)
>>>first_name = models.CharField(_('first name'), max_length=30, blank=
>>> True)
>>>last_name = models.CharField(_('last name'), max_length=30, blank=
>>> True)
>>>date_joined = models.DateTimeField(_('date joined'), auto_now_add=
>>> True)
>>>is_active = models.BooleanField(_('active'), default=True)
>>>is_staff = models.BooleanField(_('staff status'), default=False)
>>>avatar = models.CharField(_('avatar'), max_length=30, blank=True, 
>>> null=True) 
>>> #models.ImageField(upload_to='avatars/', null=True, blank=True)
>>>
>>> objects = UserManager()
>>>
>>> USERNAME_FIELD = 'email'
>>>REQUIRED_FIELDS = []
>>>
>>> class Meta:
>>>verbose_name = _('user')
>>>verbose_name_plural = _('users')
>>>
>>> settings.py
>>> AUTH_USER_MODEL = 'user.User'
>>>
>>>
>>> When i want to create a superuser and enter the email of the user i want 
>>> to create :
>>> python manage.py createsuperuser
>>>
>>>
>>> I get the following error : 
>>> django.db.utils.OperationalError: no such table: user_user
>>>
>>> Someone knows why I get this error?
>>>
>>> Thank you for you help
>>>
>> -- 
>> 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/cfca6c60-4626-470c-afa3-5213862e4dfb%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc949cde-24b4-42af-9472-447917f35f71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.db.utils.OperationalError: no such table: user_user

2019-03-08 Thread Nasir Ahmad
Hi,
Migration for each app use cmd > python manage.py migrate, it migrate all
inbuilt app.

On Fri, Mar 8, 2019 at 2:27 AM cyril moreau  wrote:

> To fix my issue I had to makemigrations for each one of my app :
>
> by doing the following it will create my user table :
>
> python manage.py  makemigrations user
>
> does not work if i just do :
> python manage.py  makemigrations
>
>
> Best regards
>
> Le jeudi 7 mars 2019 19:01:10 UTC+1, cyril moreau a écrit :
>>
>> Hi,
>>
>> I have the following model that i use as AUTH_USER_MODEL :
>>
>> model.py
>>
>>
>> class User(AbstractBaseUser, PermissionsMixin):
>>email = models.EmailField(_('email address'), unique=True)
>>password = models.CharField(_('password'), max_length=255, blank=False
>> )
>>first_name = models.CharField(_('first name'), max_length=30, blank=
>> True)
>>last_name = models.CharField(_('last name'), max_length=30, blank=True
>> )
>>date_joined = models.DateTimeField(_('date joined'), auto_now_add=True
>> )
>>is_active = models.BooleanField(_('active'), default=True)
>>is_staff = models.BooleanField(_('staff status'), default=False)
>>avatar = models.CharField(_('avatar'), max_length=30, blank=True, null
>> =True)
>> #models.ImageField(upload_to='avatars/', null=True, blank=True)
>>
>> objects = UserManager()
>>
>> USERNAME_FIELD = 'email'
>>REQUIRED_FIELDS = []
>>
>> class Meta:
>>verbose_name = _('user')
>>verbose_name_plural = _('users')
>>
>> settings.py
>> AUTH_USER_MODEL = 'user.User'
>>
>>
>> When i want to create a superuser and enter the email of the user i want
>> to create :
>> python manage.py createsuperuser
>>
>>
>> I get the following error :
>> django.db.utils.OperationalError: no such table: user_user
>>
>> Someone knows why I get this error?
>>
>> Thank you for you help
>>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/cfca6c60-4626-470c-afa3-5213862e4dfb%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ8KXKx5cxCKmQWNeiDf%3DgvY1H-YZmeNuQGSvGxu7BNmWVn-jA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: ModuleNotFoundError: No module named 'sample,'

2019-03-08 Thread abel otugeme
You must have written code that doesn't work.  Check if you imported any
function e.g models that you didn't use.
On Mar 7, 2019 10:44 AM,  wrote:

> Hi Team
>
> My project name is Sample
> While I am trying to connect database with models.py
> I am finding these type of errors
> ModuleNotFoundError: No module named 'sample,'
> Can anybody help me.
>
> --
> 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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/94eba992-1553-40a5-8a58-4f9ad85bbd5c%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 https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAMrS0S9QNYG-86u-hFwpzLBp_mXZx0pbguj9DTHVOJL-jnAnrQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Missing manage.py & settings.py

2019-03-08 Thread Andréas Kühne
The reason you have startapp in django-admin is because you might want to
start a new part of your project from scratch. For example if you are
selling ice-cream online and have models for ice-creams in the ice_cream
app and you want to start selling cupcakes as well, you can then start a
new app called cupcakes that has the templates, models and views for
cupcakes.

Regards,

Andréas


Den fre 8 mars 2019 kl 03:13 skrev lujate :

> I'm sorry,  I don't understand what you're trying to say.
>
> On Thu, Mar 7, 2019, 12:23 AM Gil Obradors 
>> For create it  yourself from 0
>>
>> El dj., 7 de març 2019, 01:05, lujate  va
>> escriure:
>>
>>> What purpose does startapp serve when you're only using a pip installed
>>> app?
>>>
>>>
>>>
>>> On Wed, Mar 6, 2019, 11:12 AM ambesh chand shahi >> wrote:
>>>
 You should first type django-admin startproject "your project name".

 Then if you are using python3 then type python3 manage.py startapp
 "appname".

 After that include that app in settings.py in Installed apps.


 On Tue, 5 Mar 2019, 07:29 lujate,  wrote:

> I created a scratch project for R
> I did a runserver and confirmed the default landing page.
> I added the apps to the settings file per the docs.
> I ran a migrate per the docs and got an error on one of the apps.
> I tried a runserver and got the same error.
> I dug into site-packages and confirmed the app was there.
>
> I added multiple apps, and there's only an error on one. I don't know
> if that's because the others are fine,  or it just stopped at the first
> error.
>
> Thanks
>
> On Mon, Mar 4, 2019, 6:59 PM Mario Martinez  wrote:
>
>> Did you run the django-admin startproject your_project_name command?
>>
>> On Fri, Mar 1, 2019, 6:13 PM lujate  wrote:
>>
>>> I pip installed a Django project, but it doesn’t have a manage.py or
>>> settings.py.  I checked the repo on GitHub, and those files don’t exist
>>> there either.  Is this an alternate way of doing a Django project that 
>>> I’m
>>> not aware of?
>>>
>>> FWIW, the project is django-wiki.
>>>
>>> TIA
>>>
>>> --
>>> 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 https://groups.google.com/group/django-users.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/30fc5fdc-6bd6-4807-99ff-c41e6e109642%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to a topic in
>> the Google Groups "Django users" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/django-users/UNcOwcHuox8/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, 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 https://groups.google.com/group/django-users.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAOXNLNvP-vePzZj1zEeN-kVRiBPwEk_A6x64aJ0Y312uaegE3w%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 https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA4ZjbSQQP-X6jmaYxGNCjtoSzWTG-ZdwXohYwJv-yo6-2Gwqw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
 --
 You received this message because you are subscribed to a topic in the
 Google Groups "Django users" group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/django-users/UNcOwcHuox8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 django-users+unsubscr...@googlegroups.com.
 To