django application field loaded from already created database and not initialized from the django codedjango - inlineformset_factory with more than one ForeignKeydjango admin crashes when trying to update record but not when inserting a new oneDjango max_length value for a character verying rowCreate a new model which have all fields of currently existing modelMigration of Django field with default value to PostgreSQL databaseError in django poll tutorialwhat does run the command dt mean?Using Tag model to create ManytoMany relationshipHow to set dynamic initial values to django modelform fielddjango-tables doesn't display foreign-key as link in gcbv ListView

Word ending in "-ine" for rat-like

Is this house-rule removing the increased effect of cantrips at higher character levels balanced?

Tricolour nonogram

Should Catholics in a state of grace call themselves sinners?

Active wildlife outside the window- Good or Bad for Cat psychology?

What are the children of two Muggle-borns called?

Is it possible to alias a column based on the result of a select+where?

Why doesn't SpaceX land boosters in Africa?

Can I take Amul cottage cheese from India to Netherlands?

Why should I allow multiple IPs on a website for a single session?

How to find out who created an event?

Fully submerged water bath for stove top baking?

Grid: different background color (of row) based on values

A quine of sorts

Can dual citizens open crypto exchange accounts where U.S. citizens are prohibited?

A* pathfinding algorithm too slow

Is it OK to throw pebbles and stones in streams, waterfalls, ponds, etc.?

Does a lens with a bigger max. aperture focus faster than a lens with a smaller max. aperture?

Copy group of files (Filename*) to backup (Filename*.bak)

Perform mirror symmetry transformation of 3D model (in OBJ)

How do I present a future free of gender stereotypes without being jarring or overpowering the narrative?

Would skyscrapers tip over if people fell sideways?

Hard for me to understand one tip written in "The as-if rule" of cppreference

I agreed to cancel a long-planned vacation (with travel costs) due to project deadlines, but now the timeline has all changed again



django application field loaded from already created database and not initialized from the django code


django - inlineformset_factory with more than one ForeignKeydjango admin crashes when trying to update record but not when inserting a new oneDjango max_length value for a character verying rowCreate a new model which have all fields of currently existing modelMigration of Django field with default value to PostgreSQL databaseError in django poll tutorialwhat does run the command dt mean?Using Tag model to create ManytoMany relationshipHow to set dynamic initial values to django modelform fielddjango-tables doesn't display foreign-key as link in gcbv ListView













0















I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.



Something like this:



class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')


If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns



coolerless_print boolean not null
print_color varchar(20)
id bigserial not null


How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?



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










share|improve this question






















  • When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

    – Paolo
    Mar 25 at 15:49











  • i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

    – Oscalation
    Mar 25 at 15:50







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54















0















I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.



Something like this:



class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')


If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns



coolerless_print boolean not null
print_color varchar(20)
id bigserial not null


How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?



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










share|improve this question






















  • When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

    – Paolo
    Mar 25 at 15:49











  • i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

    – Oscalation
    Mar 25 at 15:50







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54













0












0








0








I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.



Something like this:



class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')


If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns



coolerless_print boolean not null
print_color varchar(20)
id bigserial not null


How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?



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










share|improve this question














I see that you can initialize a new field type to be created in a new database from the django application code inside of models.py.



Something like this:



class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')


If I already have a database created, and that database is already connected to my django instance running ... and lets say I have a table called product_colors that has the following columns



coolerless_print boolean not null
print_color varchar(20)
id bigserial not null


How do I load these already created columns into my newly created app? Does Djangos, i dont know the right terminology here, field initiation process have equivalencies for all possible sql data types, exceptions (not null), etc? Is there an easy way to say - load this table and all columns?



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







python django






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 15:45









OscalationOscalation

2361 silver badge10 bronze badges




2361 silver badge10 bronze badges












  • When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

    – Paolo
    Mar 25 at 15:49











  • i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

    – Oscalation
    Mar 25 at 15:50







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54

















  • When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

    – Paolo
    Mar 25 at 15:49











  • i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

    – Oscalation
    Mar 25 at 15:50







  • 1





    If that's the case, you'll make use of Django's inspectdb.

    – Paolo
    Mar 25 at 15:54
















When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

– Paolo
Mar 25 at 15:49





When you run python manage.py makemigrations and python manage.py migrate Django would automatically create the models for you. In your case, it would automatically create a YOURAPPNAME_question table in your database.

– Paolo
Mar 25 at 15:49













i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

– Oscalation
Mar 25 at 15:50






i guess what im saying is, if i already have a database loaded with data and I just want to connect my app in django to it - not initialize a new database or create new columns ... how does one do that? @Paolo

– Oscalation
Mar 25 at 15:50





1




1





If that's the case, you'll make use of Django's inspectdb.

– Paolo
Mar 25 at 15:54





If that's the case, you'll make use of Django's inspectdb.

– Paolo
Mar 25 at 15:54










1 Answer
1






active

oldest

votes


















1














If you're planning to connect your Django app to an existing database, then you're probably going to use



python manage.py inspectdb


Full explanation can be found here. Integrating Django with a legacy database.






share|improve this answer























  • this answer my question - thank you!

    – Oscalation
    Mar 25 at 15:56






  • 1





    Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

    – Paolo
    Mar 25 at 15:57











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341567%2fdjango-application-field-loaded-from-already-created-database-and-not-initialize%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














If you're planning to connect your Django app to an existing database, then you're probably going to use



python manage.py inspectdb


Full explanation can be found here. Integrating Django with a legacy database.






share|improve this answer























  • this answer my question - thank you!

    – Oscalation
    Mar 25 at 15:56






  • 1





    Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

    – Paolo
    Mar 25 at 15:57
















1














If you're planning to connect your Django app to an existing database, then you're probably going to use



python manage.py inspectdb


Full explanation can be found here. Integrating Django with a legacy database.






share|improve this answer























  • this answer my question - thank you!

    – Oscalation
    Mar 25 at 15:56






  • 1





    Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

    – Paolo
    Mar 25 at 15:57














1












1








1







If you're planning to connect your Django app to an existing database, then you're probably going to use



python manage.py inspectdb


Full explanation can be found here. Integrating Django with a legacy database.






share|improve this answer













If you're planning to connect your Django app to an existing database, then you're probably going to use



python manage.py inspectdb


Full explanation can be found here. Integrating Django with a legacy database.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 25 at 15:54









PaoloPaolo

2631 silver badge12 bronze badges




2631 silver badge12 bronze badges












  • this answer my question - thank you!

    – Oscalation
    Mar 25 at 15:56






  • 1





    Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

    – Paolo
    Mar 25 at 15:57


















  • this answer my question - thank you!

    – Oscalation
    Mar 25 at 15:56






  • 1





    Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

    – Paolo
    Mar 25 at 15:57

















this answer my question - thank you!

– Oscalation
Mar 25 at 15:56





this answer my question - thank you!

– Oscalation
Mar 25 at 15:56




1




1





Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

– Paolo
Mar 25 at 15:57






Happy to help, please don't forget to mark as correct answer to help other people searching about the same problem too.

– Paolo
Mar 25 at 15:57







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55341567%2fdjango-application-field-loaded-from-already-created-database-and-not-initialize%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현